/* ---------- Tokens ---------- */
:root {
  --black: #000000;
  --white: #f5f5f7;
  --muted: #a1a1a6;
  --dim: #6e6e73;
  --line: rgba(255, 255, 255, 0.12);
  --glow-a: #5ac8fa;
  --glow-b: #bf5af2;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --t-hero: clamp(52px, 9.6vw, 150px);
  --t-display: clamp(40px, 6.4vw, 88px);
  --t-lede: clamp(19px, 1.7vw, 24px);
  --t-small: 14px;

  --gutter: clamp(20px, 5vw, 64px);
  --measure: 34ch;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--black);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

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

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

/* ---------- Type ---------- */
.display {
  font-size: var(--t-display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

.lede {
  font-size: var(--t-lede);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--muted);
  max-width: var(--measure);
  margin: 0 0 1em;
}
.lede:last-child { margin-bottom: 0; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: 52px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.nav-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-link:hover { color: var(--white); }

.nav-cta {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--white);
  color: var(--black);
  transition: transform 0.25s var(--ease), background 0.25s;
}
.nav-cta:hover { background: #ffffff; transform: translateY(-1px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: end center;
  overflow: hidden;
  padding-bottom: clamp(64px, 9vh, 96px);
}

.hero-portrait {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  pointer-events: none;
}

.hero-portrait img {
  width: auto;
  height: min(74svh, 1157px);
  max-width: none;
  object-fit: cover;
  object-position: top center;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 96%);
  opacity: 0;
  transform: scale(1.04);
  animation: hero-photo 1.6s var(--ease) 0.1s forwards;
}

.hero-copy {
  position: relative;
  text-align: center;
  z-index: 1;
}

.hero-title {
  font-size: var(--t-hero);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.05em;
  margin: 0;
  opacity: 0;
  transform: translateY(24px);
  animation: hero-text 1.1s var(--ease) 0.9s forwards;
}

.hero-sub {
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--muted);
  margin: 0.5em 0 0;
  opacity: 0;
  transform: translateY(16px);
  animation: hero-text 1.1s var(--ease) 1.25s forwards;
}

/* Proof strip */
.proof {
  list-style: none;
  margin: clamp(36px, 6vh, 64px) auto 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 0;
  max-width: 1040px;
  opacity: 0;
  transform: translateY(16px);
  animation: hero-text 1.1s var(--ease) 1.6s forwards;
}
.proof-item {
  flex: 1 1 0;
  padding: 4px clamp(20px, 3vw, 44px);
  text-align: left;
  border-left: 1px solid var(--line);
}
.proof-item:first-child { border-left: 0; }
.proof-value {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3em;
}
.yc-mark {
  display: block;
  width: 1em;
  height: 1em;
  border-radius: 0.14em;
  flex: none;
}
.proof-label {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 22px;
  height: 36px;
  margin-left: -11px;
  border: 1.5px solid var(--dim);
  border-radius: 12px;
  opacity: 0;
  animation: hero-text 1s var(--ease) 2s forwards;
}
.scroll-hint span {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 3px;
  height: 6px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--muted);
  animation: scroll-dot 1.8s ease-in-out infinite;
}

@keyframes hero-photo { to { opacity: 1; transform: scale(1); } }
@keyframes hero-text { to { opacity: 1; transform: none; } }
@keyframes scroll-dot {
  0%, 100% { transform: translateY(0); opacity: 1; }
  60% { transform: translateY(12px); opacity: 0; }
  61% { transform: translateY(0); opacity: 0; }
}

/* ---------- Chapters ---------- */
.chapter {
  position: relative;
  padding: clamp(96px, 18vh, 200px) var(--gutter);
}

.chapter-text {
  min-height: 80svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.chapter-text .lede { margin-left: auto; margin-right: auto; }
.chapter-inner { max-width: 1040px; }

.chapter-insight {
  background: radial-gradient(60% 50% at 50% 50%, rgba(255, 255, 255, 0.045), transparent 70%);
}

/* Quote */
.chapter-quote {
  min-height: 90svh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.chapter-quote .chapter-inner { max-width: 1100px; }
.chapter-quote .lede { margin: 2.5em auto 0; }

.quote-context {
  font-size: var(--t-lede);
  color: var(--muted);
  max-width: 44ch;
  margin: 0 auto 1.6em;
  line-height: 1.45;
}

.quote { margin: 0; }
.quote p {
  font-size: clamp(34px, 5.2vw, 76px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 6vw, 96px);
  margin-top: clamp(56px, 8vh, 96px);
  width: 100%;
  max-width: 800px;
}
.stat { text-align: center; }
.stat-value {
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  margin-top: 12px;
  font-size: 17px;
  color: var(--muted);
  line-height: 1.4;
}

/* Split (photo + copy) */
.chapter-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 7vw, 120px);
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.split-photo {
  margin: 0;
  border-radius: 28px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: #0a0a0a;
}
.split-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.split-copy {
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 7vh, 96px);
  container-type: inline-size;
}

