/* ============================================================
   Web Highlighter — marketing site
   Design language: "ink & marker" — warm paper, editorial serif,
   hand-drawn marker sweeps, hard shadows, six highlight accents.
   ============================================================ */

:root {
  --paper: #FDFBF4;
  --paper-2: #F7F3E6;
  --ink: #16150F;
  --ink-soft: #4A4739;
  --ink-faint: #8B876F;
  --line: rgba(22, 21, 15, 0.12);

  --yellow: #FFDE38;
  --yellow-deep: #FFD400;
  --green: #8CE99A;
  --pink: #FFB3D1;
  --blue: #9BD3FF;
  --orange: #FFC078;
  --purple: #D0BFFF;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --shadow-card: 0 1px 2px rgba(22,21,15,.05), 0 12px 40px -12px rgba(22,21,15,.18);
  --shadow-hard: 6px 6px 0 var(--ink);
  --r: 20px;
  --nav-h: 74px;
  --ease-out: cubic-bezier(.22,.9,.3,1);
  --ease-spring: cubic-bezier(.34,1.56,.5,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* paper grain */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 2000;
  opacity: .35; 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.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.09 0 0 0 0 0.08 0 0 0 0 0.06 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--yellow); color: var(--ink); }

img { max-width: 100%; display: block; }
p img, li img { display: inline-block; }
a { color: inherit; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -0.015em; }

/* ---------- marker highlight sweep ---------- */
.hl { --hlc: var(--yellow); position: relative; display: inline-block; white-space: nowrap; }
.hl > span { position: relative; z-index: 1; }
.hl::before {
  content: "";
  position: absolute;
  left: -0.18em; right: -0.18em; top: 0.12em; bottom: 0.02em;
  background: var(--hlc);
  border-radius: 0.35em 0.5em 0.4em 0.55em / 0.6em 0.4em 0.55em 0.4em;
  transform: skew(-6deg, -0.4deg) scaleX(0);
  transform-origin: left center;
  transition: transform .7s var(--ease-out) .15s;
}
.in .hl::before, .hl.in::before { transform: skew(-6deg, -0.4deg) scaleX(1); }
.hl-green { --hlc: var(--green); }
.hl-pink { --hlc: var(--pink); }
.hl-blue { --hlc: var(--blue); }
.hl-orange { --hlc: var(--orange); }

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease-out) var(--d, 0s), transform .8s var(--ease-out) var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: 16px;
  padding: 14px 26px;
  border: 2px solid var(--ink); border-radius: 14px;
  background: var(--paper); color: var(--ink);
  text-decoration: none; cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background .18s;
  white-space: nowrap;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--yellow); }
