/* ============================================================
   码猿新官网 — 设计系统
   ============================================================ */

:root {
  /* ——— Palette: 默认"克制编辑式" ——— */
  --ink: #0e0f12;          /* 主文字 / 深色块 */
  --ink-2: #2a2c33;        /* 次级深 */
  --paper: #f5f1e8;        /* 暖米 */
  --paper-2: #ece6d6;      /* 米的下一档 */
  --paper-3: #faf7ef;      /* 更浅米 */
  --line: #1a1b1f;         /* 线条 */
  --line-soft: #d8d2c2;    /* 浅线 */
  --muted: #6b6a64;        /* 次级文字 */

  --accent: #ff6a3d;       /* 信号橙 */
  --accent-2: #0e3a2e;     /* 深松绿 */
  --accent-3: #f4c542;     /* 金 */

  /* ——— Type ——— */
  --font-display: 'Noto Serif SC', 'Source Serif Pro', 'Songti SC', 'STSong', serif;
  --font-sans: 'HarmonyOS Sans SC', 'PingFang SC', 'Inter', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* ——— Layout ——— */
  --max: 1320px;
  --gutter: 32px;
  --section-pad: 120px;
  --radius: 4px;
  --radius-lg: 14px;

  /* ——— Density (Tweakable) ——— */
  --pad-mult: 1;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.serif { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: calc(var(--section-pad) * var(--pad-mult)) 0;
  border-top: 1px solid var(--line-soft);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 28px; height: 1px; background: currentColor;
}

.h-section {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 18px 0 0;
  text-wrap: balance;
}

.subhead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 620px;
  margin-top: 18px;
  text-wrap: pretty;
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper-3);
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper-3); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn .arrow {
  width: 16px; height: 16px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.btn:hover .arrow { transform: rotate(45deg) translate(2px, -2px); }

/* ——— News Carousel ——— */
.news-band {
  background: var(--paper);
  border-bottom: 1px solid var(--line-soft);
}
.carousel {
  position: relative;
  height: 460px;
  overflow: hidden;
  background: var(--ink);
}
.carousel .slides {
  position: absolute; inset: 0;
}
.carousel .slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity .8s ease;
  pointer-events: none;
}
.carousel .slide.active {
  opacity: 1;
  pointer-events: auto;
}
.carousel .slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.carousel .slide image-slot {
  display: block;
  width: 100%; height: 100%;
}
.carousel .slide .ph {
  width: 100%; height: 100%;
  background:
    repeating-linear-gradient(45deg,
      var(--paper-2) 0 24px,
      var(--paper-3) 24px 48px);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--muted); letter-spacing: 0.2em;
}
.carousel .overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(14,15,18,0) 35%, rgba(14,15,18,0.0) 50%, rgba(14,15,18,0.85) 100%),
    linear-gradient(90deg, rgba(14,15,18,0.55), rgba(14,15,18,0.0) 55%);
}
.carousel .caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0 var(--gutter) 56px;
  color: var(--paper-3);
}
.carousel .caption .inner {
  max-width: var(--max);
  margin: 0 auto;
}
.carousel .tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.carousel .tag::before {
  content: '';
  width: 28px; height: 1px; background: currentColor;
}
.carousel h3 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 52px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 14px 0 12px;
  max-width: 820px;
  text-wrap: balance;
}
.carousel .meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(245,241,232,0.65);
  display: flex; gap: 18px; align-items: center;
}
.carousel .meta .sep { color: rgba(245,241,232,0.3); }
.carousel .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(245,241,232,0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(245,241,232,0.2);
  display: grid; place-items: center;
  cursor: pointer;
  color: #fff;
  transition: background .2s ease, transform .2s ease;
  z-index: 5;
}
.carousel .nav:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-50%) scale(1.05); }
.carousel .nav.prev { left: 32px; }
.carousel .nav.next { right: 32px; }
.carousel .nav .arr {
  width: 12px; height: 12px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}
