/* ============================================================
   LUMEN TUTORING — modern design system (v3 · theming)
   ============================================================ */

:root {
  /* surfaces */
  --bg: #F7F4EF;
  --bg-2: #FBF9F5;
  --bg-3: #FCFAF6;

  /* text (flips) */
  --ink: #1A1A1A;
  --ink-rgb: 26, 26, 26;

  /* brand — green stays for solid surfaces; sage subdued */
  --green: #1F3A2E;
  --green-deep: #152619;
  --green-soft: #27543f;
  --sage: #9DBBA9;
  --sage-deep: #6f9582;

  /* always-light text for green / dark panels */
  --on-green: #F7F4EF;
  --on-green-rgb: 247, 244, 239;

  /* always-dark panel (contact + footer) */
  --panel: #161616;

  /* text accent (flips) */
  --accent: #1F3A2E;
  --accent-rgb: 31, 58, 46;

  /* lines */
  --line: #E4DED4;

  /* type */
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;

  /* layout */
  --maxw: 1320px;
  --pad: clamp(20px, 5vw, 72px);
  --radius: 24px;

  /* motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.9s;

  --shadow-card: 0 30px 60px -34px rgba(26, 26, 26, 0.45);
  --shadow-soft: 0 18px 40px -28px rgba(26, 26, 26, 0.3);

  color-scheme: light;
}

/* ---------- DARK ---------- */
[data-theme="dark"] {
  --bg: #14140F;
  --bg-2: #1d1c17;
  --bg-3: #24231d;
  --ink: #ECE7DC;
  --ink-rgb: 236, 231, 220;
  --accent: #8FB09E;
  --accent-rgb: 143, 176, 158;
  --line: rgba(236, 231, 220, 0.13);
  --panel: #0e0d0a;
  --shadow-card: 0 30px 60px -34px rgba(0, 0, 0, 0.6);
  --shadow-soft: 0 18px 40px -28px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(85% 50% at 50% -12%, rgba(var(--accent-rgb), 0.06), transparent 60%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}
/* fast, GPU crossfade when switching themes (where supported) */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.25s; animation-timing-function: ease; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; }
em { font-style: italic; }
::selection { background: var(--accent); color: var(--bg); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
input::placeholder, textarea::placeholder { color: rgba(var(--ink-rgb), 0.35); }

/* shared type helpers */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 22px;
}
.eyebrow--dot .dot {
  position: relative;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.16);
}
.eyebrow--dot .dot::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  background: rgba(var(--accent-rgb), 0.16);
  opacity: 0.5;
  transform: scale(0.45);
  animation: dotPulse 2.8s ease-out infinite;
  will-change: opacity, transform;
}
@keyframes dotPulse {
  0%, 100% { opacity: 0.52; transform: scale(0.45); }
  55% { opacity: 0; transform: scale(1); }
}
.eyebrow--light { color: rgba(var(--on-green-rgb), 0.62); }
.eyebrow--sage { color: var(--sage); }

.section-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(34px, 5vw, 58px); line-height: 1.04;
  letter-spacing: 0; text-wrap: balance;
}
.section-title em { color: var(--accent); }
.section-title--light { color: var(--on-green); }
.section-title--light em { color: var(--sage); }

.section-head { max-width: 720px; margin-bottom: clamp(48px, 7vh, 84px); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  font-size: 15px; font-weight: 500; letter-spacing: 0.04em;
  padding: 15px 34px; border-radius: 999px;
  transition: transform 0.4s var(--ease), background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  touch-action: manipulation;
}
.btn .arrow { transition: transform 0.4s var(--ease); }
.btn:hover .arrow { transform: translateX(5px); }

.btn--solid { background: var(--green); color: var(--on-green); box-shadow: 0 14px 34px -16px rgba(var(--accent-rgb), 0.6); }
.btn--solid:hover { background: var(--green-deep); transform: translateY(-2px); box-shadow: 0 18px 40px -16px rgba(var(--accent-rgb), 0.65); }

