/* ——— quizmill brand ———
   paper  #faf7f0   warm flour-white ground
   ink    #211d18   warm near-black
   stone  #6f6557   secondary text
   grain  #b45309   amber — the brand accent (millstone gold)
   teal   #0f766e   engine green-blue, used sparingly
   Type: Fraunces (display serif), system sans (body), ui-monospace (code).
*/
:root {
  --paper: #faf7f0;
  --paper-deep: #f3ede1;
  --ink: #211d18;
  --stone: #6f6557;
  --line: #e5dccb;
  --grain: #b45309;
  --grain-soft: #f5e3c8;
  --teal: #0f766e;
  --card: #ffffff;
  --code-bg: #292218;
  --code-ink: #f3e9d2;
  --ok: #15803d;
  --ok-soft: #dcf2e3;
  --warn: #b91c1c;
  --warn-soft: #fde3e3;
  --radius: 18px;
  --display: 'Fraunces', Georgia, serif;
  --body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1712;
    --paper-deep: #15110d;
    --ink: #f0e9dc;
    --stone: #a89b8a;
    --line: #383021;
    --grain: #e8943a;
    --grain-soft: #3a2c17;
    --card: #241f18;
    --code-bg: #14100b;
    --code-ink: #ead9b8;
    --ok: #4ade80;
    --ok-soft: #173424;
    --warn: #f87171;
    --warn-soft: #3d1a1a;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

code { font-family: var(--mono); font-size: 0.88em; background: var(--paper-deep); padding: 0.1em 0.35em; border-radius: 6px; }
pre code { background: none; padding: 0; }

/* ——— wheel mark ——— */
.wheel .seg { fill: none; stroke: currentColor; stroke-width: 9; stroke-linecap: round; }
.wheel .seg-accent { stroke: var(--grain); }
.wheel .hub { fill: currentColor; }
.wheel-spin { transform-origin: 32px 32px; transition: transform 0.6s cubic-bezier(.34,1.4,.44,1); }
.brand:hover .wheel-spin { transform: rotate(45deg); }

/* ——— header ——— */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 56px);
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.wordmark { font-family: var(--display); font-weight: 650; font-size: 24px; letter-spacing: -0.02em; }
.site-nav { display: flex; align-items: center; gap: clamp(10px, 2vw, 26px); }
.site-nav a { color: var(--stone); text-decoration: none; font-size: 15px; font-weight: 550; }
.site-nav a:hover { color: var(--ink); }
.gh-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 7px 16px; color: var(--ink) !important; font-weight: 650 !important;
}
.gh-btn:hover { background: var(--ink); color: var(--paper) !important; }
@media (max-width: 720px) { .site-nav a:not(.gh-btn) { display: none; } }

/* ——— hero ——— */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 72px); align-items: center;
  padding: clamp(40px, 7vh, 90px) clamp(20px, 5vw, 56px);
  max-width: 1240px; margin: 0 auto;
}
/* Stacked: lead with the live demo, not a wall of copy. */
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; }
  .hero-demo { order: -1; }
}
.eyebrow {
  font-size: 12.5px; font-weight: 750; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--grain); margin: 0 0 14px;
}
h1 {
  font-family: var(--display); font-weight: 750; font-size: clamp(38px, 5.2vw, 64px);
  line-height: 1.04; letter-spacing: -0.025em; margin: 0 0 20px;
}
h1 em, h2 em { font-style: italic; color: var(--grain); }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--stone); max-width: 56ch; margin: 0 0 18px; }
.lede strong { color: var(--ink); }

/* typed topic rotator — the agent-authoring pitch, animated */
.type-line {
  font-family: var(--mono); font-size: 14px; color: var(--stone);
  background: var(--paper-deep); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; margin: 0 0 22px; line-height: 1.4;
}
.tl-you { color: var(--grain); font-weight: 700; margin-right: 4px; }
.type-rotator { color: var(--ink); font-weight: 650; }
.type-caret {
  display: inline-block; width: 8px; height: 1.05em; background: var(--grain);
  vertical-align: -3px; margin-left: 1px; animation: blink 1s steps(1) infinite;
}