.carousel .nav.prev .arr { transform: rotate(-135deg); margin-left: 4px; }
.carousel .nav.next .arr { transform: rotate(45deg); margin-right: 4px; }
.carousel .dots {
  position: absolute;
  bottom: 24px; right: 40px;
  display: flex; gap: 8px;
  z-index: 5;
}
.carousel .dots span {
  width: 32px; height: 3px;
  background: rgba(245,241,232,0.3);
  cursor: pointer;
  transition: background .25s ease, width .25s ease;
}
.carousel .dots span.on { background: var(--accent); width: 56px; }
.carousel .counter {
  position: absolute;
  top: 28px; right: 40px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  color: rgba(245,241,232,0.7);
  z-index: 5;
}
.carousel .counter b { color: #fff; font-weight: 600; }

@media (max-width: 800px) {
  .carousel { height: 360px; }
  .carousel .nav { display: none; }
  .carousel .caption { padding-bottom: 40px; }
  .carousel .dots { left: var(--gutter); right: var(--gutter); justify-content: center; }
  .carousel .counter { right: var(--gutter); }
}

/* ——— Topbar ——— */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 241, 232, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .row {
  display: flex; align-items: center; gap: 40px;
  height: 64px;
}
.topbar nav { display: flex; gap: 28px; font-size: 14px; }
.topbar nav a { color: var(--ink-2); position: relative; padding: 4px 0; }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -22px;
  height: 2px; background: var(--ink);
}
.topbar .spacer { flex: 1; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
}
.brand img.logo-full {
  height: 36px; width: auto;
  display: block;
}
.brand .tagline {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.15em;
  color: var(--muted);
  padding-left: 12px;
  border-left: 1px solid var(--line-soft);
  margin-left: 4px;
}

