
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100svh; background: var(--paper); color: var(--ink); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, dl, dd, figure { margin: 0; }
button, input { font: inherit; }
ol { padding: 0; list-style: none; }
/* Declared on body so a project page's own accent (set inline on body) takes effect. */
body { --accent: var(--accent-base, var(--ink)); }
@media (prefers-color-scheme: dark) {
  body { --accent: color-mix(in oklab, var(--accent-base, var(--ink)) 62%, white); }
}
:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem; background: var(--ink); color: var(--paper); }
.skip:focus { top: 1rem; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --rack: #ecebe7;
  --ink: #141414;
  --ink-2: #3f3e3a;
  --paper: var(--rack);
  --gutter: 32px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
/* Opening a cover grows it into its page; with reduced motion, pages simply change. */
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--p-bg, var(--rack));
  color: var(--p-ink, var(--ink));
  font: 400 17px/1.5 var(--p-font, "Schibsted Grotesk", system-ui, sans-serif);
  --focus: var(--p-ink, var(--ink));
}
::selection { background: var(--p-ink, var(--ink)); color: var(--p-bg, var(--rack)); }
a { text-underline-offset: 0.22em; text-decoration-thickness: 1.5px; }
.frame { font-family: "Schibsted Grotesk", system-ui, sans-serif; }

/* ---------- The bar ---------- */

.bar { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 24px; flex-wrap: wrap; padding: 22px var(--gutter); }
.bar-name { font-size: 22px; font-weight: 650; letter-spacing: -0.025em; }
.bar nav { display: flex; flex-wrap: wrap; gap: 6px 26px; font-size: 16px; }
.bar nav a { padding: 6px 0; }
.bar nav a:hover, .bar-name:hover { text-decoration: underline; }

/* The home's bar is the masthead. */
.masthead { padding-top: 30px; padding-bottom: 36px; align-items: last baseline; }
.masthead h1 { font-size: clamp(44px, 6.6vw, 96px); font-weight: 650; letter-spacing: -0.045em; line-height: 0.92; }
.masthead-line { margin-top: 14px; max-width: 46ch; font-size: 20px; line-height: 1.35; color: var(--ink-2); }


.empty { padding: 0 var(--gutter) 96px; font-size: 20px; }

.site-foot { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding: 28px var(--gutter) 40px; border-top: 1px solid color-mix(in srgb, var(--p-ink, var(--ink)) 14%, transparent); font-size: 16px; color: var(--p-ink-2, var(--ink-2)); }
.site-foot nav { display: flex; gap: 20px; }
.site-foot a:hover { text-decoration: underline; }

/* ---------- A project's page: its cover fills the first screen, the next one waits at the edge ---------- */


.story { max-width: 1180px; margin: 0 auto; padding: 104px var(--gutter) 120px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 72px 80px; align-items: start; }
.prose p { max-width: 58ch; margin-bottom: 1.1em; font-size: 18px; line-height: 1.6; color: color-mix(in srgb, var(--p-ink, var(--ink)) 82%, transparent); text-wrap: pretty; }
.prose > p:first-child { font-size: 21px; line-height: 1.5; font-weight: 450; letter-spacing: -0.005em; color: var(--p-ink, var(--ink)); }
.more summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 17px; font-weight: 600; cursor: pointer; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "+"; font-weight: 400; transition: rotate 0.3s var(--ease); }
.more[open] summary::after { rotate: 45deg; }
.more[open] summary { margin-bottom: 14px; }
.facts-col { display: grid; gap: 32px; align-content: start; }
.facts { display: grid; gap: 28px; }
.shots-wrap, .rules-wrap { grid-column: 1 / -1; }
.facts dt { font-size: 16px; color: var(--p-ink-2, var(--ink-2)); }
.facts dd { margin-top: 4px; font-size: 19px; line-height: 1.45; }
.links { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--p-accent, var(--ink)); color: var(--p-on-accent, #fff); font-weight: 600; transition: transform 0.2s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn-quiet { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }

.film { grid-column: 1 / -1; margin: 0; padding: clamp(16px, 4vw, 56px); background: var(--p-field, color-mix(in srgb, var(--p-accent, var(--ink)) 92%, white)); }
.film video { display: block; width: 100%; height: auto; background: #000; box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.55); }
.film figcaption { margin-top: 16px; max-width: 60ch; font-size: 16px; color: var(--p-on-field, var(--p-ink)); }
.shots { display: grid; gap: 40px; margin: 0; padding: 0; list-style: none; }
.shot { padding: clamp(20px, 5vw, 72px); background: var(--p-field, color-mix(in srgb, var(--p-accent, var(--ink)) 92%, white)); }
.shot img { width: 100%; height: auto; box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.5); }
.shot figcaption { margin-top: 16px; max-width: 60ch; font-size: 16px; color: var(--p-on-field, var(--p-ink)); }

.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 32px 48px; margin: 0; padding: 0; list-style: none; }
.rules:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.rules li { padding-top: 22px; border-top: 3px solid currentColor; }
.rules h3 { margin-bottom: 14px; font-family: var(--p-display, inherit); font-size: var(--p-rule-size, 30px); font-weight: var(--p-display-weight, 650); line-height: 1; letter-spacing: var(--p-display-tracking, -0.02em); text-transform: var(--p-display-case, none); text-wrap: balance; }
.rules p { font-size: 18px; line-height: 1.5; }