.btn--ghost { color: var(--ink); border: 1px solid rgba(var(--ink-rgb), 0.18); padding: 14px 32px; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.btn--pill { padding: 11px 24px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.btn--pill, .btn--pill:hover { background: var(--green); color: var(--on-green); }
.btn--pill:hover { background: var(--green-deep); }
.btn--block { width: 100%; }

/* ============================================================
   GRAIN + PROGRESS
   ============================================================ */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: 0.04; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] .grain { opacity: 0.06; mix-blend-mode: screen; }

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; background: transparent;
}
.scroll-progress span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--sage));
  transform: scaleX(0); transform-origin: left center;
  transition: none;
  will-change: transform;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: transparent; border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}
.nav.is-scrolled {
  background: rgba(var(--ink-rgb), 0.0);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-bottom-color: var(--line);
}
/* semi-tinted glass that works in both themes */
.nav.is-scrolled { background: color-mix(in srgb, var(--bg) 78%, transparent); }

.nav__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  transition: background 0.28s ease, border-color 0.28s ease;
}
.nav.is-scrolled .nav__inner { padding-top: 18px; padding-bottom: 18px; }

.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand__mark { width: 32px; height: 32px; color: var(--ink); display: block; transition: transform 0.6s var(--ease); }
.brand:hover .brand__mark { transform: rotate(90deg); }
.brand__mark svg { width: 100%; height: 100%; }
.brand__word { font-family: var(--serif); font-weight: 500; font-size: 22px; letter-spacing: 0.12em; line-height: 1; }
.brand__word--light { color: var(--on-green); }

.nav__links { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav__links a { font-size: 14px; letter-spacing: 0.02em; opacity: 0.8; position: relative; padding: 4px 0; transition: opacity 0.3s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1.5px; width: 0; background: var(--accent);
  transition: width 0.35s var(--ease);
}
.nav__links a:hover { opacity: 1; }
.nav__links a:hover::after { width: 100%; }

.nav__actions { display: flex; align-items: center; gap: 12px; }

/* theme toggle */
.theme-toggle {
  width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--ink); position: relative;
  transition: border-color 0.35s ease, color 0.35s ease, transform 0.4s var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { position: absolute; width: 18px; height: 18px; transition: transform 0.5s var(--ease), opacity 0.3s ease; }
.icon-moon { opacity: 1; transform: rotate(0) scale(1); }
.icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.6); }
[data-theme="dark"] .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }
[data-theme="dark"] .icon-sun { opacity: 1; transform: rotate(0) scale(1); }

