@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-var.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/hanken-grotesk-var.woff2") format("woff2");
}

/* palette mirrors PAL in scripts/build_icons.py */
:root {
  --k0: #050505;
  --k1: #0e0e0e;
  --k2: #161616;
  --k3: #202020;
  --k4: #2e2e2e;
  --k5: #444444;
  --k6: #6a6a6a;
  --k7: #a0a0a0;
  --k8: #f2f2f2;
  --c1: #5a2a10;
  --c2: #c2500f;
  --c3: #ff6b1a;
  --a2: #ff9a3c;
  --a3: #ffd0a8;
  --display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: var(--body);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --surface: rgba(255, 255, 255, .03);
  --radius: 20px;
  --wrap: 1120px;
  --hero-max: 1920px;
}

@view-transition { navigation: auto; }

* { box-sizing: border-box; }

html {
  background: var(--k0);
  color-scheme: dark;
  scroll-behavior: smooth;
  scrollbar-color: var(--k5) var(--k0);
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(60rem 28rem at 78% -8%, rgba(255, 107, 26, .10), transparent 70%),
    radial-gradient(50rem 30rem at 0% 0%, rgba(255, 255, 255, .05), transparent 70%),
    var(--k0);
  background-repeat: no-repeat;
  color: var(--k8);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--c3);
}

::selection { background: var(--c3); color: var(--k0); }

a { color: var(--a2); text-underline-offset: 4px; text-decoration-thickness: 1px; transition: color .2s; }
a:hover { color: var(--k8); }

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: .55rem 1rem;
  background: var(--k8);
  color: var(--k0);
  border-radius: 999px;
  font-weight: 500;
  z-index: 20;
}
.skip:focus { top: 1rem; }
.skip:hover { color: var(--k0); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -.02em;
  text-wrap: balance;
}
p { text-wrap: pretty; }

/* ---------- entrance + scroll motion ---------- */
@keyframes rise {
  from { opacity: 0; translate: 0 22px; filter: blur(6px); }
  to { opacity: 1; translate: 0 0; filter: blur(0); }
}
@keyframes grow { from { scale: 1 0; } to { scale: 1 1; } }
@keyframes ping {
  0% { scale: .6; opacity: .9; }
  80%, 100% { scale: 2.4; opacity: 0; }
}

.rise { animation: rise .9s var(--ease) both; animation-delay: 80ms; }
.i1 { animation-delay: 170ms; }
.i2 { animation-delay: 260ms; }
.i3 { animation-delay: 350ms; }
.i4 { animation-delay: 440ms; }
.i5 { animation-delay: 530ms; }
.i6 { animation-delay: 620ms; }

@supports (animation-timeline: view()) {
  .reveal {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 45%;
  }
}

/* ---------- top bar ---------- */
.top {
  position: sticky;
  top: .75rem;
  z-index: 10;
  width: min(100% - 1.5rem, var(--wrap));
  margin: .75rem auto 0;
  padding: .45rem .5rem .45rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.25rem;
  background: rgba(14, 14, 14, .72);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 18px 40px -24px #000;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--display);
  font-weight: 600;
  color: var(--k8);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: -.01em;
}
.brand img, .nav img { width: 22px; height: 22px; flex: none; }

.nav { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .9rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--k7);
  text-decoration: none;
  border-radius: 999px;
  transition: background-color .25s var(--ease), color .25s;
}
.nav a:hover { color: var(--k8); background: rgba(255, 255, 255, .07); }
.nav a[aria-current="page"] { color: var(--k0); background: var(--k8); }
.nav a[aria-current="page"]:hover { color: var(--k0); background: var(--k8); }
.nav a[aria-current="page"] img { filter: invert(1); }

/* ---------- panels ---------- */
.panel {
  position: relative;
  padding: clamp(1.15rem, 2.5vw, 1.7rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 50px -36px #000;
}
.panel.accent {
  border-color: rgba(255, 107, 26, .38);
  background: linear-gradient(160deg, rgba(255, 107, 26, .10), rgba(255, 107, 26, .02) 55%), var(--surface);
}
.panel.empty { background: transparent; border-style: dashed; border-color: var(--k4); box-shadow: none; }

/* ---------- sub pages ---------- */
.page {
  width: min(100% - 2rem, var(--wrap));
  margin: clamp(2rem, 6vw, 4rem) auto 3rem;
  display: grid;
  gap: clamp(2.5rem, 6vw, 4.5rem);
}

.page-head { display: grid; gap: 1rem; justify-items: start; }
.page-head h1 { font-size: clamp(2.4rem, 1.2rem + 5vw, 4.5rem); font-weight: 700; max-width: 16ch; }
.page-head p { margin: 0; color: var(--k7); max-width: 56ch; font-size: 1.15rem; }

.section { display: grid; gap: 1.4rem; }
.section > h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
}
.section > h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }

.cols { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

.item h3 { font-size: 1.3rem; font-weight: 600; }
.item .org { color: var(--k7); margin: .35rem 0 0; }
.meta {
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .03em;
  color: var(--a2);
  margin: 0 0 .7rem;
  font-variant-numeric: tabular-nums;
}
.item ul { margin: .8rem 0 0; padding-left: 1.15rem; }
.item li { margin: .4rem 0; max-width: 68ch; }
.item li::marker { color: var(--c2); }
.item p { margin: .7rem 0 0; max-width: 68ch; }
.item p.org { max-width: none; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: .9rem 0 0; padding: 0 !important; list-style: none; }
.tags li {
  margin: 0 !important;
  font-size: .82rem;
  padding: .22rem .7rem;
  color: var(--k8);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.25rem;
  font-weight: 600;
  font-size: .95rem;
  color: var(--k0);
  background: var(--c3);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color .25s, translate .35s var(--ease), box-shadow .35s var(--ease);
  box-shadow: 0 12px 24px -14px #000;
}
.btn:hover { background: var(--a3); color: var(--k0); translate: 0 -2px; }
.btn.ghost { color: var(--k8); background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.ghost:hover { background: rgba(255, 255, 255, .12); color: var(--k8); }

.links { display: flex; flex-wrap: wrap; gap: .6rem; margin: .4rem 0 0; padding: 0; list-style: none; }
.item .links { margin-top: 1rem; padding: 0; }

/* ---------- footer ---------- */
.foot {
  width: min(100% - 2rem, var(--wrap));
  margin: 0 auto 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 2rem;
  font-size: .88rem;
  color: var(--k7);
}
.foot-id { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.25rem; }
.foot-id strong {
  flex-basis: 100%;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -.01em;
  color: var(--k8);
}
.foot .where { display: inline-flex; align-items: center; gap: .55rem; }
.foot .where::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c3); }
.foot-links { display: flex; gap: .25rem; margin: 0 -.85rem; padding: 0; list-style: none; }
.foot-links a {
  display: inline-block;
  padding: .4rem .85rem;
  border-radius: 999px;
  color: var(--k7);
  text-decoration: none;
  font-weight: 500;
  transition: background-color .25s, color .25s;
}
.foot-links a:hover { color: var(--k8); background: rgba(255, 255, 255, .07); }

/* ---------- CV ---------- */
.cv {
  width: min(100% - 2rem, var(--wrap));
  margin: clamp(2rem, 6vw, 4rem) auto 3rem;
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
.cv-head { display: grid; gap: 1.1rem; justify-items: start; }
.cv-head h1 { font-size: clamp(2.6rem, 1rem + 6vw, 5.5rem); font-weight: 700; letter-spacing: -.035em; max-width: 12ch; }
.cv-head .lede { margin: 0; color: var(--k7); font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); max-width: 52ch; line-height: 1.55; }
.cv-head .lede strong { color: var(--k8); font-weight: 500; }
.cv-head .links { margin-top: .6rem; }

.cv-side { display: grid; gap: 1.5rem; }
.toc { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; }
.toc a {
  display: inline-block;
  padding: .35rem .85rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--k7);
  text-decoration: none;
  border: 1px solid var(--line);
  transition: color .25s, border-color .25s, background-color .25s;
}
.toc a:hover { color: var(--k8); border-color: var(--line-strong); background: rgba(255, 255, 255, .05); }

.facts { margin: 0; display: grid; gap: .9rem; }
.facts div { display: grid; gap: .1rem; }
.facts dt { font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--k7); }
.facts dd { margin: 0; font-size: .98rem; line-height: 1.4; }

.cv-main { display: grid; gap: clamp(2.5rem, 6vw, 4rem); min-width: 0; }

.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.75rem;
  display: grid;
  gap: 1.5rem;
}
.timeline::before, .timeline::after {
  content: "";
  position: absolute;
  left: 5px;
  top: .6rem;
  bottom: .6rem;
  width: 2px;
  border-radius: 2px;
  background: var(--k4);
}
.timeline::after {
  background: linear-gradient(var(--c3), var(--a2));
  transform-origin: top;
  scale: 1 1;
}
/* The line's tip tracks 60% down the viewport; each dot fills as it passes
   80-75%, so it lights up before the line arrives. */
