@import url("../fonts/fonts.css");

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Surfaces. Base sits well below 18% grey so the work is the brightest
     thing on screen; each step up is a real, perceptible lift. */
  --bg: #0e0f11;
  --bg-deep: #08090a;
  --surface: #16181b;
  --surface-2: #1d2024;
  --surface-3: #26292e;

  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text: #eef0f2;
  --text-dim: #b4b9c0; /* 9.6:1 on --bg */
  --text-faint: #8b9199; /* 6.0:1 on --bg - never used below 14px */

  --ember: #ff9057;
  --ember-dim: #c96a38;
  --ember-glow: rgba(255, 144, 87, 0.22);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  /* Spacious scale, per the design dial. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 16px;
  --s-4: 24px;
  --s-5: 40px;
  --s-6: 64px;
  --s-7: 96px;
  --s-8: 140px;

  /* Wide enough that the work fills a large display, while paragraphs stay
     readable because text is capped separately by a `ch` measure, not by the
     container. */
  --shell: min(1920px, 100%);
  --gutter: clamp(20px, 5vw, 80px);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 260ms;

  --z-nav: 100;
  --z-overlay: 1000;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ==========================================================================
   Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Keeps anchored sections clear of the fixed header. */
  scroll-padding-top: 96px;
  /* clip, not hidden: `overflow-x: hidden` would turn this into a scroll
     container and break position: fixed / scroll offsets in some engines. */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p,
figure,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

::selection {
  background: var(--ember);
  color: #17110c;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% -120%;
  z-index: calc(var(--z-overlay) + 1);
  padding: 12px 20px;
  background: var(--ember);
  color: #17110c;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: translate 180ms var(--ease);
}

.skip-link:focus {
  translate: -50% 0;
}

/* ==========================================================================
   Typography helpers
   ========================================================================== */

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.eyebrow--ember {
  color: var(--ember);
}

.display {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-wrap: balance;
}

.section-title {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}

.lede {
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.65;
  color: var(--text-dim);
  max-width: 68ch;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-nav);
  padding-block: var(--s-3);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    backdrop-filter var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header[data-stuck="true"] {
  background: color-mix(in srgb, var(--bg-deep) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 17px;
  white-space: nowrap;
}

.wordmark__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 12px var(--ember-glow);
  flex: none;
  translate: 0 -1px;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 28px);
}

.nav__link {
  position: relative;
  padding: 10px 4px;
  font-size: 15px;
  color: var(--text-dim);
  transition: color var(--dur) var(--ease);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 1px;
  background: var(--ember);
  scale: 0 1;
  transform-origin: left;
  transition: scale var(--dur) var(--ease);
}

.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--text);
}

.nav__link:hover::after,
.nav__link[aria-current="page"]::after {
  scale: 1 1;
}

.nav__socials {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  padding-left: clamp(8px, 2vw, 20px);
  border-left: 1px solid var(--line);
}

.icon-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text-faint);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.icon-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.icon-link svg {
  width: 19px;
  height: 19px;
}

.nav-toggle {
  display: none;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding-block: 140px var(--s-7);
  overflow: hidden;
  isolation: isolate;
}

/* Two soft gradient pools - warm from the lower left, cool counterweight
   upper right. Cheap (no filters), and they never touch the text contrast. */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.hero::before {
  inset: auto -20% -40% -30%;
  aspect-ratio: 1;
  background: radial-gradient(
    circle at 40% 60%,
    rgba(255, 144, 87, 0.17),
    rgba(255, 144, 87, 0.05) 42%,
    transparent 68%
  );
}

.hero::after {
  inset: -35% -35% auto auto;
  width: 90vmax;
  aspect-ratio: 1;
  background: radial-gradient(
    circle at 60% 40%,
    rgba(86, 148, 176, 0.14),
    transparent 62%
  );
}

.hero__inner {
  position: relative;
  display: grid;
  gap: var(--s-5);
}

.hero__name {
  font-size: clamp(52px, 13vw, 184px);
  margin-block: var(--s-3) 0;
}

.hero__name span {
  display: inline-block;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-3) var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}