.code-block {
  position: relative; background: var(--code-bg); color: var(--code-ink);
  border-radius: 14px; padding: 18px 20px; overflow-x: auto;
  box-shadow: 0 8px 28px rgba(33, 29, 24, 0.18);
}
.code-block pre { margin: 0; padding-right: 62px; font-family: var(--mono); font-size: 14px; line-height: 1.75; }
.install-card .code-block pre { font-size: 12.5px; }
.code-block .c { opacity: 0.45; }
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  font: 650 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--code-ink); background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 8px;
  padding: 6px 10px; cursor: pointer;
}
.copy-btn:hover { background: rgba(255,255,255,0.18); }

.cta-row { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 12px 24px; font-weight: 700; font-size: 16px;
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: transform 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--grain); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--grain); color: var(--grain); }

/* ——— hero demo (live quiz) ——— */
.demo-frame {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(33, 29, 24, 0.14);
  overflow: hidden;
}
.demo-titlebar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--paper-deep);
}
.demo-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--c, #ccc); }
.demo-title { font-size: 12.5px; color: var(--stone); margin-left: 6px; font-family: var(--mono); }
.demo-hint { text-align: center; color: var(--stone); font-size: 14px; margin-top: 14px; }

/* Fixed height: the answered state (feedback + button) is taller than the
   question-only state, so a variable height would grow the frame and shove
   the rest of the page around on every click. Pin it to the worst case;
   the question-only state just shows a little breathing room below. */
