/* rezza-site-styles · index.css
   sketch 05 taken further, on direction A (common.css and a.css carry the page): the home is one
   index on one screen, the sentence alone over the work list, and the list answers it; a case page
   opens on its own row and turns through its own sentences. the bar stays on top. things move only
   where the movement says something: the landing builds the page in the order it reads, and the
   move to a project goes right, back to the index left. */

/* ---- the bar: it stays on top as the page scrolls, on the page's own white, with no rule ---- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-bottom: 18px;
  background: var(--paper);
}

/* his mark, then where you are: Projects, or Projects / a project, where Projects is the way back.
   the mark's box carries a 2-unit inset, so it steps left by that much to sit on the margin */
.top > * { grid-row: 1; }
.top .crumbs { grid-column: 1 / 4; display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-width: 0; }
.top .crumbs.wide { grid-column: 1 / 9; }
.top .links { grid-column: 9 / 13; }
.top .mark { display: block; flex: none; width: 24px; height: 24px; margin: -2px 6px -2px -2.4px; color: var(--ink); }
.top .mark svg { display: block; width: 24px; height: 24px; }
.top .crumb { white-space: nowrap; }
.top a.crumb { color: var(--ink-2); }
.top a.crumb:hover { color: var(--ink); }
.top .crumb.here { color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.top .leaf { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top .sep { color: var(--ink-2); }
.top .short { display: none; }

/* ---- the sentence, alone: no picture; the list under it is what answers ---- */

.five-hero {
  --h1: min(150px, calc((100vw - 64px) / 10.4));
  margin-top: clamp(40px, 5vw, 64px);
  align-items: start;
}

.five-hero h1, .five-hero .sentence {
  grid-column: 1 / -1;
  font-size: var(--h1);
  font-weight: 500;
  line-height: 1.02;             /* a little air between the lines, for the underline that runs between them */
  letter-spacing: -0.045em;
  white-space: nowrap;
}

/* each line: the fixed words, then the word on its blank, right after them (his word 2026-11-03: no gap
   between the words; only the line runs on). the word's window runs from the word to the end of the line,
   and every word on the reel is followed by a run of spaces, so the font's own underline (breaking around
   descenders, as an underline does) goes on to the line end under any word, while it spins too. the blank
   is a plain block so the line can find its baseline; the spaces are clipped */
.five-hero .line { display: flex; align-items: baseline; }
.five-hero .t { flex: none; padding-right: 0.15em; }           /* a word space at this tracking */
.five-hero .blank { display: block; flex: 1 1 auto; min-width: 0; cursor: pointer; outline: none; }
/* the window on a word is 1.26em tall (a.css), more than the line; it reaches out evenly above and below so
   the word keeps the line's baseline: (1.02 - 1.26) / 2 */
.five-hero .slot { width: calc(100% + 0.08em); padding-right: 0; margin-right: 0; margin-block: -0.12em; }   /* a.css keeps the italic's room on the left */
.five-hero .reel > span {
  text-decoration: underline;
  text-decoration-thickness: 0.035em;
  text-underline-offset: 0.09em;
  text-decoration-color: rgb(18 18 17 / 0.3);
}
.five-hero .blank:hover .reel > span, .five-hero .blank:focus-visible .reel > span { text-decoration-color: var(--ink); }

/* a word changing (index.js): the next slides in from the right and the one showing fades where it is. the
   one sliding in has the page's ground in a strip under its own underline only (index.js sets where): under
   it only its own line shows, breaks and all, in the colour of the line at rest. a ground any taller would
   reach into the line above, the windows overlapping it. the one fading draws its line straight through,
   leaving no gaps where its letters were */
.five-hero .reel { position: relative; }
.five-hero .reel > .was { text-decoration-skip-ink: none; }
.five-hero .reel > .now { position: absolute; top: 0; left: 0; background: linear-gradient(var(--paper), var(--paper)) no-repeat 0 100% / 100% 0; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- the work list: one ruled row a project; every project the sentence fits is lit ---- */

.rows { display: block; margin-top: clamp(40px, 5vw, 64px); }
.rows::after { content: ""; display: block; height: 1px; margin-inline: var(--margin); background: var(--ink); }

.row {
  padding-block: 14px 15px;
  align-items: baseline;
  color: rgb(18 18 17 / 0.24);      /* a row the sentence does not fit fades well back; the rules stay */
  background: linear-gradient(var(--ink), var(--ink)) var(--margin) 0 / calc(100% - 2 * var(--margin)) 1px no-repeat;
  transition: color 320ms cubic-bezier(0.4, 0, 0.2, 1);
}
a.row:hover { text-decoration: none; }
.row.is-on, .row:hover, .row:focus-within { color: var(--ink); }
.row .num { grid-column: 1 / 2; font-size: 15px; font-variant-numeric: tabular-nums; }
.row .name { grid-column: 2 / 7; font-size: clamp(26px, 2.4vw, 36px); font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; }
.row .kind, .row .made { grid-column: 7 / 10; font-size: 15px; line-height: 20px; }
.row .years { grid-column: 10 / 12; font-size: 15px; white-space: nowrap; }
.row .arrow { grid-column: 12 / 13; justify-self: end; font-size: 20px; opacity: 0; transform: translateX(-6px); transition: opacity 320ms cubic-bezier(0.4, 0, 0.2, 1), transform 320ms cubic-bezier(0.4, 0, 0.2, 1); }
.row.is-on .arrow, .row:hover .arrow, .row:focus-within .arrow { opacity: 1; transform: none; }
.row .name a:hover { text-decoration: none; }

/* 5b: the rows as one table. a row's words are packed on one line, with no gaps for the things it
   did not make; every row's words start on the same line and the years line up after them */
.rows.tagged {
  display: grid;
  grid-template-columns:
    [num] calc((100% - 11 * var(--gutter)) / 12 + var(--gutter) - 16px)
    [name] minmax(0, 1fr)
    [made] max-content
    [years] max-content
    [arrow] max-content;
  column-gap: 16px;
  margin-inline: var(--margin);
}
.rows.tagged::after { grid-column: 1 / -1; margin-inline: 0; }
.rows.tagged .row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  background: linear-gradient(var(--ink), var(--ink)) 0 0 / 100% 1px no-repeat;
}
.rows.tagged .num { grid-column: num; }
.rows.tagged .name { grid-column: name; }
.rows.tagged .made { grid-column: made; display: flex; flex-wrap: nowrap; gap: 0 12px; font-size: 14px; }
.rows.tagged .years { grid-column: years; padding-left: 24px; }
.rows.tagged .arrow { grid-column: arrow; }
.made button { color: inherit; white-space: nowrap; transition: background-color 320ms cubic-bezier(0.4, 0, 0.2, 1), color 320ms cubic-bezier(0.4, 0, 0.2, 1); }
.made button:hover { color: var(--ink); }
.made button.is-match { background: var(--ink); color: var(--paper); padding: 0 5px; margin: 0 -5px; }

/* ---- a case page: its own row on top (no number), its own sentences, then the work ---- */

.case-top { margin-top: clamp(16px, 2vw, 24px); }
.case-row { color: var(--ink); }
.case-row .name { grid-column: 1 / 7; margin: 0; }

.case-intro { margin-top: clamp(64px, 8vw, 120px); align-items: start; }
.case-intro .lede { grid-column: 1 / 8; font-size: clamp(22px, 2.2vw, 32px); line-height: 1.25; letter-spacing: -0.015em; }
.case-intro .facts { grid-column: 9 / 13; grid-row: 1; padding-top: 0; }

.next-rows { margin-top: clamp(96px, 12vw, 176px); }

/* what lives on a project's page holds still out of view (index.js marks it), so its loops run only where they are seen */
.is-away, .is-away * { animation-play-state: paused !important; }

/* a case page's pictures come in only once they are decoded (index.js marks them ready), and softly;
   without the engine they simply show */
.js .case-body img { opacity: 0; transition: opacity 480ms ease; }
.js .case-body img.ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .js .case-body img { transition: none; } }

/* ---- the landing (index.js) ----
   a visit that lands on the index sees the sentence alone first, in the middle of the screen; the bar,
   the list and the footer wait unseen until it has risen to its place and turned */

/* unseen, they are out of reach too: nothing hidden takes the keyboard's focus. the head sets the landing
   before the first frame (build_five.py), the sentence hidden with it (.pre) until index.js holds it unseen */
.landing .top, .landing #work .row, .landing #work::after, .landing .foot { opacity: 0; visibility: hidden; pointer-events: none; }
.pre .five-hero h1 { opacity: 0; }

/* ---- moving between the index and a project ----
   the projects sit to the right of the index. going into one, the list leaves to the left and the
   project comes in from the right in reading order: its row under the bar, with its name in the
   breadcrumb, then the rest; the sentence takes one step down to make room for the row. going back,
   the project clears out first, then the sentence steps up and the list comes in. the bar stays where
   it is. leaving is quick and gathers speed, and is gone before what arrives reaches the same place;
   arriving takes longer and settles. (index.js keeps a sentence scrolled off screen out of it, so it
   goes with its page; the page's data-page, index or case, says which way that is) */

@view-transition { navigation: auto; }
:root { --travel: min(22vw, 320px); }
.top { view-transition-name: bar; }
.top .root { view-transition-name: crumb-root; }
.top .leaf { view-transition-name: crumb-leaf; }
.five-hero h1, .five-hero .sentence { view-transition-name: sentence; }
#work { view-transition-name: list; }
.case-top { view-transition-name: case-head; }
.case-body { view-transition-name: case-body; }

@keyframes to-left { to { transform: translateX(calc(-1 * var(--travel))); opacity: 0; } }
@keyframes to-right { to { transform: translateX(var(--travel)); opacity: 0; } }
@keyframes from-left { from { transform: translateX(calc(-1 * var(--travel))); opacity: 0; } }
@keyframes from-right { from { transform: translateX(var(--travel)); opacity: 0; } }

/* into a project: the list goes; the project's row comes in, then the rest */
::view-transition-old(list):only-child { animation: to-left 280ms cubic-bezier(0.4, 0, 1, 1) both; }
::view-transition-new(case-head):only-child { animation: from-right 720ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both; }
::view-transition-new(case-body):only-child { animation: from-right 720ms cubic-bezier(0.16, 1, 0.3, 1) 280ms both; }
/* back: the project's row goes first (the sentence steps up into its place), the rest after it; then the list */
::view-transition-old(case-head):only-child { animation: to-right 220ms cubic-bezier(0.4, 0, 1, 1) both; }
::view-transition-old(case-body):only-child { animation: to-right 260ms cubic-bezier(0.4, 0, 1, 1) both; }
::view-transition-new(list):only-child { animation: from-left 720ms cubic-bezier(0.16, 1, 0.3, 1) 240ms both; }

/* the project's name in the breadcrumb comes and goes with its row, a short way */
::view-transition-new(crumb-leaf):only-child { --travel: 24px; animation: from-right 560ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both; }
::view-transition-old(crumb-leaf):only-child { --travel: 24px; animation: to-right 200ms cubic-bezier(0.4, 0, 1, 1) both; }

::view-transition-group(sentence) { animation-duration: 720ms; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
/* back on the index the sentence must be up in its place before the list slides in under it: it leaves quickly and settles long */
:root[data-page="index"]::view-transition-group(sentence) { animation-delay: 80ms; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
:root[data-page="case"]::view-transition-old(sentence):only-child { animation: to-left 280ms cubic-bezier(0.4, 0, 1, 1) both; }
:root[data-page="case"]::view-transition-new(sentence):only-child { animation: from-right 720ms cubic-bezier(0.16, 1, 0.3, 1) 200ms both; }
:root[data-page="index"]::view-transition-old(sentence):only-child { animation: to-right 260ms cubic-bezier(0.4, 0, 1, 1) both; }
:root[data-page="index"]::view-transition-new(sentence):only-child { animation: from-left 720ms cubic-bezier(0.16, 1, 0.3, 1) 240ms both; }

/* the bar stays on top of what moves under it */
::view-transition-group(bar),
::view-transition-group(crumb-root),
::view-transition-group(crumb-leaf) { z-index: 1; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 280ms; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ---- below a laptop ---- */

@media (max-width: 900px) {
  .five-hero { --h1: calc((100vw - 40px) / 6.3); }
  /* a phone: the fixed words take a line each, the word on its blank the next, its line to the right edge */
  .five-hero .line { flex-wrap: wrap; }
  .five-hero .t { flex: 0 0 100%; padding-right: 0; }
  .five-hero .blank { flex: 1 0 100%; }

  .top .crumbs { grid-column: 1 / 8; }
  .top .links { grid-column: 8 / 13; }

  /* the table folds: what a project made goes on a line of its own under the name */
  .rows.tagged { grid-template-columns: [num] max-content [name] minmax(0, 1fr); }
  .rows.tagged .made { grid-column: name; grid-row: 2; display: flex; flex-wrap: nowrap; gap: 0 12px; margin-top: 4px; }
  .rows.tagged .years, .rows.tagged .arrow { display: none; }

  .row .name { grid-column: 2 / 12; }
  .case-row .name { grid-column: 1 / 12; }
  .row .kind, .row .made, .row .years { grid-column: 2 / 12; }
  .case-row .kind { grid-column: 1 / 12; }
  .row .years { display: none; }
  .row .kind, .row .made { margin-top: 4px; }

  .case-intro .lede, .case-intro .facts { grid-column: 1 / -1; grid-row: auto; }
  .case-intro .facts { margin-top: 32px; }
}

@media (max-width: 640px) {
  .row .kind, .row .made { display: none; }
  .case-row .kind { display: block; }
  .top .long { display: none; }
  .top .short { display: inline; }

  /* a phone keeps every row's words on one line too: a size smaller, a little closer */
  .rows.tagged .made { flex-wrap: nowrap; gap: 0 9px; font-size: 12px; }
}