/* Counter: the one accent moment */
.counter-value {
  font-size: clamp(40px, 13.5cqw, 150px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, #ffffff 0%, var(--glow-a) 45%, var(--glow-b) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.counter-label {
  margin-top: 14px;
  font-size: var(--t-lede);
  color: var(--muted);
}

/* Photo chapters with the photo on the left */
#bay { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
#yc { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split-photo-tall { aspect-ratio: 3 / 4; }
.split-photo-tall img { object-position: center 12%; }

.chapter-sully { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

/* Closing */
.chapter-close {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 7vw, 120px);
  max-width: 1400px;
  margin: 0 auto;
  padding-bottom: clamp(120px, 20vh, 220px);
}
.close-photo {
  margin: 0;
  aspect-ratio: 2 / 3;
  border-radius: 28px;
  overflow: hidden;
  background: #0a0a0a;
}
.close-photo img { width: 100%; height: 100%; object-fit: cover; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--white);
  color: var(--black);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  transition: transform 0.3s var(--ease), background 0.3s;
}
.button:hover { background: #ffffff; transform: translateY(-2px); }

.button-secondary {
  background: transparent;
  color: var(--white);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}
.button-secondary:hover { background: rgba(255, 255, 255, 0.08); }

/* Footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: space-between;
  padding: 28px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: var(--t-small);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--dim); transition: color 0.2s; }
.footer-links a:hover { color: var(--white); }

/* Screen-reader-only text (keeps full names in the HTML next to icons) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-link { color: var(--white); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,0.3); }
.text-link:hover { text-decoration-color: var(--white); }

/* About page */
.page { padding: calc(52px + clamp(56px, 10vh, 120px)) var(--gutter) clamp(96px, 14vh, 160px); }
.page-inner { max-width: 720px; margin: 0 auto; }
.page-header { margin-bottom: clamp(40px, 7vh, 72px); }
.page-header .display { margin-bottom: 0.4em; }
.page-header .lede { max-width: none; }
.prose section { margin: 0 0 clamp(48px, 7vh, 80px); scroll-margin-top: 80px; }
.prose h2 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 0.6em;
}
.prose h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 1.6em 0 0.4em;
  color: var(--white);
}
.prose p, .prose li {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}
.prose p { margin: 0 0 1em; }
.prose p strong { color: var(--white); font-weight: 500; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose a { color: var(--white); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,0.3); }
.prose a:hover { text-decoration-color: var(--white); }
.prose figure { margin: 0 0 2em; border-radius: 20px; overflow: hidden; }
.prose figcaption { font-size: 14px; color: var(--dim); margin-top: 10px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 24px; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--white); }
.timeline strong { color: var(--white); font-weight: 500; }
.faq h3 { margin-top: 1.4em; }
.summary-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 32px);
  margin: 0 0 clamp(48px, 7vh, 80px);
}
.summary-card p:last-child { margin-bottom: 0; }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .chapter-split,
  .chapter-close {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .chapter-sully .split-photo { order: -1; }
  .split-copy { width: 100%; }
  .split-photo,
  .close-photo {
    aspect-ratio: 4 / 5;
    max-width: 440px;
  }
  .split-photo-tall { aspect-ratio: 3 / 4; }
  #bay, #yc, .chapter-sully { grid-template-columns: 1fr; }
  #yc .split-photo { order: -1; }
  .stats { gap: 40px; }
}

@media (max-width: 720px) {
  .proof { flex-direction: column; align-items: stretch; gap: 20px; max-width: 320px; }
  .proof-item { border-left: 0; padding: 0; }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .hero-portrait img { height: 58svh; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-portrait img,
  .hero-title,
  .hero-sub,
  .proof,
  .scroll-hint { animation: none; opacity: 1; transform: none; }
  .scroll-hint span { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
