/* Dennis Ray Filho, portfolio.
   Look borrowed from the Hook site (v6) on purpose: the earhook is the same design, so the portfolio
   speaks the device's language. Navy ink on drafting paper, JetBrains Mono, square corners,
   ruled strips instead of cards, one navy band as the accent.
   Light only: the turning frames and the photos are rendered on this paper colour. */

:root {
  --paper: #f7f8f8;
  --surface: #ffffff;
  --ink: #13294b;
  --muted: #2f4466;
  --rule: color-mix(in srgb, var(--ink) 18%, transparent);
  --rule-strong: var(--ink);
  --band: #13294b;
  --band-ink: #f7f8f8;
  --band-muted: #d6dde7;
  --font: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 2vw, 24px);
  --pad: clamp(16px, 4vw, 80px);
  --sec: clamp(64px, 9vw, 128px);
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.65; font-weight: 450; }
img, svg, canvas { max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 750; color: var(--ink); text-wrap: balance; }
h2 { font-size: clamp(28px, 3.2vw, 46px); line-height: 1.08; letter-spacing: -0.035em; }
h3 { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0; max-width: 62ch; }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
b { font-weight: 700; }

/* every control shows it can be used, and where the keyboard is */
a[href], button, summary, label[for] { cursor: pointer; }
button[disabled] { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.band :focus-visible, .foot :focus-visible { outline-color: var(--band-ink); }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 14px; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: var(--pad); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 28px; }
.grid > * { grid-column: 1 / -1; min-width: 0; }
@media (min-width: 1024px) {
  /* the span sets the end and the start class the start, so the two combine */
  .grid > [class*="span-"] { grid-column-start: auto; }
  .span-3 { grid-column-end: span 3; } .span-4 { grid-column-end: span 4; } .span-5 { grid-column-end: span 5; }
  .span-6 { grid-column-end: span 6; } .span-7 { grid-column-end: span 7; } .span-8 { grid-column-end: span 8; }
  .grid > .span-12 { grid-column: 1 / -1; }
  .grid > .start-5 { grid-column-start: 5; } .grid > .start-9 { grid-column-start: 9; } .grid > .start-6 { grid-column-start: 6; } .grid > .start-7 { grid-column-start: 7; } .grid > .start-8 { grid-column-start: 8; }
}
.stack { display: grid; gap: 20px; align-content: start; }

/* small lowercase labels, as on the Hook's figures; no wide tracking */
.t-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.lead { font-size: clamp(17px, 1.35vw, 19px); line-height: 1.55; }
.meta { font-size: 13px; color: var(--muted); }
.note { padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: 15px; }

/* ---------- buttons: square, navy, 44px tall ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 22px; border: 1.5px solid var(--ink); font: inherit; font-size: 15px; font-weight: 700; text-decoration: none; line-height: 1.2; transition: background .15s, color .15s; }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: #0b1a33; color: var(--paper); }
.btn--secondary, .btn--small { background: var(--surface); color: var(--ink); border-color: var(--rule); }
.btn--secondary:hover, .btn--small:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn--small { min-height: 44px; padding: 8px 14px; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 20; background: color-mix(in srgb, var(--paper) 94%, transparent); border-bottom: 1px solid var(--rule); }
.nav__bar { height: var(--nav-h); display: flex; align-items: center; gap: 28px; }
.nav__name { display: inline-flex; align-items: center; gap: 12px; font-weight: 750; text-decoration: none; min-height: 44px; }
.mark { border: 1.5px solid var(--ink); padding: 1px 6px; font-size: 12px; line-height: 1.5; }
.nav nav { margin-left: auto; }
.nav__links { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; font-size: 15px; }
.nav__links a:hover, .nav__links a[aria-current] { text-decoration: underline; }
.nav__cta { padding-inline: 18px; }
@media (max-width: 860px) { .nav__links .opt { display: none; } }
@media (max-width: 560px) {
  .nav__bar { gap: 8px; }
  .nav__name span:last-child { display: none; }
  .nav__links a { padding: 0 10px; font-size: 14px; }
  .nav__cta { padding-inline: 12px; font-size: 14px; }
}

/* ---------- sections ---------- */
.section, .case { padding-block: var(--sec); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); max-width: 62ch; }
.case + .case, .case + .section, .section + .case, .section + .section { border-top: 1px solid var(--rule); }
.band + .section, .section + .band, .case + .band, .band + .case { border-top: 0; }
.case--surface { background: var(--surface); }
.case__head { margin-bottom: clamp(36px, 5vw, 64px); align-items: start; }
.case__head h2 { margin-top: 14px; font-size: clamp(30px, 3.8vw, 54px); letter-spacing: -0.04em; }