.nav__burger { display: none; width: 44px; height: 44px; position: relative; color: var(--ink); }
.nav__burger span {
  position: absolute; top: 50%; left: 11px; right: 11px; height: 1.5px; background: currentColor; border-radius: 2px;
  transition: transform 0.36s var(--ease), opacity 0.24s ease;
}
.nav__burger span:nth-child(1) { transform: translate3d(0, -4px, 0); }
.nav__burger span:nth-child(2) { transform: translate3d(0, 4px, 0); }
.nav__burger.is-open span:nth-child(1) { transform: translate3d(0, 0, 0) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { transform: translate3d(0, 0, 0) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 49;
  background: var(--green); color: var(--on-green);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(96px + env(safe-area-inset-top)) var(--pad) calc(36px + env(safe-area-inset-bottom));
  opacity: 0; pointer-events: none; visibility: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transform: translate3d(0, -10px, 0);
  transition: opacity 0.32s var(--ease), transform 0.32s var(--ease), visibility 0s linear 0.32s;
}
.mobile-menu.is-open { opacity: 1; pointer-events: auto; visibility: visible; transform: none; transition-delay: 0s; }
.mobile-menu nav {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  gap: clamp(6px, 1.4svh, 12px);
  width: min(100%, 340px);
}
.mobile-menu a {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: transform 0.3s var(--ease), opacity 0.22s ease, color 0.3s;
}
.mobile-menu a:not(.mobile-menu__cta) {
  font-family: var(--serif); font-size: clamp(34px, 9vw, 56px); font-weight: 400;
  line-height: 1.02; padding: 5px 0; text-align: center;
}
.mobile-menu.is-open a { transform: none; opacity: 1; transition: transform 0.42s var(--ease), opacity 0.36s ease, color 0.3s; }
.mobile-menu.is-open a:nth-child(1) { transition-delay: 0.08s; }
.mobile-menu.is-open a:nth-child(2) { transition-delay: 0.14s; }
.mobile-menu.is-open a:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.is-open a:nth-child(4) { transition-delay: 0.26s; }
.mobile-menu.is-open a:nth-child(5) { transition-delay: 0.32s; }
.mobile-menu a:hover { color: var(--sage); }
.mobile-menu__cta {
  width: min(100%, 260px);
  min-height: 50px;
  margin-top: 18px;
  margin-top: clamp(14px, 3svh, 22px);
  padding: 12px 20px;
  font-size: 12px;
  background: var(--on-green);
  color: var(--green);
  border: 1px solid rgba(var(--on-green-rgb), 0.28);
  box-shadow: none;
}
.mobile-menu__cta:hover { background: var(--sage); color: var(--green-deep); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: calc(100vh - 67px);
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(40px, 9vh, 120px) 0 clamp(60px, 9vh, 120px);
  width: 100%; overflow: hidden;
  background-image:
    radial-gradient(60% 50% at 85% 8%, rgba(157, 187, 169, 0.2) 0%, transparent 60%),
    radial-gradient(45% 40% at 12% 90%, rgba(var(--accent-rgb), 0.08) 0%, transparent 65%);
}
.hero__blob { position: absolute; border-radius: 50%; pointer-events: none; z-index: 0; will-change: transform; }
.hero__blob--a {
  top: -4%; right: -10%; width: min(720px, 86vw); height: min(720px, 86vw);
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.2) 0%, rgba(var(--accent-rgb), 0.05) 40%, transparent 70%);
  animation: float 14s ease-in-out infinite;
}
.hero__blob--b {
  bottom: -8%; left: -14%; width: min(500px, 66vw); height: min(500px, 66vw);
  background: radial-gradient(circle, rgba(157, 187, 169, 0.26) 0%, rgba(157, 187, 169, 0.05) 50%, transparent 70%);
  animation: float 18s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate3d(-2%, 3%, 0) scale(1.03); }
}

.hero__inner { position: relative; z-index: 2; max-width: var(--maxw); margin-inline: auto; width: 100%; padding-inline: var(--pad); }
.hero__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(46px, 8.6vw, 98px); line-height: 1.0;
  letter-spacing: 0; margin-bottom: clamp(24px, 4vh, 38px);
}
.hero__title em { color: var(--accent); }
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero__title .line > span {
  display: block; transform: translateY(110%);
  transition: transform 1.05s var(--ease);
}
.hero__inner.is-in .hero__title .line:nth-child(1) > span { transform: none; transition-delay: 0.05s; }
.hero__inner.is-in .hero__title .line:nth-child(2) > span { transform: none; transition-delay: 0.18s; }
.hero__inner.is-in .hero__title .line:nth-child(3) > span { transform: none; transition-delay: 0.31s; }

.hero__lede {
  font-size: clamp(17px, 1.5vw, 20px); line-height: 1.65; max-width: 600px;
  margin-bottom: clamp(34px, 5vh, 48px); color: rgba(var(--ink-rgb), 0.72);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

.hero__seal {
  position: absolute; right: clamp(16px, 6vw, 90px); bottom: clamp(70px, 13vh, 150px);
  width: 156px; height: 156px; z-index: 1; opacity: 0.85;
}
.hero__seal svg { width: 100%; height: 100%; animation: spin 26s linear infinite; }
.hero__seal text { font-family: var(--sans); font-size: 12.5px; letter-spacing: 0.2em; fill: var(--accent); text-transform: uppercase; font-weight: 500; }
.hero__seal-dot { position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); transform: translate(-50%, -50%); box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.1); }
@keyframes spin { to { transform: rotate(360deg); } }

