/* The project view — one project, in a dialog over the home page
   (project.js). The desktop is the 1440 × 1200 frame of 2026-11-18
   ("All projects / 01 of 10" then, Helium), measured from its export: a 1248
   panel, 96 in from each side and 48 from the top, on the page dimmed with
   Ink at 70 %; 32 / 40 of padding; a 40 bar and a rule; the heading; the
   picture (640) beside the words (480), 48 apart; a rule; the two
   neighbours' cards. The panel is as tall as its project: the dialog
   scrolls, the dimmed page behind it does not. It uses the home page's
   picture frame and caption (home.css). The design draws no phone: there
   the panel fills the screen and its two columns stack. */

html:has(dialog.project[open]) { overflow: hidden; }
/* …and its floating bar is out of the way: the view has a card of its own,
   and the bar showed through the dimming. Out of sight it keeps up with a
   call all the same (dock.js), and is back when the view closes. */
html:has(dialog.project[open]) .dock-page { display: none; }

.project {
  --project-gutter: clamp(0px, 6.67vw, 96px);
  box-sizing: border-box;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.project::backdrop { background: var(--scrim); }
/* The dialog scrolls, so a browser lets the keyboard stop on it: the ring
   goes round the panel, where it can be seen. */
.project:focus-visible { outline: none; }
.project:focus-visible .project-panel { outline: 2px solid var(--accent); outline-offset: 4px; }

.project-panel {
  min-height: 100%;
  padding: var(--space-24) max(var(--gutter), env(safe-area-inset-right, 0px)) var(--space-32) max(var(--gutter), env(safe-area-inset-left, 0px));
  background: var(--canvas);
}

/* ---------- the bar: where you are, and the way out ---------- */

.project-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding-bottom: var(--space-24);
  border-bottom: 1px solid var(--rule);
}
.project-bar .label { margin: 0; }
.project-close {
  flex: none;
  height: 40px;
  padding: 0 var(--space-16);
  border: 1px solid var(--rule);
  border-radius: 0;
  background: none;
  color: var(--text);
  font: 500 var(--fs-14)/var(--lh-meta) var(--font-sans);
  cursor: pointer;
}
.project-close:hover { border-color: var(--text); }

/* ---------- the heading ---------- */

.project-head { padding-top: var(--space-32); }
.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-4) var(--space-16);
  margin: 0;
  font-size: var(--fs-14);
  line-height: var(--lh-meta);
}
.project-head h2:focus { outline: none; }      /* it takes the focus so a reader starts at the top */
.project-head h2 {
  margin: var(--space-12) 0 0;
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
}
.project-tagline {
  margin: var(--space-12) 0 0;
  font-size: var(--fs-20);
  line-height: var(--lh-lead);
  letter-spacing: var(--ls-lead);
}

/* ---------- the picture, and the aside under it ---------- */

.project-body { margin-top: var(--space-32); }
/* the picture, then one line: its caption, and — when there is more than
   one picture — the pager at the line's far end */
.project-media figure { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-16); margin: 0; }
.project-media .frame { grid-column: 1 / -1; aspect-ratio: 640 / 474; }      /* the frame, as this view draws it */
.project-media .caption { grid-row: 2; grid-column: 1; }
.project-pager {
  grid-row: 2;
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 22px;                      /* the caption's line: the buttons reach past it */
  margin-top: var(--space-16);
  font-size: var(--fs-14);
  line-height: var(--lh-meta);
  font-variant-numeric: tabular-nums;
  color: var(--secondary);
}
.project-pager[hidden] { display: none; }
.project-pager button {
  min-width: 32px;                   /* something to press: 32 square */
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: 400 var(--fs-14)/var(--lh-meta) var(--font-sans);
  cursor: pointer;
}
.project-pager button:hover { color: var(--accent); }
.project-note { margin-top: var(--space-40); padding-top: var(--space-8); border-top: 1px solid var(--rule); }
.project-note p { margin: 0; }
.project-note p + p { margin-top: 10px; }

/* ---------- the words ----------
   A heading (the label), 12, its paragraphs 12 apart; 24 to the next
   heading, to the links out and to the card. */

.project-story { margin-top: var(--space-32); }
.project-section + .project-section { margin-top: var(--space-24); }
.project-section h3 { margin: 0; }
.project-section p, .project-section ul { margin: var(--space-12) 0 0; }
.project-section ul { padding-left: 1.2em; }
.project-section a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.project-section a:hover { color: var(--accent); }
.project-links { display: flex; flex-wrap: wrap; gap: var(--space-8) var(--space-24); margin: var(--space-24) 0 0; }
.project-links[hidden] { display: none; }
.project-link {
  font-size: var(--fs-14);
  font-weight: 500;
  line-height: var(--lh-meta);
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.project-link .arrow { display: inline; }      /* the rule runs on under the arrow */
.project-story .dock { margin-top: var(--space-24); }

/* ---------- the neighbours ----------
   A rule, 24, then a card each for the project before and after — the
   label, 8, the name; 16 / 24 inside a 1 px rule — with the place in the
   list between them. */

.project-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-12);
  align-items: stretch;
  margin-top: var(--space-32);
  padding-top: var(--space-24);
  border-top: 1px solid var(--rule);
}
.project-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 0;
  padding: var(--space-16) var(--space-24);
  border: 1px solid var(--rule);
}
.project-step .label { color: var(--secondary); }
.project-step-name {
  overflow-wrap: anywhere;          /* a long name wraps inside its card */
  font-size: var(--fs-20);
  font-weight: 500;
  line-height: var(--lh-lead);
  letter-spacing: var(--ls-lead);
}
.project-step-next { align-items: flex-end; text-align: right; }
.project-step:hover { border-color: var(--text); }
.project-position { display: none; margin: 0; text-align: center; font-size: var(--fs-14); line-height: var(--lh-meta); color: var(--secondary); }

/* ---------- desktop ---------- */

@media (min-width: 900px) {
  .project { padding: var(--space-48) var(--project-gutter) var(--space-40); }
  .project-panel { max-width: 1248px; min-height: 0; margin: 0 auto; padding: var(--space-32) var(--space-40); }

  .project-tagline { font-size: var(--fs-24); }
  .project-body {
    display: grid;
    grid-template-columns: minmax(0, 640fr) minmax(0, 480fr);
    column-gap: var(--space-48);
    align-items: start;
  }
  .project-story { margin-top: 0; }

  .project-nav { grid-template-columns: minmax(0, 1fr) 168px minmax(0, 1fr); gap: 0; align-items: center; }
  .project-position { display: block; }
  .project-step-name { font-size: var(--fs-24); }
}

/* ---------- a project's video ----------
   A panel over the view: the name of what is playing and Close, then the
   player, as wide as the screen allows up to 960 and sixteen by nine. */

.video {
  box-sizing: border-box;
  width: min(960px, calc(100vw - 2 * var(--gutter)));
  max-width: none;
  padding: var(--space-24);
  border: 0;
  background: var(--canvas);
  color: var(--text);
}
.video::backdrop { background: var(--scrim); }
.video-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding-bottom: var(--space-16);
}
.video-bar .label { margin: 0; }
.video-frame { aspect-ratio: 16 / 9; background: var(--band); }
.video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
