/* A dark, quiet page that lets the work move. Committed to one palette — the
   previews are lit for this ground, so the page does not follow the viewer's
   light theme. Every colour is painted explicitly. */

:root {
  --ink: #0a0b0d;          /* page ground, near-black with a cool bias */
  --ink-lift: #101216;     /* raised surfaces */
  --rule: #23262c;         /* hairlines */
  --paper: #f2f0ec;        /* warm off-white, the tension against the cool ground */
  --muted: #8a8d95;
  --faint: #55585f;
  --signal: #e0a857;       /* the one accent: warm sand */

  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --pad: clamp(20px, 5vw, 76px);
  --wide: 1440px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; text-wrap: balance; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

html { scroll-behavior: smooth; }

/* The single WebGL surface every preview is scissored into. It sits above the
   body background and below the page content, so a tile with a transparent
   stage shows the scene through it. */
#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
  transition: opacity .8s ease;
}
#gl.is-lit { opacity: 1; }

/* A little noise keeps the large dark fields from banding. */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.page { position: relative; z-index: 2; pointer-events: none; }

/* The page sits above the canvas, so anything that does not need to catch a
   click lets one through to the strand behind it. */
.masthead, .intro, .section, .contact, .node__text, .detail { pointer-events: auto; }

/* ---------------------------------------------------------------- masthead */

.masthead {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 18px var(--pad);
  background: linear-gradient(to bottom, rgba(10, 11, 13, .95), rgba(10, 11, 13, .72) 70%, rgba(10, 11, 13, 0));
  backdrop-filter: blur(6px);
}

.mark {
  font-family: var(--display); font-weight: 700; font-size: 15px;
  font-variation-settings: 'wdth' 112; letter-spacing: .02em;
  text-decoration: none; text-transform: uppercase;
}

.nav { display: flex; gap: 22px; }
.nav a {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); text-decoration: none;
  transition: color .2s;
}
.nav a:hover { color: var(--paper); }

/* ------------------------------------------------------------------- intro */

.intro {
  max-width: var(--wide); margin: 0 auto;
  padding: clamp(30px, 7vw, 80px) var(--pad) clamp(48px, 8vw, 96px);
}

.intro__name {
  font-size: clamp(46px, 9.5vw, 132px);
  line-height: 0.92;
  font-variation-settings: 'wdth' 112;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.intro__cols {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px); align-items: start;
  margin-top: clamp(28px, 4vw, 44px);
  padding-top: clamp(24px, 3vw, 34px);
  border-top: 1px solid var(--rule);
}