/* ——— Hero ——— */
.hero {
  padding: 60px 0 var(--section-pad);
  border-top: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: end;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(56px, 7vw, 112px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.hero h1 .underline {
  position: relative; display: inline-block;
}
.hero h1 .underline::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 4px;
  height: 12px; background: var(--accent-3); z-index: -1;
  border-radius: 999px;
}
.hero .lede {
  font-size: 20px; line-height: 1.55;
  color: var(--ink-2);
  max-width: 540px;
  margin-top: 36px;
}
.hero-actions {
  margin-top: 40px;
  display: flex; gap: 14px; flex-wrap: wrap;
}
.hero-meta {
  margin-top: 56px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  border-top: 1px solid var(--line-soft);
  padding-top: 28px;
}
.hero-meta .num {
  font-family: var(--font-display);
  font-size: 44px; font-weight: 600; letter-spacing: -0.02em;
  line-height: 1;
}
.hero-meta .num sup { font-size: 18px; color: var(--accent); vertical-align: super; }
.hero-meta .lbl { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ——— Code panel ——— */
.code-panel {
  background: var(--ink);
  color: #e8e4d6;
  border-radius: var(--radius-lg);
  padding: 22px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(14,15,18,0.4);
}
.code-panel::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at top right, rgba(255,106,61,0.12), transparent 50%);
  pointer-events: none;
}
.code-panel .head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.code-panel .dots { display: flex; gap: 6px; }
.code-panel .dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
}
.code-panel .title {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
}
.code-panel .ln {
  display: flex; gap: 16px;
  white-space: pre;
}
.code-panel .ln .n { color: rgba(255,255,255,0.25); width: 18px; text-align: right; user-select: none; }
.tok-kw { color: #ff8a64; }
.tok-fn { color: #ffd86b; }
.tok-str { color: #87d2a3; }
.tok-com { color: #6b6a64; font-style: italic; }
.tok-num { color: #c7a2ff; }
.tok-var { color: #e8e4d6; }

.code-cursor::after {
  content: '▍';
  color: var(--accent);
  animation: blink 1s steps(2) infinite;
  margin-left: 2px;
}
@keyframes blink { to { opacity: 0; } }

/* ——— Marquee bar ——— */
.marquee {
  background: var(--ink);
  color: var(--paper-3);
  padding: 18px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
}
.marquee-track {
  display: flex; gap: 60px;
  animation: marquee 40s linear infinite;
  width: max-content;
  font-family: var(--font-display);
  font-size: 22px;
  white-space: nowrap;
}
.marquee-track span {
  display: inline-flex; align-items: center; gap: 60px;
}
.marquee-track .star {
  width: 18px; height: 18px; flex-shrink: 0;
  background: var(--accent);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ——— Section heading row ——— */
.head-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: end;
  margin-bottom: 64px;
}

/* ——— Course tracks ——— */
.tracks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.track-card {
  border: 1px solid var(--line-soft);
  background: var(--paper-3);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  transition: border-color .25s ease, transform .25s ease;
  display: flex; flex-direction: column;
  min-height: 540px;
}
.track-card:hover { border-color: var(--ink); transform: translateY(-3px); }
.track-card .num {
  font-family: var(--font-mono);
  font-size: 13px; color: var(--muted);
}
.track-card .age {
  position: absolute; top: 28px; right: 28px;
  font-family: var(--font-mono); font-size: 12px;
  padding: 4px 10px; border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
}
.track-card h3 {
  font-family: var(--font-display);
  font-size: 40px; font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.05;
  margin: 24px 0 6px;
}
.track-card .zh {
  font-size: 16px; color: var(--muted); margin-bottom: 28px;
}
.track-card .preview {
  flex: 1; margin-bottom: 24px;
  background: var(--paper-2);
  border-radius: 8px;
  position: relative; overflow: hidden;
  min-height: 180px;
}
.track-card .desc {
  font-size: 14px; line-height: 1.6; color: var(--ink-2);
  margin-bottom: 20px;
}
.track-card .feat {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px 16px;
}
.track-card .feat span::before {
  content: '+'; color: var(--accent); margin-right: 6px;
}

/* ——— Path / stages ——— */
.path {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 56px;
}
.path .stage {
  border: 1px solid var(--line-soft);
  background: var(--paper-3);
  border-radius: 12px;
  padding: 24px 20px 28px;
  position: relative;
  transition: all .25s ease;
  cursor: pointer;
}
.path .stage:hover { background: var(--ink); color: var(--paper-3); border-color: var(--ink); }
.path .stage:hover .stage-age { color: var(--accent-3); }
.path .stage:hover .stage-num { color: rgba(255,255,255,0.4); }
.path .stage:hover .stage-sub { color: rgba(255,255,255,0.6); }
.path .stage-num {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  letter-spacing: 0.1em;
}
.path .stage-age {
  display: inline-block;
  font-family: var(--font-mono); font-size: 11px;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 600;
}
.path .stage-name {
  font-family: var(--font-display); font-size: 28px; font-weight: 600;
  letter-spacing: -0.02em;
  margin: 8px 0 6px;
  line-height: 1.1;
}
.path .stage-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ——— 5Es ——— */
.fives-wrap {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 80px;
  align-items: start;
  margin-top: 56px;
}
.fives {
  display: grid; gap: 0;
}
.fives .row {
  display: grid; grid-template-columns: 60px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.fives .row:first-child { border-top: 1px solid var(--line-soft); }
.fives .row .e {
  font-family: var(--font-display);
  font-size: 56px; font-weight: 600;
  letter-spacing: -0.04em; line-height: 1;
  color: var(--accent);
}
.fives .row h4 {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 600;
  margin: 0 0 4px;
}
.fives .row .en {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--muted); letter-spacing: 0.1em;
}
.fives .row p { font-size: 14px; color: var(--ink-2); margin: 10px 0 0; max-width: 480px; }

.smallclass {
  background: var(--ink);
  color: var(--paper-3);
  border-radius: var(--radius-lg);
  padding: 36px;
  position: sticky; top: 100px;
}
.smallclass .big {
  font-family: var(--font-display);
  font-size: 120px; font-weight: 600;
  letter-spacing: -0.04em; line-height: 1;
}
.smallclass .big sup {
  font-size: 36px; color: var(--accent);
  font-family: var(--font-mono); font-weight: 400;
  vertical-align: super; margin-left: 4px;
}
.smallclass h4 { font-family: var(--font-display); font-size: 28px; margin: 16px 0 12px; font-weight: 500; }
.smallclass p { font-size: 14px; color: rgba(245,241,232,0.7); max-width: 320px; }
.smallclass .seats {
  margin-top: 24px;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px;
}
.smallclass .seats span {
  aspect-ratio: 1; border-radius: 50%;
  background: rgba(245,241,232,0.18);
}
.smallclass .seats span.filled { background: var(--accent); }

/* ——— Faculty ——— */
.faculty {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-top: 48px;
}
.teacher {
  border: 1px solid var(--line-soft);
  background: var(--paper-3);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  transition: transform .25s ease;
}
.teacher:hover { transform: translateY(-3px); }
.teacher .ph {
  aspect-ratio: 4 / 5;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}
.teacher .ph image-slot {
  display: block;
  width: 100%; height: 100%;
}
.teacher .info { padding: 18px 18px 20px; }
.teacher .name { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.teacher .title { font-size: 13px; color: var(--muted); margin-top: 2px; }
.teacher .badges {
  margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px;
}
.teacher .badges span {
  font-family: var(--font-mono); font-size: 10px;
  padding: 3px 8px;
  background: var(--ink); color: var(--paper-3);
  border-radius: 999px;
}

/* ——— Results / leaderboard ——— */
.results-grid {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 60px;
  margin-top: 56px;
}
.medals {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--paper-3);
  padding: 36px;
}
.medals .ring {
  width: 100%;
  aspect-ratio: 1;
  position: relative;
  margin: 12px 0 28px;
}
.medal-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px;
}
.medal-stats .num {
  font-family: var(--font-display);
  font-size: 42px; font-weight: 600; letter-spacing: -0.02em; line-height: 1;
}
.medal-stats .lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }

.leaderboard {
  border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper-3);
}
.lb-head {
  display: grid; grid-template-columns: 50px 1fr 100px 90px 80px;
  gap: 14px;
  padding: 16px 24px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}
.lb-row {
  display: grid; grid-template-columns: 50px 1fr 100px 90px 80px;
  gap: 14px; align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  transition: background .15s ease;
}
.lb-row:hover { background: var(--paper-2); }
.lb-row:last-child { border-bottom: none; }
.lb-row .rank {
  font-family: var(--font-mono); color: var(--muted);
}
.lb-row .rank.top { color: var(--accent); font-weight: 700; }
.lb-row .name { font-weight: 500; }
.lb-row .name small { color: var(--muted); font-weight: 400; margin-left: 8px; }
.lb-row .award { font-family: var(--font-mono); font-size: 12px; }
.lb-row .award.gold { color: var(--accent-3); font-weight: 700; }
.lb-row .award.silver { color: #b8b6a7; font-weight: 600; }
.lb-row .award.bronze { color: #c08a5e; }
.lb-row .yr { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.lb-row .school { font-size: 12px; color: var(--muted); }

/* ——— Campuses ——— */
.campuses {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-top: 56px;
}
.campus {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper-3);
  transition: transform .25s ease, border-color .25s ease;
}
.campus:hover { border-color: var(--ink); transform: translateY(-3px); }
.campus .ph {
  aspect-ratio: 4/3;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}
.campus .ph image-slot {
  display: block;
  width: 100%; height: 100%;
}
.campus .info { padding: 20px 22px 22px; }
.campus h4 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0; }
.campus .addr { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.55; }
.campus .meta {
  margin-top: 14px;
  display: flex; gap: 14px;
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
}
.campus .meta .dot { color: var(--accent); }

/* ——— Recommender widget ——— */
.recommender {
  background: var(--ink);
  color: var(--paper-3);
  border-radius: 20px;
  padding: 56px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.recommender::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at bottom right, rgba(255,106,61,0.18), transparent 55%);
  pointer-events: none;
}
.recommender h2 {
  font-family: var(--font-display);
  font-size: 48px; font-weight: 600; letter-spacing: -0.02em;
  margin: 14px 0 16px; line-height: 1.05;
}
.recommender p { color: rgba(245,241,232,0.7); max-width: 380px; font-size: 15px; }
.age-picker {
  position: relative; z-index: 1;
}
.age-display {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 12px;
}
.age-display .v {
  font-family: var(--font-display);
  font-size: 96px; font-weight: 600; letter-spacing: -0.04em; line-height: 1;
}
.age-display .v sup { color: var(--accent); font-size: 36px; }
.age-display .l { color: rgba(245,241,232,0.6); font-family: var(--font-mono); font-size: 13px; }
.age-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: rgba(245,241,232,0.18);
  border-radius: 999px;
  outline: none;
  margin-bottom: 24px;
}
.age-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px;
  background: var(--accent); border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 1px var(--accent);
}
.age-slider::-moz-range-thumb {
  width: 22px; height: 22px; background: var(--accent); border-radius: 50%;
  cursor: pointer; border: 3px solid var(--ink);
}
.rec-result {
  background: rgba(245,241,232,0.06);
  border: 1px solid rgba(245,241,232,0.12);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  transition: all .3s ease;
}
.rec-result .lbl { font-family: var(--font-mono); font-size: 11px; color: rgba(245,241,232,0.5); letter-spacing: 0.15em; }
.rec-result h4 { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin: 6px 0 4px; }
.rec-result .reason { font-size: 13px; color: rgba(245,241,232,0.7); }
.rec-result .tag {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--font-mono); font-size: 11px;
  padding: 4px 10px;
  background: var(--accent); color: var(--ink);
  border-radius: 999px;
  font-weight: 600;
}

