/* Antern Report Card — quiet luxury design tokens
   Photography-first, near-invisible UI, single quiet blue accent. */

:root {
  /* Single accent */
  --primary: #0066cc;
  --primary-focus: #0071e3;
  --primary-on-dark: #2997ff;

  /* Surfaces */
  --canvas: #ffffff;
  --canvas-parchment: #f5f5f7;
  --surface-pearl: #fbfbfd;
  --surface-tile-1: #1d1d1f;
  --surface-tile-2: #2a2a2c;
  --surface-tile-3: #161617;
  --surface-black: #000000;

  /* Text */
  --ink: #1d1d1f;
  --ink-muted-80: #333336;
  --ink-muted-60: #515154;
  --ink-muted-48: #6e6e73;
  --ink-muted-30: #a1a1a6;
  --ink-muted-15: #d2d2d7;
  --on-dark: #f5f5f7;
  --on-dark-muted: #a1a1a6;
  --on-dark-muted-2: #6e6e73;

  /* Hairlines */
  --hairline: #d2d2d7;
  --hairline-soft: #e8e8ed;
  --hairline-on-dark: rgba(255, 255, 255, 0.08);

  /* Status — muted, never neon */
  --positive: #1f6f43;
  --negative: #86383b;
  --neutral: #8a6d3b;

  /* Type */
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;
  --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;

  /* Spacing */
  --xxs: 4px; --xs: 8px; --sm: 12px; --md: 17px;
  --lg: 24px; --xl: 32px; --xxl: 48px; --section: 96px;

  /* Radius */
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-pill: 9999px;

  /* Single product shadow — used only on figure renders */
  --shadow-product: 0 30px 60px -20px rgba(0,0,0,0.18), 0 12px 30px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.028em;
  line-height: 1.06;
  text-wrap: balance;
}
.display-300 { font-weight: 300; letter-spacing: -0.022em; }
p { margin: 0; text-wrap: pretty; }
button { font-family: inherit; cursor: pointer; }

.wordmark { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.04em; }

.tabular { font-variant-numeric: tabular-nums; }

/* Scroll */
.thin-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.thin-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.14); border-radius: 999px; }
.thin-scroll::-webkit-scrollbar-track { background: transparent; }