.hero__role {
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.hero__tagline {
  color: var(--text-dim);
  font-size: clamp(15px, 1.6vw, 18px);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
}

.scroll-cue {
  position: absolute;
  left: var(--gutter);
  bottom: var(--s-5);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-faint);
  transition: color var(--dur) var(--ease);
}

.scroll-cue:hover {
  color: var(--text);
}

.scroll-cue svg {
  width: 16px;
  height: 16px;
  animation: nudge 2.4s var(--ease) infinite;
}

@keyframes nudge {
  0%,
  70%,
  100% {
    translate: 0 0;
  }
  35% {
    translate: 0 5px;
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border: 1px solid var(--line-strong);
  color: var(--text);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease), translate var(--dur) var(--ease);
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  translate: 0 -1px;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.btn--primary {
  background: var(--ember);
  border-color: var(--ember);
  color: #17110c; /* 9.7:1 on the ember fill */
  font-weight: 600;
}

.btn--primary:hover {
  background: #ffa473;
  border-color: #ffa473;
  color: #17110c;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding-block: clamp(72px, 11vw, var(--s-8));
  position: relative;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section__head {
  display: grid;
  gap: var(--s-3);
  max-width: 72ch;
  margin-bottom: var(--s-6);
}

.section__head--split {
  max-width: none;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--s-4);
}

@media (max-width: 720px) {
  .section__head--split {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

/* ==========================================================================
   Reels
   ========================================================================== */

/* Stacked, one per row. A reel is the single most important thing on the
   page; side by side made each one small enough to be dismissed. */
.reels {
  display: grid;
  gap: clamp(48px, 7vw, 96px);
  grid-template-columns: 1fr;
}

.reel {
  display: grid;
  gap: var(--s-3);
}

.reel__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  /* On a very wide display a 16:9 frame at full width would be taller than the
     viewport; cap it so a whole reel stays visible at once. */
  max-height: 86vh;
  margin-inline: auto;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  isolation: isolate;
}

.reel__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Click-to-load facade: nothing from YouTube is requested until the visitor
   presses play, so the page carries no third-party cookies or scripts. */
.reel__facade {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  cursor: pointer;
}

.reel__facade img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.62) saturate(0.9);
  transition: filter 420ms var(--ease), scale 620ms var(--ease);
}

.reel__facade:hover img {
  filter: brightness(0.78) saturate(1);
  scale: 1.03;
}

.reel__play {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(12, 13, 15, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    scale var(--dur) var(--ease);
}

.reel__facade:hover .reel__play {
  background: var(--ember);
  border-color: var(--ember);
  scale: 1.06;
}

.reel__play svg {
  width: 26px;
  height: 26px;
  translate: 2px 0;
  fill: #fff;
  transition: fill var(--dur) var(--ease);
}

.reel__facade:hover .reel__play svg {
  fill: #17110c;
}

.reel__pending {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--s-2);
  text-align: center;
  padding: var(--s-4);
  background: linear-gradient(160deg, var(--surface-2), var(--bg-deep));
}

.reel__pending-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px dashed var(--line-strong);
  color: var(--text-faint);
}

.reel__pending-icon svg {
  width: 22px;
  height: 22px;
}

.reel__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2) var(--s-3);
}

.reel__title {
  font-size: clamp(24px, 3vw, 34px);
}

.reel__blurb {
  font-size: clamp(15px, 1.4vw, 17px);
}

/* A bigger target on a bigger frame. */
@media (min-width: 900px) {
  .reel__play {
    width: 108px;
    height: 108px;
  }

  .reel__play svg {
    width: 34px;
    height: 34px;
  }
}

.reel__title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.reel__blurb {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 56ch;
}

/* ==========================================================================
   Horizontal rail
   ========================================================================== */

.rail {
  position: relative;
}

.rail__track {
  --rail-h: clamp(200px, 34vw, 620px);
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  /* Bleed to the viewport edge so the rail reads as continuing off-screen,
     while the first card still lines up with the page gutter. */
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  padding-block: 4px;
  scrollbar-width: none;
}

.rail__track::-webkit-scrollbar {
  display: none;
}

.rail__track > * {
  scroll-snap-align: start;
}

.rail__controls {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-4);
}