.quiz { padding: 20px; height: 600px; display: flex; flex-direction: column; overflow-y: auto; }
@media (max-width: 920px) { .quiz { height: auto; min-height: 520px; } }
.quiz-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.quiz-chip {
  font-size: 10.5px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, transparent);
  border-radius: 999px; padding: 4px 10px;
}
.quiz-chip.requeued { color: var(--grain); background: var(--grain-soft); }
.quiz-dots { display: flex; gap: 5px; }
.quiz-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.quiz-dots span.done { background: var(--ok); }
.quiz-dots span.missed { background: var(--grain); }
.quiz-dots span.now { background: var(--ink); transform: scale(1.25); }
.quiz-prompt { font-size: 17px; font-weight: 650; line-height: 1.45; margin: 4px 0 16px; }
.quiz-opts { display: flex; flex-direction: column; gap: 9px; }
.quiz-opt {
  display: flex; align-items: flex-start; gap: 11px; text-align: left;
  border: 2px solid var(--line); border-radius: 13px; background: var(--card);
  padding: 11px 13px; font: 550 15px/1.45 var(--body); color: var(--ink); cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--grain); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt .key {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--stone); font: 750 12px/1 var(--mono); color: var(--stone);
}
.quiz-opt.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.quiz-opt.is-correct .key { background: var(--ok); border-color: var(--ok); color: #fff; }
.quiz-opt.is-wrong { border-color: var(--warn); background: var(--warn-soft); }
.quiz-opt.is-wrong .key { background: var(--warn); border-color: var(--warn); color: #fff; }
.quiz-opt.is-dim { opacity: 0.55; }

.quiz-feedback { border-radius: 13px; padding: 13px 15px; margin-top: 14px; font-size: 14.5px; line-height: 1.55; }
.quiz-feedback.good { background: var(--ok-soft); }
.quiz-feedback.bad { background: var(--warn-soft); }
.quiz-feedback .verdict { font-family: var(--display); font-weight: 750; font-size: 17px; display: block; margin-bottom: 4px; }
.quiz-feedback.good .verdict { color: var(--ok); }
.quiz-feedback.bad .verdict { color: var(--warn); }
.quiz-feedback .comeback { display: block; margin-top: 8px; font-weight: 650; color: var(--grain); }
.quiz-next { margin-top: 13px; width: 100%; }
.quiz-btn {
  width: 100%; border: none; border-radius: 13px; background: var(--ink); color: var(--paper);
  font: 700 15.5px/1 var(--body); padding: 14px; cursor: pointer;
}
.quiz-btn:hover { background: var(--grain); }

.quiz-end { text-align: center; margin: auto 0; padding: 10px 0; }
.quiz-end .score { font-family: var(--display); font-weight: 750; font-size: 54px; line-height: 1; }
.quiz-end .rescued { color: var(--grain); font-weight: 700; margin-top: 8px; }
.quiz-end p { color: var(--stone); margin: 14px auto 18px; max-width: 34ch; }

/* ——— sections ——— */
.section { padding: clamp(56px, 9vh, 110px) clamp(20px, 5vw, 56px); max-width: 1240px; margin: 0 auto; }
.section h2 {
  font-family: var(--display); font-weight: 750; font-size: clamp(30px, 3.8vw, 46px);
  letter-spacing: -0.02em; line-height: 1.08; margin: 0 0 16px;
}
.section-lede { color: var(--stone); max-width: 64ch; font-size: 17.5px; margin: 0 0 36px; }
.section-tint { max-width: none; background: var(--paper-deep); }
.section-tint > * { max-width: 1240px; margin-left: auto; margin-right: auto; }
.section-tint .feature-grid { margin-top: 36px; }

/* ——— pack switcher / phone ——— */
.packswitch { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: clamp(24px, 4vw, 64px); align-items: center; }
@media (max-width: 920px) { .packswitch { grid-template-columns: 1fr; } }
.pack-chips { display: flex; flex-direction: column; gap: 12px; }
.pack-chip {
  display: flex; align-items: center; gap: 14px; text-align: left;
  border: 2px solid var(--line); border-radius: 16px; background: var(--card);
  padding: 14px 16px; cursor: pointer; font: 550 15px/1.4 var(--body); color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pack-chip:hover { border-color: color-mix(in srgb, var(--pc, var(--grain)) 45%, var(--line)); }
.pack-chip.is-active { border-color: var(--pc, var(--grain)); box-shadow: 0 6px 18px color-mix(in srgb, var(--pc, var(--grain)) 22%, transparent); }
.pack-chip .swatch {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; background: var(--pc);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font: 800 13px/1 var(--body); letter-spacing: -0.04em;
}
.pack-chip small { display: block; color: var(--stone); font-size: 13px; }

/* Fixed to the phone's own width so the grid's auto column never resizes
   with the per-pack caption text — otherwise switching packs shoved the
   phone left and right. The caption now wraps within this width. */
.phone-wrap { justify-self: center; text-align: center; width: 280px; }
.phone {
  width: 280px; border-radius: 40px; border: 10px solid var(--ink);
  background: var(--paper); overflow: hidden; position: relative;
  box-shadow: 0 24px 60px rgba(33,29,24,0.22);
}
.phone-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 88px; height: 20px; border-radius: 12px; background: var(--ink); }
.phone-screen { padding: 44px 18px 18px; min-height: 470px; display: flex; flex-direction: column; transition: background 0.4s ease; }
.app-icon {
  width: 58px; height: 58px; border-radius: 16px; background: var(--ac, var(--teal));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font: 800 19px/1 var(--body); letter-spacing: -0.05em; margin-bottom: 12px;
  transition: background 0.4s ease;
}
.app-title { font-family: var(--display); font-weight: 750; font-size: 21px; margin: 0; line-height: 1.15; }
.app-subtitle { color: var(--stone); font-size: 13px; margin: 5px 0 16px; }
.app-cats { display: flex; flex-direction: column; gap: 8px; }
.app-cat { border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; font-size: 13px; font-weight: 650; background: var(--card); }
.app-cat .bar { height: 5px; border-radius: 3px; background: var(--line); margin-top: 7px; overflow: hidden; }
.app-cat .bar i { display: block; height: 100%; width: var(--p, 30%); background: var(--ac, var(--teal)); border-radius: 3px; transition: width 0.5s ease, background 0.4s ease; }
.app-practice {
  margin-top: 16px; border: none; border-radius: 13px; background: var(--ac, var(--teal));
  color: #fff; font: 750 15px/1 var(--body); padding: 13px; cursor: pointer; transition: background 0.4s ease;
}
.app-installbar { margin-top: auto; padding-top: 14px; text-align: center; color: var(--stone); font-size: 11.5px; }
.phone-caption { margin-top: 16px; color: var(--stone); font-size: 14px; min-height: 3em; }

/* ——— terminal / agent ——— */
.section-dark { max-width: none; background: var(--code-bg); color: var(--code-ink); }
.section-dark > * { max-width: 1240px; margin-left: auto; margin-right: auto; }
.section-dark h2 { color: var(--code-ink); }
.section-dark .section-lede { color: color-mix(in srgb, var(--code-ink) 72%, transparent); }
.section-dark .eyebrow { color: var(--grain); }
.section-dark code { background: rgba(255,255,255,0.08); color: var(--code-ink); }
.terminal {
  border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(255,255,255,0.12);
  background: #0f0c08; box-shadow: 0 18px 50px rgba(0,0,0,0.4);
}
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: rgba(255,255,255,0.05); }
.terminal-title { font: 12.5px var(--mono); color: rgba(255,255,255,0.5); margin-left: 6px; }
.terminal-body { padding: 18px 20px; font: 14px/1.8 var(--mono); min-height: 270px; white-space: pre-wrap; }
.terminal-body .u { color: #8ec9ff; }
.terminal-body .a { color: #e8d9b5; }
.terminal-body .err { color: #ff9f9f; }
.terminal-body .ok { color: #79e0a5; }
.terminal-body .dim { color: rgba(255,255,255,0.4); }
.cursor { display: inline-block; width: 8px; height: 16px; background: var(--grain); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.agent-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 28px; }
.agent-step {
  display: flex; gap: 12px; align-items: baseline;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; padding: 14px 16px; font-size: 14.5px;
}
.agent-step span {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grain); color: #fff; font: 750 12px/1 var(--mono);
}

/* ——— format tabs ——— */
.format-tabs { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.tab-row { display: flex; border-bottom: 1px solid var(--line); background: var(--paper-deep); }
.tab {
  border: none; background: none; padding: 13px 20px; cursor: pointer;
  font: 650 14px var(--mono); color: var(--stone); border-bottom: 2.5px solid transparent;
}
.tab.is-active { color: var(--grain); border-bottom-color: var(--grain); background: var(--card); }
.tab-panels { position: relative; }
.tab-panel { display: none; margin: 0; padding: 20px 24px; overflow-x: auto; font: 13.5px/1.7 var(--mono); }
.tab-panel.is-active { display: block; }
.format-note { color: var(--stone); font-size: 15.5px; max-width: 70ch; margin-top: 22px; }

/* ——— features ——— */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; }
.feature h3 { font-family: var(--display); font-weight: 650; font-size: 18px; margin: 0 0 8px; }
.feature p { margin: 0; color: var(--stone); font-size: 14.5px; }

/* ——— inside-every-app showcase ——— */
.showcase { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.show-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.show-card h3 { font-family: var(--display); font-weight: 650; font-size: 20px; margin: 0; }
.show-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.show-sub { color: var(--stone); font-size: 14px; margin: 6px 0 16px; }
.show-foot { color: var(--stone); font-size: 12.5px; margin: 12px 0 0; }
.show-streak { font-size: 12px; font-weight: 750; color: var(--grain); background: var(--grain-soft); border-radius: 999px; padding: 4px 11px; white-space: nowrap; }

.show-stickers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sc {
  border: 2px solid var(--line); border-radius: 14px; background: var(--paper-deep);
  padding: 12px 6px; text-align: center; color: var(--stone);
}
.sc span { font-size: 30px; display: block; filter: grayscale(1); opacity: 0.35; transition: transform 0.2s ease; }
.sc b { display: block; font-size: 11px; font-weight: 650; margin-top: 5px; }
.sc.earned { background: var(--card); border-color: var(--grain); color: var(--ink); }
.sc.earned span { filter: none; opacity: 1; }
.sc.earned:hover span { transform: rotate(-8deg) scale(1.15); }

.show-bars { display: flex; flex-direction: column; gap: 11px; }
.sb { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; font-size: 13px; font-weight: 650; }
.sb em { font-style: normal; color: var(--stone); font-weight: 550; }
.sb .bar { grid-column: 1 / -1; height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.sb .bar i { display: block; height: 100%; width: 0; background: var(--c, var(--teal)); border-radius: 4px; transition: width 0.9s cubic-bezier(.4,0,.2,1); }
.reveal.is-in .sb .bar i { width: var(--p, 0%); }
.show-spark { display: flex; align-items: flex-end; gap: 5px; height: 54px; margin-top: 16px; }
.show-spark i { flex: 1; height: 8px; background: color-mix(in srgb, var(--teal) 14%, transparent); border-top: 3px solid var(--teal); border-radius: 3px 3px 0 0; transition: height 0.7s cubic-bezier(.4,0,.2,1); }
.reveal.is-in .show-spark i { height: var(--h, 40%); }

.show-explain { border-radius: 13px; background: var(--ok-soft); padding: 14px 16px; }
.se-verdict { font-family: var(--display); font-weight: 750; font-size: 16px; color: var(--ok); }
.show-explain p { margin: 6px 0 0; font-size: 14px; line-height: 1.55; }
.se-source { margin-top: 10px; font-size: 12px; color: var(--stone); font-family: var(--mono); }
.explain-link {
  display: inline-block; margin-top: 4px; color: var(--grain); font-weight: 650;
  text-decoration: none; border-bottom: 1.5px solid color-mix(in srgb, var(--grain) 40%, transparent);
}
.explain-link:hover { border-bottom-color: var(--grain); }

/* ——— scroll-reveal ——— */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.34,1.2,.44,1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .reveal.is-in .sb .bar i { transition: none; }
  .reveal.is-in .show-spark i { transition: none; }
}

/* ——— install ——— */
.install-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.install-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.install-card h3 { font-family: var(--display); font-weight: 650; font-size: 20px; margin: 0 0 14px; }
.install-card .code-block { box-shadow: none; }
.install-card p { color: var(--stone); font-size: 14.5px; margin: 14px 0 0; }
.packs-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 40px; }
.pack-card {
  display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 16px 18px;
  font-size: 14px; line-height: 1.4; transition: border-color 0.15s ease, transform 0.15s ease;
}
.pack-card:hover { border-color: var(--grain); transform: translateY(-3px); }
.pack-card-you { border-style: dashed; }
.pack-swatch {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 13px; background: var(--c);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font: 800 14px/1 var(--body);
}

/* ——— footer ——— */
.site-footer { border-top: 1px solid var(--line); background: var(--paper-deep); }
.footer-inner {
  max-width: 1240px; margin: 0 auto; padding: 40px clamp(20px, 5vw, 56px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px 36px;
}
.footer-inner p { color: var(--stone); font-size: 14px; margin: 0; flex: 1; }
.footer-inner nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-inner nav a { color: var(--stone); font-size: 14px; text-decoration: none; }
.footer-inner nav a:hover { color: var(--grain); }

/* ——— confetti ——— */
.confetti {
  position: fixed; width: 9px; height: 14px; top: -20px; z-index: 100; pointer-events: none;
  animation: fall var(--t, 2.4s) ease-in forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(var(--r, 540deg)); opacity: 0.9; }
}
/* In-phone confetti: absolute within the host, smaller drop. */
.confetti-local { position: absolute; width: 7px; height: 11px; animation-name: fall-local; }
@keyframes fall-local {
  to { transform: translateY(520px) rotate(var(--r, 540deg)); opacity: 0.9; }
}

/* ——— sticker toast (hero frame + phone) ——— */
.sticker-toast {
  position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--paper);
  border-radius: 14px; padding: 11px 14px; font-size: 13.5px; line-height: 1.35;
  box-shadow: 0 12px 32px rgba(33,29,24,0.35);
  animation: toast-in 0.45s cubic-bezier(.34,1.4,.44,1), toast-out 0.4s ease-in 2.7s forwards;
}
.sticker-toast b { display: block; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grain); }
.st-emoji { font-size: 28px; line-height: 1; animation: st-wobble 0.9s ease 0.3s; }
.demo-frame { position: relative; }
@keyframes toast-in { from { transform: translateY(24px) scale(0.9); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(16px); opacity: 0; } }
@keyframes st-wobble {
  25% { transform: rotate(-14deg) scale(1.25); }
  60% { transform: rotate(10deg) scale(1.1); }
}

/* ——— mini quizmill (inside the phone) ——— */
.phone-screen { position: relative; --acs: color-mix(in srgb, var(--ac, var(--teal)) 12%, transparent); }
.mini-app { display: flex; flex-direction: column; min-height: 432px; }
.ma-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; min-height: 34px; }
.ma-head .app-icon { width: 40px; height: 40px; border-radius: 12px; font-size: 14px; margin-bottom: 0; }
.ma-nav { display: flex; gap: 7px; }
.ma-nav button {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 14px; line-height: 1; transition: border-color 0.15s ease, color 0.15s ease;
}
.ma-nav button:hover { border-color: var(--ac, var(--teal)); color: var(--ac, var(--teal)); }
.mini-app .app-title { font-size: 19px; }
.mini-app .app-subtitle { margin-bottom: 12px; }
.ma-back {
  border: none; background: none; cursor: pointer; padding: 4px 8px 4px 0;
  font: 650 13px var(--body); color: var(--stone);
}
.ma-back:hover { color: var(--ac, var(--teal)); }
.ma-count { font: 650 11px var(--mono); color: var(--stone); }
.ma-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.ma-stat { background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.ma-stat b { font-family: var(--display); font-size: 19px; display: block; line-height: 1.15; }
.ma-stat span { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stone); }
.ma-cats { display: flex; flex-direction: column; gap: 7px; }
.ma-cat {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--card);
  padding: 9px 12px; font: 650 13px/1.3 var(--body); color: var(--ink); cursor: pointer;
  transition: border-color 0.12s ease;
}
.ma-cat:hover { border-color: var(--ac, var(--teal)); }
.ma-cat small { display: block; font-weight: 500; color: var(--stone); font-size: 11px; }
.ma-cat-go { color: var(--stone); font-size: 16px; }
.mini-app .app-practice { margin-top: 12px; }
.ma-chip {
  align-self: flex-start; font-size: 9.5px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ac, var(--teal)); background: var(--acs); border-radius: 999px; padding: 3px 9px; margin-bottom: 8px;
}
.ma-q { font-size: 14px; font-weight: 650; line-height: 1.4; margin-bottom: 10px; }
.ma-opts { display: flex; flex-direction: column; gap: 6px; }
.ma-opt {
  display: flex; align-items: flex-start; gap: 8px; text-align: left;
  border: 1.5px solid var(--line); border-radius: 11px; background: var(--card);
  padding: 8px 10px; font: 550 12.5px/1.35 var(--body); color: var(--ink); cursor: pointer;
}
.ma-opt:hover:not(:disabled) { border-color: var(--ac, var(--teal)); }
.ma-opt:disabled { cursor: default; }
.ma-opt .key {
  flex-shrink: 0; width: 19px; height: 19px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--stone); font: 750 10px/1 var(--mono); color: var(--stone);
}
.ma-opt.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.ma-opt.is-correct .key { background: var(--ok); border-color: var(--ok); color: #fff; }
.ma-opt.is-wrong { border-color: var(--warn); background: var(--warn-soft); }
.ma-opt.is-wrong .key { background: var(--warn); border-color: var(--warn); color: #fff; }
.ma-opt.is-dim { opacity: 0.5; }
.ma-feedback { border-radius: 11px; padding: 9px 11px; margin-top: 9px; font-size: 11.5px; line-height: 1.45; }
.ma-feedback.good { background: var(--ok-soft); }
.ma-feedback.bad { background: var(--warn-soft); }
.ma-feedback b { display: block; font-family: var(--display); font-size: 13px; }
.ma-feedback.good b { color: var(--ok); }
.ma-feedback.bad b { color: var(--warn); }
.ma-next {
  width: 100%; margin-top: 9px; border: none; border-radius: 11px;
  background: var(--ink); color: var(--paper); font: 700 13px/1 var(--body); padding: 11px; cursor: pointer;
}
.ma-next:hover { background: var(--ac, var(--teal)); }
.ma-end { text-align: center; margin: auto 0; }
.ma-score { font-family: var(--display); font-weight: 750; font-size: 44px; line-height: 1; }
.ma-end-sub { color: var(--stone); font-size: 12.5px; margin: 6px 0 16px; }
.ma-ghost {
  width: 100%; margin-top: 8px; border: 1.5px solid var(--line); border-radius: 13px;
  background: none; color: var(--ink); font: 650 13px/1 var(--body); padding: 11px; cursor: pointer;
}
.ma-ghost:hover { border-color: var(--ac, var(--teal)); color: var(--ac, var(--teal)); }
.ma-h { font-family: var(--display); font-weight: 750; font-size: 18px; margin: 0 0 10px; }
.ma-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ma-sticker {
  border: 2px solid var(--line); border-radius: 12px; background: var(--paper-deep);
  padding: 8px 6px; text-align: center; font-size: 10px; line-height: 1.3; color: var(--stone);
}
.ma-sticker b { display: block; font-size: 11px; color: inherit; }
.ma-sticker small { display: block; font-size: 9px; }
.ma-sticker-emoji { font-size: 22px; display: block; filter: grayscale(1); opacity: 0.35; }
.ma-sticker.is-earned { background: var(--card); border-color: var(--grain); color: var(--ink); }
.ma-sticker.is-earned .ma-sticker-emoji { filter: none; opacity: 1; }
.ma-locked { text-transform: uppercase; letter-spacing: 0.1em; font-size: 8px !important; }
.ma-note { color: var(--stone); font-size: 11px; margin: 10px 0 0; text-align: center; }
.ma-section { font-size: 10px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stone); margin: 4px 0 7px; }
.ma-bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ma-bar-row { font-size: 11.5px; font-weight: 650; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.ma-bar-row em { font-style: normal; color: var(--stone); font-weight: 550; }
.ma-bar-row .bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ma-bar-row .bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--ac, var(--teal)); border-radius: 3px; transition: width 0.5s ease; }
.ma-days { display: flex; align-items: flex-end; gap: 4px; height: 56px; }
.ma-days i { flex: 1; height: var(--h, 40%); background: var(--acs); border-top: 3px solid var(--ac, var(--teal)); border-radius: 3px 3px 0 0; }
.ma-streak {
  font-size: 11px; font-weight: 750; color: var(--grain);
  background: var(--grain-soft); border-radius: 999px; padding: 4px 10px;
}

/* ——— quiz end: link to the real app ——— */
.quiz-link { display: block; margin-top: 12px; font-size: 13.5px; font-weight: 650; color: var(--grain); text-decoration: none; }
.quiz-link:hover { text-decoration: underline; }
