/* Projects (SPEC 5.2). Guide: DESIGN.md 9. Cards and detail pages come from tools/build-projects.py. */

/* ---------- 1. Empty state: the shared .statement--solo (base.css 9); the planet runs into the footer's black ---------- */
body:has(.statement--solo) .foot::before { content: none; }

/* ---------- 2. Cards: one target each (the title link covers the card) ---------- */
.project { display: flex; }
.project__card { position: relative; display: flex; flex-direction: column; width: 100%; transition: transform var(--dur-press) var(--ease-out); }
.project__cover, .proj-cover { overflow: hidden; border-radius: var(--r-s); aspect-ratio: 16 / 10; background: var(--mist); }
.project__cover { margin-bottom: var(--sp-5); }
.project__cover img, .proj-cover img { width: 100%; height: 100%; object-fit: cover; }
.project__cover img { transition: transform var(--dur-ui-l) var(--ease-out); }
.project__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip { display: inline-flex; align-items: center; height: 28px; padding-inline: var(--sp-3); border-radius: var(--r-pill); background: var(--chip-bg);
  font-size: var(--fs-small); letter-spacing: var(--tr-small); line-height: 1; color: var(--fg-2); white-space: nowrap; }
.project__title { margin-top: var(--sp-4); }
.project__link { color: var(--fg); text-decoration-thickness: 2px; }
.project__link::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-l); }
.project__sum { max-width: 30em; margin-top: var(--sp-3); }
.project__stack { margin-top: auto; padding-top: var(--sp-5); color: var(--fg-2); }
.project__card:has(.project__link:active) { transform: scale(var(--scale-press)); }
/* a teaser (status "soon"): the same card without a link, its status chip in navy */
.chip--soon { background: var(--navy-tint); color: var(--navy-ink); }
/* its sign of life (build-projects.py LIVE): one packet runs the cover's stream (2.4 s, then 3 s of rest) once the card is
   in and only while it is on screen (horizon.js adds .is-on); never with reduced motion. A 0-length dash with round caps
   is the dot, a short dash behind it the tail; dashes are in pathLength units (the path is 1 long) */
.project__cover { position: relative; }
.soon-live { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke-linecap: round; pointer-events: none; visibility: hidden; }
.soon-live path { stroke-dasharray: 0 2; stroke-dashoffset: 2; }
.soon-live__glow { stroke: rgba(var(--hz-sky), 0.35); stroke-width: 18px; }
.soon-live .soon-live__tail { stroke: rgba(var(--blue-nt-rgb), 0.55); stroke-width: 2.5px; stroke-dasharray: 0.07 2; }
.soon-live__dot { stroke: rgb(var(--hz-rim)); stroke-width: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .m-ok .is-in .soon-live.is-on { visibility: visible; }
  .m-ok .is-in .soon-live.is-on path { animation: soon-run var(--dur-soon) var(--ease-standard) infinite; }
  .m-ok .is-in .soon-live.is-on .soon-live__tail { animation-name: soon-tail; }
}
@keyframes soon-run { 0% { stroke-dashoffset: 0.02; } 44%, 100% { stroke-dashoffset: -1.1; } }
@keyframes soon-tail { 0% { stroke-dashoffset: 0.09; } 44%, 100% { stroke-dashoffset: -1.03; } }
@supports selector(:has(*)) {
  .project__link:focus-visible { outline: none; }
  .project__card:has(.project__link:focus-visible) { outline: var(--focus-w) solid var(--focus); outline-offset: var(--focus-off); }
}
@media (hover: hover) and (pointer: fine) {
  .project__card:hover .project__link { text-decoration-line: underline; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .project:not(.project--soon) .project__card:hover .project__cover img { transform: scale(1.02); }
}

/* ---------- 3. Detail page ---------- */
.proj-cover { border-radius: var(--r-l); box-shadow: var(--shadow-rest); }
.proj-cover + .sec-head, .proj-cover__note + .sec-head { margin-top: var(--sp-8); }
.proj-cover__note { margin-top: var(--sp-3); font-size: var(--fs-small); letter-spacing: var(--tr-small); color: var(--fg-2); }
.proj-stack { max-width: var(--measure); margin-top: var(--sp-6); color: var(--fg-2); }

/* ---------- 4. Preferences ---------- */
@media (prefers-reduced-motion: reduce) { .project__card:has(.project__link:active) { transform: none; } }
@media (forced-colors: active) { .chip { border: 1px solid; } .project__card:has(.project__link:focus-visible) { outline-color: Highlight; } }

/* ---------- 5. The planet under the statement (the Earth: base.css 9b, caps.js) ---------- */
/* all three behind the same :has(), so a browser without it keeps the statement as before (no planet) instead of a
   horizon positioned against the page */
/* the floor is at least the limb's drop to the screen's sides (9.3vw: 9.23vw for the 280vw circle, 8.58vw for 300vw) and
   12 to 24 px more, so the limb leaves through both sides as a horizon and never ends on the section's edge; the words sit
   48 to 64 px above the planet, and on tall screens the statement stops growing at the words plus about that gap, so the
   planet comes up under them instead of leaving an empty sky */
.statement--short:has(> .horizon) { --hz-floor: max(clamp(96px, 15svh, 150px), calc(9.3vw + clamp(12px, 2.5svh, 24px))); --hz-gap: clamp(48px, 7.2svh, 64px);
  position: relative; overflow: clip; padding-bottom: calc(var(--hz-floor) + var(--hz-gap));
  min-height: min(calc(64svh - var(--header-h)), calc(var(--hz-floor) + var(--hz-gap) + 26rem)); }
.statement--short:has(> .horizon) .statement__inner { position: relative; z-index: var(--z-content); }
.statement--short:has(> .horizon) > .horizon { display: block; --hz-top: calc(100% - var(--hz-floor)); --glow-h: clamp(220px, 36svh, 380px); }