.rail__btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.rail__btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.rail__btn:disabled {
  opacity: 0.32;
  cursor: default;
}

.rail__btn svg {
  width: 18px;
  height: 18px;
}

.rail__hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: var(--s-2);
  font-size: 13px;
  color: var(--text-faint);
}

.rail__hint svg {
  width: 14px;
  height: 14px;
  flex: none;
}

@media (max-width: 720px) {
  .rail__hint {
    display: none;
  }
}

.rail__dots {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* Dots are progress indicators, not controls - the arrows and native
   swipe/keyboard scrolling do the driving. */
.rail__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--surface-3);
  transition: background var(--dur) var(--ease), scale var(--dur) var(--ease);
}

.rail__dot[data-active="true"] {
  background: var(--ember);
  scale: 1.25;
}

/* ==========================================================================
   Still cards
   ========================================================================== */

.still {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: zoom-in;
  transition: border-color var(--dur) var(--ease), translate var(--dur) var(--ease);
}

.still:hover {
  border-color: var(--line-strong);
  translate: 0 -2px;
}

/* --ar is each image's true ratio, set on the card from the manifest.
   Nothing is ever cropped: the 2.39:1 frames stay 2.39:1. */
.still__media {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

/* In a grid the width is fixed by the column, so the ratio sets the height. */
.still--grid {
  aspect-ratio: var(--ar, 16 / 9);
}

/* In a rail every card shares a height and the ratio sets the width, so an
   ultra-wide frame simply occupies more of the rail. The card must keep an
   indefinite width for aspect-ratio to drive it - hence flex-basis auto and
   no width declaration anywhere on the card or its media. */
.still--rail {
  flex: 0 0 auto;
  /* Overrides the width: 100% on .still - that made the width definite, which
     stops aspect-ratio from deriving it and left grey space beside the image. */
  width: auto;
  height: var(--rail-h);
  aspect-ratio: var(--ar, 16 / 9);
}

.still__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 480ms var(--ease), scale 700ms var(--ease);
}

.still__media img.is-loaded {
  opacity: 1;
}

.still:hover .still__media img {
  scale: 1.035;
}

.still__caption {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 48px var(--s-3) 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(to top, rgba(6, 7, 8, 0.88), transparent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.still:hover .still__caption,
.still:focus-visible .still__caption {
  opacity: 1;
}

.still__index {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.75);
}

/* Sits between the caption and the index, so the pointer sees what a click
   will do without another line of chrome on the page. */
.still__zoom {
  display: inline-grid;
  place-items: center;
  margin-left: auto;
  margin-right: var(--s-2);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(10, 11, 12, 0.45);
  color: #fff;
}

.still__zoom svg {
  width: 14px;
  height: 14px;
}

/* Full grid used on the project pages. */
.grid-stills {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  /* Ratios differ between frames, so let each card keep its natural height
     rather than stretching to match its neighbours. */
  align-items: start;
}

.grid-stills .still:first-child {
  grid-column: 1 / -1;
}

/* ==========================================================================
   Project teaser
   ========================================================================== */

.project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-2) var(--s-4);
  margin-bottom: var(--s-4);
}

.project-head h3 {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.project-head .meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ember);
  min-height: 44px;
}

.link-arrow svg {
  width: 15px;
  height: 15px;
  transition: translate var(--dur) var(--ease);
}

.link-arrow:hover svg {
  translate: 4px 0;
}

/* ==========================================================================
   About
   ========================================================================== */