.hero__cue {
  position: absolute; left: 50%; bottom: clamp(20px, 4vh, 40px); transform: translateX(-50%);
  width: 26px; height: 44px; border: 1.5px solid rgba(var(--ink-rgb), 0.25); border-radius: 999px;
  display: flex; justify-content: center; padding-top: 8px; z-index: 2;
}
.hero__cue span {
  width: 3px; height: 8px; border-radius: 2px; background: var(--accent);
  animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(-4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ============================================================
   TRUST + MARQUEE
   ============================================================ */
.trust { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-2); }
.trust__grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.trust__item { padding: clamp(28px, 4vw, 44px) clamp(22px, 4vw, 44px); border-right: 1px solid var(--line); }
.trust__item:last-child { border-right: none; }
.trust__num, .trust__big {
  font-family: var(--serif); font-weight: 500; font-size: clamp(24px, 2.6vw, 34px);
  margin-bottom: 6px; line-height: 1.1;
}
.trust__num {
  display: inline-block;
  min-width: 2.4ch;
  font-variant-numeric: tabular-nums;
}
.trust__label { font-size: 13px; letter-spacing: 0.04em; color: rgba(var(--ink-rgb), 0.6); }

.marquee { overflow: hidden; border-top: 1px solid var(--line); padding: 20px 0; }
.marquee__track {
  display: inline-flex; align-items: center; gap: 28px; white-space: nowrap;
  animation: marquee 38s linear infinite; will-change: transform;
}
.marquee__track span { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--accent); opacity: 0.85; }
.marquee__track .sep { font-size: 12px; opacity: 0.45; font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============================================================
   SUBJECTS
   ============================================================ */
.subjects { max-width: var(--maxw); margin: 0 auto; padding: clamp(72px, 12vh, 150px) var(--pad); }
.subjects__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 18px;
}
.card {
  position: relative; padding: clamp(30px, 3.4vw, 44px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s ease;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(var(--accent-rgb), 0.1), transparent 60%);
  opacity: 0; transition: opacity 0.5s ease;
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1.4px; background: linear-gradient(140deg, var(--accent), var(--sage));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.5s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-card); border-color: transparent; }
.card:hover::before, .card:hover::after { opacity: 1; }
.card--accent { background: var(--green); color: var(--on-green); border-color: transparent; }
.card--accent .card__index { color: var(--sage); opacity: 0.6; }
.card--accent .card__icon { background: rgba(157, 187, 169, 0.16); color: var(--sage); }
.card--accent .tag { color: var(--sage); border-color: rgba(157, 187, 169, 0.4); }
.card--accent::before { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(157, 187, 169, 0.22), transparent 60%); }
.card--accent::after { background: linear-gradient(140deg, var(--sage), rgba(var(--on-green-rgb), 0.5)); }

.card__index {
  position: absolute; top: clamp(26px, 3vw, 38px); right: clamp(28px, 3vw, 40px);
  font-family: var(--serif); font-size: 18px; color: var(--accent); opacity: 0.4;
}
.card__icon {
  width: 58px; height: 58px; border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.1); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 26px;
  transition: transform 0.5s var(--ease);
  overflow: hidden;
}
.card__icon svg { width: 28px; height: 28px; }
.card__icon svg * {
  transform-box: fill-box;
  transform-origin: center;
}
.card:hover .card__icon { transform: scale(1.08) rotate(-4deg); }
.card__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.card__head h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 2.6vw, 34px); line-height: 1.12; }
.tag { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); border: 1px solid rgba(var(--accent-rgb), 0.35); padding: 4px 11px; border-radius: 999px; }
.card p { font-size: 16px; line-height: 1.68; color: rgba(var(--ink-rgb), 0.7); max-width: 46ch; }
.card--accent p { color: rgba(var(--on-green-rgb), 0.8); }

