/* Mobile first. Two themes: dark (default) and light. Tokens derive from DESIGN.md (type scale,
   spacing, radius), re-keyed to a green accent.
   Theme resolution: [data-theme] (saved choice) wins; otherwise the system preference. */

@font-face {
  font-family: 'Daddy Time Mono';
  src: url('/assets/fonts/daddy-time-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  /* dark (default) */
  color-scheme: dark;
  --bg: #060807;
  --bg-raise: #0b100d;
  --bg-raise-2: #101713;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink: #eef2ef;
  --ink-2: #b6c0ba;
  --ink-3: #7e8b84;
  --accent: #4fb98a;
  --accent-hover: #62cb9c;
  --accent-ink: #04120b;
  --accent-text: #4fb98a;
  --accent-soft: rgba(79, 185, 138, 0.14);
  --glow: rgba(79, 185, 138, 0.2);
  --glow-2: rgba(79, 185, 138, 0.08);
  --header-bg: rgba(6, 8, 7, 0.72);

  --font-sans: 'Daddy Time Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-mono: 'Daddy Time Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --gutter: 1.25rem;
  --max: 72rem;
  --radius: 1rem;
  --radius-sm: 0.5rem;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --header-h: 4.25rem;
}

:root[data-theme='dark'] {
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    color-scheme: light;
    --bg: #f6f8f6;
    --bg-raise: #ffffff;
    --bg-raise-2: #eef2ef;
    --line: rgba(6, 20, 12, 0.1);
    --line-strong: rgba(6, 20, 12, 0.18);
    --ink: #0a1410;
    --ink-2: #3a4740;
    --ink-3: #5f6d65;
    --accent: #1a7f55;
    --accent-hover: #146944;
    --accent-ink: #ffffff;
    --accent-text: #16724b;
    --accent-soft: rgba(29, 138, 92, 0.12);
    --glow: rgba(29, 138, 92, 0.16);
    --glow-2: rgba(29, 138, 92, 0.07);
    --header-bg: rgba(246, 248, 246, 0.8);
  }
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f6f8f6;
  --bg-raise: #ffffff;
  --bg-raise-2: #eef2ef;
  --line: rgba(6, 20, 12, 0.1);
  --line-strong: rgba(6, 20, 12, 0.18);
  --ink: #0a1410;
  --ink-2: #3a4740;
  --ink-3: #5f6d65;
  --accent: #1a7f55;
  --accent-hover: #146944;
  --accent-ink: #ffffff;
  --accent-text: #16724b;
  --accent-soft: rgba(29, 138, 92, 0.12);
  --glow: rgba(29, 138, 92, 0.16);
  --glow-2: rgba(29, 138, 92, 0.07);
  --header-bg: rgba(246, 248, 246, 0.8);
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: 'ss01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
  transition: background-color 0.4s var(--ease);
}

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

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: top 0.2s var(--ease);
}