@supports (animation-timeline: view()) {
  .timeline { view-timeline: --tl block; }
  .timeline::after {
    scale: 1 0;
    animation: grow linear both;
    animation-timeline: --tl;
    animation-range: cover 40vh cover calc(100% - 60vh);
  }
  .job { view-timeline: --job block; }
  .job::before {
    animation: dot linear both;
    animation-timeline: --job;
    animation-range: cover 20vh cover 25vh;
  }
}
@keyframes dot {
  from { background: var(--k0); }
  to { background: var(--c3); }
}
.job { position: relative; }
.job::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem + 0px);
  top: 1.85rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--k0);
  box-shadow: 0 0 0 2px var(--c3);
  z-index: 1;
}
.job.now::before { background: var(--c3); }
.job .org { font-weight: 500; color: var(--k8); }
.job .org span { color: var(--k7); font-weight: 400; }
.job li strong, .item p strong { color: var(--a3); font-weight: 500; }

.pub h3 { font-size: clamp(1.25rem, 1rem + 1vw, 1.7rem); line-height: 1.2; }
.pub .org { font-size: .95rem; }

/* ---------- home ---------- */
.home {
  margin: clamp(1rem, 3vw, 2rem) 0 3rem;
  display: grid;
  align-content: start;
  gap: clamp(2rem, 5vw, 3.5rem);
}
.home > nav { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }

/* The scene is the hero's backdrop, not a framed panel: it runs to the right
   edge of the page and its borders fade into the background. */
.hero {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(1rem, 1fr) minmax(0, var(--wrap)) minmax(1rem, 1fr);
  align-items: center;
}
.hello { grid-column: 2; display: grid; justify-items: start; position: relative; z-index: 1; }
.hello h1 {
  font-size: clamp(2.5rem, .8rem + 5.6vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: .98;
}
.hello h1 span { display: block; }
.hello .role {
  margin: 1.1rem 0 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.2rem, 1rem + .9vw, 1.6rem);
  letter-spacing: -.01em;
  line-height: 1.25;
  color: var(--a2);
}
.hello .lede { margin: .6rem 0 0; color: var(--k7); font-size: clamp(1rem, .95rem + .3vw, 1.15rem); line-height: 1.55; max-width: 36ch; }
.hello .links { margin-top: 1.6rem; }

.room {
  grid-column: 1 / -1;
  position: relative;
  width: 100%;
  overflow: hidden;
}
/* Narrower than 1280px the scene's empty left bay is cropped away. */
.stage { position: relative; width: 150.12%; margin-left: -50.12%; }
.stage > svg {
  display: block;
  width: 100%;
  height: auto;
  --fade-x: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  --fade-y: linear-gradient(transparent, #000 12%, #000 78%, transparent);
  -webkit-mask-image: var(--fade-x), var(--fade-y);
  -webkit-mask-composite: source-in;
  mask-image: var(--fade-x), var(--fade-y);
  mask-composite: intersect;
}

/* Hovering or focusing a hotspot makes its part of the scene react (see
   HOVER in build_room_scene.py) and shows a tooltip, which is also the
   link's name. The tooltip stays while the pointer is on it, and Escape
   hides it (scene.js). */
.hs {
  position: absolute;
  display: block;
  text-decoration: none;
  border-radius: 22px;
  outline: 0;
}
.hs:focus-visible { outline: 2px solid var(--a2); outline-offset: 4px; }
.hs::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--c3);
  box-shadow: 0 0 0 4px rgba(5, 5, 5, .7);
  transition: opacity .3s var(--ease);
}
.hs i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  border: 2px solid var(--c3);
  animation: ping 2.4s ease-out infinite;
  pointer-events: none;
}
.hs-computer i { animation-delay: .8s; }
.hs-screen i { animation-delay: 1.6s; }
.hs:hover::before, .hs:focus-visible::before { opacity: 0; }
.hs:hover i, .hs:focus-visible i { visibility: hidden; }

.tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + .6rem);
  translate: -50% 6px;
  display: grid;
  width: max-content;
  max-width: 15rem;
  padding: .55rem .9rem .6rem;
  font-size: .82rem;
  line-height: 1.35;
  color: var(--k7);
  background: rgba(14, 14, 14, .94);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 18px 36px -18px #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), translate .25s var(--ease);
}
.tip b { font-family: var(--display); font-weight: 600; font-size: .98rem; letter-spacing: -.01em; color: var(--k8); }
/* covers the gap to the hotspot, so the pointer can move onto the tooltip */
.tip::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: .7rem; }
.hs-computer .tip { bottom: auto; top: calc(100% + .6rem); translate: -50% -6px; }
.hs-computer .tip::after { top: auto; bottom: 100%; }
.hs:hover .tip, .hs:focus-visible .tip { opacity: 1; translate: -50% 0; pointer-events: auto; }
/* While the pointer is over a hotspot the tooltip follows it (scene.js sets
   --tx and --ty); keyboard focus keeps the anchored position above. */