/* ——— Partnership CTA ——— */
.partner {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.partner h2 {
  font-family: var(--font-display);
  font-size: clamp(48px, 5.5vw, 80px);
  font-weight: 600; letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
}
.partner-steps {
  display: grid; gap: 0;
}
.partner-steps .s {
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
  display: grid; grid-template-columns: 80px 1fr;
  gap: 24px; align-items: baseline;
}
.partner-steps .s:last-child { border-bottom: 1px solid var(--line-soft); }
.partner-steps .s .n {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.15em;
}
.partner-steps .s h5 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0; }
.partner-steps .s p { font-size: 14px; color: var(--muted); margin: 6px 0 0; }

/* ——— Footer ——— */
.footer {
  background: var(--ink);
  color: var(--paper-3);
  padding: 80px 0 36px;
}
.footer .row1 {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 60px;
  padding-bottom: 64px;
  border-bottom: 1px solid rgba(245,241,232,0.12);
}
.footer h6 {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.2em;
  color: rgba(245,241,232,0.5);
  margin: 0 0 18px;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { padding: 6px 0; font-size: 14px; color: rgba(245,241,232,0.8); }
.footer li:hover { color: var(--accent); cursor: pointer; }
.footer .big-mark {
  font-family: var(--font-display);
  font-size: 96px; font-weight: 600;
  letter-spacing: -0.04em; line-height: 0.9;
  margin: -8px 0 18px;
}
.footer .row2 {
  padding-top: 28px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 12px;
  color: rgba(245,241,232,0.4);
}

.qr-row {
  display: flex; gap: 20px;
  margin-top: 20px;
}
.qr-cell {
  text-align: center;
}
.qr-cell img.qr {
  display: block;
  width: 120px; height: 120px;
  object-fit: contain;
  background: #fff;
  padding: 6px;
  border-radius: 10px;
  margin-bottom: 10px;
  box-sizing: border-box;
}
.qr-cell image-slot {
  display: block;
  width: 96px; height: 96px;
  background: var(--paper-3);
  border-radius: 8px;
  margin-bottom: 8px;
}
.qr-cell .qr-label {
  font-family: var(--font-mono); font-size: 10px;
  color: rgba(245,241,232,0.55);
  letter-spacing: 0.1em;
  line-height: 1.4;
}

/* ——— Responsive ——— */
@media (max-width: 980px) {
  .hero-grid, .head-row, .fives-wrap, .results-grid, .partner, .recommender { grid-template-columns: 1fr; gap: 40px; }
  .tracks, .faculty, .campuses { grid-template-columns: 1fr 1fr; }
  .path { grid-template-columns: 1fr 1fr; }
  .hero-meta { grid-template-columns: repeat(3, 1fr); }
  .topbar nav { display: none; }
}
@media (max-width: 600px) {
  .tracks, .faculty, .campuses { grid-template-columns: 1fr; }
  .path { grid-template-columns: 1fr; }
  .hero h1 { font-size: 56px; }
  .recommender { padding: 36px 24px; }
  .footer .row1 { grid-template-columns: 1fr 1fr; }
}

/* ——— Mascot ——— */
.mascot-float {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.15));
}
.recommender .mascot-float {
  right: -30px; bottom: -40px;
  width: 240px;
  transform: rotate(-8deg);
  z-index: 0;
}
.footer .mascot-float {
  position: relative;
  width: 88px;
  margin-bottom: 12px;
  transform: rotate(-6deg);
}