.math-curve {
  stroke-dasharray: 32;
  stroke-dashoffset: 32;
}
.card--math.is-in .math-curve {
  animation: mathTrace 3.2s var(--ease) 0.2s infinite;
}
.card--math.is-in .math-plus {
  animation: mathPlus 3.2s var(--ease) 0.2s infinite;
}
.card--english.is-in .book-pages {
  animation: bookOpen 3.6s var(--ease) infinite;
}
.card--english.is-in .book-spine {
  animation: bookSpine 3.6s var(--ease) infinite;
}
.card--python.is-in .code-left {
  animation: codeLeft 3s var(--ease) infinite;
}
.card--python.is-in .code-right {
  animation: codeRight 3s var(--ease) infinite;
}
.card--python.is-in .code-slash {
  animation: codeSlash 3s var(--ease) infinite;
}
.card--science.is-in .atom-orbits {
  animation: atomSpin 8s linear infinite;
  transform-origin: 12px 12px;
  transform-box: view-box;
}
.card--science.is-in .atom-nucleus {
  animation: atomPulse 2.6s ease-in-out infinite;
  transform-origin: 12px 12px;
  transform-box: view-box;
}

@keyframes mathTrace {
  0% { stroke-dashoffset: 32; opacity: 0.5; }
  38%, 68% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -32; opacity: 0.5; }
}
@keyframes mathPlus {
  0%, 44%, 100% { opacity: 0.55; transform: scale(0.9); }
  60%, 76% { opacity: 1; transform: scale(1.08); }
}
@keyframes bookOpen {
  0%, 100% { transform: scaleX(0.96); }
  50% { transform: scaleX(1.04); }
}
@keyframes bookSpine {
  0%, 100% { opacity: 0.58; }
  50% { opacity: 1; }
}
@keyframes codeLeft {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-1.6px, 0, 0); }
}
@keyframes codeRight {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(1.6px, 0, 0); }
}
@keyframes codeSlash {
  0%, 100% { opacity: 0.64; transform: scaleY(0.92); }
  50% { opacity: 1; transform: scaleY(1.08); }
}
@keyframes atomSpin {
  to { transform: rotate(360deg); }
}
@keyframes atomPulse {
  0%, 100% { opacity: 0.72; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.12); }
}

/* ============================================================
   APPROACH (green band)
   ============================================================ */
.approach { position: relative; background: var(--green); color: var(--on-green); overflow: hidden; }
.approach__glow {
  position: absolute; top: -20%; right: -10%; width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(circle, rgba(157, 187, 169, 0.22) 0%, rgba(157, 187, 169, 0) 68%);
  pointer-events: none;
}
.approach__inner {
  position: relative; max-width: var(--maxw); margin: 0 auto;
  padding: clamp(72px, 13vh, 160px) var(--pad);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(40px, 6vw, 90px); align-items: start;
}
.approach__body { max-width: 620px; }
.lede--light { font-size: clamp(18px, 1.7vw, 22px); line-height: 1.62; margin-bottom: 28px; color: rgba(var(--on-green-rgb), 0.92); }
.approach__body p { font-size: 17px; line-height: 1.7; color: rgba(var(--on-green-rgb), 0.7); }
.approach__list { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 14px; }
.approach__list li { display: flex; align-items: center; gap: 14px; font-size: 16px; color: rgba(var(--on-green-rgb), 0.88); }
.approach__check {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 50%; background: rgba(157, 187, 169, 0.18); color: var(--sage); font-size: 14px; flex-shrink: 0;
}

/* ============================================================
   RESULTS
   ============================================================ */