.skip:focus {
  top: 0.75rem;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem var(--gutter) 0.4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.tools {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition:
    color 0.3s var(--ease),
    background-color 0.3s var(--ease);
}

.theme-toggle:hover {
  color: var(--ink);
  background: var(--bg-raise-2);
}

/* Geometric half-filled circle: no icon font or SVG needed. */
.theme-toggle__icon {
  width: 1.05rem;
  height: 1.05rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.lang a,
.lang__current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: 999px;
  text-decoration: none;
}

.lang__current {
  color: var(--ink);
  background: var(--bg-raise-2);
  border: 1px solid var(--line-strong);
  order: 2;
}

.lang a {
  color: var(--ink-3);
  order: 1;
  transition: color 0.3s var(--ease);
}

.lang a:hover {
  color: var(--ink);
}

.site-nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav ul {
  display: flex;
  gap: 0.25rem;
  width: max-content;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  color: var(--ink-3);
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color 0.3s var(--ease),
    background-color 0.3s var(--ease);
}

.site-nav a:hover,
.site-nav a[aria-current='true'] {
  color: var(--ink);
  background: var(--bg-raise-2);
}

/* Mobile: the section nav is hidden entirely (shown only from 900px). */
.site-nav {
  display: none;
}

/* ---------- Typography ---------- */

.display {
  color: var(--ink);
  font-weight: 300;
  font-size: clamp(2.6rem, 11vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.display--md {
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.eyebrow::before {
  content: '';
  width: 1.5rem;
  height: 1px;
  background: var(--accent-text);
}

.section__title {
  color: var(--ink);
  font-weight: 300;
  font-size: clamp(1.9rem, 7vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.section__intro {
  margin-top: 0.9rem;
  max-width: 42rem;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Hero ---------- */

/* The hero is always a dark stage (the portrait is dark), also in the light theme. */
.hero {
  position: relative;
  overflow: hidden;
}

.hero__stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
}

.hero__graph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

:root[data-theme='light'] .hero__aurora {
  opacity: 0.45;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) .hero__aurora {
    opacity: 0.45;
  }
}

.hero__aurora {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(40% 35% at 25% 30%, rgba(79, 185, 138, 0.28), transparent 70%),
    radial-gradient(35% 40% at 78% 20%, rgba(40, 140, 170, 0.2), transparent 70%),
    radial-gradient(45% 40% at 60% 85%, rgba(79, 185, 138, 0.14), transparent 70%);
  filter: blur(30px);
}

/* Background trace: a circuit line that draws itself along the page margins with scroll. */
.trace {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Words enter one by one. Hidden state only exists when motion is allowed. */
.display .w {
  display: inline-block;
  font-weight: inherit;
}

.hero__body {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 7rem var(--gutter) 1rem;
}

.statement {
  margin-top: 1.5rem;
  max-width: 36rem;
  color: var(--ink);
  font-size: clamp(1.2rem, 4.8vw, 1.6rem);
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.experience {
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-3);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition:
    transform 0.4s var(--ease),
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--ink-3);
  transform: translateY(-1px);
}

.focus {
  display: grid;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) 3.5rem;
}

.focus li {
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
}

.focus__title {
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.focus p {
  max-width: 24rem;
  text-wrap: pretty;
}

/* ---------- Sections ---------- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4.5rem var(--gutter);
  border-top: 1px solid var(--line);
}

.section__head {
  margin-bottom: 2.5rem;
}

/* Timeline */

.timeline {
  position: relative;
  display: grid;
  gap: 1.25rem;
  padding-left: 1.25rem;
  border-left: 1px solid var(--line-strong);
}

.timeline__item {
  position: relative;
  padding: 1.25rem;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: calc(-1.25rem - 4px);
  top: 1.75rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}

.timeline__company {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.timeline__sector {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-3);
}

.role {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.15rem 1rem;
  margin-top: 0.6rem;
}

.role__title {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
}

.role__period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-3);
}

.bullets {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.bullets li {
  position: relative;
  padding-left: 1.1rem;
  text-wrap: pretty;
}

.bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 0.4rem;
  height: 1px;
  background: var(--accent-text);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.1rem;
}

.badges li {
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-2);
  background: var(--bg);
}

.timeline__item--compact {
  padding: 1rem 1.25rem;
}

.timeline__item--compact .timeline__company {
  font-size: 1.1rem;
}

/* Selected work: each case is a row, header on the left and the story on the right. */

.cases {
  display: grid;
  gap: 1.25rem;
}

.case {
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem 1.25rem;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.case__domain {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.case__title {
  margin-top: 0.9rem;
  color: var(--ink);
  font-size: clamp(1.25rem, 4.6vw, 1.55rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.case__built {
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.case__head .badges {
  margin-top: 0.6rem;
}

.case__steps {
  display: grid;
  gap: 1.25rem;
}

.step {
  position: relative;
  padding-left: 1.1rem;
  border-left: 1px solid var(--line-strong);
}

.step dt {
  margin-bottom: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.step dd {
  text-wrap: pretty;
}

.step--result {
  border-left-color: var(--accent);
}

.step--result dt {
  color: var(--accent-text);
}

.step--result dd {
  color: var(--ink);
}

/* Stack */

.stack {
  display: grid;
  gap: 1.75rem 2rem;
}

.stack__name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.stack .badges {
  margin-top: 0.7rem;
}

/* Education */

.split {
  display: grid;
  gap: 3rem;
}

.edu__degree {
  margin-top: 1.25rem;
  color: var(--ink);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.edu__school {
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-3);
}

.edu__detail {
  margin-top: 1rem;
  text-wrap: pretty;
}

.edu__merits {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--ink-3);
}

.split .bullets {
  margin-top: 1.25rem;
}

/* Contact */

.section--contact {
  padding-bottom: 5rem;
}

.contact {
  display: grid;
  justify-items: start;
  gap: 1rem;
}

.contact .btn {
  margin-top: 0.75rem;
}

/* Footer */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-3);
}

/* Language chooser (root fallback page) */

.chooser {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: var(--gutter);
  text-align: center;
}

.chooser__list {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.chooser__list a {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
}

/* ---------- Motion: scroll-driven reveal, progressive enhancement ---------- */

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
  }
}

/* Hero portrait eases out while the page scrolls over it (progressive enhancement). */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .hero__aurora {
      animation: hero-out linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 90svh;
    }
  }
}

@keyframes hero-out {
  to {
    opacity: 0.1;
    transform: scale(1.08) translateY(-3%);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__aurora {
    animation: aurora 18s ease-in-out infinite alternate;
  }

  .display .w {
    animation: word-in 1.7s var(--ease) both;
  }

  .display .w:nth-of-type(1) { animation-delay: 0.3s; }
  .display .w:nth-of-type(2) { animation-delay: 0.7s; }
  .display .w:nth-of-type(3) { animation-delay: 1.1s; }
  .display .w:nth-of-type(4) { animation-delay: 1.5s; }

  .hero__body > :not(h1) {
    animation: rise 1.2s var(--ease) both;
    animation-delay: 1.9s;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
  }

  ::view-transition-new(root) {
    animation: theme-reveal 0.8s var(--ease) both;
  }
}

@keyframes aurora {
  to {
    transform: translate3d(6%, -4%, 0) scale(1.15) rotate(6deg);
  }
}

@keyframes word-in {
  from {
    opacity: 0;
    transform: translateY(0.6em);
    filter: blur(10px);
  }

  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}




@keyframes theme-reveal {
  from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); }
  to { clip-path: circle(150vmax at var(--vt-x, 50%) var(--vt-y, 0)); }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Stage 2/3: motion details ---------- */

/* Top scroll progress bar. */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

/* Stack marquee: two rows moving in opposite directions. */
.marquee {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}

.marquee__row {
  display: flex;
  overflow: hidden;
}

.marquee__track {
  display: flex;
  flex: none;
  list-style: none;
}

.marquee__track > ul {
  display: flex;
  flex: none;
  gap: 0.75rem;
  padding-right: 0.75rem;
}

.marquee__track li,
.marquee__track > ul > li {
  flex: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-raise);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Spotlight that follows the pointer on cards. */
.case,
.stack__group,
.timeline__item {
  --mx: 50%;
  --my: 0%;
  position: relative;
}

.case::after,
.timeline__item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), var(--accent-soft), transparent 70%);
  transition: opacity 0.4s var(--ease);
}