.intro__blurb { margin: 0; font-size: clamp(16px, 1.55vw, 19px); max-width: 60ch; color: #d6d4d0; }

.intro__where { margin: 0; display: flex; flex-direction: column; gap: 5px; }
.intro__where span {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.intro__where span:last-child { color: var(--signal); }

/* ----------------------------------------------------------------- section */

.section { max-width: var(--wide); margin: 0 auto; padding: 0 var(--pad) clamp(56px, 8vw, 104px); }

.section__label {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
  padding-bottom: 14px; margin-bottom: clamp(20px, 3vw, 30px);
  border-bottom: 1px solid var(--rule);
}

.minor {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
  margin-bottom: 12px;
}

/* ------------------------------------------------------------------ strand */

.strand {
  position: relative;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.strand__label { margin-bottom: 0; }

.strand__list { list-style: none; margin: 0; padding: 0; }

/* A rule across the strand where the kind of work changes. */
.band {
  display: flex; align-items: baseline; gap: 14px;
  padding: 6vh 0 0; border-top: 1px solid var(--rule);
}
.band:first-child { border-top: 0; padding-top: 0; }
.band h3 {
  font-family: var(--display); font-weight: 700; font-size: clamp(15px, 1.6vw, 19px);
  font-variation-settings: 'wdth' 110; letter-spacing: .04em; text-transform: uppercase;
}
.band span {
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--faint);
}

/* Each project owns a screenful. The helix behind the page advances to its node
   as that screenful reaches the middle of the viewport. */
.node {
  min-height: 86vh;
  display: grid;
  grid-template-columns: minmax(0, 46%) 1fr;
  align-items: center;
}

.node__text {
  max-width: 34ch;
  opacity: .32;
  transform: translateY(10px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .3, 1);
}
.node.is-live .node__text { opacity: 1; transform: none; }

.node__index {
  display: block;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em;
  color: var(--faint); margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}
.node.is-live .node__index { color: var(--signal); }

.node__title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(30px, 4.4vw, 54px); line-height: 1.02;
  font-variation-settings: 'wdth' 106; letter-spacing: -0.018em;
}

.node__teaser { margin: 14px 0 0; font-size: clamp(15px, 1.5vw, 18px); color: #cbc9c5; }

.node__meta {
  display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px;
}

.pip {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  padding: 3px 8px; border: 1px solid var(--rule);
}
.pip--live { color: var(--signal); border-color: rgba(224, 168, 87, .4); }
.pip--wip { color: var(--faint); }

.node__open {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 26px; padding: 12px 20px;
  background: transparent; border: 1px solid var(--rule); color: var(--paper);
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; cursor: pointer;
  transition: background .22s, border-color .22s, color .22s, gap .22s;
}
.node__open:hover, .node.is-live .node__open:focus-visible {
  background: var(--signal); border-color: var(--signal); color: var(--ink); gap: 16px;
}

/* ---------------------------------------------------------------- earlier */

.earlier { list-style: none; margin: 0; padding: 0; }
.earlier li {
  display: grid; grid-template-columns: 74px minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 10px 24px; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--rule);
}
.earlier b {
  font-family: var(--display); font-weight: 600; font-size: 17px;
  font-variation-settings: 'wdth' 104;
}
.earlier time {
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.earlier p { margin: 0; color: var(--muted); font-size: 14.5px; }
.earlier .stack { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* ---------------------------------------------------------------- toolkit */

.kit { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); }

.kit__tabs { display: flex; flex-direction: column; gap: 2px; align-self: start; }

.kit__tab {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 11px 12px; background: transparent; border: 0;
  border-left: 2px solid var(--rule); color: var(--muted); cursor: pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; text-align: left;
  transition: color .22s, border-color .22s, background .22s;
}
.kit__tab:hover { color: var(--paper); background: rgba(255, 255, 255, .03); }
.kit__tab[aria-selected="true"] {
  color: var(--ink); background: var(--signal); border-left-color: var(--signal);
}
.kit__tab b { font-weight: 400; font-variant-numeric: tabular-nums; opacity: .7; }

.kit__panel { display: none; }
.kit__panel.is-open { display: block; }

.kit__note {
  margin: 0 0 16px; font-size: 14.5px; color: var(--muted); max-width: 52ch;
}

.kit__items { display: flex; flex-wrap: wrap; gap: 7px; }
.kit__items span {
  padding: 7px 12px; border: 1px solid var(--rule); color: #c3cad4;
  font-family: var(--mono); font-size: 11px; letter-spacing: .05em;
  transition: border-color .2s, color .2s;
}
.kit__items span:hover { border-color: var(--signal); color: var(--signal); }

/* ------------------------------------------------------------------ about */

.about__grid {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 80px); align-items: start;
}
.about__prose p { margin: 0 0 18px; max-width: 62ch; font-size: 16.5px; color: #d6d4d0; }
.about__prose p:first-child::first-line { color: var(--paper); }

.edu { list-style: none; margin: 0 0 30px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.edu b { display: block; font-family: var(--display); font-weight: 600; font-size: 15px; }
.edu span { font-size: 13.5px; color: var(--muted); }

.skills { display: flex; flex-direction: column; gap: 14px; }
.skills h4 {
  margin: 0 0 6px; font-family: var(--mono); font-size: 10px; font-weight: 400;
  letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
}
.skills div div { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------------------------- contact */

.contact {
  max-width: var(--wide); margin: 0 auto;
  padding: clamp(40px, 6vw, 70px) var(--pad) clamp(40px, 6vw, 64px);
  border-top: 1px solid var(--rule);
}

.contact__head {
  font-size: clamp(34px, 6vw, 72px); line-height: 1;
  font-variation-settings: 'wdth' 108; letter-spacing: -0.015em;
}

.contact__links {
  list-style: none; margin: clamp(24px, 4vw, 40px) 0 0; padding: 0;
  display: flex; flex-direction: column;
}
.contact__links li { border-top: 1px solid var(--rule); }
.contact__links li:last-child { border-bottom: 1px solid var(--rule); }
.contact__links a {
  display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 16px;
  padding: 15px 4px; text-decoration: none;
  transition: padding-left .25s, color .25s;
}
.contact__links a:hover { padding-left: 14px; color: var(--signal); }
.contact__links b {
  font-family: var(--mono); font-size: 10.5px; font-weight: 400;
  letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}
.contact__links span {
  font-family: var(--display); font-weight: 600; font-size: clamp(17px, 2vw, 22px);
  font-variation-settings: 'wdth' 104;
}
.contact__links em { font-style: normal; font-family: var(--mono); font-size: 13px; color: var(--faint); }

.colophon {
  margin: 34px 0 0; max-width: 64ch;
  font-family: var(--mono); font-size: 11px; line-height: 1.8; color: var(--faint);
}
.colophon a { color: var(--muted); }

/* ----------------------------------------------------------------- detail */

.detail {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(6, 7, 9, .66);
  animation: fade .25s ease;
}
.detail[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }

.detail__inner {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(680px, 92vw);
  background: var(--ink-lift);
  border-left: 1px solid var(--rule);
  box-shadow: -40px 0 90px rgba(0, 0, 0, .55);
}
.detail__close {
  position: absolute; z-index: 2; top: 18px; right: 20px;
  padding: 8px 14px; background: rgba(10, 11, 13, .85);
  border: 1px solid var(--rule); color: var(--paper); cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
}
.detail__close:hover { border-color: var(--signal); color: var(--signal); }

.detail__scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 0 0 60px; }

.dt__head { padding: 58px clamp(22px, 4vw, 40px) 24px; border-bottom: 1px solid var(--rule); }
.dt__eyebrow {
  margin: 0 0 12px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}
.dt__title {
  font-size: clamp(28px, 4.4vw, 44px); line-height: 1.02;
  font-variation-settings: 'wdth' 106; letter-spacing: -0.015em;
}
.dt__teaser { margin: 12px 0 0; font-size: 17px; color: var(--signal); max-width: 46ch; }

.dt__body { padding: 26px clamp(22px, 4vw, 40px) 0; }
.dt__body > p:not([class]) { margin: 0; font-size: 16.5px; color: #d6d4d0; max-width: 60ch; }

.dt__body > .dt__label {
  margin: 30px 0 12px; font-family: var(--mono); font-size: 10px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
}

.dt__facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.dt__facts li { position: relative; padding-left: 20px; max-width: 60ch; color: #ccc9c4; font-size: 15px; }
.dt__facts li::before {
  content: ''; position: absolute; left: 0; top: .65em;
  width: 9px; height: 2px; background: var(--signal);
}

.dt__stack { display: flex; flex-wrap: wrap; gap: 6px; }

.dt__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.dt__links a {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 17px;
  border: 1px solid var(--rule); text-decoration: none;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  transition: background .2s, border-color .2s, color .2s;
}
.dt__links a:hover { background: var(--signal); border-color: var(--signal); color: var(--ink); }
.dt__links a.is-primary { border-color: var(--signal); color: var(--signal); }
.dt__links a.is-primary:hover { color: var(--ink); }

.shots { display: flex; flex-direction: column; gap: 16px; }
.shot { margin: 0; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); }
.shot figcaption {
  margin-top: 7px; font-family: var(--mono); font-size: 10.5px; line-height: 1.55; color: var(--faint);
}

.dt__credit {
  margin: 18px 0 0; font-family: var(--mono); font-size: 10px;
  letter-spacing: .08em; color: var(--faint);
}

.dt__note {
  margin: 24px 0 0; padding: 12px 14px; border-left: 2px solid var(--signal);
  background: rgba(224, 168, 87, .05);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.7; color: var(--muted);
}

/* ------------------------------------------------------------ narrow */

@media (max-width: 880px) {
  .intro__cols, .about__grid { grid-template-columns: 1fr; }
  .node { grid-template-columns: 1fr; align-content: end; min-height: 78vh; padding-bottom: 8vh; }
  .node__text { max-width: none; }
  .earlier li { grid-template-columns: 62px 1fr; }
  .earlier p { grid-column: 2; }
  .earlier .stack { grid-column: 2; }
  .contact__links a { grid-template-columns: 84px 1fr; }
  .kit { grid-template-columns: 1fr; }
  .kit__tabs { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .kit__tab { border-left: 0; border-bottom: 2px solid var(--rule); white-space: nowrap; }
  .kit__tab[aria-selected="true"] { border-bottom-color: var(--signal); }
  .kit__tab b { display: none; }
  .contact__links em { display: none; }
  .nav { gap: 16px; }
}

/* ------------------------------------------------- motion and refinements */

/* Reserve the scrollbar so locking the page behind the detail panel does not
   shift the layout sideways. */
html { scrollbar-gutter: stable; }

/* Tiles rise in the first time they are seen. The hidden start state is only
   applied once JS has confirmed it can observe them, so with no JS — or with
   reduced motion — everything is simply visible. */
html.js-reveal .reveal { opacity: 0; transform: translateY(18px); }
html.js-reveal .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .7s cubic-bezier(.2, .7, .3, 1), transform .7s cubic-bezier(.2, .7, .3, 1);
}
@media (prefers-reduced-motion: reduce) {
  html.js-reveal .reveal { opacity: 1; transform: none; }
}

.tile { transition: border-color .3s, transform .3s cubic-bezier(.2, .7, .3, 1); }

/* A quiet affordance that the tile opens something. */
.tile__open {
  margin-left: auto;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--signal);
  opacity: 0; transform: translateX(-6px);
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
}
.tile:hover .tile__open, .tile:focus-visible .tile__open { opacity: 1; transform: none; }

.nav a.is-here { color: var(--paper); }
.nav a.is-here::after {
  content: ''; display: block; height: 1px; margin-top: 3px; background: var(--signal);
}

/* Hold the space a screenshot will take so nothing jumps as it loads. */
.shot img { aspect-ratio: 16 / 9; object-fit: cover; background: #15171c; }

.detail__scroll { scroll-behavior: smooth; }

/* ----------------------------------------------- opening a project */

/* Each panel takes the hue of the project it belongs to. */
.detail { --tone: var(--signal); }

.detail__inner { position: absolute; overflow: hidden; }

/* A permanent, very light scanline and vignette pass, so the panel reads as a
   signal rather than a document. Kept low enough not to touch legibility. */
.detail__inner::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, .03) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, .55) 100%);
}