/* ── Animations ───────────────────────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes shimmer-across {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes draw-line {
  from { stroke-dashoffset: var(--len, 1000); }
  to   { stroke-dashoffset: 0; }
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.rise { animation: rise 0.9s cubic-bezier(.2,.7,.2,1) both; }
.rise-d1 { animation-delay: .08s; } .rise-d2 { animation-delay: .16s; }
.rise-d3 { animation-delay: .24s; } .rise-d4 { animation-delay: .32s; }
.rise-d5 { animation-delay: .4s;  } .rise-d6 { animation-delay: .48s; }

.reveal-on-scroll { opacity: 0; transform: translateY(24px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal-on-scroll.in { opacity: 1; transform: none; }

/* Display number with optical thinning */
.hero-numeral {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.hero-numeral-thin {
  font-family: var(--font-display);
  font-weight: 200;
  letter-spacing: -0.04em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

/* Quiet pill button */
.btn-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-text); font-size: 14px; font-weight: 400;
  padding: 9px 18px; border-radius: 9999px; border: none;
  background: var(--primary); color: #fff;
  letter-spacing: -0.01em;
  transition: transform 0.18s ease;
}
.btn-pill:active { transform: scale(0.96); }
.btn-pill-ghost {
  background: transparent; color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-pill-ghost-dark {
  background: transparent; color: var(--on-dark);
  border: 1px solid rgba(255,255,255,0.22);
}

/* Eyebrow */
.eyebrow {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 500; color: var(--ink-muted-48);
}
.eyebrow-on-dark { color: var(--on-dark-muted); }
.eyebrow-blue { color: var(--primary); }

/* ── Responsive: tablet ≤ 900px ─────────────────────────────────────── */
@media (max-width: 900px) {
  /* Reduce horizontal section padding */
  section[style*="64px 64px"],
  section[style*="80px 64px"],
  section[style*="96px 64px"],
  section[style*="112px 64px"],
  section[style*="120px 64px"],
  section[style*="72px 64px"],
  footer[style*="48px 64px"] {
    padding-left: 32px !important;
    padding-right: 32px !important;
  }
  /* 4-col grids → 2-col */
  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* 2-col side-by-side → single col */
  div[style*="grid-template-columns: 1.2fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── Responsive: mobile ≤ 640px ─────────────────────────────────────── */
@media (max-width: 640px) {
  /* Tighter horizontal padding */
  section[style*="64px 64px"],
  section[style*="80px 64px"],
  section[style*="96px 64px"],
  section[style*="112px 64px"],
  section[style*="120px 64px"],
  section[style*="72px 64px"],
  footer[style*="48px 64px"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-top: 64px !important;
    padding-bottom: 56px !important;
  }
  /* All multi-col grids → single col */
  div[style*="grid-template-columns: repeat(4, 1fr)"],
  div[style*="grid-template-columns: repeat(3, 1fr)"],
  div[style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  /* Hero stat row borders: switch right-borders to bottom-borders when stacked */
  div[style*="repeat(4, 1fr)"] > div[style*="border-right"],
  div[style*="repeat(3, 1fr)"] > div[style*="border-right"] {
    border-right: none !important;
    border-bottom: 1px solid var(--hairline-on-dark) !important;
    padding-right: 0 !important;
    padding-bottom: 24px !important;
    padding-top: 24px !important;
  }
  div[style*="repeat(4, 1fr)"] > div:last-child,
  div[style*="repeat(3, 1fr)"] > div:last-child {
    border-bottom: none !important;
  }
  /* Funnel & leaderboard rows: stack the 4-column grids */
  div[style*="grid-template-columns: 220px 1fr"],
  div[style*="grid-template-columns: 60px 1fr"],
  div[style*="grid-template-columns: 1fr 130px"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  div[style*="grid-template-columns: 180px 1fr"] {
    grid-template-columns: 1fr 60px !important;
  }
  /* Big hero numerals */
  .hero-numeral, .hero-numeral-thin {
    font-size: clamp(40px, 11vw, 56px) !important;
  }
  /* Pipeline value range — let it wrap */
  span[style*="clamp(72px, 8vw, 120px)"],
  span[style*="clamp(72px, 9vw, 140px)"] {
    font-size: clamp(40px, 12vw, 64px) !important;
    display: inline-block;
  }
  /* h1/h2 down a notch */
  h1[style*="clamp(56px"] { font-size: clamp(40px, 9vw, 56px) !important; }
  h2[style*="clamp(40px"] { font-size: clamp(28px, 7vw, 40px) !important; }
  /* Pipeline pull-quote flex stack */
  div[style*="justify-content: space-between"][style*="align-items: flex-end"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 24px !important;
  }
  /* Donut + sentiment list inside Reply Intel — stack */
  div[style*="display: flex"][style*="gap: 36px"][style*="align-items: center"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 24px !important;
  }
  /* SectionHead and timeline cards: prevent fixed widths from bleeding */
  svg[viewBox] { max-width: 100% !important; height: auto !important; }
  /* Footer: stack and let copy wrap */
  footer > div[style*="justify-content: space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }
  /* Caveat badge popover: keep within viewport */
  div[style*="width: 380px"] {
    width: calc(100vw - 60px) !important;
    max-width: 380px !important;
  }
  /* Top nav: collapse extra space */
  nav, header { font-size: 13px !important; }
  /* Hero-name size — Abhijeet P. Singh @ 96px wraps weirdly on mobile */
  h1[style*="clamp(56px, 7vw, 96px)"] {
    font-size: clamp(36px, 9vw, 56px) !important;
  }
  /* Cohort directory cards already use auto-fill minmax(280px) — keep, already responsive */
  /* Funnel row: label spans full width on top, bar+value on second row, % hidden */
  div[style*="grid-template-columns: 220px 1fr 110px 110px"] {
    grid-template-columns: 1fr 80px !important;
    grid-template-rows: auto auto !important;
    gap: 4px 12px !important;
  }
  div[style*="grid-template-columns: 220px 1fr 110px 110px"] > div:nth-child(1) {
    grid-column: 1 / -1 !important;
  }
  div[style*="grid-template-columns: 220px 1fr 110px 110px"] > div:nth-child(4) {
    display: none !important;
  }
}

/* ── Tiny phones ≤ 380px ───────────────────────────────────────────── */
@media (max-width: 380px) {
  section[style*="64px"],
  section[style*="80px"],
  section[style*="96px"],
  section[style*="112px"],
  section[style*="120px"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* ── Hide horizontal overflow at body level ─────────────────────────── */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Decorative radial-gradient backgrounds: don't let them push body width */
section > div[style*="radial-gradient"] { max-width: 100vw !important; }

/* ── Mobile nav fixes ≤ 640px ──────────────────────────────────────── */
@media (max-width: 640px) {
  /* Hide date label + extra nav links on mobile to free space */
  header > div[style*="margin-left: auto"] > span { display: none !important; }
  header > nav > button:nth-child(n+3) { display: none !important; }
  header > nav { gap: 16px !important; margin-left: 18px !important; }
  /* Switch student popover on mobile: full-width */
  div[style*="position: absolute"][style*="width: 380px"] {
    width: calc(100vw - 24px) !important;
    right: 12px !important;
    left: 12px !important;
  }
}
