@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* Night field. One dark theme for every visitor. */
:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --band: #111923;        /* every other section sits on this, so sections read as separate */
  --raise: #17212d;
  --ink: #e8edf2;
  --muted: #9da8b5;
  --accent: #4aa6f4;
  --accent-ink: #0b0f14;

  /* flow field demo (read by main.js) */
  --canvas-bg: transparent;
  --wall: #16212c;
  --wall-round: 0.4;
  --arrow: #4aa6f4;
  --arrow-alpha: 0.28;
  --dot: #e8edf2;
  --target: #4aa6f4;
  --target-core: #0b0f14;

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --step-small: 0.9375rem;
  --step-body: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --step-title: clamp(1.5rem, 1.25rem + 0.9vw, 2rem);
  --step-head: clamp(2.5rem, 1.6rem + 3.4vw, 4.75rem);
  --step-display: clamp(3.25rem, 1.6rem + 5.4vw, 7rem);

  --margin: clamp(20px, 3vw, 40px);
  --gap: clamp(16px, 2vw, 28px);
  --section: clamp(96px, 10vw, 168px);
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.skip { position: absolute; left: var(--margin); top: -100px; background: var(--ink); color: var(--bg); padding: 10px 14px; z-index: 10; }
.skip:focus { top: 12px; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding-inline: var(--margin);
  max-width: 1440px;
  margin-inline: auto;
}

h1, h2, h3 { font-weight: 600; }
h3 { font-size: var(--step-title); line-height: 1.15; letter-spacing: -0.02em; }
.lead { font-size: var(--step-lead); line-height: 1.4; letter-spacing: -0.01em; max-width: 34ch; }
.when, .stat, .readout { font-variant-numeric: tabular-nums; }

.link { text-decoration: underline; transition: text-decoration-color 160ms var(--ease), color 160ms var(--ease); }
.link:hover { color: var(--accent); }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none; border-radius: 999px;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.button:hover { background: var(--ink); }
.button:active { transform: scale(0.97); }

/* Bar */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 64px; padding-inline: var(--margin);
  background: var(--bg);
  font-size: var(--step-small);
}
.wordmark { font-weight: 600; text-decoration: none; justify-self: start; }
.bar nav { display: flex; gap: 28px; }
.bar nav a, .bar-resume { text-decoration: none; color: var(--ink); transition: color 160ms var(--ease); }
.bar nav a:hover, .bar-resume:hover { color: var(--accent); }
.bar-resume { justify-self: end; font-weight: 600; }

/* Hero: the flow field fills the first screen behind the name */
.hero {
  position: relative;
  min-height: calc(100svh - 64px);
  align-items: center;
  padding-block: clamp(40px, 8vh, 96px);
}
.hero .field { position: absolute; inset: 0; z-index: 0; }
.hero .field canvas {
  display: block; width: 100%; height: 100%;
  touch-action: manipulation; cursor: crosshair;
}
.hero .field figcaption {
  position: absolute; right: var(--margin); bottom: 24px; max-width: 380px;
  font-size: var(--step-small); line-height: 1.45; text-align: right; color: var(--muted);
}
.hero .field figcaption a { color: var(--ink); }
.readout { margin-top: 6px; }
.hero-text { position: relative; z-index: 1; grid-column: 2 / span 6; pointer-events: none; }
.hero-text a { pointer-events: auto; }
.hero h1 {
  font-size: var(--step-display); line-height: 0.95; letter-spacing: -0.04em;
  margin-left: -0.05em; max-width: 7ch;
}
.hero .lead { margin-top: 32px; max-width: 30ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 40px; }

/* Every section opens the same way: a dot like the demo's target, a big title, one line beside it */
section { padding-block: var(--section); }
.band { background: var(--band); }
.sec-head {
  grid-column: 2 / span 10;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  align-items: end; column-gap: var(--gap);
  margin-bottom: clamp(48px, 6vw, 88px);
}
.sec-head h2 {
  position: relative;
  font-size: var(--step-head); line-height: 0.95; letter-spacing: -0.04em;
  padding-left: 0.42em;
}
.sec-head h2::before {
  content: ""; position: absolute; left: 0; top: 0.36em;
  width: 0.2em; height: 0.2em; border-radius: 50%;
  background: var(--accent);
}
.sec-intro { color: var(--muted); font-size: var(--step-lead); line-height: 1.35; max-width: 34ch; padding-bottom: 0.3em; }

/* Streamlite */
.sl-intro { grid-column: 2 / span 5; }
.prize { margin-top: 48px; margin-bottom: 36px; }
.prize-figure {
  font-size: var(--step-display); line-height: 0.95; letter-spacing: -0.04em; font-weight: 600;
  color: var(--accent);
}
.prize p:last-child { margin-top: 14px; max-width: 36ch; color: var(--muted); }
.sl-stack { grid-column: 8 / span 4; display: grid; gap: 36px; align-content: start; }
.sl-stack dt { font-weight: 600; font-size: var(--step-lead); letter-spacing: -0.01em; }
.sl-stack dd { margin: 8px 0 0; color: var(--muted); max-width: 40ch; }

/* Experience: photo beside a list of roles, each with its own title, dates and points */
.exp-photo { grid-column: 2 / span 3; align-self: start; position: sticky; top: 96px; }
.exp-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius); }
.roles { grid-column: 6 / span 6; display: grid; gap: clamp(56px, 6vw, 80px); }
.role-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 24px; flex-wrap: wrap; }
.role .when { color: var(--muted); font-size: var(--step-small); white-space: nowrap; }
.role .title { margin-top: 6px; color: var(--accent); font-weight: 500; }
.points { margin-top: 20px; display: grid; gap: 12px; }
.points li { position: relative; padding-left: 22px; max-width: 60ch; }
.points li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
}