.case:hover::after,
.timeline__item:hover::after {
  opacity: 1;
}

/* Terminal */
.term {
  margin: 2.5rem 0 0;
  max-width: 40rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-raise);
  overflow: hidden;
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.term__dots {
  width: 2.1rem;
  height: 0.55rem;
  background:
    radial-gradient(circle at 0.275rem 50%, var(--ink-3) 0.2rem, transparent 0.22rem),
    radial-gradient(circle at 1.05rem 50%, var(--ink-3) 0.2rem, transparent 0.22rem),
    radial-gradient(circle at 1.825rem 50%, var(--accent) 0.2rem, transparent 0.22rem);
}

.term__body {
  margin: 0;
  padding: 1.1rem 1rem 1.25rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--ink-2);
}

.term__cmd::before {
  content: '$ ';
  color: var(--accent-text);
}

.term__cmd:empty::before {
  content: none;
}

.term__out {
  color: var(--ink-3);
}

.term__caret {
  display: inline-block;
  width: 0.5rem;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1s steps(2) infinite;
}

/* Cursor halo (fine pointers only; added by main.js). */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.3s var(--ease),
    width 0.3s var(--ease),
    height 0.3s var(--ease),
    margin 0.3s var(--ease),
    background-color 0.3s var(--ease);
}

.cursor.is-on {
  opacity: 0.75;
}

.cursor.is-link {
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  background: var(--accent-soft);
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .progress {
      animation: grow-x linear both;
      animation-timeline: scroll(root block);
    }

    .timeline {
      border-left-color: var(--line);
    }

    .timeline::before {
      content: '';
      position: absolute;
      left: -1px;
      top: 0;
      bottom: 0;
      width: 2px;
      background: linear-gradient(to bottom, var(--accent), var(--accent-text));
      transform-origin: top;
      animation: grow-y linear both;
      animation-timeline: view();
      animation-range: entry 30% cover 75%;
    }
  }

  .marquee__row {
    --dur: 38s;
  }

  .marquee__track {
    animation: marquee var(--dur) linear infinite;
  }

  .marquee__row--rev .marquee__track {
    animation-direction: reverse;
    --dur: 46s;
  }

  .marquee:hover .marquee__track {
    animation-play-state: paused;
  }

  @view-transition {
    navigation: auto;
  }
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

@keyframes grow-x {
  to {
    transform: scaleX(1);
  }
}