.btn-primary:hover { background: var(--yellow-deep); }
.btn-ghost { box-shadow: none; border-color: transparent; background: transparent; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.btn-ghost:hover { transform: none; box-shadow: none; background: rgba(22,21,15,.05); }
.btn-ink { background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 rgba(22,21,15,.35); }
.btn-ink:hover { background: #000; box-shadow: 7px 7px 0 rgba(22,21,15,.35); }
.btn-lg { font-size: 17px; padding: 17px 30px; }
.btn-xl { font-size: 19px; padding: 20px 38px; border-radius: 16px; }
.chrome-i { width: 20px; height: 20px; flex: none; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(253, 251, 244, 0.82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.nav.scrolled { border-bottom-color: var(--line); box-shadow: 0 8px 30px -18px rgba(22,21,15,.25); }
.nav-inner {
  max-width: 1200px; margin: 0 auto; height: var(--nav-h);
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-icon { width: 30px; height: 30px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  position: relative; text-decoration: none; font-weight: 500; font-size: 15px;
  color: var(--ink-soft); padding: 8px 12px; border-radius: 8px;
}
.nav-links a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 5px; height: 8px;
  background: var(--yellow); z-index: -1; border-radius: 3px 5px 2px 4px;
  transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-cta-wrap { display: flex; align-items: center; gap: 14px; }
.btn-nav { font-size: 15px; padding: 10px 18px; box-shadow: 3px 3px 0 var(--ink); }

.menu-btn { display: none; flex-direction: column; gap: 6px; background: none; border: 0; padding: 10px; cursor: pointer; }
.menu-btn span { display: block; width: 24px; height: 2.5px; background: var(--ink); border-radius: 2px; transition: transform .25s var(--ease-out), opacity .2s; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4.25px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4.25px) rotate(-45deg); }

.mobile-menu {
  display: none; flex-direction: column; gap: 4px;
  padding: 12px 28px 24px; border-bottom: 1px solid var(--line);
}
.mobile-menu.open { display: flex; }
.mobile-menu a { text-decoration: none; font-weight: 500; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.mobile-menu a.btn { margin-top: 14px; justify-content: center; border-bottom: 2px solid var(--ink); }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: calc(var(--nav-h) + clamp(48px, 8vh, 96px)); }
.hero-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(40px, 5vw, 72px);
  align-items: center;
}
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  background: var(--paper); border: 1.5px solid var(--line);
  padding: 8px 16px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 2px 10px -4px rgba(22,21,15,.15);
  transition: border-color .2s;
}
.chip:hover { border-color: var(--ink); }
.chip-stars { color: #E8A200; letter-spacing: 2px; font-size: 13px; }
.chip strong { color: var(--ink); }

.hero h1 {
  font-size: clamp(44px, 5.6vw, 76px);
  margin: 26px 0 22px;
  font-weight: 640;
}
.lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-soft); max-width: 54ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 34px; }
.risk-free { margin-top: 18px; font-size: 14px; color: var(--ink-faint); }

/* --- browser mockup --- */
.hero-visual { position: relative; }
.browser {
  background: #fff; border: 2px solid var(--ink); border-radius: var(--r);
  box-shadow: var(--shadow-hard), var(--shadow-card);
  overflow: hidden; position: relative;
}
.browser-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 2px solid var(--ink);
  background: var(--paper-2);
}
.dot { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid rgba(22,21,15,.35); }
.dot.r { background: #FF8A80; } .dot.y { background: #FFE082; } .dot.g { background: #A5D6A7; }
.urlbar {
  flex: 1; margin: 0 8px; font-size: 12.5px; color: var(--ink-faint);
  background: #fff; border: 1.5px solid var(--line); border-radius: 8px;
  padding: 5px 12px;
}
.ext-slot img { width: 20px; height: 20px; }
.browser-body { padding: 26px 28px 34px; position: relative; }
.fake-h { font-family: var(--font-display); font-weight: 650; font-size: 21px; margin-bottom: 14px; line-height: 1.25; }
.fake-p { font-size: 14.5px; line-height: 1.75; color: var(--ink-soft); margin-bottom: 12px; }

.hl-t {
  --c: var(--yellow);
  background-image: linear-gradient(var(--c), var(--c));
  background-repeat: no-repeat;
  background-position: 0 55%;
  background-size: 0% 92%;
  border-radius: 3px;
  transition: background-size .9s var(--ease-out);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.hl-t.on { background-size: 100% 92%; }
.hl-t[data-c="y"] { --c: var(--yellow); }
.hl-t[data-c="g"] { --c: var(--green); }
.hl-t[data-c="p"] { --c: var(--pink); }

.mini-palette {
  position: absolute; display: flex; gap: 6px;
  background: var(--ink); padding: 8px 10px; border-radius: 12px;
  box-shadow: 0 10px 30px -8px rgba(22,21,15,.5);
  opacity: 0; transform: translateY(6px) scale(.92);
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-spring);
  pointer-events: none;
}
.mini-palette.show { opacity: 1; transform: none; }
.mini-palette span { width: 16px; height: 16px; border-radius: 50%; background: var(--c); border: 1.5px solid rgba(255,255,255,.4); }
.mini-palette span:first-child { outline: 2px solid #fff; outline-offset: 1px; }

.saved-toast {
  position: absolute; top: 14px; right: 14px;
  background: var(--ink); color: var(--paper);
  font-size: 13px; font-weight: 600;
  padding: 9px 14px; border-radius: 10px;
  opacity: 0; transform: translateY(-8px);
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-spring);
}
.saved-toast.show { opacity: 1; transform: none; }

/* --- floating dashboard card --- */
.dash-card {
  position: absolute; right: -18px; bottom: -46px; width: min(300px, 78%);
  background: var(--paper); border: 2px solid var(--ink); border-radius: 16px;
  box-shadow: var(--shadow-hard), var(--shadow-card);
  padding: 14px 16px 10px;
  transform: rotate(1.5deg);
}
.dash-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; padding-bottom: 8px; border-bottom: 1.5px solid var(--line); }
.dash-head img { width: 17px; height: 17px; }
.dash-count { margin-left: auto; background: var(--yellow); border: 1.5px solid var(--ink); font-size: 11.5px; padding: 1px 9px; border-radius: 999px; }
.dash-list { list-style: none; }
.dash-list li {
  font-size: 12.5px; line-height: 1.45; color: var(--ink-soft);
  padding: 8px 2px 8px 12px; border-bottom: 1px dashed var(--line);
  position: relative;
  animation: dashPop .45s var(--ease-spring) both;
}
.dash-list li:last-child { border-bottom: 0; }
.dash-list li::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px;
  border-radius: 4px; background: var(--c, var(--yellow));
}
@keyframes dashPop {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: none; }
}