.detail__inner { border-top: 2px solid var(--tone); }

.detail__hint {
  position: absolute; z-index: 4; top: 22px; left: clamp(22px, 4vw, 40px);
  margin: 0; font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--tone); opacity: .8; pointer-events: none;
}

/* The tune-in: the panel arrives the way a signal locks on.

   Transform and opacity only. An earlier version animated `filter` here, which
   put the panel on its own GPU layer with a filter chain; tearing that layer
   down at the end of the animation repainted the whole panel in one frame and
   read as the page reloading. The chromatic split lives on the ::before overlay
   below instead, which is thrown away without touching the panel. */
@keyframes tune {
  0%   { opacity: 0; transform: translateX(34px) skewX(-2.2deg) scaleY(1.06); }
  9%   { opacity: 1; transform: translateX(-20px) skewX(3deg) scaleY(.97); }
  18%  { transform: translateX(13px) skewX(-1.6deg) scaleY(1.03); }
  27%  { transform: translateX(-8px) skewX(1deg) scaleY(.99); }
  40%  { transform: translateX(5px) skewX(-.4deg) scaleY(1); }
  58%  { transform: translateX(-2px) scaleY(1); }
  100% { transform: none; opacity: 1; }
}
.detail.is-tuning .detail__inner {
  animation: tune .6s cubic-bezier(.2, .8, .2, 1) both;
  will-change: transform, opacity;
}