.about {
  display: grid;
  gap: clamp(40px, 6vw, 80px);
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

@media (max-width: 900px) {
  .about {
    grid-template-columns: 1fr;
  }
}

.about__cols {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.tag {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--text-dim);
}

.stack-list {
  display: grid;
  gap: 10px;
  font-size: 15px;
  color: var(--text-dim);
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline__row {
  border-top: 1px solid var(--line);
}

.timeline__row:last-child {
  border-bottom: 1px solid var(--line);
}

/* A non-expandable row and the button inside an expandable one share this
   layout, so the list reads as one column whichever kind a row is. */
.timeline__row,
.timeline__toggle {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-2) var(--s-4);
  align-items: baseline;
  padding-block: var(--s-3);
}

.timeline__toggle {
  width: 100%;
  text-align: left;
  padding-block: var(--s-3);
  transition: color var(--dur) var(--ease);
}

.timeline__row--expandable {
  display: block;
  padding-block: 0;
}

.timeline__row--expandable:hover .timeline__company,
.timeline__toggle:focus-visible .timeline__company {
  color: var(--ember);
}

.timeline__chevron {
  display: inline-grid;
  place-items: center;
  color: var(--text-faint);
  transition: rotate var(--dur) var(--ease), color var(--dur) var(--ease);
}

.timeline__chevron svg {
  width: 16px;
  height: 16px;
}

.timeline__toggle[aria-expanded="true"] .timeline__chevron {
  rotate: 180deg;
  color: var(--ember);
}

.timeline__toggle[aria-expanded="true"] .timeline__company {
  color: var(--ember);
}

/* Animating grid-template-rows between 0fr and 1fr expands to the content's
   own height without hard-coding one. */
.timeline__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms var(--ease), opacity 320ms var(--ease);
  opacity: 0;
}

.timeline__panel[data-open="true"] {
  grid-template-rows: 1fr;
  opacity: 1;
}

.timeline__body {
  overflow: hidden;
  min-height: 0;
}

.timeline__summary {
  color: var(--text-dim);
  font-size: 15.5px;
  max-width: 68ch;
  padding-bottom: var(--s-3);
}

.timeline__panel .subhead {
  margin-bottom: var(--s-2);
}

.timeline__achievements {
  display: grid;
  gap: var(--s-2);
  padding-bottom: var(--s-4);
  max-width: 68ch;
}

.timeline__achievements li {
  position: relative;
  padding-left: 20px;
  font-size: 15px;
  color: var(--text-dim);
}

.timeline__achievements li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 6px;
  height: 1px;
  background: var(--ember);
}

.timeline__company {
  font-weight: 500;
}

.timeline__role {
  display: block;
  font-size: 14px;
  color: var(--text-faint);
}

.timeline__years {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

.subhead {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--s-3);
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact {
  display: grid;
  gap: var(--s-5);
  justify-items: start;
}

.contact__email {
  font-size: clamp(26px, 5.5vw, 60px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
  background: linear-gradient(100deg, var(--text) 30%, var(--ember));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.contact__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.contact__list a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 15px;
  color: var(--text-dim);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

.contact__list a:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line-strong);
}

.contact__list svg {
  width: 17px;
  height: 17px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--s-5);
  font-size: 14px;
  color: var(--text-faint);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-4);
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: color-mix(in srgb, var(--bg-deep) 98%, transparent);
  backdrop-filter: blur(18px) saturate(0.8);
  -webkit-backdrop-filter: blur(18px) saturate(0.8);
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms var(--ease), visibility 240ms;
}

.lightbox[data-open="true"] {
  opacity: 1;
  visibility: visible;
}

.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--gutter);
}

.lightbox__hint {
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
}

/* The hint is a nicety; the count and close button are not. */
@media (max-width: 720px) {
  .lightbox__hint {
    display: none;
  }
}

.lightbox__count {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

/* One full-height slide per image inside a native scroll container. The
   browser supplies the momentum, rubber-banding and kinetic touch scrolling.
   Snapping is `proximity`, not `mandatory`: it only pulls a frame into place
   once you are already close to it, so scrolling stays free and you can rest
   between two images if you want to. */
.lightbox__scroller {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 5vh, 64px);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y proximity;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding-inline: var(--gutter);
  touch-action: pan-y;
  cursor: zoom-out;
}

.lightbox__scroller::-webkit-scrollbar {
  display: none;
}

.lightbox__scroller:focus-visible {
  outline: none;
}

.lightbox__slide {
  /* The picture is positioned against this box rather than sized with
     percentage heights. A centred grid item leaves its height indefinite, so
     `height: 100%` inside it silently fell back to the image's intrinsic
     height - the image overflowed its slide and swallowed the gap. */
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: center;
  /* Deliberately not scroll-snap-stop: always - a fast flick should carry
     through several frames the way a long page does, rather than being
     halted at every single one. */
}