/* --- marquee --- */
.hero-marquee {
  margin-top: clamp(84px, 10vw, 130px);
  border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  background: var(--paper); overflow: hidden; padding: 14px 0;
}
.marquee-track { display: flex; width: max-content; animation: marquee 26s linear infinite; }
.marquee-track span {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 17px; color: var(--ink-soft); padding-right: 8px;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============================================================
   STATS
   ============================================================ */
.stats { padding: clamp(64px, 8vw, 100px) 28px 0; }
.stats-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  text-align: center;
}
.stat-n { display: block; font-family: var(--font-display); font-weight: 650; font-size: clamp(40px, 4.5vw, 60px); line-height: 1.1; }
.stat-l { display: block; margin-top: 6px; font-size: 14px; color: var(--ink-faint); max-width: 20ch; margin-inline: auto; }

/* ============================================================
   SECTIONS (shared)
   ============================================================ */
section { scroll-margin-top: var(--nav-h); }
.section-head { max-width: 820px; margin: 0 auto; text-align: center; padding: 0 28px; }
.section-head.tight { padding: 0; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-soft);
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 6px 16px;
  background: var(--paper);
}
.eyebrow.light { color: var(--paper); border-color: rgba(253,251,244,.4); background: transparent; }
.section-head h2 { font-size: clamp(34px, 4vw, 54px); margin: 22px 0 16px; }
.section-sub { font-size: clamp(16px, 1.4vw, 19px); color: var(--ink-soft); max-width: 56ch; margin: 0 auto; }
.dim { color: var(--ink-faint); }

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.how { padding: clamp(90px, 11vw, 150px) 28px 0; }
.steps {
  max-width: 1100px; margin: clamp(44px, 5vw, 64px) auto 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px;
}
.step {
  position: relative;
  background: #fff; border: 2px solid var(--ink); border-radius: var(--r);
  padding: 30px 26px 28px;
  box-shadow: var(--shadow-card);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.step:hover { transform: translateY(-6px); box-shadow: var(--shadow-hard), var(--shadow-card); }
.step-num {
  position: absolute; top: -18px; left: 22px;
  width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--yellow); border: 2px solid var(--ink); border-radius: 12px;
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
  transform: rotate(-4deg);
}
.step-visual {
  height: 96px; display: grid; place-items: center;
  background: var(--paper); border: 1.5px dashed var(--line); border-radius: 14px;
  margin-bottom: 20px; font-size: 14.5px; color: var(--ink-soft); text-align: center;
  padding: 0 14px; overflow: hidden;
}
.step h3 { font-size: 22px; margin-bottom: 8px; }
.step p { font-size: 15px; color: var(--ink-soft); }

.select-anim { background: rgba(58, 121, 255, 0.25); border-radius: 3px; animation: selectPulse 2.6s ease-in-out infinite; }
@keyframes selectPulse { 0%, 100% { background: rgba(58,121,255,.12); } 50% { background: rgba(58,121,255,.32); } }

.palette-anim { display: flex; gap: 9px; }
.palette-anim span { width: 22px; height: 22px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); }
.step.in .palette-anim span { animation: popIn .5s var(--ease-spring) both; }
.pop-1 { animation-delay: .10s } .pop-2 { animation-delay: .18s } .pop-3 { animation-delay: .26s }
.pop-4 { animation-delay: .34s } .pop-5 { animation-delay: .42s } .pop-6 { animation-delay: .50s }
@keyframes popIn { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }

.saved-anim { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.saved-check {
  width: 26px; height: 26px; display: grid; place-items: center;
  background: var(--green); border: 2px solid var(--ink); border-radius: 50%;
  font-size: 14px; font-weight: 800;
}
.step.in .saved-check { animation: popIn .5s var(--ease-spring) .3s both; }

/* ============================================================
   DEMO
   ============================================================ */
.demo { padding: clamp(100px, 12vw, 160px) 28px 0; }
.demo-card {
  max-width: 880px; margin: 0 auto;
  background: #fff; border: 2px solid var(--ink); border-radius: 26px;
  box-shadow: var(--shadow-hard), var(--shadow-card);
  padding: clamp(30px, 5vw, 56px);
}
.demo-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 34px 0 20px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 12px 16px;
}
.swatch {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--c); border: 2px solid var(--ink);
  cursor: pointer;
  transition: transform .18s var(--ease-spring), outline-color .15s;
  outline: 3px solid transparent; outline-offset: 2px;
}
.swatch:hover { transform: scale(1.15); }
.swatch.active { outline-color: var(--ink); transform: scale(1.12); }
.demo-hint { font-size: 13.5px; color: var(--ink-faint); margin-left: 6px; }
.demo-text { cursor: text; }
.demo-text p { font-size: clamp(16.5px, 1.5vw, 19px); line-height: 1.8; margin-bottom: 16px; color: var(--ink-soft); }
.demo-text p:last-child { margin-bottom: 0; }
.demo-mark {
  background: var(--c, var(--yellow));
  border-radius: 3px; padding: 0.05em 0.1em; margin: 0 -0.02em;
  cursor: pointer;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  animation: markIn .35s var(--ease-out);
  color: var(--ink);
}
@keyframes markIn { from { background-color: transparent; } }
.demo-footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 16px; border-top: 1.5px dashed var(--line);
  font-size: 13.5px; color: var(--ink-faint);
}
.demo-counter { font-weight: 600; color: var(--ink-soft); }
.demo-cta {
  display: none; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin-top: 26px; padding: 20px 24px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 16px;
}
.demo-cta.show { display: flex; animation: dashPop .5s var(--ease-spring); }
.demo-cta p { font-size: 16px; }

/* ============================================================
   FEATURES
   ============================================================ */
.features { padding: clamp(100px, 12vw, 160px) 28px 0; }
.feature-grid {
  max-width: 1100px; margin: clamp(44px, 5vw, 64px) auto 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.fcard {
  position: relative; overflow: hidden;
  background: #fff; border: 2px solid var(--ink); border-radius: var(--r);
  padding: 30px 26px;
  box-shadow: var(--shadow-card);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.fcard::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 7px;
  background: var(--fc);
  border-bottom: 2px solid var(--ink);
}
.fcard:hover { transform: translateY(-6px) rotate(-0.4deg); box-shadow: var(--shadow-hard), var(--shadow-card); }
.fcard-icon {
  width: 52px; height: 52px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--fc) 38%, #fff);
  border: 2px solid var(--ink); border-radius: 14px;
  margin-bottom: 18px;
}
.fcard-icon svg { width: 26px; height: 26px; }
.fcard h3 { font-size: 21px; margin-bottom: 8px; }
.fcard p { font-size: 15px; color: var(--ink-soft); }

/* ============================================================
   AI (dark)
   ============================================================ */
.ai {
  margin-top: clamp(100px, 12vw, 160px);
  background: var(--ink); color: var(--paper);
  padding: clamp(90px, 11vw, 150px) 28px;
  position: relative;
}
.ai::before, .ai::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--yellow);
}
.ai::before { top: 10px; } .ai::after { bottom: 10px; }
.ai .section-sub { color: rgba(253,251,244,.72); }
.ai-inner { max-width: 1100px; margin: 0 auto; }
.ai-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  margin-top: clamp(44px, 5vw, 64px);
}
.ai-card {
  background: #201F17; border: 1.5px solid rgba(253,251,244,.16); border-radius: var(--r);
  padding: 26px 24px;
  transition: border-color .25s, transform .25s var(--ease-out);
}
.ai-card:hover { border-color: rgba(253,251,244,.4); transform: translateY(-4px); }
.ai-tag {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); background: var(--c); border-radius: 999px; padding: 4px 12px; margin-bottom: 14px;
}
.ai-card h3 { font-size: 20px; margin-bottom: 16px; color: var(--paper); }
.ai-chat { grid-column: 1 / -1; }

