:root {
  --bg: #0d0b0a;
  --text: #b7ab98;
  --bright: #e8dfd0;
  --dim: #9a907f;   /* secondary text: 4.5:1 or better on the page and on the cards (axe) */
  --accent: #e0a458;
  --line: rgba(183, 171, 152, .16);
  --display: "Caveat Brush", "Bradley Hand", cursive;
  --sans: "Caveat", "Bradley Hand", cursive;      /* everything is handwritten: pen for text, brush for titles */
  --mono: "Caveat", "Bradley Hand", cursive;
  /* set by main.js: pointer offset (-.5 to .5) and scroll progress through the hero (0 to 1) */
  --mx: 0;
  --my: 0;
  --s: 0;
  /* motion: every transition and page change on the site uses these */
  --quick: .2s;      /* hover, press, content leaving */
  --base: .45s;      /* content arriving, panels opening */
  --slow: .8s;       /* reveals on scroll */
  --ease: cubic-bezier(.3, 0, .2, 1);
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; } /* hidden always wins over a layout rule (grid, flex) */
html { scroll-behavior: smooth; font-size: 137.5%; } /* handwriting reads small, so every rem size is scaled up */
body {
  background: var(--bg);
  color: var(--text);
  font: 400 1.15rem/1.4 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
ul { list-style: none; padding: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; color: var(--bright); line-height: 1.05; filter: url(#rough); }

/* ---------- background: five 360° environments ---------- */
@property --accent { syntax: "<color>"; inherits: true; initial-value: #ffb070; }
html { transition: --accent var(--slow) var(--ease); }
html[data-world="1"] { --accent: #ff8a4c; }
html[data-world="2"], html.detail-page { --accent: #8fd0ff; }
html.detail-page.warm { --accent: #ff8a4c; } /* the featured project sits in the afterglow */
html.news-page { --accent: #ffb3c0; } /* the news page sits at first light */
html[data-world="3"] { --accent: #ffb3c0; }
html[data-world="4"] { --accent: #ffd36b; }

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.bg::after { /* flat page: text sits straight on the photo, so keep it dark, darker after the hero */
  content: ""; position: absolute; inset: 0; background: var(--bg); opacity: calc(.2 + var(--s) * .32);
}
.w { position: absolute; inset: 0; opacity: 0; transition: opacity var(--slow) var(--ease); } /* flat page: main.js fades these in as you scroll */
.w:nth-child(1) { opacity: 1; background: linear-gradient(#191233, #8c2e47 45%, #f2732e 62%, #4d1f1f 62.2%, #08080f); }
.w:nth-child(2) { background: linear-gradient(#05050f, #1a0d1c 48%, #732014 61.8%, #0a0608 62.2%); }
.w:nth-child(3) { background: radial-gradient(90% 50% at 50% 100%, #2a1a3a, transparent 70%), linear-gradient(#01020a, #050817); }
.w:nth-child(4) { background: linear-gradient(#1f1a47, #9e5280 45%, #f29e80 62%, #1a0d1c 62.2%); }
.w:nth-child(5) { background: radial-gradient(60% 40% at 50% 62%, #ffd98c, transparent), linear-gradient(#33335c, #bf6b59 40%, #ffb859 62%, #1a0f0d 62.2%); }
.sky { position: absolute; inset: 0; width: 100%; height: 100%; } /* the live sky, on every screen size */
.no-gl .sky { display: none; }
.sky3d { position: absolute; inset: 0; width: 100%; height: 100%; } /* the Three.js scene (scene3d.js), computers only */
.sky3d-on .sky { animation: sky-out var(--base) var(--ease) forwards; } /* the quick 2D sky melts into the 3D one once it has loaded */
@keyframes sky-out { to { opacity: 0; visibility: hidden; } }
html:not(.no-gl) .w { display: none; } /* the gradients are only the fallback when WebGL is missing */
.route, .fly-only, .touch-only { display: none; }

/* ---------- phones: look around, and the projects as a list ---------- */
html:not(.fly) body { touch-action: pan-y pinch-zoom; } /* sideways drags are ours (they turn the view); up and down still scrolls */
@media (pointer: coarse) { html:not(.fly) .touch-only { display: inline; } }
.thumb { -webkit-touch-callout: none; } /* a held finger plays the clip instead of opening the link preview */
html.fly .list { display: contents; }
@media (max-width: 760px) {
  .list { display: grid; gap: 14px; } /* the four cards in a list, laid out like the computer cards: clip on the left, number and text on the right */
  .list .project {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: auto 1fr; gap: 4px 14px; align-items: start;
    padding: 12px; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 14px; background: rgba(14, 11, 10, .8);
  }
  .list .project:last-child { border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
  .list .thumb { grid-column: 1; grid-row: 1 / span 2; align-self: center; aspect-ratio: 4 / 3; }
  .list .num { grid-column: 2; grid-row: 1; font-size: 1.75rem; color: color-mix(in srgb, var(--accent) 55%, transparent); }
  .list .project-text { grid-column: 2; grid-row: 2; min-width: 0; }
  .list .project h3 { font-size: 1.35rem; margin-bottom: 4px; }
  .list .project-text p { font-size: .85rem; line-height: 1.4; }
  .list .spec { margin-top: 6px; font-size: .62rem; }
}


/* film grain over everything */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 15; pointer-events: none; opacity: .13; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px clamp(20px, 4vw, 48px);
  font-size: .8125rem; letter-spacing: .12em; text-transform: uppercase;
  background: linear-gradient(rgba(13, 11, 10, .95) 35%, transparent);
}
.nav nav { display: flex; gap: clamp(18px, 3vw, 36px); }
.nav a { color: var(--dim); transition: color var(--quick) var(--ease); }
.nav a:hover, .nav a[aria-current] { color: var(--bright); }
.nav .corner { color: var(--accent); }

/* ---------- layout ---------- */
.world > section, footer { width: min(1120px, 100%); margin-inline: auto; padding-inline: clamp(20px, 4vw, 48px); }
section { scroll-margin-top: 72px; }
.section-title { font-size: clamp(2.75rem, 7vw, 4.75rem); margin-bottom: clamp(28px, 5vw, 56px); }
.eyebrow { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }

/* ---------- hero ---------- */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; position: relative; }
.hero-inner {
  opacity: calc(1 - var(--s) * 1.7);
  transform: translateY(calc(var(--s) * -50px)) scale(calc(1 + var(--s) * .06));
  transform-origin: left center;
  padding-bottom: 14vh;
}
.hello { font: 400 clamp(1.5rem, 3vw, 2.25rem) var(--display); color: var(--text); }
h1 { font-size: clamp(5rem, 18vw, 13rem); margin: 0 0 14px; }
.role { font-size: clamp(1.125rem, 2.2vw, 1.5rem); color: var(--bright); }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.tags li {
  font: .75rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  padding: 9px 13px; border: 1px solid rgba(224, 164, 88, .45); border-radius: 999px; color: var(--accent);
  background: rgba(13, 11, 10, .45);
}
.scroll-hint {
  position: absolute; bottom: 32px; left: clamp(20px, 4vw, 48px);
  font-size: .6875rem; letter-spacing: .22em; text-transform: uppercase; color: var(--dim);
  opacity: calc(1 - var(--s) * 4);
}
.scroll-hint::after { content: ""; display: block; width: 1px; height: 34px; margin-top: 10px; background: linear-gradient(var(--dim), transparent); }

/* ---------- featured ---------- */
.featured { padding-block: clamp(40px, 8vw, 96px); }
.frame {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px;
  background: radial-gradient(120% 90% at 50% 100%, rgba(224, 164, 88, .13), rgba(20, 16, 13, .9) 60%);
  box-shadow: 0 30px 90px -30px rgba(224, 164, 88, .22);
}
.frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* what fills a frame: a looping capture, a still, or (no capture yet) the project's name or today's headlines */
.frame-in { position: absolute; inset: 0; }
.frame-in img, .d-media img, .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.frame-title { display: grid; place-items: center; padding: 24px; text-align: center; font: 400 clamp(2rem, 5vw, 3.5rem)/1 var(--display); color: color-mix(in srgb, var(--accent) 70%, var(--bright)); }
.frame-news { display: grid; align-content: center; padding: 46px clamp(18px, 5%, 48px); background: radial-gradient(80% 90% at 30% 20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent), rgba(14, 11, 10, .55); }
.frame-news ol { list-style: none; padding: 0; display: grid; gap: clamp(8px, 2vh, 16px); counter-reset: n; }
.frame-news li { counter-increment: n; display: grid; grid-template-columns: auto 1fr; gap: 0 14px; color: var(--bright); font-size: clamp(.95rem, 1.6vw, 1.25rem); line-height: 1.2; }
.frame-news li::before { content: "0" counter(n); grid-row: span 2; font: 400 clamp(1.4rem, 2.6vw, 2rem)/1 var(--display); color: var(--accent); }
.frame-news li span { font-size: .8em; color: var(--dim); }
.frame-news b { font-weight: inherit; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
@media (max-width: 760px) { /* a phone's frame fits two headlines, one line each */
  .frame-news { padding-block: 40px; }
  .frame-news li:nth-child(3) { display: none; }
  .frame-news li { font-size: .95rem; }
  .frame-news b { -webkit-line-clamp: 1; }
}
.thumb { position: relative; }
.thumb-title { position: absolute; inset: 0; display: grid; place-items: center; font: 400 1.6rem/1 var(--display); color: color-mix(in srgb, var(--accent) 60%, transparent); }
.d-play { aspect-ratio: 16 / 10; margin-top: 18px; }
.d-play iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.photo-grid { columns: 3 260px; column-gap: 16px; }
.photo-grid figure { break-inside: avoid; margin: 0 0 16px; }
.photo-grid img { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--line); }
.photo-grid figcaption { margin-top: 6px; font-size: .9rem; color: var(--dim); }
.hud {
  position: absolute; z-index: 1; padding: 6px 9px;
  font: .6875rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--bright);
  background: rgba(13, 11, 10, .55); border-radius: 3px;
}
.hud.tl { top: 14px; left: 14px; } .hud.tr { top: 14px; right: 14px; }
.hud.bl { bottom: 14px; left: 14px; } .hud.br { bottom: 14px; right: 14px; }
.hud i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #e2573f; animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.featured-text { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 48px; margin-top: 28px; align-items: start; }
.featured-text .links { margin-top: 18px; }
.featured-text h2 a:hover { color: var(--accent); }
a.frame { display: block; }
.featured-text h2 { font-size: clamp(2.25rem, 5vw, 3.5rem); }

/* ---------- selected work ---------- */
.selected { padding-block: clamp(40px, 8vw, 96px); }
.project {
  display: grid; grid-template-columns: 120px 1fr minmax(0, 380px); gap: 24px 40px; align-items: center;
  padding-block: clamp(28px, 4vw, 44px); border-top: 1px solid var(--line);
}
.project:last-child { border-bottom: 1px solid var(--line); }
.num { font: 400 clamp(3rem, 7vw, 5rem)/1 var(--display); color: rgba(183, 171, 152, .22); transition: color var(--quick) var(--ease); }
.project:hover .num { color: var(--accent); }
.project h3 { font-size: clamp(2rem, 4vw, 2.75rem); margin-bottom: 10px; }
.project h3 a { transition: color var(--quick) var(--ease); }
.project:hover h3 a, .featured:hover h2 a { color: var(--accent); }
/* The whole card opens the project (main.js); the title stays the one link for screen readers and the keyboard. */
.project, .featured { cursor: pointer; }
.spec { margin-top: 14px; font: .75rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.thumb {
  display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 6px; border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(224, 164, 88, .16), rgba(20, 16, 13, .9));
}
.thumb video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--base) var(--ease); }
.project:hover .thumb video { transform: scale(1.04); }

/* ---------- about / contact / footer ---------- */
.about, .contact { padding-block: clamp(56px, 10vw, 128px); }
.lead { font: 300 clamp(1.25rem, 2.2vw, 1.625rem)/1.55 var(--sans); color: var(--bright); max-width: 30em; }
.contact > p { max-width: 34em; }
.links { display: flex; flex-wrap: wrap; gap: 14px 40px; margin-top: 36px; }
.links a {
  font-size: .8125rem; letter-spacing: .16em; text-transform: uppercase; color: var(--bright);
  padding-bottom: 6px; border-bottom: 1px solid var(--accent); transition: color var(--quick) var(--ease);
}
.links a:hover { color: var(--accent); }
footer { padding-block: 40px; border-top: 1px solid var(--line); font-size: .8125rem; color: var(--dim); }

/* ---------- reveal on scroll (only hidden when JS is running) ---------- */
.js:not(.fly) [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease); }
.js:not(.fly) [data-reveal].in { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .project { grid-template-columns: 1fr; gap: 14px; }
  .thumb { order: -1; }
  .featured-text { grid-template-columns: 1fr; }
  .hud.tr, .hud.br { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hud i { animation: none; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .thumb video { transition: none; }
}
/* handwriting does not suit wide-spaced capitals, so the small labels drop them */
html .nav, html .tags li, html .eyebrow, html .scroll-hint, html .hud, html .spec, html .links a, html .route a, html .route .here {
  text-transform: none; letter-spacing: .02em;
}

/* =====================================================================
   Project pages (project-N.html, html.detail-page): plain top-to-bottom reading over a still sky.
   ===================================================================== */
/* Moving between pages: the sky stays (it is the root, and the next page starts from the same sky, pages.js);
   only the content moves. The old header, main and footer fade out first, then the new ones fade in. Nothing slides. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
::view-transition-group(root) { animation-duration: var(--base); } /* the same sky on both sides, so this cross-fade is invisible; it only softens the 2D-to-3D case where the 3D sky could not be waited for */
::view-transition-group(*.content) { animation: none; } /* each page's content has its own name, so nothing morphs */
::view-transition-old(*.content) { animation: vt-out var(--quick) var(--ease) both; }
::view-transition-new(*.content) { animation: vt-in var(--base) var(--ease) var(--quick) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
/* The Claude viewer can put a new page at the old scroll for a moment; the text stays hidden until the page holds its top. */
html.settling .detail, html.settling > body > .nav { opacity: 0; }
.detail-page .detail, .detail-page > body > .nav { transition: opacity var(--quick) var(--ease); }

.detail-page .w { opacity: 1; background: radial-gradient(90% 50% at 50% 100%, #2a1a3a, transparent 70%), linear-gradient(#01020a, #050817); }
.detail-page .bg::after { opacity: .45; }

.detail { width: min(1000px, 100%); margin-inline: auto; padding: 110px clamp(20px, 4vw, 48px) 60px; display: grid; gap: clamp(20px, 3vw, 32px); }
.detail .frame { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.detail .d-media { aspect-ratio: auto; height: min(56vh, 52vw); } /* leaves room for the title on the first screen */
.d-hero .eyebrow { margin: 30px 0 4px; }
.detail h1 { font-size: clamp(3.5rem, 10vw, 7rem); margin: 0 0 10px; }
.d-summary { font-size: clamp(1.25rem, 2.4vw, 1.6rem); color: var(--bright); max-width: 30em; text-shadow: 0 2px 20px rgba(10, 8, 8, .9); }
.detail h1, .d-hero .eyebrow { text-shadow: 0 2px 24px rgba(10, 8, 8, .85); }

.facts, .d-block {
  background: rgba(14, 11, 10, .8);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 16px;
}
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px 28px; padding: 24px 30px; }
.facts dt { font-size: .8rem; color: var(--accent); }
.facts dd { margin: 0; color: var(--bright); line-height: 1.25; }

.d-block { padding: clamp(24px, 4vw, 40px); }
.d-block h2 { font-size: clamp(2.25rem, 5vw, 3.25rem); margin-bottom: 12px; }
.d-block > p { max-width: 36em; }
.d-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 26px; }
.d-shots figure { margin: 0; }
.d-shots .frame { box-shadow: none; }
.d-shots figcaption { margin-top: 10px; font-size: .9rem; color: var(--dim); }
.d-block .links { margin-top: 26px; }

/* ---------- the pill: the one button of the site (Home, Back, Next, Contact, the News tabs) ----------
   Spaced capitals like the contact links, on dark glass, edged in the page's accent. 36px tall to look at, with an
   invisible edge that makes the touch area 44px. Hover lifts the colour, a press dims it, the keyboard ring is the accent;
   the chosen one (a selected tab) is filled. */
.pill {
  position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 18px;
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: rgba(14, 11, 10, .72);
  font: 400 .8125rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; color: var(--bright);
  transition: color var(--quick) var(--ease), border-color var(--quick) var(--ease), background var(--quick) var(--ease), transform var(--quick) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.pill::after { content: ""; position: absolute; inset: -4px -2px; border-radius: inherit; } /* the touch area */
.nav a.pill { color: var(--bright); } /* over .nav a's dim grey */
.nav a.pill:hover { color: var(--accent); }
.pill:hover { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, rgba(14, 11, 10, .78)); }
.pill:active { transform: scale(.96); background: color-mix(in srgb, var(--accent) 22%, rgba(14, 11, 10, .8)); }
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 999px; }
.pill[aria-selected="true"], .pill[aria-current="page"] { color: var(--bright); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, rgba(14, 11, 10, .8)); }
@media (prefers-reduced-motion: reduce) { .pill:active { transform: none; } }
.nav nav { align-items: center; }

/* the end of a project page: back to the route, or on to the next project, between two hairlines */
.d-next { display: flex; align-items: center; gap: 12px; padding-top: 12px; }
.d-next::before, .d-next::after { content: ""; flex: 1; min-width: 12px; height: 1px; background: linear-gradient(to var(--to, right), transparent, color-mix(in srgb, var(--accent) 40%, transparent)); }
.d-next::after { --to: left; }
@media (max-width: 480px) { .d-next { flex-wrap: wrap; justify-content: center; } .d-next::before, .d-next::after { display: none; } }

/* =====================================================================
   News page (news.html, html.news-page): two columns of ranked stories over a still first-light sky.
   ===================================================================== */
/* one colour per topic, used for the chips and tags */
.t-xr-ar { --topic: #8fe3d0; } .t-unity-games { --topic: #ffc27a; } .t-3d-blender { --topic: #c9b3ff; }
.t-career-industry { --topic: #ffb3c0; } .t-ai { --topic: #9cc8ff; }

/* hidden until news.js has the stories and has picked the layout, so the plain layout never flashes up first */
html.news-page:not(.ready) .news, html.news-page:not(.ready) footer { visibility: hidden; }
html.news-page:not(.ready) .news { opacity: 0; }
.news-page .news { transition: opacity var(--base) var(--ease); } /* the stories fade in over the sky, which is already there */
.news { width: min(1180px, 100%); margin-inline: auto; padding: 104px clamp(20px, 4vw, 48px) 60px; display: grid; gap: 26px; }
.n-head { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 6px 22px; }
.n-head .eyebrow { grid-column: 1 / -1; margin: 0; }
.news h1 { font-size: clamp(4rem, 11vw, 7.5rem); margin: 0; text-shadow: 0 2px 24px rgba(10, 8, 8, .8); }
.n-date { color: var(--bright); padding-bottom: 1.1em; text-shadow: 0 1px 10px #000; }
.n-tabs { display: flex; gap: 8px; padding-bottom: .9em; justify-self: end; } /* the tabs are pills (above) */

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; gap: 8px; align-items: baseline; font: inherit; font-size: .95rem; color: var(--text); cursor: pointer;
  padding: 5px 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(14, 11, 10, .6);
}
.chip span { font-size: .8rem; color: var(--dim); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--topic, var(--bright)); align-self: center; }
.chip[aria-pressed="true"] { color: var(--bright); border-color: var(--topic, var(--accent)); background: color-mix(in srgb, var(--topic, var(--accent)) 16%, rgba(14, 11, 10, .75)); }

.n-cols { display: grid; grid-template-columns: 1fr; gap: 24px; width: min(780px, 100%); justify-self: center; }
#view-older { display: grid; grid-template-columns: 1.15fr .85fr; gap: 24px; align-items: start; }
.n-col {
  min-width: 0; padding: clamp(18px, 2.5vw, 28px); border-radius: 16px;
  background: rgba(14, 11, 10, .8); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.n-col h2 { font-size: clamp(2rem, 3.6vw, 2.6rem); margin-bottom: 10px; }
.n-col h2 span { font: 400 1rem var(--sans); color: var(--dim); filter: none; }

/* a ranked story: tap the row to open its summary */
.stories { list-style: none; display: grid; }
.stories.is-empty::after { content: "Nothing on this topic here."; color: var(--dim); padding: 12px 0; }
.story { border-top: 1px solid var(--line); }
.story:first-child { border-top: 0; }
.s-head {
  width: 100%; display: grid; grid-template-columns: 2.6em 1fr auto; gap: 12px; align-items: start; text-align: left;
  font: inherit; color: inherit; background: none; border: 0; padding: 14px 0; cursor: pointer;
}
.s-num { font: 400 1.7rem/1 var(--display); color: color-mix(in srgb, var(--accent) 70%, transparent); padding-top: 2px; }
.s-main { display: grid; gap: 2px; min-width: 0; }
.s-title { color: var(--bright); font-weight: 600; font-size: 1.2rem; line-height: 1.25; transition: color var(--quick) var(--ease); }
.story:hover .s-title, .story.open .s-title { color: color-mix(in srgb, var(--accent) 45%, var(--bright)); }
.s-meta { color: var(--dim); font-size: .9rem; }
.s-score { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; color: var(--text); padding-top: 4px; }
.s-score i { width: 34px; height: 4px; border-radius: 2px; background: var(--line); position: relative; overflow: hidden; }
.s-score i::after { content: ""; position: absolute; inset: 0; width: calc(var(--v) * 100%); background: var(--accent); border-radius: inherit; }
.s-body { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--base) var(--ease), opacity var(--quick) var(--ease); }
.s-in { overflow: hidden; min-height: 0; display: grid; gap: 12px; padding: 0 0 16px calc(2.6em + 12px); }
.story.open .s-body { grid-template-rows: 1fr; opacity: 1; }
@media (hover: hover) { .story:hover .s-body, .story:focus-within .s-body { grid-template-rows: 1fr; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .s-body { transition: none; } }
.s-body p { font-size: 1.15rem; line-height: 1.45; max-width: 36em; }
.s-foot { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.tag {
  font-size: .85rem; padding: 2px 10px; border-radius: 999px; color: var(--topic, var(--text));
  border: 1px solid color-mix(in srgb, var(--topic, var(--text)) 45%, transparent);
}
.s-link { color: var(--bright); border-bottom: 1px solid var(--accent); padding-bottom: 2px; }
.s-link:hover { color: var(--accent); }

/* archive: one folding row per week */
.a-week { border-top: 1px solid var(--line); }
.a-week:first-child { border-top: 0; }
.a-week summary {
  list-style: none; cursor: pointer; padding: 12px 0; display: grid; grid-template-columns: auto auto 1fr; gap: 2px 12px; align-items: baseline;
}
.a-week summary::-webkit-details-marker { display: none; }
.a-week summary::after { content: "+"; grid-column: 3; grid-row: 1; justify-self: end; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.a-week[open] summary::after { content: "–"; }
.a-no { font: 400 1.3rem var(--display); color: var(--bright); }
.a-range { color: var(--dim); font-size: .95rem; }
.a-lead { grid-column: 1 / -1; color: var(--text); font-size: 1rem; line-height: 1.3; }
.a-count { grid-column: 1 / -1; color: var(--dim); font-size: .85rem; }
.a-week ul { list-style: none; padding: 2px 0 12px; display: grid; }
.a-row a { display: grid; grid-template-columns: 3.4em 1fr; gap: 2px 10px; padding: 8px 0; border-top: 1px dashed var(--line); }
.a-row a:hover .a-title { color: var(--accent); }
.a-day { color: var(--dim); font-size: .9rem; padding-top: 2px; }
.a-title { color: var(--bright); line-height: 1.3; transition: color var(--quick) var(--ease); }
.a-row .tag { grid-column: 2; justify-self: start; font-size: .78rem; }
.n-empty { color: var(--bright); }

/* News fly-through (html.news-fly, set by news.js on wide screens): the camera sinks past one row per step,
   like the project section on the home page. news.js moves the track and fades rows by their distance. */
.n-fly { position: fixed; inset: 0; overflow: clip; pointer-events: none; } /* clip, not hidden: a link to #something must never scroll it */
.n-track { position: absolute; inset: 0; will-change: transform; }
.n-row {
  position: absolute; left: 50%; transform: translateX(-50%); width: min(960px, 76vw);
  display: grid; gap: 22px; pointer-events: auto;
}
.n-row.off { pointer-events: none; }
.n-row:hover, .n-row:focus-within { z-index: 2; }
.n-row.n-title h2 { font-size: clamp(2.6rem, 4.4vw, 3.6rem); text-shadow: 0 2px 24px rgba(10, 8, 8, .85); }
.n-row.n-title h2 span { font: 400 1.05rem var(--sans); color: var(--bright); filter: none; }
.n-row .stories { display: block; }

/* a story card: headline on the left, its summary appears on the right when you point at it */
.n-row .story {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 30px; align-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); border-radius: 16px; padding: 18px 26px;
  background: rgba(14, 11, 10, .84); box-shadow: 0 30px 90px -40px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: transform var(--base) var(--ease), box-shadow var(--base) var(--ease), border-color var(--base) var(--ease), opacity var(--quick) var(--ease);
}
.n-row .s-head { grid-template-columns: auto 1fr; gap: 6px 18px; padding: 8px 0; }
.n-row .s-num { grid-row: 1 / span 2; font-size: clamp(3rem, 5vw, 4.2rem); }
.n-row .s-title { font-size: clamp(1.35rem, 2vw, 1.7rem); }
.n-row .s-score { grid-column: 2; padding-top: 4px; }
.n-row .s-body {
  grid-template-rows: 1fr; align-self: stretch; position: relative;
  border-left: 1px solid var(--line); padding-left: 26px;
  opacity: 1; transition: none;
}
.n-row .s-in { padding: 4px 0; align-content: center; opacity: 0; transform: translateX(18px); transition: opacity var(--base) var(--ease), transform var(--base) var(--ease); }
.n-row .s-body::before { /* what the right side says before you point at it */
  content: "Point here for the summary →"; position: absolute; left: 26px; top: 50%; translate: 0 -50%;
  color: var(--dim); font-size: 1rem; transition: opacity var(--quick) var(--ease);
}
.n-row .story:hover .s-in, .n-row .story:focus-within .s-in, .n-row .story.open .s-in { opacity: 1; transform: none; }
.n-row .story:hover .s-body::before, .n-row .story:focus-within .s-body::before, .n-row .story.open .s-body::before { opacity: 0; }
.n-row .story:hover, .n-row .story:focus-within, .n-row .story.open {
  transform: scale(1.025); border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 40px 110px -30px color-mix(in srgb, var(--accent) 55%, transparent);
}
.n-row .story.dim { opacity: .22; }
@media (prefers-reduced-motion: reduce) { .n-row .s-in { transition: none; } }
.n-scroll-hint { color: var(--bright); text-shadow: 0 1px 10px #000; }
html.news-fly .bg::after { opacity: .15; }
html.news-fly footer { position: fixed; inset: auto 0 0 0; width: auto; border: 0; padding-block: 18px; opacity: calc((var(--p, 0) - .95) * 20); }

@media (max-width: 860px) {
  .n-head { grid-template-columns: auto 1fr; }
  .n-tabs { grid-column: 1 / -1; justify-self: start; padding-bottom: 0; }
}
@media (max-width: 700px) { #view-older { grid-template-columns: 1fr; } } /* too narrow for two columns: the week, then the archive below */

/* Lists of stories (phones and narrow windows): each story is its own card, as in the computer fly-through;
   the section title sits above the cards instead of in a box round them. */
.n-col:has(> .stories) { padding: 0; background: none; border: 0; }
.n-col:has(> .stories) h2 { text-shadow: 0 2px 20px rgba(10, 8, 8, .85); }
.n-col > .stories { gap: 12px; padding: 0; }
.n-col > .stories .story {
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); border-radius: 16px; padding: 4px 18px;
  background: rgba(14, 11, 10, .84); box-shadow: 0 30px 90px -40px color-mix(in srgb, var(--accent) 40%, transparent);
}
.n-col > .stories .s-in { padding-bottom: 0; }   /* the space goes inside, so a closed card has no empty strip at the bottom */
.n-col > .stories .s-foot { padding-bottom: 16px; }
.n-col > .stories .story.open { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
@media (max-width: 480px) {
  .s-head { grid-template-columns: 2.1em 1fr; }
  .s-score { grid-column: 2; padding-top: 0; }
  .s-in { padding-left: 0; }
}

/* =====================================================================
   Fly-through mode (html.fly, set in index.html's head script).
   .world holds every .panel in 3D space; scrolling moves and turns a camera through it,
   and the canvas behind draws the generated sky from the same camera (sky.js).
   main.js places the panels (--px --py --pz --ry), drives the camera (--ex --ey --ez --yaw)
   and sets --cam (distance travelled) and --z (each panel's distance along the route).
   ===================================================================== */
:root { --cam: 0; --eye: 1100px; } /* --eye must match EYE in main.js */

html.fly body > main { position: fixed; inset: 0; perspective: var(--eye); overflow: clip; pointer-events: none; } /* main itself must not catch clicks: it sits in front of any panel that is still approaching */
html.fly .hero, html.fly #work, html.fly .selected { display: contents; }
html.fly .fly-only { display: inline; }
html.fly .bg::after { opacity: 0; }
html.fly.sky3d-on .bg::after { opacity: 1; background: radial-gradient(ellipse at center, transparent 50%, rgba(8, 6, 6, .42) 100%); } /* vignette over the 3D scene */

html.fly .world {
  position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform;
  /* read right to left: move the world so the eye is at the origin, turn it, then push it out in front of the eye.
     The pointer adds a little head movement (--look-* are set by main.js so the sky matches). */
  transform:
    translateZ(var(--eye))
    rotateX(calc(var(--my) * var(--look-pitch, 3deg) * -1))
    rotateY(calc(var(--yaw, 0deg) + var(--mx) * var(--look-yaw, 6deg)))
    translate3d(var(--ex, 0px), var(--ey, 0px), var(--ez, 0px));
}

html.fly .panel {
  --d: calc(var(--z, 0) - var(--cam)); /* route distance still ahead of the camera */
  --fog: blur(calc(clamp(0, (var(--d) - 250) / 900, 1) * 5px));
  position: absolute; left: 50%; top: 50%;
  width: var(--w, min(760px, 70vw)); margin: 0; padding: 0;
  transform:
    translate(-50%, -50%)
    translate3d(var(--px, 0px), calc(var(--py, 0px) + var(--oy, 0px)), var(--pz, 0px))
    rotateY(var(--ry, 0deg))
    translateZ(var(--pop, 0px));
  /* fog: fades in from far away, fades out once you have passed it */
  opacity: min(calc(1 - (var(--d) - 300) / 700), calc((var(--d) + 500) / 350));
  filter: var(--fog);
  transition: transform var(--base) var(--ease);
}
html.fly h2.panel { filter: url(#rough) var(--fog); }
html.fly .panel { pointer-events: auto; }
html.fly .panel.off { pointer-events: none; }

/* dark glass cards, so text stays readable over any photo */
html.fly .project, html.fly .about, html.fly .contact {
  background: rgba(14, 11, 10, .84);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 16px;
  box-shadow: 0 40px 120px -40px color-mix(in srgb, var(--accent) 45%, transparent);
}

html.fly .hero-inner { --w: min(1000px, 84vw); --oy: -3vh; text-shadow: 0 2px 28px rgba(10, 8, 8, .85); }
html.fly .featured { --w: min(820px, 58vw, 105vh); text-shadow: 0 2px 20px rgba(10, 8, 8, .9); }
html.fly .section-title { --w: auto; white-space: nowrap; font-size: clamp(4rem, 9vw, 7rem); margin-bottom: 28px; text-shadow: 0 2px 28px rgba(10, 8, 8, .85); }
html.fly .about { --w: min(780px, 72vw); padding: 44px; }
html.fly .contact { --w: min(620px, 50vw); padding: 44px; left: 28%; }   /* off to the left, so the sunrise and its path stay open on the right */
html.fly .about .section-title, html.fly .contact .section-title { font-size: clamp(2.75rem, 5vw, 4rem); white-space: normal; text-shadow: none; }

/* selected work: one large card per level; you ride up past them and the one in reach steps forward on hover */
html.fly .project {
  --w: min(900px, 70vw); padding: 26px; /* leaves room for the route map */
  grid-template-columns: 1.3fr 1fr; grid-template-rows: 1fr auto; gap: 8px 34px; align-items: start;
}
html.fly .project:hover, html.fly .project:focus-within { --pop: 50px; }
html.fly .project .thumb { grid-column: 1; grid-row: 1 / span 2; max-width: none; }
html.fly .project .num { grid-column: 2; grid-row: 1; align-self: end; font-size: clamp(4rem, 8vw, 6.5rem); color: color-mix(in srgb, var(--accent) 55%, transparent); }
html.fly .project .project-text { grid-column: 2; grid-row: 2; padding-bottom: 6px; }

/* spec labels sit beside the featured screen, tied to it with leader lines */
html.fly .frame { overflow: visible; }
html.fly .frame video { border-radius: 8px; }
html.fly .hud { white-space: nowrap; text-shadow: none; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
html.fly .hud.tr { top: 16%; right: auto; left: calc(100% + 44px); }
html.fly .hud.br { bottom: 26%; right: auto; left: calc(100% + 44px); }
html.fly .hud.bl { bottom: 14%; left: auto; right: calc(100% + 44px); }
html.fly .hud.tr::before, html.fly .hud.br::before, html.fly .hud.bl::before {
  content: ""; position: absolute; top: 50%; width: 44px; height: 1px; background: var(--accent); opacity: .7;
}
html.fly .hud.tr::before, html.fly .hud.br::before { right: 100%; }
html.fly .hud.bl::before { left: 100%; }

html.fly .scroll-hint { position: fixed; z-index: 5; color: var(--bright); text-shadow: 0 1px 10px #000; }
html.fly footer { /* appears at the end of the route */
  position: fixed; inset: auto 0 0 0; width: auto; border: 0; padding-block: 18px;
  color: var(--bright); text-shadow: 0 1px 10px #000;
  opacity: calc((var(--p, 0) - .95) * 20);
}

/* route map: five named stops on a line, the fill shows how far you have come */
html.fly .route, html.news-fly .route {
  display: block; position: fixed; z-index: 5; right: clamp(20px, 4vw, 48px); top: 50%;
  width: 1px; height: 240px; margin-top: -120px; background: rgba(232, 223, 208, .3);
}
html.fly .route::before, html.news-fly .route::before { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(var(--p, 0)); }
html.fly .route a, html.news-fly .route a {
  position: absolute; right: -4px; top: var(--t, 0%); translate: 0 -50%;
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  font: .6875rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: rgba(232, 223, 208, .6); text-shadow: 0 1px 8px #000; transition: color var(--quick) var(--ease);
}
html.fly .route a::after, html.news-fly .route a::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid currentColor; }
html.fly .route a:hover, html.fly .route a[aria-current], html.news-fly .route a:hover, html.news-fly .route a[aria-current] { color: var(--accent); }
html.fly .route a[aria-current]::after, html.news-fly .route a[aria-current]::after { background: var(--accent); }
html.fly .route .here, html.news-fly .route .here {
  position: absolute; right: -4px; top: calc(100% + 18px); white-space: nowrap;
  font: .6875rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); text-shadow: 0 1px 8px #000;
}

/* ---------- play a game hosted on the site: the cover and one filled button in the hero open it in a new tab ---------- */
.d-media-link { display: block; position: relative; border-radius: 8px; }
.d-media-link .d-media { transition: border-color var(--quick) var(--ease), transform var(--base) var(--ease); }
.d-media-play {
  position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 88%, #fff); box-shadow: 0 10px 40px rgba(0, 0, 0, .55);
  opacity: 0; transform: scale(.85); transition: opacity var(--quick) var(--ease), transform var(--quick) var(--ease);
}
.d-media-play::before, .pill-play-icon::before {
  content: ""; position: absolute; left: 50%; top: 50%; border-style: solid; border-color: transparent transparent transparent #0d0b0a;
}
.d-media-play::before { border-width: 15px 0 15px 25px; margin: -15px 0 0 -9px; }
.d-media-link:hover .d-media, .d-media-link:focus-visible .d-media { border-color: var(--accent); transform: scale(1.01); }
.d-media-link:hover .d-media-play, .d-media-link:focus-visible .d-media-play { opacity: 1; transform: scale(1); }
.d-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 26px; }
.pill.pill-play {
  min-height: 54px; padding: 0 30px 0 22px; gap: 12px; font-size: 1rem; color: #0d0b0a; border-color: var(--accent);
  background: var(--accent); box-shadow: 0 8px 30px color-mix(in srgb, var(--accent) 30%, transparent);
}
.pill.pill-play:hover { color: #0d0b0a; background: color-mix(in srgb, var(--accent) 82%, #fff); border-color: color-mix(in srgb, var(--accent) 82%, #fff); }
.pill.pill-play:active { background: color-mix(in srgb, var(--accent) 80%, #000); }
.pill-play-icon { position: relative; width: 26px; height: 26px; border-radius: 50%; background: rgba(13, 11, 10, .14); flex: none; }
.pill-play-icon::before { border-width: 6px 0 6px 10px; margin: -6px 0 0 -3px; }
.d-actions-note { font-size: .95rem; color: var(--dim); text-shadow: 0 2px 16px rgba(10, 8, 8, .9); }
@media (prefers-reduced-motion: reduce) { .d-media-link .d-media, .d-media-play { transition: none; } .d-media-link:hover .d-media { transform: none; } }