@keyframes grow-y {
  from {
    transform: scaleY(0);
  }

  to {
    transform: scaleY(1);
  }
}


@media print {
  .reveal {
    animation: none;
  }
}

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

  * {
    transition-duration: 0.01ms !important;
  }
}

/* ---------- >= 640px ---------- */

@media (min-width: 640px) {
  :root {
    --gutter: 2rem;
    --header-h: 4.5rem;
  }

  .actions {
    flex-direction: row;
  }

  .focus {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .stack {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline {
    padding-left: 2rem;
  }

  .timeline__item {
    padding: 1.75rem;
  }

  .timeline__item::before {
    left: calc(-2rem - 4px);
    top: 2.2rem;
  }

  .case {
    padding: 2rem;
  }
}

/* ---------- >= 900px ---------- */

@media (min-width: 900px) {
  .site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 0;
  }

  /* Full-bleed bar behind the centered header content. */
  .site-header::before {
    content: '';
    position: absolute;
    inset: 0 calc(50% - 50vw);
    z-index: -1;
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }

  .site-header__bar {
    display: contents;
  }

  .brand {
    order: 1;
  }

  .site-nav {
    display: block;
    order: 2;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .tools {
    order: 3;
  }

  .section {
    padding: 7rem var(--gutter);
  }

  .section__head {
    margin-bottom: 3.5rem;
  }

  .hero {
    display: grid;
    min-height: min(100svh, 62rem);
    align-content: end;
  }

  .hero__body {
    width: 100%;
    margin: 0 auto;
    padding: 7rem var(--gutter) 3rem;
  }

  .hero__body > :not(.actions) {
    max-width: 36rem;
  }

  .display {
    font-size: clamp(3.5rem, 6vw, 5.5rem);
  }

  .statement {
    max-width: 40rem;
  }

  .focus {
    padding-bottom: 5rem;
  }

  .case {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 3rem;
    padding: 2.5rem;
  }

  .case__steps {
    gap: 1.5rem;
  }

  .split {
    grid-template-columns: repeat(2, 1fr);
    gap: 5rem;
  }
}

@media (min-width: 1100px) {
  .stack {
    grid-template-columns: repeat(4, 1fr);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Pinned, scroll-driven hero (class set by main.js; off under reduced motion) ---- */

.hero__steps {
  display: none;
}

.hero--pinned {
  overflow: visible;
}

.hero--pinned .hero__track {
  height: 420svh;
}

.hero--pinned .hero__sticky {
  position: sticky;
  top: var(--hh, 4.25rem);
  height: calc(100svh - var(--hh, 4.25rem));
  min-height: 28rem;
  overflow: hidden;
}

.hero--pinned .hero__body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--max);
  padding-top: 0;
  padding-bottom: 0;
  opacity: clamp(0, calc(1 - (var(--p, 0) - 0.03) * 16), 1);
  transform: translateY(calc(var(--p, 0) * -240px));
  pointer-events: none;
}

.hero--pinned .hero__body .actions a {
  pointer-events: auto;
}

.hero--pinned .hero__steps {
  display: block;
  position: absolute;
  inset: 0;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  list-style: none;
  pointer-events: none;
}

.pin-step {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 50%;
  max-width: 28rem;
  opacity: 0;
  transform: translateY(calc(-50% + 28px));
  transition:
    opacity 0.55s var(--ease),
    transform 0.7s var(--ease);
}

.pin-step.is-active {
  opacity: 1;
  transform: translateY(-50%);
}

.pin-step.is-past {
  transform: translateY(calc(-50% - 28px));
}

.pin-step__count {
  display: block;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.pin-step__title {
  color: var(--ink);
  font-weight: 300;
  font-size: clamp(2rem, 8vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.pin-step__text {
  margin-top: 1rem;
  color: var(--ink-2);
  font-size: clamp(1rem, 3.6vw, 1.2rem);
  text-wrap: pretty;
}

/* Stacked layout: the steps sit below the graph, like the body. */
.hero--stacked.hero--pinned .hero__body {
  justify-content: flex-end;
  padding-top: 14rem;
  padding-bottom: 1.5rem;
}

.hero--stacked .pin-step {
  top: auto;
  bottom: 2rem;
  transform: translateY(28px);
}

.hero--stacked .pin-step.is-active {
  transform: none;
}

.hero--stacked .pin-step.is-past {
  transform: translateY(-28px);
}

/* The graph sits above the title when it does not fit beside it (class set by main.js). */
.hero--stacked .hero__body {
  padding-top: 14.5rem;
}