/* Projects: three columns, each led by one big figure */
.work { grid-column: 2 / span 10; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(32px, 4vw, 64px); }
.work .stat {
  font-size: clamp(2rem, 1.4rem + 1.8vw, 3rem); line-height: 1; letter-spacing: -0.035em; font-weight: 600;
  color: var(--accent);
}
.work h3 { margin-top: 20px; }
.work h3 + p { margin-top: 14px; color: var(--muted); }

/* About */
.about-photo { grid-column: 2 / span 4; }
.about-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius); }
.about-photo figcaption { margin-top: 12px; font-size: var(--step-small); color: var(--muted); }
.about-text { grid-column: 7 / span 5; align-self: center; }
.about-text p { max-width: 52ch; }
.about-text p + p { margin-top: 1em; }
.about-text h3 { margin-top: 48px; margin-bottom: 16px; font-size: var(--step-lead); }
.skills { display: flex; flex-wrap: wrap; gap: 10px; }
.skills li {
  padding: 6px 14px; border-radius: 999px; background: var(--raise);
  font-size: var(--step-small);
}

/* Closing footer: contact, big email, links, then the name signed across the page */
.closing {
  background: var(--band);
  padding-top: var(--section);
  overflow: hidden;
}
.close-say { grid-column: 2 / span 5; }
.close-portrait { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; margin-bottom: 28px; }
.close-say h2 { font-size: var(--step-head); line-height: 0.95; letter-spacing: -0.04em; }
.close-say .sec-intro { margin-top: 20px; }
.close-links { grid-column: 7 / span 5; align-self: end; }
.big-mail {
  display: inline-block;
  font-size: clamp(1.6rem, 0.9rem + 2.4vw, 3rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em;
  text-decoration-color: var(--accent);
  overflow-wrap: anywhere;
  transition: color 160ms var(--ease);
}
.big-mail:hover { color: var(--accent); }
.close-links ul { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.close-links ul a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; background: var(--raise); text-decoration: none; font-weight: 500;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.close-links ul a:hover { background: var(--accent); color: var(--accent-ink); }
.signature {
  margin-top: clamp(80px, 10vw, 160px);
  padding-inline: var(--margin);
  font-size: 13.7vw; font-weight: 600; letter-spacing: -0.055em; line-height: 0.8;
  white-space: nowrap; color: #1c2938;
  margin-bottom: -0.06em;
  user-select: none;
}
.base {
  display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  position: relative; /* paints over the signature's descenders */
  padding: 24px var(--margin) 28px;
  background: var(--bg);
  font-size: var(--step-small); color: var(--muted);
}
.base a { color: var(--ink); text-decoration: none; }
.base a:hover { color: var(--accent); }

/* Entrances (content stays visible without script) */
.js [data-reveal] > * {
  opacity: 0; transform: translateY(24px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  transition-delay: calc(var(--i, 0) * 75ms);
}
.js [data-reveal].in > * { opacity: 1; transform: none; }
.js .hero .field[data-reveal] > * { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] > * { transform: none; transition: opacity 300ms linear; }
  .button { transition: none; }
}

/* Tablet */
@media (max-width: 1080px) {
  .bar nav { display: none; }
  .bar { grid-template-columns: 1fr auto; }
  .hero-text { grid-column: 1 / span 9; }
  .sec-head, .work { grid-column: 1 / -1; }
  .sl-intro { grid-column: 1 / span 6; }
  .sl-stack { grid-column: 8 / span 5; }
  .exp-photo { grid-column: 1 / span 4; }
  .roles { grid-column: 6 / span 7; }
  .work { grid-template-columns: 1fr 1fr; }
  .about-photo { grid-column: 1 / span 5; }
  .about-text { grid-column: 7 / span 6; }
  .close-say { grid-column: 1 / span 6; }
  .close-links { grid-column: 7 / span 6; }
}

/* Phone */
@media (max-width: 700px) {
  :root { --margin: 20px; --section: 80px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid > * { grid-column: 1 / -1 !important; }

  /* The field sits under the text instead of behind it */
  .hero { min-height: 0; padding-top: 32px; padding-bottom: 56px; row-gap: 36px; }
  .hero .field { position: static; }
  .hero .field canvas { height: auto; aspect-ratio: 4 / 3; border-radius: var(--radius); background: #0e141b; }
  .hero .field figcaption { position: static; max-width: none; text-align: left; margin-top: 14px; }
  .hero-text { pointer-events: auto; }
  .hero h1 { max-width: none; }
  .hero .lead { margin-top: 20px; }
  .actions { margin-top: 28px; }
  .actions .button { width: 100%; }

  .sec-head { grid-template-columns: 1fr; row-gap: 14px; margin-bottom: 40px; }
  .sl-stack { margin-top: 56px; gap: 28px; }

  .exp-photo { position: static; margin-bottom: 48px; }
  .exp-photo img { aspect-ratio: 4 / 3; object-position: 50% 45%; }
  .roles { gap: 48px; }

  .work { grid-template-columns: 1fr; gap: 48px; }

  .about-photo { margin-bottom: 36px; }
  .about-photo img { aspect-ratio: 4 / 3; object-position: 50% 62%; }

  .close-links { margin-top: 40px; }
  .close-portrait { width: 72px; height: 72px; }
  .signature { font-size: 13vw; }
  .base { flex-direction: column; }
}
