/* The studio site: the visual language of delauw.vercel.app. True black, warm paper, one vermilion signal,
   Space Grotesk for display, Geist for text, Geist Mono for labels, square corners, hairlines. */
/* Fonts, self-hosted (assets/fonts, OFL): the first paint no longer waits on two Google origins.
   Space Grotesk blocks instead of swapping: it is preloaded from this origin, and the giant wordmark
   should never flash in a fallback face. Text faces swap. */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: block;
  src: url("assets/fonts/space-grotesk-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: block;
  src: url("assets/fonts/space-grotesk-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("assets/fonts/geist-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("assets/fonts/geist-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/geist-mono-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/geist-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink: oklch(0 0 0);
  --surface: oklch(0.14 0 0);
  --line: oklch(1 0 0 / 0.1);
  --line-2: oklch(1 0 0 / 0.18);
  --paper: oklch(0.96 0.004 90);
  --mute: oklch(0.62 0 0);
  --signal: oklch(0.68 0.21 34);
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --f-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --f-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; min-width: 0; }
html { background: var(--ink); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--paper); font: 300 17px/1.6 var(--f-sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--signal); color: var(--ink); }
:focus-visible { outline: 1px solid var(--signal); outline-offset: 4px; }

.mono { font: 400 11px/1.4 var(--f-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute); }
.display { font-family: var(--f-display); font-weight: 700; letter-spacing: -0.04em; line-height: 0.92; margin: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 12px; z-index: 50; background: var(--paper); color: var(--ink); padding: 8px 12px; }

/* frame: registration marks in the corners, the rest is hairlines */
.frame i { position: fixed; width: 14px; height: 14px; z-index: 30; pointer-events: none; border: 0 solid var(--line-2); }
.frame i:nth-child(1) { top: 10px; left: 10px; border-top-width: 1px; border-left-width: 1px; }
.frame i:nth-child(2) { top: 10px; right: 10px; border-top-width: 1px; border-right-width: 1px; }
.frame i:nth-child(3) { bottom: 10px; left: 10px; border-bottom-width: 1px; border-left-width: 1px; }
.frame i:nth-child(4) { bottom: 10px; right: 10px; border-bottom-width: 1px; border-right-width: 1px; }

/* header: a lockup and four words, no bar */
.top { position: fixed; inset: 0 0 auto; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  padding: 26px var(--gutter); mix-blend-mode: difference; }
.lockup { font: 700 18px/1 var(--f-display); letter-spacing: -0.04em; text-decoration: none; text-transform: uppercase; color: #fff; }
.top nav { display: flex; gap: clamp(14px, 2.4vw, 32px); }
.top nav a { font: 400 11px/1 var(--f-mono); letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; color: #fff; opacity: .62; padding: 6px 0; }
.top nav a:hover, .top nav a[aria-current="page"] { opacity: 1; }

/* sections */
.sec { position: relative; padding: clamp(96px, 16vh, 180px) var(--gutter); border-top: 1px solid var(--line); }
.sec__head { display: grid; grid-template-columns: 4rem 1fr; gap: 0 1.5rem; align-items: baseline; margin-bottom: clamp(40px, 8vh, 96px); }
.sec__head .idx { font: 400 11px/1 var(--f-mono); letter-spacing: 0.2em; color: var(--signal); }
.sec__head h2 { font: 400 11px/1 var(--f-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute); margin: 0; }

/* 00 opening */
.open { border-top: 0; }
.open__pin { min-height: 100svh; display: grid; grid-template-rows: 1fr auto; padding: 120px var(--gutter) 34px; }
.open__mark { align-self: center; font-size: var(--mark-size, clamp(4rem, 22.6vw, 40rem)); text-transform: uppercase; margin-left: -0.04em; }
.open__mark .ltr__base { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.open__row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2rem; align-items: end; }
.open__claim { font: 700 clamp(1.6rem, 3.6vw, 3.4rem)/1 var(--f-display); letter-spacing: -0.035em; margin: 0; }
.open__claim em { font-style: normal; color: var(--signal); }
.open__lede { margin: 0; max-width: 40ch; color: var(--mute); }
.open__lede strong { color: var(--paper); font-weight: 400; }
.open__meta { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); }

/* 01 work: one pinned plate per site; the site itself scrolls inside the frame */
.case { height: max(100svh, calc(var(--stops, 4) * 75vh)); position: relative; border-top: 1px solid var(--line); }
.case__pin { position: sticky; top: 0; height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr);
  gap: clamp(24px, 4vw, 72px); align-items: center; padding: 96px var(--gutter) 56px; }
.case__text .n { font: 400 11px/1 var(--f-mono); letter-spacing: 0.2em; color: var(--mute); }
.case__text .n b { color: var(--signal); font-weight: 400; }
.case__text h3 { font-size: clamp(2.6rem, 5vw, 5rem); margin: 18px 0 16px; }
.case__text p { margin: 0; color: var(--mute); max-width: 36ch; }
.case__text .n, .case__text .case__frame { max-width: none; }   /* label lines stay on one line */
.case__text p strong { color: var(--paper); font-weight: 400; }
.facts { margin: 28px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { font: 400 11px/1.6 var(--f-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute); }
.facts dd { margin: 0; font-size: 15px; }
.case__note { margin-top: 16px !important; font-size: 13px; }
.go { display: inline-flex; gap: 10px; align-items: center; margin-top: 28px; font: 400 11px/1 var(--f-mono); letter-spacing: 0.2em;
  text-transform: uppercase; text-decoration: none; color: var(--paper); padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.go:hover { border-color: var(--signal); }
.go span { color: var(--signal); }

.screen { margin: 0; border: 1px solid var(--line-2); background: var(--surface); }
.screen__bar { display: flex; justify-content: space-between; gap: 1rem; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.screen__bar span { font: 400 10px/1 var(--f-mono); letter-spacing: 0.16em; text-transform: lowercase; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen__view { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.screen__view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .25s ease; }
.screen__view img.is-on { opacity: 1; }
.screen__track { height: 1px; background: var(--line); }
.screen__track i { display: block; height: 1px; width: 100%; background: var(--signal); transform: scaleX(0); transform-origin: left; }
/* a terminal screen (plain page): the whole session at once; world.js types it out on its own screen */
.term { position: absolute; inset: 0; padding: 4% 4.5%; overflow: hidden; background: #0b0b0b; }
.term pre { margin: 0 0 0.9em; font: 400 clamp(12px, 1.05vw, 14px)/1.6 var(--f-mono); color: var(--mute); white-space: pre-wrap; text-indent: 2ch hanging each-line; }
.term pre::first-line { color: var(--paper); }

/* 02 services: an oversized list */
.services { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.services li { display: grid; grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 26rem); gap: 1.5rem; align-items: baseline;
  padding: clamp(18px, 3vh, 30px) 0; border-bottom: 1px solid var(--line); }
.services .i { font: 400 11px/1 var(--f-mono); letter-spacing: 0.2em; color: var(--mute); }
.services h3 { font-size: clamp(2rem, 5.4vw, 5.6rem); transition: color .3s ease; }
.services p { margin: 0; color: var(--mute); font-size: 15px; }
.services li:hover h3 { color: var(--signal); }

/* 03 contact */
.contact__line { font-size: clamp(3rem, 9vw, 9.5rem); }
.contact__mail { display: inline-block; margin-top: clamp(32px, 6vh, 64px); font: 700 clamp(1.4rem, 3.6vw, 3.2rem)/1 var(--f-display);
  letter-spacing: -0.03em; text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 10px; }
.contact__mail:hover { border-color: var(--signal); }
.contact__row { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-top: 36px; }
.contact__row a { text-decoration: none; }
.contact__row a:hover { color: var(--paper); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 24px var(--gutter) 34px; border-top: 1px solid var(--line); }

/* reveal: plain and quick, only once */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1); }
.rv.is-in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .top nav a:nth-child(2) { display: none; }
  .open__row { grid-template-columns: 1fr; }
  .open__meta { flex-wrap: wrap; gap: 6px 8px; }   /* chapter and clock stay whole; the clock drops below when short of room */
  .open__meta .mono { letter-spacing: 0.16em; white-space: nowrap; }
  .case { height: max(100svh, calc(var(--stops, 4) * 65vh)); }
  .case__pin { grid-template-columns: 1fr; align-content: center; gap: 22px; padding: 84px var(--gutter) 28px; }
  .case__text h3 { margin: 10px 0 8px; }
  .case__text p, .facts, .case__note { display: none; }
  .case__text p.case__one { display: block; }
  .go { margin-top: 14px; }
  .screen { order: 2; }
  .screen__view:has(.term) { aspect-ratio: auto; }   /* the terminal grows to hold the whole session */
  .term { position: relative; }
  .services li { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .services p { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .case { height: auto; }
  .case__pin { position: relative; height: auto; }
}

.sec--lead { padding-bottom: 0; }

/* ---------------------------------------------------------------------------------------------
   World mode (html.is-world, set before first paint when WebGL2 and motion are available).
   A fixed canvas renders the camera flight; every beat's content becomes a fixed overlay that
   world.js shows (.is-active) and reveals (.is-shown). The sections only give the scroll length.
   --------------------------------------------------------------------------------------------- */
#world, .hudline, .case__frame { display: none; }
.is-world #world { display: block; position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
.is-world main { position: relative; z-index: 2; }
.is-world .rv { opacity: 1; transform: none; transition: none; }
.is-world .foot { position: relative; z-index: 2; background: var(--ink); }

.is-world .hudline { display: flex; justify-content: space-between; gap: 1rem; position: fixed; left: var(--gutter); right: var(--gutter);
  bottom: 26px; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .6s ease; }
.is-world .hudline.is-on { opacity: 1; }
.is-world .hudline [data-hud-depth] { font-variant-numeric: tabular-nums; }

/* opening: the DOM wordmark stays for first paint and screen readers; the world draws identical letters */
.is-world .open { height: 220vh; }
.is-world .open__pin { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.is-world .open.is-past .open__pin { visibility: hidden; }
.is-world .open__mark.is-gl { color: transparent; }

/* work: the screens live in the world; the text slides in beside them */
.is-world .sec--lead { display: none; }
.is-world .case { height: calc(var(--stops, 4) * 100vh); border-top: 0; }
.is-world .case__pin { position: fixed; inset: 0; height: 100vh; display: block; padding: 0; pointer-events: none;
  visibility: hidden; transition: visibility 0s .6s; }
.is-world .case.is-active .case__pin { visibility: visible; transition: visibility 0s 0s; }
.is-world .screen { display: none; }
.is-world .case__text { position: absolute; top: 50%; left: var(--gutter); width: min(30vw, 420px); transform: translateY(-50%); }
.is-world .case[data-side="left"] .case__text { left: auto; right: var(--gutter); }
.is-world .case__text > * { opacity: 0; transform: translateY(14px); transition: opacity .4s ease, transform .4s ease; }
.is-world .case.is-shown .case__text { pointer-events: auto; }
.is-world .case.is-shown .case__text > * { opacity: 1; transform: none; transition: opacity .8s ease, transform 1s cubic-bezier(.16, 1, .3, 1); }
.is-world .case.is-shown .case__text > :nth-child(2) { transition-delay: .07s; }
.is-world .case.is-shown .case__text > :nth-child(3) { transition-delay: .14s; }
.is-world .case.is-shown .case__text > :nth-child(4) { transition-delay: .2s; }
.is-world .case.is-shown .case__text > :nth-child(5) { transition-delay: .26s; }
.is-world .case.is-shown .case__text > :nth-child(6) { transition-delay: .32s; }
.is-world .case.is-shown .case__text > :nth-child(7) { transition-delay: .38s; }
.is-world .case__frame { display: block; margin-top: 22px; font-variant-numeric: tabular-nums; }
/* a soft dark field behind the text, so the lines on the ground never compete with the copy */
.is-world .case__text::before { content: ""; position: absolute; inset: -18% -30% -18% -40%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .72), rgba(0, 0, 0, .35) 60%, transparent); opacity: 0; transition: opacity .6s ease; }
.is-world .case.is-shown .case__text::before { opacity: 1; }
.is-world .case__frame span { color: var(--paper); }

/* services: the words stand in the world; the overlay names the one you are passing */
.is-world .beat { padding: 0; border-top: 0; }
.is-world .beat--services { height: 560vh; }
.is-world .beat--contact { height: 200vh; }
.is-world .beat__pin { position: fixed; inset: 0; padding: clamp(96px, 16vh, 180px) var(--gutter) 96px; pointer-events: none;
  visibility: hidden; transition: visibility 0s .6s; }
.is-world .beat.is-active .beat__pin { visibility: visible; transition: visibility 0s 0s; }
.is-world .beat--services .sec__head { opacity: 0; transition: opacity .6s ease; }
.is-world .beat--services.is-active .sec__head { opacity: 1; }
.is-world .services { position: absolute; left: var(--gutter); bottom: 104px; width: min(34rem, calc(100vw - 2 * var(--gutter))); border: 0; }
.is-world .services li { position: absolute; left: 0; bottom: 0; width: 100%; display: block; padding: 0; border: 0;
  opacity: 0; transform: translateY(12px); transition: opacity .35s ease, transform .35s ease; }
.is-world .services li.is-on { opacity: 1; transform: none; transition: opacity .8s ease, transform 1s cubic-bezier(.16, 1, .3, 1); }
.is-world .services li .i { display: block; margin-bottom: 12px; color: var(--signal); }
.is-world .services li h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.is-world .services li p { margin: 0; font-size: 17px; color: var(--paper); max-width: 34ch; }

/* contact: the camera looks down on the grid and the line arrives */
.is-world .beat--contact .beat__pin { display: flex; flex-direction: column; justify-content: center; }
.is-world .beat--contact .beat__pin > * { opacity: 0; transform: translateY(16px); transition: opacity .4s ease, transform .4s ease; }
.is-world .beat--contact.is-shown .beat__pin { pointer-events: auto; }
.is-world .beat--contact.is-shown .beat__pin > * { opacity: 1; transform: none; transition: opacity .9s ease, transform 1.1s cubic-bezier(.16, 1, .3, 1); }
.is-world .beat--contact.is-shown .beat__pin > :nth-child(2) { transition-delay: .08s; }
.is-world .beat--contact.is-shown .beat__pin > :nth-child(3) { transition-delay: .18s; }
.is-world .beat--contact.is-shown .beat__pin > :nth-child(4) { transition-delay: .26s; }
.is-world .beat--contact .sec__head { position: absolute; top: clamp(96px, 16vh, 180px); left: var(--gutter); right: var(--gutter); }

@media (max-width: 860px) {
  .is-world .case__text, .is-world .case[data-side="left"] .case__text { top: auto; bottom: 84px; left: var(--gutter); right: var(--gutter);
    width: auto; transform: none; }
  .is-world .hudline { bottom: 22px; }
  .is-world .services { bottom: 84px; }
}