/* ——— Variants via Tweaks ——— */
body[data-palette="brand"] {
  --paper: #f0f8fc;
  --paper-2: #dbeefa;
  --paper-3: #ffffff;
  --ink: #0f3a55;
  --ink-2: #1e5a82;
  --line-soft: #c5e2f2;
  --accent: #5bb7e8;
  --accent-2: #1e89c7;
  --accent-3: #ffb84d;
}
body[data-palette="brand"] .topbar { background: rgba(240,248,252,0.86); }
body[data-palette="brand"] .btn { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
body[data-palette="brand"] .btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
body[data-palette="brand"] .btn--ghost:hover { background: var(--ink); color: var(--paper-3); }
body[data-palette="brand"] .btn--accent { background: var(--accent-3); border-color: var(--accent-3); color: var(--ink); }
body[data-palette="brand"] .hero h1 em { color: var(--accent-2); }
body[data-palette="brand"] .hero h1 .underline::after { background: var(--accent-3); }

body[data-palette="forest"] {
  --paper: #f0ebdc;
  --paper-3: #f7f2e2;
  --accent: #0e3a2e;
  --accent-2: #ff6a3d;
}
body[data-palette="dawn"] {
  --paper: #fdf6f0;
  --paper-3: #fffbf6;
  --paper-2: #f5e6d4;
  --accent: #d94d1a;
  --accent-3: #f4c542;
}
body[data-palette="paper"] {
  --paper: #ffffff;
  --paper-2: #f0ece2;
  --paper-3: #fafaf6;
  --accent: #1a1b1f;
  --accent-3: #ffd84d;
}
body[data-palette="dark"] {
  --paper: #0e0f12;
  --paper-2: #1a1b1f;
  --paper-3: #15161a;
  --ink: #f5f1e8;
  --ink-2: #d8d2c2;
  --muted: #8a877e;
  --line-soft: #2a2c33;
  --line: #f5f1e8;
}
body[data-palette="dark"] .topbar { background: rgba(14,15,18,0.86); }
body[data-palette="dark"] .btn { background: var(--paper-3); color: var(--paper); border-color: var(--paper-3); }
body[data-palette="dark"] .btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
body[data-palette="dark"] .btn--ghost:hover { background: var(--ink); color: var(--paper); }

body[data-sans-display="true"] {
  --font-display: var(--font-sans);
}
body[data-sans-display="true"] .serif,
body[data-sans-display="true"] .hero h1,
body[data-sans-display="true"] .h-section,
body[data-sans-display="true"] .brand,
body[data-sans-display="true"] .track-card h3,
body[data-sans-display="true"] .path .stage-name,
body[data-sans-display="true"] .fives .row .e,
body[data-sans-display="true"] .fives .row h4,
body[data-sans-display="true"] .teacher .name,
body[data-sans-display="true"] .campus h4,
body[data-sans-display="true"] .recommender h2,
body[data-sans-display="true"] .age-display .v,
body[data-sans-display="true"] .rec-result h4,
body[data-sans-display="true"] .partner h2,
body[data-sans-display="true"] .partner-steps .s h5,
body[data-sans-display="true"] .smallclass .big,
body[data-sans-display="true"] .smallclass h4,
body[data-sans-display="true"] .medal-stats .num,
body[data-sans-display="true"] .hero-meta .num,
body[data-sans-display="true"] .footer .big-mark {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.025em;
}

body[data-density="loose"] { --pad-mult: 1.25; }
body[data-density="tight"] { --pad-mult: 0.75; }