.results { max-width: var(--maxw); margin: 0 auto; padding: clamp(72px, 12vh, 150px) var(--pad); }
.results__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: clamp(36px, 5vw, 72px); }
.result { position: relative; }
.result::before { content: ""; position: absolute; left: 0; top: 8px; width: 28px; height: 2px; background: var(--sage); border-radius: 2px; }
.result__num { font-family: var(--serif); font-size: clamp(28px, 3vw, 40px); color: var(--accent); margin: 0 0 18px 46px; font-weight: 400; }
.result h3 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin-bottom: 12px; line-height: 1.2; }
.result p { font-size: 16px; line-height: 1.68; color: rgba(var(--ink-rgb), 0.66); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { background: var(--panel); color: var(--on-green); color-scheme: dark; }
.contact__inner {
  max-width: var(--maxw); margin: 0 auto; padding: clamp(72px, 13vh, 160px) var(--pad);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(48px, 7vw, 110px); align-items: start;
}
.contact__lede { font-size: 18px; line-height: 1.65; color: rgba(var(--on-green-rgb), 0.74); margin: 0 0 36px; max-width: 42ch; }
.contact__meta { font-size: 14px; letter-spacing: 0.04em; color: rgba(var(--on-green-rgb), 0.55); }

.contact__form-wrap {
  position: relative;
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid rgba(var(--on-green-rgb), 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(var(--on-green-rgb), 0.07), rgba(var(--on-green-rgb), 0.025)),
    rgba(255, 255, 255, 0.015);
  box-shadow: 0 34px 86px -58px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}
.contact__form-wrap::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(157, 187, 169, 0.52), transparent);
  pointer-events: none;
}
.form { display: flex; flex-direction: column; gap: clamp(20px, 2.6vw, 26px); }
.form__fields { display: flex; flex-direction: column; gap: clamp(20px, 2.6vw, 26px); }
.field { display: flex; flex-direction: column; gap: 9px; position: relative; }
.field > span { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(var(--on-green-rgb), 0.6); }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid rgba(var(--on-green-rgb), 0.17);
  border-radius: 14px;
  background: rgba(var(--on-green-rgb), 0.055);
  color: var(--on-green);
  font-size: 17px;
  line-height: 1.35;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(var(--on-green-rgb), 0.055);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.contact input::placeholder,
.contact textarea::placeholder { color: rgba(var(--on-green-rgb), 0.36); }
.field input { min-height: 52px; }
.field textarea { resize: vertical; line-height: 1.6; min-height: 132px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(157, 187, 169, 0.78);
  background: rgba(157, 187, 169, 0.1);
  box-shadow: 0 0 0 3px rgba(157, 187, 169, 0.12), inset 0 1px 0 rgba(var(--on-green-rgb), 0.07);
  outline: none;
}
.field--select select {
  min-height: 52px;
  appearance: none;
  -webkit-appearance: none;
  padding: 13px 46px 13px 16px;
  cursor: pointer;
}
.field--select::after {
  content: "";
  position: absolute;
  right: 17px;
  top: calc(50% + 6px);
  width: 9px;
  height: 9px;
  border-right: 1.5px solid rgba(var(--on-green-rgb), 0.7);
  border-bottom: 1.5px solid rgba(var(--on-green-rgb), 0.7);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
  transition: transform 0.25s var(--ease), border-color 0.25s ease;
}
.field--select:focus-within select {
  background: rgba(157, 187, 169, 0.12);
}
.field--select:focus-within::after {
  border-color: var(--sage);
  transform: translateY(-30%) rotate(45deg);
}
.field select option { color: #1A1A1A; background: #FBF9F5; }
.field__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: clamp(20px, 2.6vw, 26px); }

.form__status { font-size: 13px; color: var(--sage); min-height: 1em; }
.form__status.is-error { color: #e3a3a3; }

.form__success {
  border: 1px solid rgba(157, 187, 169, 0.4); padding: 30px 28px; border-radius: 16px;
  background: rgba(31, 58, 46, 0.25);
}
.form__success.is-warning {
  border-color: rgba(215, 195, 139, 0.45);
  background: rgba(130, 104, 41, 0.18);
}
.form__success-title { font-family: var(--serif); font-size: 26px; margin-bottom: 8px; }
.form__success p { font-size: 15px; line-height: 1.6; color: rgba(var(--on-green-rgb), 0.78); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--panel); color: var(--on-green); border-top: 1px solid rgba(var(--on-green-rgb), 0.12); }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: clamp(48px, 7vh, 72px) var(--pad);
  display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-start;
}
.footer__brand { display: flex; align-items: center; gap: 14px; }
.footer__brand .brand__mark--light { color: var(--on-green); }
.footer__brand p { font-size: 13px; letter-spacing: 0.04em; color: rgba(var(--on-green-rgb), 0.55); margin-top: 4px; }
.footer__links { display: flex; gap: clamp(20px, 3vw, 40px); flex-wrap: wrap; }
.footer__links a { color: rgba(var(--on-green-rgb), 0.75); font-size: 14px; transition: color 0.3s; }
.footer__links a:hover { color: var(--sage); }
.footer__legal { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad) clamp(36px, 5vh, 52px); }
.footer__legal p { font-size: 12px; color: rgba(var(--on-green-rgb), 0.4); letter-spacing: 0.03em; }