.progress { grid-column: 1 / -1; display: grid; gap: 56px; }
.progress h2 { margin-bottom: 20px; font-size: 22px; font-weight: 600; }
.numbers { margin: 0; padding: 0; list-style: none; border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.numbers li { display: grid; grid-template-columns: minmax(0, 1fr) 15ch 11ch; align-items: baseline; gap: 24px; padding: 22px 0 24px; border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.numbers .what { font-size: 20px; line-height: 1.35; }
.numbers .from { font-size: 16px; color: var(--p-ink-2, var(--ink-2)); }
.numbers .now, .numbers .goal { font: 500 clamp(40px, 5vw, 64px)/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; text-align: right; }
.numbers small { display: block; margin-bottom: 8px; font: 400 16px/1 var(--p-font, "Schibsted Grotesk", system-ui, sans-serif); letter-spacing: 0; color: var(--p-ink-2, var(--ink-2)); }
.numbers .goal { color: var(--p-accent, inherit); }
.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 40px 48px; }
.steps .count { font: 500 56px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.steps .count span { font-size: 0.5em; letter-spacing: 0; color: var(--p-ink-2, var(--ink-2)); }
.steps .what { margin-top: 10px; font-size: 18px; line-height: 1.4; }
.track { height: 4px; margin-top: 16px; background: color-mix(in srgb, currentColor 14%, transparent); }
.track span { display: block; height: 100%; background: var(--p-accent, currentColor); }

.next { display: grid; grid-template-columns: minmax(0, 1fr) 240px; align-items: end; gap: 32px; padding: 56px var(--gutter); border-top: 1px solid color-mix(in srgb, var(--p-ink, var(--ink)) 14%, transparent); font-family: "Schibsted Grotesk", system-ui, sans-serif; }
.next-label { display: block; font-size: 17px; color: var(--p-ink-2, var(--ink-2)); }
.next-name { display: block; margin-top: 6px; font-size: clamp(36px, 5vw, 72px); font-weight: 650; letter-spacing: -0.045em; line-height: 1; }
.next:hover .next-name { text-decoration: underline; text-decoration-thickness: 3px; }

.missing { min-height: 60svh; padding: 12vh var(--gutter); display: grid; align-content: start; gap: 28px; }
.missing h1 { font-size: clamp(44px, 7vw, 96px); font-weight: 650; letter-spacing: -0.045em; line-height: 0.95; }
.missing p { max-width: 40ch; font-size: 20px; }
.missing nav { display: flex; flex-wrap: wrap; gap: 12px; }


/* ---------- A project's page: the chip's board, the project's window at the top ---------- */

.page-project {
  background-color: var(--p-bg, #0a0a0c);
  background-image:
    linear-gradient(rgb(255 255 255 / 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.026) 1px, transparent 1px);
  background-size: 48px 48px;
}
.page-project .status { display: inline-flex; align-items: center; gap: 0.55em; font-size: 16px; font-weight: 500; color: var(--p-ink-2); white-space: nowrap; }
.page-project .status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 10px #2fbf71; }
.page-project .status[data-building]::before { background: #f0a73a; box-shadow: 0 0 10px #f0a73a; }
.p-hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: center; gap: 56px; min-height: calc(100svh - 88px); padding: 24px var(--gutter) 72px; }
.p-window { border-radius: 12px; overflow: hidden; background: #1b1b20; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1), 0 50px 110px -60px color-mix(in srgb, var(--edge, #ffffff) 45%, transparent), 0 40px 90px -50px rgb(0 0 0 / 0.9); }
.p-window .chrome, .next-window .chrome { position: relative; display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; background: #1f1f24; }
.p-window .chrome i, .next-window .chrome i { width: 10px; height: 10px; border-radius: 50%; background: #45454d; }
.p-window .chrome span { position: absolute; left: 50%; translate: -50% 0; font-size: 15px; color: #9d9ca6; white-space: nowrap; }
.p-screens { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.p-shot { position: absolute; inset: 0; clip-path: inset(0 0 0 100%); transition: clip-path 0.95s cubic-bezier(0.77, 0, 0.175, 1); }
.p-shot.is-on { clip-path: inset(0); z-index: 1; }
.p-shot.was-on { clip-path: inset(0); z-index: 0; }
.p-shot img { width: 100%; height: 100%; object-fit: cover; object-position: 0 0; }
.p-figure { margin: 0; }
.p-under { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; min-height: 26px; margin-top: 14px; font-size: 15px; color: var(--p-ink-2); }
.p-pause { padding: 6px 0; border: 0; background: none; color: var(--p-ink-2); font: inherit; font-weight: 600; cursor: pointer; }
.p-pause:hover { color: var(--p-ink); text-decoration: underline; text-underline-offset: 0.2em; }
/* A project with nothing to show in a window opens on its words alone. */
.p-hero:not(:has(.p-figure)) { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 12vh; }
.p-words { display: grid; gap: 22px; justify-items: start; }
.p-name { font-size: clamp(48px, 5.4vw, 88px); font-weight: 650; letter-spacing: -0.045em; line-height: 0.95; text-wrap: balance; }
.p-line { max-width: 28ch; font-size: clamp(21px, 1.9vw, 27px); line-height: 1.3; color: color-mix(in srgb, var(--p-ink) 88%, transparent); text-wrap: pretty; }
.next-window { display: block; width: 280px; border-radius: 10px; overflow: hidden; background: #1b1b20; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 30px 60px -30px rgb(0 0 0 / 0.9); transition: transform 0.5s var(--ease); }
.next-window .chrome { height: 22px; gap: 5px; padding: 0 9px; }
.next-window .chrome i { width: 7px; height: 7px; }
.next-window img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: 0 0; }
.next { grid-template-columns: minmax(0, 1fr) 280px; }
.next:hover .next-window { transform: translateY(-4px); }
/* Screens and the film sit straight on the board, each with a hairline edge; highlights take a fine rule. */
.page-project .shot, .page-project .film { padding: 0; background: none; }
.page-project .shot img, .page-project .film video { border-radius: 12px; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 40px 80px -45px rgb(0 0 0 / 0.95); }
.page-project .shot figcaption, .page-project .film figcaption { color: var(--p-ink-2); }
.page-project .rules li { padding-top: 18px; border-top: 1px solid rgb(255 255 255 / 0.14); }
.page-project .rules h3 { font-size: 24px; }
.page-project .rules p { font-size: 17px; color: color-mix(in srgb, var(--p-ink) 80%, transparent); }
@media (prefers-reduced-motion: reduce) { .p-shot { transition: none; } }
@media (max-width: 900px) {
  .p-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 32px; padding: 12px var(--gutter) 48px; }
  .p-line { max-width: none; }
  .next { grid-template-columns: minmax(0, 1fr) minmax(0, 150px); }
  .next-window { width: 100%; max-width: 150px; justify-self: end; }
}

/* ---------- Motion around the covers ---------- */

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-group(*) { animation-duration: 0.55s; animation-timing-function: var(--ease); }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.3s; }
  @supports (animation-timeline: scroll()) {
  }
}

/* ---------- Narrower screens ---------- */

@media (max-width: 1100px) {
  .story { grid-template-columns: minmax(0, 1fr); gap: 56px; }
}

@media (max-width: 700px) {
  :root { --gutter: 16px; }
  .bar { padding-top: 16px; padding-bottom: 16px; }
  .masthead { padding-top: 22px; padding-bottom: 24px; }
  .story { padding: 48px var(--gutter) 72px; }
  .prose p { font-size: 18px; }
  .prose p:first-child { font-size: 20px; }
  .numbers li { grid-template-columns: minmax(0, 1fr) auto; }
  .numbers .what { grid-column: 1 / -1; }
  .numbers .now, .numbers .goal { text-align: left; }
  .next { grid-template-columns: minmax(0, 1fr) 132px; padding: 40px var(--gutter); }
}