/* ---------- the opening: the scroll stage (from the Hook site) ---------- */
.scrub { position: relative; height: 420vh; background: var(--paper); }
.scrub__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.scrub__grid { height: 100%; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: center; padding-top: var(--nav-h); }
.scrub__copy { grid-column: 1 / span 5; position: relative; height: min(560px, 74svh); }
.scrub__chap { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(calc(-50% + 16px)); opacity: 0; visibility: hidden; transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s; display: grid; gap: 18px; }
.scrub__chap.is-on { opacity: 1; visibility: visible; transform: translateY(-50%); transition: opacity .45s ease, transform .45s ease, visibility 0s; }
.scrub__chap h1 { font-size: clamp(34px, 4.2vw, 62px); line-height: 1.04; letter-spacing: -0.045em; }
.scrub__chap h2 { font-size: clamp(28px, 3vw, 44px); }
.scrub__chap p { color: var(--muted); max-width: 46ch; }
.scrub__chap .btn-row { margin-top: 10px; }
.scrub__view { grid-column: 6 / span 7; position: relative; aspect-ratio: 1 / 1; width: min(100%, calc(100svh - 112px)); justify-self: center; }
.scrub__view > * { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scrub__view canvas:not(.is-ready) { opacity: 0; }
.scrub__view svg { overflow: visible; pointer-events: none; }
.scrub__meter { position: absolute; left: 0; bottom: 0; display: flex; gap: 6px; }
.scrub__meter i { width: 18px; height: 2px; background: var(--rule); transition: background .3s; }
.scrub__meter i.is-on { background: var(--ink); }
.co { opacity: 0; transition: opacity .35s ease; }
.co.is-on { opacity: 1; }
.co polyline { stroke: var(--ink); stroke-width: 1.6; fill: none; vector-effect: non-scaling-stroke; }
.co circle { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.co text { font-family: var(--font); font-size: 22px; fill: var(--ink); }
@media (max-width: 1023px) {
  .scrub { height: 380vh; }
  .scrub__grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-items: stretch; padding-top: calc(var(--nav-h) + 4px); padding-bottom: 16px; }
  .scrub__view { grid-column: 1; grid-row: 1; width: min(100%, 40svh); align-self: center; }
  .scrub__copy { grid-column: 1; grid-row: 2; height: auto; min-height: 0; }
  .scrub__chap { top: 8px; transform: translateY(12px); gap: 12px; }
  .scrub__chap.is-on { transform: none; }
  .scrub__chap h1 { font-size: clamp(27px, 6.6vw, 42px); }
  .scrub__chap h2 { font-size: clamp(23px, 5.4vw, 32px); }
  .scrub__chap p { font-size: 15px; line-height: 1.55; }
  .scrub__meter { display: none; }
  .co text { font-size: 30px; }
}
@media (max-width: 639px) { html.js:not(.calm) .scrub__chap .btn--secondary { display: none; } }   /* the résumé stays one tap away in the nav */
@media (max-width: 380px) { .scrub__chap p { font-size: 14px; } .scrub__chap .btn { padding-inline: 14px; } }
/* without the script, or with reduced motion: one still frame, every chapter in order */
html:not(.js) .scrub, html.calm .scrub { height: auto; }
html:not(.js) .scrub__stage, html.calm .scrub__stage { position: static; height: auto; overflow: visible; }
html:not(.js) .scrub__grid, html.calm .scrub__grid { height: auto; padding-block: calc(var(--nav-h) + 40px) 40px; align-items: start; }
html:not(.js) .scrub__copy, html.calm .scrub__copy { height: auto; display: grid; gap: 40px; }
html:not(.js) .scrub__chap, html.calm .scrub__chap { position: static; opacity: 1; visibility: visible; transform: none; }
html:not(.js) .scrub__meter, html.calm .scrub__meter, html:not(.js) .scrub__chap .dup, html.calm .scrub__chap .dup { display: none; }
@media (max-width: 1023px) { html:not(.js) .scrub__copy, html.calm .scrub__copy { grid-row: 2; } }
@media (min-width: 1024px) { html:not(.js) .scrub__view, html.calm .scrub__view { position: sticky; top: calc(var(--nav-h) + 24px); } }

/* ---------- ruled strips, the Hook's "four" ---------- */
.strip { list-style: none; margin: 0; padding: 0; display: grid; border: 1.5px solid var(--ink); background: var(--surface); }
.strip > li { display: grid; gap: 8px; align-content: start; padding: clamp(18px, 2vw, 28px); border-left: 1.5px solid var(--ink); }
.strip > li:first-child { border-left: 0; }
.strip__n { font-size: clamp(28px, 3vw, 40px); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.strip b { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.25; }
.strip span:not(.strip__n) { color: var(--muted); font-size: 15px; }
.strip--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.index > li { padding: 0; }
.index a { display: grid; gap: 10px; align-content: start; height: 100%; padding: clamp(18px, 2vw, 28px); text-decoration: none; transition: background .15s; }
.index a:hover { background: color-mix(in srgb, var(--ink) 5%, var(--surface)); }
.index a:hover b { text-decoration: underline; text-underline-offset: 4px; }
.strip--stack > li { border-left: 0; border-top: 1.5px solid var(--ink); grid-template-columns: 56px minmax(0, 1fr); column-gap: 14px; row-gap: 4px; }
.strip--stack > li:first-child { border-top: 0; }
.conds { align-self: start; }
.strip--stack .strip__n { grid-row: span 2; }
@media (max-width: 1023px) and (min-width: 640px) {
  .strip--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip--4 > li:nth-child(3) { border-left: 0; }
  .strip--4 > li:nth-child(n+3) { border-top: 1.5px solid var(--ink); }
}
@media (max-width: 639px) {
  .strip--4 { grid-template-columns: minmax(0, 1fr); }
  .strip--4 > li { border-left: 0; border-top: 1.5px solid var(--ink); }
  .strip--4 > li:first-child { border-top: 0; }
  .index a { grid-template-columns: 48px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; padding: 16px; }
  .index .strip__n { grid-row: span 2; font-size: 26px; }
}

/* ---------- rows: name left, value right ---------- */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.rows > li { display: grid; grid-template-columns: minmax(84px, 28%) minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.rows > li > span:first-child { color: var(--muted); font-weight: 600; }
.rows a { overflow-wrap: anywhere; }
.rows--long > li { grid-template-columns: minmax(120px, 32%) minmax(0, 1fr); }
@media (max-width: 639px) { .rows--long > li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* ---------- case bodies ---------- */
.body { margin-top: clamp(48px, 6vw, 80px); row-gap: 20px; }
.body > h3 { padding-top: 4px; }
.body > :not(h3) { margin-bottom: clamp(28px, 4vw, 52px); }
@media (min-width: 1024px) { .body > h3 { grid-column: 1 / span 3; } }
.txt { display: grid; gap: 16px; }
.decisions { margin: 0; display: grid; border-top: 1.5px solid var(--ink); }
.decisions > div { display: grid; grid-template-columns: minmax(0, 15ch) minmax(0, 1fr); gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.decisions dt { font-weight: 700; }
.decisions dd { margin: 0; color: var(--muted); }
@media (max-width: 639px) { .decisions > div { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

/* photographs, two side by side; the prototype gets the larger share */
.photos { display: grid; grid-template-columns: 7fr 4fr; gap: var(--gutter); align-items: end; }
@media (max-width: 767px) { .photos { grid-template-columns: minmax(0, 1fr); } }
.photo { margin: 0; }
.photo img { display: block; width: 100%; height: auto; background: var(--surface); }
.photo figcaption, .shots figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }
.photo--drawing img { background: transparent; mix-blend-mode: multiply; max-width: 420px; }

/* the timing chart */
.chart { margin: 0; border: 1.5px solid var(--ink); background: var(--surface); }
.chart svg { display: block; width: 100%; height: auto; padding: 12px 8px 0; }
.chart .ax { font-family: var(--font); font-size: 12px; fill: var(--muted); }
.chart .c-acc, .chart .c-jerk { fill: none; stroke: var(--ink); stroke-width: 2; }
.chart .c-acc { stroke-dasharray: 5 4; }
.chart .base { stroke: var(--rule); }
.chart .burst rect { fill: var(--ink); }
.chart .burst text { font-family: var(--font); font-size: 12px; fill: var(--muted); }
.chart .playhead { stroke: var(--ink); stroke-width: 1; opacity: 0; }
.chart.is-playing .burst { opacity: .18; }
.chart.is-playing .burst.is-hit { opacity: 1; transition: opacity .15s; }
.chart.is-playing .playhead { opacity: .5; }
.chart figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 14px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
html:not(.js) [data-replay], html.calm [data-replay] { display: none; }

/* the gesture pipeline: five steps on one ruled line */
.pipe { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1.5px solid var(--ink); background: var(--surface); counter-reset: s; }
.pipe li { padding: 14px; border-left: 1px solid var(--rule); display: grid; gap: 4px; align-content: start; font-size: 14px; }
.pipe li:first-child { border-left: 0; }
.pipe li::before { counter-increment: s; content: counter(s); font-weight: 800; font-size: 20px; line-height: 1; }
.pipe span { color: var(--muted); }
@media (max-width: 1180px) {
  .pipe { grid-template-columns: minmax(0, 1fr); }
  .pipe li { border-left: 0; border-top: 1px solid var(--rule); grid-template-columns: 28px minmax(0, 12ch) minmax(0, 1fr); column-gap: 12px; align-items: baseline; }
  .pipe li:first-child { border-top: 0; }
}
@media (max-width: 480px) { .pipe li { grid-template-columns: 28px minmax(0, 1fr); } .pipe li span { grid-column: 2; } }

/* the EV reframe: two large ruled halves */
.reframe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1.5px solid var(--ink); }
.reframe > div { display: grid; gap: 12px; align-content: start; padding: clamp(20px, 3vw, 40px); }
.reframe > div + div { border-left: 1.5px solid var(--ink); background: var(--ink); color: var(--band-ink); }
.reframe > div + div .t-label, .reframe > div + div span:not(.t-label) { color: var(--band-muted); }
.reframe b { font-size: clamp(22px, 2.4vw, 34px); line-height: 1.15; letter-spacing: -0.03em; }
.reframe span:not(.t-label) { color: var(--muted); }
@media (max-width: 639px) { .reframe { grid-template-columns: minmax(0, 1fr); } .reframe > div + div { border-left: 0; border-top: 1.5px solid var(--ink); } }

/* accessibility: two projects side by side */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 80px); border-top: 1.5px solid var(--ink); padding-top: 28px; }
@media (max-width: 767px) { .pair { grid-template-columns: minmax(0, 1fr); } }
.pair h3 { font-size: clamp(22px, 2vw, 28px); letter-spacing: -0.03em; }

/* more projects: a table; on a phone each row becomes a block */
.table-wrap { border: 1.5px solid var(--ink); background: var(--surface); }
.projects { width: 100%; border-collapse: collapse; font-size: 15px; }
.projects th, .projects td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.projects tbody tr:last-child > * { border-bottom: 0; }
.projects thead th { font-size: 13px; color: var(--muted); font-weight: 600; border-bottom: 1.5px solid var(--ink); }
.projects tbody th { font-weight: 750; width: 22%; }
.projects tbody th small { display: block; font-weight: 450; font-size: 13px; color: var(--muted); }
.projects td:nth-child(2) { font-weight: 700; width: 20%; }
.projects td:last-child { color: var(--muted); width: 18%; }
@media (max-width: 767px) {
  .projects thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .projects tr { display: grid; gap: 6px; padding: 16px; border-bottom: 1px solid var(--rule); }
  .projects tbody tr:last-child { border-bottom: 0; }
  .projects th, .projects td { display: block; padding: 0; border: 0; width: auto !important; }
}

/* ---------- the navy band ---------- */
.band { background: var(--band); color: var(--band-ink); }
.band h2, .band h3, .band b, .band .strip__n { color: var(--band-ink); }
.band p, .band .t-label { color: var(--band-muted); }
.band a { color: var(--band-ink); }
.stats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1.5px solid var(--band-ink); }
.stats > div { padding: 18px 0 20px; border-bottom: 1px solid color-mix(in srgb, var(--band-ink) 25%, transparent); display: grid; gap: 6px; }
.stats > div:nth-child(odd) { padding-right: 16px; }
.stats > div:nth-child(even) { padding-left: 16px; border-left: 1px solid color-mix(in srgb, var(--band-ink) 25%, transparent); }
.stats dt { font-size: 13px; color: var(--band-muted); order: 2; }
.stats dd { margin: 0; font-size: clamp(30px, 3.6vw, 52px); font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.shots { display: grid; grid-template-columns: 5fr 3fr 4fr; gap: var(--gutter); align-items: end; margin-top: clamp(24px, 4vw, 48px); }
.shots figure { margin: 0; }
.shots img { display: block; width: 100%; height: auto; background: var(--surface); }
.band .shots figcaption { color: var(--band-muted); }
@media (max-width: 767px) { .shots { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .shots figure:first-child { grid-column: 1 / -1; } }
.pubs { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--band-ink); }
.pubs li { display: grid; gap: 6px; padding: 18px 0; border-bottom: 1px solid color-mix(in srgb, var(--band-ink) 25%, transparent); }
.pubs a, .pubs b { font-size: clamp(17px, 1.5vw, 21px); font-weight: 750; line-height: 1.3; }
.pubs span:not(.t-label) { color: var(--band-muted); font-size: 15px; }

/* ---------- footer ---------- */
.foot { background: var(--band); color: var(--band-ink); padding-block: clamp(64px, 9vw, 120px) 32px; border-top: 1px solid color-mix(in srgb, var(--band-ink) 20%, transparent); }
.foot a { color: var(--band-ink); }
.foot__h { color: var(--band-ink); font-size: clamp(30px, 3.4vw, 48px); }
.foot__mail { display: inline-block; margin-top: 16px; font-size: clamp(20px, 3.6vw, 48px); font-weight: 750; letter-spacing: -0.03em; line-height: 1.2; overflow-wrap: anywhere; }
.foot__row { margin-top: clamp(48px, 7vw, 96px); padding-top: 20px; border-top: 1px solid color-mix(in srgb, var(--band-ink) 30%, transparent); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 32px; }
.foot__row p { color: var(--band-muted); font-size: 14px; }
.foot__row ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 24px; }
.foot__row ul a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; }

/* ---------- home: the introduction ---------- */
.intro { padding-block: calc(var(--nav-h) + clamp(40px, 7vw, 104px)) 0; }
.intro__grid { align-items: end; }
.intro h1 { font-size: clamp(34px, 4.6vw, 66px); line-height: 1.04; letter-spacing: -0.045em; }
.intro__text .lead { color: var(--muted); }
.intro__text .btn-row { margin-top: 8px; }
.portrait { margin: 0; }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border: 1.5px solid var(--ink); background: var(--surface); }
@media (max-width: 1023px) {
  .portrait { grid-row: 1; max-width: 220px; }
}
/* highlights: a ruled sheet; the 1.5px gaps are the rules, so any column count stays closed */
.facts { list-style: none; margin: clamp(40px, 6vw, 80px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5px; background: var(--ink); border: 1.5px solid var(--ink); }
.facts > li { background: var(--surface); padding: clamp(16px, 2vw, 26px); display: grid; gap: 6px; align-content: start; }
.facts b { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.25; }
.facts span:not(.t-label) { color: var(--muted); font-size: 15px; }
@media (max-width: 1023px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* ---------- home: project cards, each opens its own page ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gutter); }
.card { display: grid; grid-template-rows: auto 1fr; border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); text-decoration: none; transition: background .15s; }
.card:hover { background: color-mix(in srgb, var(--ink) 4%, var(--surface)); }
.card:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.card__media { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1.5px solid var(--ink); background: var(--paper); }
.card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card__media--paper { background: #fff; }
.card__media--paper img { object-position: 50% 58%; }
.card__media--or img { object-position: 58% 50%; }
.card__body { display: grid; gap: 10px; align-content: start; padding: clamp(18px, 2.2vw, 30px); }
.card__body h3 { font-size: clamp(21px, 2vw, 28px); line-height: 1.15; letter-spacing: -0.03em; }
.card__body p { color: var(--muted); }
.card__meta { margin-top: 6px; font-size: 13px; color: var(--muted); }
.card--lead { grid-column: 1 / -1; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: none; }
.card--lead .card__media { aspect-ratio: auto; min-height: 100%; height: clamp(320px, 36vw, 520px); border-bottom: 0; border-right: 1.5px solid var(--ink); }
.card--lead .card__body { align-content: center; }
.card--lead h3 { font-size: clamp(24px, 2.6vw, 38px); }
@media (max-width: 767px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card--lead { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .card--lead .card__media { height: auto; min-height: 0; aspect-ratio: 16 / 10; border-right: 0; border-bottom: 1.5px solid var(--ink); }
}
.after-cards { margin-top: 28px; color: var(--muted); }
.credits { margin-top: 10px; font-size: 13px; color: var(--muted); max-width: 90ch; }

/* ---------- project and about pages ---------- */
.page-top { padding-top: calc(var(--nav-h) + clamp(40px, 6vw, 88px)); }
.case__head h1 { margin-top: 14px; font-size: clamp(32px, 4.4vw, 62px); line-height: 1.04; letter-spacing: -0.045em; }

.hero-fig { margin: 0 0 clamp(8px, 2vw, 16px); }
.hero-fig img { display: block; width: 100%; height: auto; border: 1.5px solid var(--ink); }
.hero-fig figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }
.loop { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1.5px solid var(--ink); background: var(--surface); counter-reset: s; }
.loop li { padding: 14px; border-left: 1px solid var(--rule); display: grid; gap: 4px; align-content: start; font-size: 14px; }
.loop li:first-child { border-left: 0; }
.loop li::before { counter-increment: s; content: counter(s); font-weight: 800; font-size: 20px; line-height: 1; }
.loop span { color: var(--muted); }
@media (max-width: 767px) { .loop { grid-template-columns: minmax(0, 1fr); } .loop li { border-left: 0; border-top: 1px solid var(--rule); } .loop li:first-child { border-top: 0; } }
.next { border-top: 1px solid var(--rule); padding-block: clamp(40px, 6vw, 72px); }
.next a { display: grid; gap: 6px; text-decoration: none; max-width: 40ch; }
.next b { font-size: clamp(22px, 2.6vw, 36px); line-height: 1.12; letter-spacing: -0.03em; }
.next a:hover b { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.about-photo { margin: 0; max-width: 420px; }
@media (max-width: 639px) { .about-photo { max-width: 240px; } }
.about-photo img { display: block; width: 100%; height: auto; border: 1.5px solid var(--ink); }

@media (max-width: 639px) {
  body { font-size: 15px; }
  .section, .case { padding-block: 56px; }
  .grid { row-gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .scrub__chap, .co, .btn, .index a, .card { transition: none; }
}