/* Tear bands sweeping down over the panel while it locks on. */
@keyframes tear {
  from { transform: translateY(-60%); opacity: .85; }
  to   { transform: translateY(60%); opacity: 0; }
}
.detail.is-tuning .detail__inner::before {
  content: ''; position: absolute; inset: -30% 0; z-index: 4; pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0 14px,
      rgba(255, 255, 255, .12) 14px 17px,
      transparent 17px 30px,
      rgba(255, 255, 255, .05) 30px 34px),
    linear-gradient(90deg,
      rgba(255, 40, 80, .2), transparent 14%,
      transparent 86%, rgba(0, 225, 255, .2));
  mix-blend-mode: screen;
  animation: tear .6s ease-out both;
}

/* The whole screen catches the flash the strand gives off. */
.flash {
  position: fixed; inset: 0; z-index: 30; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 50%, var(--tone), transparent 70%);
  opacity: 0;
}
@keyframes flash { 0% { opacity: .5; } 100% { opacity: 0; } }
.flash.is-on { animation: flash .5s ease-out both; }

/* Accents take the project's hue. */
.dt__teaser { color: var(--tone); }
.dt__facts li::before { background: var(--tone); }
.dt__links a.is-primary { border-color: var(--tone); color: var(--tone); }
.dt__links a:hover { background: var(--tone); border-color: var(--tone); color: var(--ink); }
.dt__credit {
  margin: 18px 0 0; font-family: var(--mono); font-size: 10px;
  letter-spacing: .08em; color: var(--faint);
}

.dt__note { border-left-color: var(--tone); }
.detail__close:hover { border-color: var(--tone); color: var(--tone); }

@media (prefers-reduced-motion: reduce) {
  .detail.is-tuning .detail__inner,
  .detail.is-tuning .detail__inner::before,
  .flash.is-on { animation: none; }
  .flash { opacity: 0; }
}