.hs.follow .tip,
.hs.follow:hover .tip {
  left: var(--tx);
  top: var(--ty);
  bottom: auto;
  translate: 0 0;
  pointer-events: none;
}
.hs.follow .tip::after { display: none; }
.stage.quiet .tip { opacity: 0; pointer-events: none; }

.doors {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.doors a {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  grid-template-areas: "icon title title" "desc desc arrow";
  gap: .85rem 1rem;
  align-items: center;
  height: 100%;
  padding: 1.15rem 1.3rem;
  text-decoration: none;
  color: var(--k8);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .35s var(--ease), background-color .35s var(--ease), translate .35s var(--ease);
}
.doors a:hover, .doors a:focus-visible {
  border-color: rgba(255, 154, 60, .6);
  background: rgba(255, 107, 26, .07);
  translate: 0 -4px;
}
.doors img {
  grid-area: icon;
  width: 44px;
  height: 44px;
  padding: 9px;
  background: rgba(255, 255, 255, .05);
  border-radius: 14px;
}
.doors strong { grid-area: title; font-family: var(--display); font-weight: 600; font-size: 1.2rem; letter-spacing: -.01em; }
.doors span { grid-area: desc; align-self: start; color: var(--k7); font-size: .92rem; line-height: 1.4; }
.doors a::after {
  content: "→";
  grid-area: arrow;
  align-self: end;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--a2);
  transition: translate .35s var(--ease);
}
.doors a:hover::after { translate: 5px 0; }

/* ---------- breakpoints ---------- */
@media (min-width: 980px) {
  .cv { grid-template-columns: 250px minmax(0, 1fr); }
  .cv-head { grid-column: 1 / -1; }
  .cv-side { position: sticky; top: 6rem; }
  .toc { flex-direction: column; flex-wrap: nowrap; gap: .1rem; }
  .toc a { border: 0; border-radius: 10px; padding: .45rem .7rem; margin-left: -.7rem; font-size: .95rem; }
  .job { padding-left: .25rem; }
}

/* Wide screens: the scene runs edge to edge and scales in height with its
   width (aspect 3.57). It includes an empty wall bay on its left, and the copy
   sits in that bay, so nothing covers the art. */
@media (min-width: 1280px) {
  /* The hero is capped and centred, so on ultra-wide monitors the scene stops
     growing (its edges already fade into the page) and the copy stays beside
     the art instead of drifting away from it. Offsets are percentages of the
     hero, not of the viewport. */
  .hero {
    display: block;
    position: relative;
    width: 100%;
    max-width: var(--hero-max);
    margin-inline: auto;
  }
  .hello {
    position: absolute;
    left: 4%;
    top: 50%;
    translate: 0 -50%;
    width: min(26%, 30rem);
    z-index: 1;
  }
  .hello h1 { font-size: clamp(2.2rem, 3.1vw, 3.7rem); }
  .room { overflow: visible; }
  .room .stage { width: 100%; margin-left: 0; }
}

@media (max-width: 640px) {
  .nav a span { display: none; }
  .nav a { padding: .5rem .65rem; }
  .brand { font-size: .95rem; }
  .top { border-radius: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .timeline::after { scale: 1 1; }
  .job::before { background: var(--c3); }
}

/* ---------- contact ---------- */
.contact { display: grid; gap: 1.4rem; max-width: 40rem; }
.contact h2 { margin: 0 0 1rem; font-size: 1.4rem; }
.contact .meta { margin: 1rem 0 0; }
.form { display: grid; gap: 1.1rem; justify-items: start; }
.form label {
  display: grid; gap: .45rem; width: 100%;
  font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--k7);
}
.form input, .form textarea {
  width: 100%; font: inherit; font-size: 1rem; font-weight: 400; letter-spacing: 0; text-transform: none;
  color: var(--k8); background: rgba(255, 255, 255, .04); border: 1px solid var(--line-strong);
  border-radius: 14px; padding: .8rem 1rem; caret-color: var(--c3);
  transition: border-color .25s var(--ease), background-color .25s var(--ease), box-shadow .25s var(--ease);
}
.form input:hover, .form textarea:hover { border-color: rgba(255, 154, 60, .45); }
.form input:focus, .form textarea:focus {
  outline: none; border-color: var(--c3); background: rgba(255, 107, 26, .06);
  box-shadow: 0 0 0 3px rgba(255, 107, 26, .22);
}
.form textarea { resize: vertical; min-height: 9rem; }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form .btn { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