.sum-line { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--yellow), rgba(255,222,56,.35)); margin-bottom: 10px; }
.w90 { width: 90%; } .w75 { width: 75%; } .w60 { width: 60%; }
.ai-quote { margin-top: 16px; font-size: 14px; color: rgba(253,251,244,.65); font-style: italic; }

/* flashcard */
.flashcard {
  width: 100%; min-height: 172px; position: relative;
  background: none; border: 0; cursor: pointer; color: inherit;
  perspective: 900px; font: inherit; text-align: left;
}
.fc-face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; gap: 8px; justify-content: center;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 16px;
  padding: 20px 22px;
  font-size: 15px; line-height: 1.5; font-weight: 500;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .6s var(--ease-out);
  box-shadow: 0 8px 26px -10px rgba(0,0,0,.55);
}
.fc-face em { font-style: normal; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.fc-face small { font-size: 12px; color: var(--ink-faint); font-weight: 400; }
.fc-front { transform: rotateY(0deg); }
.fc-back { transform: rotateY(180deg); background: var(--green); }
.flashcard.flipped .fc-front { transform: rotateY(-180deg); }
.flashcard.flipped .fc-back { transform: rotateY(0deg); }

/* quiz */
.quiz-q { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.quiz-opt {
  display: block; width: 100%; text-align: left;
  font: inherit; font-size: 14px; color: var(--paper);
  background: rgba(253,251,244,.06); border: 1.5px solid rgba(253,251,244,.22);
  border-radius: 12px; padding: 11px 14px; margin-bottom: 9px; cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
}
.quiz-opt:hover { border-color: rgba(253,251,244,.55); }
.quiz-opt.correct { background: var(--green); color: var(--ink); border-color: var(--green); font-weight: 600; }
.quiz-opt.wrong { animation: shake .4s ease; border-color: #FF8A80; color: #FF8A80; }
@keyframes shake { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-5px) } 75% { transform: translateX(5px) } }
.quiz-result { font-size: 13.5px; margin-top: 4px; min-height: 20px; color: var(--green); font-weight: 600; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.chat-msg { padding: 13px 18px; border-radius: 16px; font-size: 14.5px; line-height: 1.6; max-width: 78%; }
.chat-msg.user { align-self: flex-end; background: var(--yellow); color: var(--ink); border-bottom-right-radius: 4px; font-weight: 500; }
.chat-msg.bot { align-self: flex-start; background: rgba(253,251,244,.1); border: 1.5px solid rgba(253,251,244,.16); border-bottom-left-radius: 4px; color: rgba(253,251,244,.92); }

.ai-cta { text-align: center; margin-top: clamp(40px, 5vw, 56px); }

/* ============================================================
   REVIEWS
   ============================================================ */
.reviews { padding: clamp(100px, 12vw, 160px) 28px 0; }
.score {
  display: inline-block; font-size: 0.5em; vertical-align: middle;
  background: var(--yellow); border: 2px solid var(--ink); border-radius: 12px;
  padding: 4px 14px; margin-left: 10px; transform: rotate(-2deg) translateY(-4px);
  font-family: var(--font-body); font-weight: 700;
}
.review-grid {
  max-width: 1100px; margin: clamp(44px, 5vw, 64px) auto 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.rcard {
  background: #fff; border: 2px solid var(--ink); border-radius: var(--r);
  padding: 26px 24px;
  box-shadow: var(--shadow-card);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.rcard:nth-child(odd) { transform: rotate(-0.6deg); }
.rcard:nth-child(even) { transform: rotate(0.5deg); }
.rcard:hover { transform: rotate(0deg) translateY(-5px); box-shadow: var(--shadow-hard), var(--shadow-card); }
.rstars { color: #E8A200; letter-spacing: 3px; margin-bottom: 12px; font-size: 15px; }
.rcard blockquote { font-family: var(--font-display); font-size: 17.5px; line-height: 1.5; font-weight: 450; margin-bottom: 14px; }
.rcard figcaption { font-size: 13px; color: var(--ink-faint); font-weight: 500; }
.reviews-link { text-align: center; margin-top: 36px; }
.reviews-link a { font-weight: 600; color: var(--ink-soft); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.reviews-link a:hover { color: var(--ink); }

/* ============================================================
   FAQ
   ============================================================ */
.faq { padding: clamp(100px, 12vw, 160px) 28px 0; }
.faq-list { max-width: 760px; margin: clamp(40px, 5vw, 56px) auto 0; }
.faq-item {
  background: #fff; border: 2px solid var(--ink); border-radius: 16px;
  margin-bottom: 14px; overflow: hidden;
  transition: box-shadow .25s var(--ease-out);
}
.faq-item[open] { box-shadow: var(--shadow-hard); }
.faq-item summary {
  list-style: none; cursor: pointer;
  font-weight: 600; font-size: 17px;
  padding: 20px 56px 20px 24px;
  position: relative;
  transition: background .2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: var(--paper); }
.faq-item summary::after {
  content: "+"; position: absolute; right: 22px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display); font-size: 26px; font-weight: 500;
  transition: transform .3s var(--ease-out);
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-a { padding: 0 24px 22px; font-size: 15.5px; color: var(--ink-soft); max-width: 62ch; }
.faq-a a { font-weight: 600; }

/* ============================================================
   FINAL CTA
   ============================================================ */
.final {
  margin-top: clamp(100px, 12vw, 160px);
  background: var(--yellow);
  border-top: 2px solid var(--ink);
  padding: clamp(90px, 11vw, 150px) 28px;
  text-align: center;
  position: relative; overflow: hidden;
}
.final::before {
  content: ""; position: absolute; inset: -40%;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.55), transparent 45%),
              radial-gradient(circle at 75% 80%, rgba(255,180,0,.4), transparent 40%);
  pointer-events: none;
}
.final-inner { position: relative; max-width: 900px; margin: 0 auto; }
.final h2 { font-size: clamp(32px, 4.4vw, 58px); margin-bottom: 40px; }
.final-em { font-style: italic; font-weight: 700; }
.final-note { margin-top: 20px; font-size: 14.5px; font-weight: 500; color: rgba(22,21,15,.75); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--ink); color: var(--paper); padding: 52px 28px; }
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.footer .brand-name { color: var(--paper); }
.footer-links { display: flex; gap: 26px; flex-wrap: wrap; }
.footer-links a { color: rgba(253,251,244,.75); text-decoration: none; font-size: 14.5px; }
.footer-links a:hover { color: var(--yellow); }
.footer-copy { font-size: 13.5px; color: rgba(253,251,244,.45); width: 100%; text-align: center; margin-top: 26px; padding-top: 22px; border-top: 1px solid rgba(253,251,244,.12); }

/* ============================================================
   SELECT-ANYWHERE HIGHLIGHTING (homepage)
   ============================================================ */
.sel-pop {
  position: fixed; z-index: 1300;
  display: flex; gap: 8px; align-items: center;
  background: var(--ink); padding: 10px 12px; border-radius: 14px;
  box-shadow: 0 14px 36px -10px rgba(22,21,15,.55);
  opacity: 0; transform: translateY(6px) scale(.9); pointer-events: none;
  transition: opacity .18s var(--ease-out), transform .18s var(--ease-spring);
}
.sel-pop.show { opacity: 1; transform: none; pointer-events: auto; }
.sel-pop button {
  width: 22px; height: 22px; border-radius: 50%; padding: 0;
  background: var(--c); border: 1.5px solid rgba(255,255,255,.45);
  cursor: pointer;
  transition: transform .15s var(--ease-spring), border-color .15s;
}
.sel-pop button:hover { transform: scale(1.28); border-color: #fff; }

mark.page-mark {
  background: var(--c, var(--yellow)); color: var(--ink);
  border-radius: 3px; padding: 0.02em 0.06em;
  cursor: pointer;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  animation: markIn .35s var(--ease-out);
}

.mini-saved {
  position: fixed; z-index: 1300;
  background: var(--ink); color: var(--paper);
  font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 8px;
  pointer-events: none;
  animation: miniSaved 1s var(--ease-out) forwards;
}
@keyframes miniSaved {
  0% { opacity: 0; transform: translateY(5px) scale(.8); }
  18% { opacity: 1; transform: none; }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-12px); }
}

.hl-snack {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%);
  z-index: 1250;
  display: flex; gap: 16px; align-items: center;
  background: var(--ink); color: var(--paper);
  padding: 12px 12px 12px 22px; border-radius: 18px;
  box-shadow: 0 18px 44px -12px rgba(22,21,15,.6);
  font-size: 14.5px; font-weight: 500;
  max-width: calc(100vw - 40px);
  transition: transform .55s var(--ease-spring);
}
.hl-snack.show { transform: translate(-50%, 0); }
.hl-snack strong { color: var(--yellow); }
.hl-snack .btn { box-shadow: none; padding: 10px 16px; font-size: 14px; border-radius: 11px; flex: none; }
.snack-x {
  background: none; border: 0; color: rgba(253,251,244,.55);
  font-size: 20px; line-height: 1; padding: 4px 8px; cursor: pointer;
}
.snack-x:hover { color: #fff; }

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

/* ============================================================
   SUBPAGES (billing / success / welcome)
   ============================================================ */
.page-hero { padding: calc(var(--nav-h) + clamp(48px, 7vh, 84px)) 28px 0; text-align: center; }
.page-hero h1 { font-size: clamp(36px, 4.6vw, 60px); margin: 22px auto 16px; max-width: 20ch; line-height: 1.1; }
.page-hero .section-sub { margin-bottom: 8px; }

/* billing toggle */
.toggle {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff; border: 2px solid var(--ink); border-radius: 999px;
  padding: 5px; margin: 30px auto 0;
}
.toggle button {
  font: inherit; font-weight: 600; font-size: 15px; color: var(--ink-soft);
  background: transparent; border: 0; border-radius: 999px;
  padding: 9px 22px; cursor: pointer; transition: background .2s, color .2s;
}
.toggle button.active { background: var(--ink); color: var(--paper); }
.save-pill {
  font-size: 12px; font-weight: 700; color: var(--ink);
  background: var(--green); border: 1.5px solid var(--ink);
  padding: 2px 10px; border-radius: 999px; margin-left: 6px;
}

/* plan cards */
.plans {
  max-width: 880px; margin: clamp(40px, 5vw, 60px) auto 0;
  display: grid; grid-template-columns: 1fr 1.08fr; gap: 26px;
  padding: 0 28px; align-items: start;
}
.plan {
  background: #fff; border: 2px solid var(--ink); border-radius: 24px;
  padding: 34px 30px 30px; text-align: left; position: relative;
  box-shadow: var(--shadow-card);
}
.plan.featured { background: #FFFAE0; box-shadow: var(--shadow-hard), var(--shadow-card); }
.plan-badge {
  position: absolute; top: -16px; right: 24px;
  background: var(--yellow); border: 2px solid var(--ink); border-radius: 10px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 14px; transform: rotate(2deg);
}
.plan h2 { font-size: 26px; margin-bottom: 4px; }
.plan-tag { font-size: 14.5px; color: var(--ink-faint); margin-bottom: 20px; }
.plan-price { font-family: var(--font-display); font-weight: 650; font-size: 54px; line-height: 1; letter-spacing: -0.02em; }
.plan-price .per { font-family: var(--font-body); font-size: 15px; font-weight: 500; color: var(--ink-faint); letter-spacing: 0; }
.plan-sub { font-size: 13.5px; color: var(--ink-faint); min-height: 20px; margin-top: 6px; }
.plan ul { list-style: none; margin: 22px 0 26px; }
.plan li { display: flex; gap: 11px; align-items: flex-start; font-size: 15px; color: var(--ink-soft); padding: 7px 0; }
.plan li strong { color: var(--ink); font-weight: 600; }
.tick {
  flex: none; width: 21px; height: 21px; margin-top: 1px;
  display: grid; place-items: center;
  background: var(--tc, var(--yellow)); border: 1.5px solid var(--ink); border-radius: 50%;
  font-size: 11px; font-weight: 800;
}
.plan .btn { width: 100%; justify-content: center; }
.plan-note { text-align: center; font-size: 12.5px; color: var(--ink-faint); margin-top: 12px; }

.trial-strip {
  max-width: 824px; margin: 26px auto 0; padding: 0 28px;
}
.trial-strip > div {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  border: 1.5px dashed var(--ink); border-radius: 16px; padding: 14px 20px;
  font-size: 14.5px; color: var(--ink-soft); background: var(--paper);
}

/* mini numbered steps */
.mini-steps { max-width: 640px; margin: clamp(36px, 4vw, 52px) auto 0; padding: 0 28px; counter-reset: ms; text-align: left; }
.mini-step {
  display: flex; gap: 18px; align-items: flex-start;
  background: #fff; border: 2px solid var(--ink); border-radius: 18px;
  padding: 22px 24px; margin-bottom: 14px; counter-increment: ms;
  box-shadow: var(--shadow-card);
}
.mini-step::before {
  content: counter(ms);
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--yellow); border: 2px solid var(--ink); border-radius: 11px;
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  transform: rotate(-4deg);
}
.mini-step h3 { font-size: 18px; margin-bottom: 4px; }
.mini-step p { font-size: 14.5px; color: var(--ink-soft); }

/* keyboard keys */
.kbd {
  display: inline-block; font-family: var(--font-body); font-size: 13px; font-weight: 600;
  background: #fff; border: 1.5px solid var(--ink); border-bottom-width: 3px;
  border-radius: 7px; padding: 3px 9px; margin: 0 2px;
}
.shortcut-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.shortcut-row:last-child { border-bottom: 0; }

/* success confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.confetti i {
  position: absolute; top: -4vh; width: 10px; height: 16px; border-radius: 3px;
  background: var(--c); left: var(--x); opacity: .9;
  transform: rotate(var(--r0));
  animation: confetti-fall var(--t) linear var(--dl) 3;
}
@keyframes confetti-fall {
  0% { transform: translateY(-6vh) rotate(var(--r0)); opacity: 1; }
  100% { transform: translateY(108vh) rotate(calc(var(--r0) + 320deg)); opacity: .7; }
}
.success-icon {
  width: 92px; height: 92px; margin: 0 auto; display: grid; place-items: center;
  background: var(--green); border: 2.5px solid var(--ink); border-radius: 50%;
  font-size: 40px; font-weight: 800;
  box-shadow: var(--shadow-hard);
  animation: popIn .6s var(--ease-spring) both;
}
.unlock-grid {
  max-width: 880px; margin: clamp(36px, 4vw, 52px) auto 0; padding: 0 28px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.unlock {
  display: flex; gap: 14px; align-items: flex-start; text-align: left;
  background: #fff; border: 2px solid var(--ink); border-radius: 16px; padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.unlock .tick { margin-top: 2px; }
.unlock h3 { font-size: 16.5px; margin-bottom: 2px; }
.unlock p { font-size: 14px; color: var(--ink-soft); }

.center-cta { text-align: center; margin: clamp(40px, 5vw, 56px) auto 0; padding: 0 28px; }
.center-cta .fineprint { margin-top: 16px; font-size: 13.5px; color: var(--ink-faint); }

@media (max-width: 760px) {
  .plans { grid-template-columns: 1fr; max-width: 520px; }
  .unlock-grid { grid-template-columns: 1fr; max-width: 520px; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1020px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { max-width: 620px; margin: 24px auto 46px; width: 100%; }
  .steps, .feature-grid, .review-grid, .ai-grid { grid-template-columns: repeat(2, 1fr); }
  .ai-chat { grid-column: auto; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); gap: 36px 20px; }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .menu-btn { display: flex; }
}
@media (max-width: 640px) {
  .steps, .feature-grid, .review-grid, .ai-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(36px, 10vw, 48px); }
  /* let marker highlights wrap across lines on narrow screens */
  .hl { white-space: normal; }
  .hl::before { display: none; }
  .hl > span {
    background-image: linear-gradient(var(--hlc), var(--hlc));
    background-repeat: no-repeat;
    background-position: 0 55%;
    background-size: 100% 88%;
    border-radius: 4px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    padding: 0.04em 0.1em;
    margin: 0 -0.1em;
  }
  .cta-row .btn-lg { width: 100%; justify-content: center; }
  .dash-card { right: 0; bottom: -40px; }
  .btn-nav { display: none; }
  .demo-card { border-radius: 20px; }
  .rcard:nth-child(n) { transform: none; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .hl::before { transform: skew(-6deg, -0.4deg) scaleX(1); }
  .hl-t { background-size: 100% 92%; }
  .marquee-track { animation: none; }
}