@media (hover: none), (pointer: coarse) {
  .btn:hover,
  .theme-toggle:hover,
  .nav__burger:hover,
  .card:hover,
  .card:hover .card__icon {
    transform: none;
  }
  .btn:hover .arrow { transform: none; }
  .btn--solid:hover { background: var(--green); box-shadow: 0 14px 34px -16px rgba(var(--accent-rgb), 0.6); }
  .btn--ghost:hover { color: var(--ink); border-color: rgba(var(--ink-rgb), 0.18); }
  .card:hover { box-shadow: none; }
  .card:not(.card--accent):hover { border-color: var(--line); }
  .card:hover::before,
  .card:hover::after { opacity: 0; }
  .mobile-menu a:hover { color: var(--on-green); }
  .mobile-menu__cta:hover { background: var(--on-green); color: var(--green); }
}

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0; transform: translate3d(0, 26px, 0);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  backface-visibility: hidden;
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; will-change: auto; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero__title .line > span { transform: none !important; }
  .hero__blob,
  .marquee__track,
  .hero__cue span,
  .hero__seal svg,
  .eyebrow--dot .dot::after,
  .math-curve,
  .math-plus,
  .book-pages,
  .book-spine,
  .code-left,
  .code-right,
  .code-slash,
  .atom-orbits,
  .atom-nucleus { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .grain { display: none; }

  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: 0.18s; }

  .nav.is-scrolled {
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav__inner {
    justify-content: flex-start;
    gap: 8px;
    min-height: 68px;
    padding-top: 12px;
    padding-bottom: 12px;
    transition: background 0.28s ease, border-color 0.28s ease;
  }
  .nav.is-scrolled .nav__inner { padding-top: 12px; padding-bottom: 12px; }
  .brand { min-width: 0; margin-right: auto; }
  .brand__mark { width: 30px; height: 30px; }
  .brand__word { font-size: 20px; letter-spacing: 0.1em; white-space: nowrap; }
  .nav__links, .nav__cta-btn { display: none; }
  .nav__actions { margin-left: auto; gap: 8px; }
  .theme-toggle,
  .nav__burger {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    box-shadow: 0 14px 30px -24px rgba(var(--ink-rgb), 0.45);
  }
  .theme-toggle { flex: 0 0 44px; }
  .nav__burger {
    display: block;
    flex: 0 0 44px;
    transition: border-color 0.24s ease, background 0.24s ease, transform 0.28s var(--ease), color 0.24s ease;
  }
  .nav__burger:hover,
  .nav__burger.is-open { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
  body.menu-open .scroll-progress { opacity: 0; }
  body.menu-open .nav {
    color: var(--on-green);
    background: transparent;
    border-bottom-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body.menu-open .brand__mark,
  body.menu-open .theme-toggle,
  body.menu-open .nav__burger { color: var(--on-green); }
  body.menu-open .theme-toggle,
  body.menu-open .nav__burger {
    border-color: rgba(var(--on-green-rgb), 0.24);
    background: rgba(var(--on-green-rgb), 0.08);
    box-shadow: none;
  }
  body.menu-open .nav__burger.is-open { color: var(--on-green); transform: none; }

  .hero {
    min-height: calc(100svh - 72px);
    justify-content: flex-start;
    padding-top: clamp(82px, 13svh, 112px);
    padding-bottom: clamp(42px, 7svh, 58px);
  }
  .hero__blob {
    filter: none;
    opacity: 0.5;
    animation-duration: 24s;
  }
  .hero__blob--a { top: 2%; right: -34%; width: 100vw; height: 100vw; }
  .hero__blob--b { bottom: 2%; left: -42%; width: 82vw; height: 82vw; animation-duration: 30s; }
  .hero__title {
    font-size: clamp(48px, 8vw, 58px);
    line-height: 0.98;
    max-width: 10ch;
    text-wrap: balance;
  }
  .hero__title .line { padding-bottom: 0.07em; }
  .hero__title .line > span {
    transform: translate3d(0, 108%, 0);
    transition: transform 0.86s var(--ease);
  }
  .hero__lede { font-size: 16px; line-height: 1.62; max-width: 34ch; }
  .hero__seal {
    width: 88px;
    height: 88px;
    bottom: auto;
    top: 96px;
    right: clamp(16px, 5vw, 34px);
    opacity: 0.46;
  }
  .hero__seal svg { animation: none; }
  .hero__seal text { font-size: 16px; }
  .hero__seal-dot { width: 11px; height: 11px; }

  .reveal {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
    transition: opacity 0.72s var(--ease), transform 0.72s var(--ease);
    will-change: opacity, transform;
  }
  .reveal.is-in { opacity: 1; transform: none; will-change: auto; }
  .marquee__track { animation-duration: 46s; }
  .eyebrow--dot .dot::after { animation-duration: 3.2s; }
}
@media (max-width: 560px) {
  .eyebrow { font-size: 11px; letter-spacing: 0.18em; line-height: 1.5; }
  .section-title { font-size: 38px; line-height: 1.08; }
  .hero {
    min-height: auto;
    padding-top: clamp(68px, 11svh, 82px);
    padding-bottom: clamp(30px, 6svh, 40px);
  }
  .hero__title {
    font-size: clamp(42px, 12vw, 48px);
    line-height: 1.02;
    max-width: 10ch;
    margin-bottom: 22px;
  }
  .hero__lede {
    font-size: 15px;
    line-height: 1.58;
    margin-bottom: 28px;
  }
  .hero__actions { gap: 12px; justify-content: center; }
  .hero__actions .btn {
    min-height: 54px;
    padding: 13px 22px;
    font-size: clamp(13px, 3.7vw, 15px);
    line-height: 1.2;
    text-align: center;
    white-space: normal;
  }
  .hero__actions .btn .arrow { flex: 0 0 auto; }
  .hero__seal { display: none; }
  .hero__cue { display: none; }
  .mobile-menu { padding-top: calc(86px + env(safe-area-inset-top)); }
  .mobile-menu a:not(.mobile-menu__cta) { font-size: clamp(35px, 11vw, 44px); }
  .trust__item { border-right: none; border-bottom: 1px solid var(--line); }
  .trust__item:last-child { border-bottom: none; }
  .hero__actions .btn { width: 100%; }
}
@media (max-width: 560px) and (max-height: 700px) {
  .eyebrow { margin-bottom: 14px; }
  .hero {
    padding-top: clamp(34px, 8svh, 54px);
    padding-bottom: 14px;
  }
  .hero__title {
    font-size: clamp(34px, 10.8vw, 40px);
    line-height: 1;
    max-width: 100%;
    margin-bottom: 14px;
  }
  .hero__lede {
    font-size: 14px;
    line-height: 1.44;
    margin-bottom: 14px;
  }
  .hero__actions { gap: 8px; }
  .hero__actions .btn {
    min-height: 48px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .hero__actions .btn--ghost {
    width: auto;
    min-height: auto;
    padding: 2px 0;
    border-color: transparent;
    font-size: 13px;
  }
}
@media (max-width: 360px) {
  .brand__word { font-size: 18px; letter-spacing: 0.08em; }
  .theme-toggle,
  .nav__burger { width: 42px; height: 42px; flex-basis: 42px; }
  .hero__title { font-size: 41px; }
  .mobile-menu a:not(.mobile-menu__cta) { font-size: 34px; }
}