.lightbox__slide picture {
  position: absolute;
  /* Inset from the slide edges, so the frame never runs flush into the bar
     above or the next image below. */
  inset: clamp(8px, 1.5vh, 20px) 0;
  display: block;
}

.lightbox__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-sm);
}

.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--gutter);
}

.lightbox__hint {
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
}

/* The hint is a nicety; the count and close button are not. */
@media (max-width: 720px) {
  .lightbox__hint {
    display: none;
  }
}

.lightbox__count {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.lightbox__foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--gutter) var(--s-4);
}

.lightbox__caption {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
}

.lightbox .rail__btn {
  background: var(--surface);
}

html[data-lightbox="open"],
body[data-lightbox="open"] {
  overflow: hidden;
  /* Stops a scroll that runs past the end of the viewer from chaining into
     the page underneath. */
  overscroll-behavior: none;
}

.lightbox[data-open="true"] {
  overscroll-behavior: contain;
}

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  translate: 0 18px;
  transition: opacity 620ms var(--ease), translate 620ms var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  translate: 0 0;
}

/* ==========================================================================
   Mobile nav
   ========================================================================== */

@media (max-width: 820px) {
  .nav-toggle {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    color: var(--text);
    /* Sits above the full-screen nav overlay so it can also close it. */
    position: relative;
    z-index: 2;
  }

  .nav-toggle svg:last-child,
  .nav-toggle[aria-expanded="true"] svg:first-child {
    display: none;
  }

  .nav-toggle[aria-expanded="true"] svg:last-child {
    display: block;
  }

  .nav-toggle svg {
    width: 20px;
    height: 20px;
  }

  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: var(--s-2);
    padding: calc(var(--s-7) + env(safe-area-inset-top)) var(--gutter)
      calc(var(--s-5) + env(safe-area-inset-bottom));
    background: var(--bg-deep);
    translate: 0 -100%;
    z-index: 1;
    transition: translate 320ms var(--ease);
    overflow-y: auto;
  }

  .nav[data-open="true"] {
    translate: 0 0;
  }

  .nav__link {
    font-size: 26px;
    font-weight: 500;
    letter-spacing: -0.03em;
    padding-block: 14px;
    border-bottom: 1px solid var(--line);
  }

  .nav__link::after {
    display: none;
  }

  .nav__socials {
    margin: var(--s-4) 0 0;
    padding: 0;
    border: 0;
    justify-content: flex-start;
  }
}

@media (min-width: 821px) {
  .nav[data-open] {
    translate: none;
  }
}

/* ==========================================================================
   Motion & contrast preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1;
    translate: none;
  }

  .rail__track {
    scroll-snap-type: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(255, 255, 255, 0.24);
    --line-strong: rgba(255, 255, 255, 0.42);
    --text-dim: #d7dade;
    --text-faint: #b8bec6;
  }
}

@media print {
  .site-header,
  .scroll-cue,
  .rail__controls,
  .lightbox {
    display: none !important;
  }
}

/* ==========================================================================
   Utilities
   Small, named helpers so no markup needs an inline style attribute - that
   keeps the Content-Security-Policy free of 'unsafe-inline' for styles.
   ========================================================================== */

.u-mt-5 { margin-top: var(--s-5); }
.u-mt-6 { margin-top: var(--s-6); }
.u-mb-7 { margin-bottom: var(--s-7); }
.u-mb-0 { margin-bottom: 0; }

[data-reveal][data-delay="1"] { --reveal-delay: 90ms; }
[data-reveal][data-delay="2"] { --reveal-delay: 180ms; }
[data-reveal][data-delay="3"] { --reveal-delay: 270ms; }
[data-reveal][data-delay="4"] { --reveal-delay: 360ms; }

/* Reel with no poster image: a quiet gradient rather than a borrowed still. */
.reel__facade--plain {
  background: linear-gradient(150deg, var(--surface-2) 0%, var(--bg-deep) 70%),
    radial-gradient(circle at 30% 20%, var(--ember-glow), transparent 60%);
}

/* Ultra-wide frames (2.1:1 and wider) take a full grid row - a 2.39:1
   composition beside a 16:9 one would be reduced to a letterbox strip. */
.grid-stills .still--wide {
  grid-column: 1 / -1;
}
