/* ============================================================
   Vibe Camp — "Camp Vibe" theme
   A vintage summer-camp trail map: parchment canvas, merit badges,
   pennant bunting, hand-painted signposts. Warm, outdoorsy, crafted.
   ============================================================ */

:root {
  /* --- warm camp palette (tinted neutrals, no pure black/white) --- */
  --paper:      #f6ead0;   /* tent canvas / parchment */
  --paper-2:    #fcf5e4;   /* lighter card / postcard */
  --paper-3:    #efe0c2;   /* sunk panel */
  --edge:       #e0cda3;   /* tan hairline */
  --edge-strong:#cdb487;
  --ink:        #36291b;   /* warm bark-black text */
  --ink-soft:   #8a755a;   /* muted trail-brown */

  --pine:       #2f6b46;   /* primary */
  --pine-deep:  #214d33;
  --clay:       #d2552c;   /* campfire orange */
  --clay-deep:  #b3411e;
  --sun:        #f2b430;   /* golden badge */
  --sun-deep:   #d8951a;
  --lake:       #2b7a8c;
  --berry:      #b23a48;
  --good:       #2f8f4e;
  --bad:        #c4452f;

  --accent: var(--pine);   /* overridden per-week inline */

  --maxw: 460px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* warm, low, slightly hard "sticker" shadow — feels printed/placed */
  --lift: 0 2px 0 rgba(54,41,27,.10), 0 10px 22px -12px rgba(54,41,27,.40);
  --sticker: 0 3px 0 rgba(54,41,27,.16);

  --font-display: "Fraunces", Georgia, serif;
  --font-hand: "Shantell Sans", "Comic Sans MS", cursive;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

/* paper grain + soft sun-bloom, layered for a canvas feel */
body {
  background-image:
    radial-gradient(120% 80% at 80% -10%, rgba(242,180,48,.22), transparent 55%),
    radial-gradient(90% 60% at -10% 5%, rgba(43,122,140,.10), transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

#app { min-height: 100dvh; width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.screen {
  position: relative; min-height: 100dvh; width: 100%;
  max-width: var(--maxw); margin: 0 auto;
  display: flex; flex-direction: column;
}
@media (min-width: 480px) {
  .screen { box-shadow: 0 0 70px -20px rgba(54,41,27,.55); }
}

/* --- pennant bunting strip (the camp banner) --- */
.bunting {
  height: 22px; flex: 0 0 auto;
  margin-top: var(--safe-top);
  background:
    repeating-linear-gradient(135deg, transparent 0 13px, rgba(54,41,27,.12) 13px 14px),
    conic-gradient(from 0deg, var(--clay), var(--sun), var(--pine), var(--lake), var(--berry), var(--clay));
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 13px, transparent 13px 14px) top/auto 100% repeat-x,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: source-in;
  mask: repeating-linear-gradient(90deg, #000 0 13px, transparent 13px 14px),
    linear-gradient(#000 0 0);
  mask-composite: intersect;
  clip-path: polygon(0 0,100% 0,100% 55%, 96% 100%, 92% 55%, 88% 100%, 84% 55%, 80% 100%, 76% 55%, 72% 100%, 68% 55%, 64% 100%, 60% 55%, 56% 100%, 52% 55%, 48% 100%, 44% 55%, 40% 100%, 36% 55%, 32% 100%, 28% 55%, 24% 100%, 20% 55%, 16% 100%, 12% 55%, 8% 100%, 4% 55%, 0 100%);
  opacity: .92;
}

/* ============================================================
   HOME — the trail map
   ============================================================ */
.home { padding: 0 18px calc(var(--safe-bottom) + 40px); }

.home-header { padding: 18px 2px 4px; position: relative; }
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-weight: 900; font-size: clamp(30px, 9vw, 40px);
  font-style: italic; letter-spacing: -0.02em; color: var(--pine-deep);
  line-height: 1;
}
.brand .logo {
  width: 46px; height: 46px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 24px;
  background: var(--sun); color: var(--pine-deep);
  border-radius: 50%;
  border: 3px solid var(--pine-deep);
  box-shadow: var(--sticker);
  transform: rotate(-8deg);
}
.tagline {
  font-family: var(--font-hand);
  color: var(--clay-deep); font-size: 16px; font-weight: 600;
  margin: 10px 2px 0; transform: rotate(-0.6deg);
}

/* stat patches — embroidered badges, hand-placed */
.stats { display: flex; gap: 10px; margin: 20px 0 6px; }
.stat {
  flex: 1; text-align: center;
  background: var(--paper-2);
  border: 2px dashed var(--edge-strong);
  border-radius: 16px; padding: 11px 8px 9px;
  box-shadow: var(--sticker);
}
.stat:nth-child(1) { transform: rotate(-1.5deg); }
.stat:nth-child(2) { transform: rotate(0.8deg); }
.stat:nth-child(3) { transform: rotate(-0.6deg); }
.stat .num { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--ink); }
.stat .lbl { font-family: var(--font-hand); font-size: 11px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

/* the big trail-sign CTA */
.continue-btn {
  width: 100%; margin: 22px 0 30px;
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--pine); color: #fdf6e6;
  padding: 17px 18px; border-radius: 18px;
  border: 2.5px solid var(--pine-deep);
  box-shadow: 0 5px 0 var(--pine-deep), 0 16px 26px -14px rgba(33,77,51,.8);
  font-family: var(--font-display); font-weight: 800; font-size: 18px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.continue-btn::before {
  content: "🥾"; font-size: 26px;
  background: var(--sun); border-radius: 12px; padding: 8px;
  border: 2px solid var(--pine-deep); transform: rotate(-6deg); flex: 0 0 auto;
}
.continue-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--pine-deep), 0 8px 16px -12px rgba(33,77,51,.8); }
.continue-btn small { display: block; font-family: var(--font-body); font-weight: 600; opacity: .85; font-size: 12px; margin-top: 2px; }
.continue-btn:disabled { background: var(--paper-3); color: var(--ink-soft); border-color: var(--edge-strong); box-shadow: var(--sticker); }
.continue-btn:disabled::before { background: var(--paper-2); }

/* --- a trail (week) --- */
.week-group { margin-bottom: 26px; }
.week-head {
  display: flex; align-items: center; gap: 12px;
  background: var(--accent); color: #fdf6e6;
  padding: 10px 16px; border-radius: 14px;
  border: 2.5px solid rgba(54,41,27,.55);
  box-shadow: var(--sticker);
  margin-bottom: 4px; transform: rotate(-0.5deg);
  position: relative; z-index: 2;
}
.week-icon { font-size: 22px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.week-title {
  font-family: var(--font-display); font-weight: 800; font-style: italic;
  font-size: 15px; letter-spacing: .01em;
}
.week-title b { display: block; font-style: normal; font-family: var(--font-hand); font-size: 11px; font-weight: 700; opacity: .85; text-transform: uppercase; letter-spacing: .12em; }

/* trail stops, strung along a dashed path */
.trail { position: relative; padding: 14px 0 2px 6px; }
.trail::before {
  content: ""; position: absolute; left: 28px; top: 0; bottom: 26px;
  border-left: 3px dashed color-mix(in oklab, var(--accent) 55%, var(--edge-strong));
  z-index: 0;
}

.session-row {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  padding: 8px 6px; margin-bottom: 6px;
  background: none;
  transition: transform .12s ease;
}
.session-row:active { transform: scale(0.99); }

/* the trail-stop badge (number) */
.session-num {
  flex: 0 0 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 17px;
  background: var(--paper-2); color: var(--ink);
  border: 3px solid var(--edge-strong);
  box-shadow: var(--sticker);
}
.session-row.done .session-num {
  background: var(--accent); color: #fdf6e6;
  border-color: rgba(54,41,27,.5);
}
.session-row.current .session-num {
  background: var(--sun); color: var(--pine-deep);
  border-color: var(--pine-deep);
  animation: bob 1.8s ease-in-out infinite;
}
.session-row.locked { opacity: .58; }
.session-row.locked .session-num { background: var(--paper-3); border-style: dashed; }

@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.session-info { flex: 1; min-width: 0; padding: 2px 0; }
.session-info .t { display: block; font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.2; color: var(--ink); }
.session-info .d { display: block; color: var(--ink-soft); font-size: 12.5px; margin-top: 3px; line-height: 1.32; }
.session-row.current .session-info .t { color: var(--pine-deep); }

.session-badge { flex: 0 0 auto; font-size: 17px; }
.session-row.current .session-badge {
  font-family: var(--font-hand); font-weight: 800; font-size: 11px;
  color: var(--clay-deep); background: var(--paper-2);
  border: 2px solid var(--clay); border-radius: 999px; padding: 3px 8px;
  transform: rotate(4deg); white-space: nowrap;
}

/* ============================================================
   STORY PLAYER — postcards from camp
   ============================================================ */
.story {
  min-height: 100dvh; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  background: var(--paper);
}
.story-bg { position: absolute; inset: 0; opacity: .9; }
.story-bg::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(130% 60% at 50% 0%, transparent 0%, var(--paper) 72%); }

/* progress = a row of stitches */
.progress-bars { position: relative; z-index: 3; display: flex; gap: 5px; padding: calc(var(--safe-top) + 14px) 16px 4px; }
.pbar { flex: 1; height: 5px; border-radius: 5px; background: color-mix(in oklab, var(--accent) 22%, var(--paper-3)); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(54,41,27,.08); }
.pbar .fill { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 5px; transition: width .25s ease; }

.story-top { position: relative; z-index: 6; display: flex; align-items: center; justify-content: space-between; padding: 10px 18px 0; }
.story-top .label { font-family: var(--font-hand); font-size: 13px; font-weight: 700; color: var(--accent); }
.story-controls { display: flex; align-items: center; gap: 4px; }
.ctrl {
  font-size: 16px; line-height: 1; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-2); border: 2px solid var(--edge-strong); color: var(--ink);
  box-shadow: var(--sticker);
}
.ctrl:active { transform: translateY(1px); }
.close-btn { font-size: 26px; line-height: 1; color: var(--ink-soft); padding: 4px 6px; }

.frame {
  position: relative; z-index: 2; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 16px 26px 30px;
  animation: frameIn .4s cubic-bezier(.2,.8,.2,1);
}
@keyframes frameIn { from { opacity: 0; transform: translateY(14px) rotate(-.5deg); } to { opacity: 1; transform: none; } }

/* the emoji sits on a hand-stamped badge disc */
.frame .emoji {
  font-size: 60px; width: 132px; height: 132px; margin-bottom: 22px;
  display: grid; place-items: center;
  background: var(--paper-2);
  border-radius: 50%;
  border: 3px dashed var(--accent);
  box-shadow: var(--lift); transform: rotate(-2deg);
}
.frame .heading {
  font-family: var(--font-display); font-weight: 900; font-style: italic;
  font-size: clamp(26px, 8vw, 32px); line-height: 1.1; letter-spacing: -.01em;
  margin-bottom: 16px; color: var(--ink); text-wrap: balance;
}
.frame .body { font-size: 18px; line-height: 1.5; color: var(--ink); max-width: 21em; }

.tap-zones { position: absolute; inset: 0; z-index: 4; display: flex; }
.tap-zones .tz { flex: 1; }
.tap-zones .tz-back { flex: 0 0 32%; }

.story-hint { position: relative; z-index: 3; text-align: center; font-family: var(--font-hand); color: var(--ink-soft); font-size: 12.5px; padding-bottom: calc(var(--safe-bottom) + 16px); }

/* ============================================================
   QUIZ + WARM-UP — campfire quiz
   ============================================================ */
.quiz {
  min-height: 100dvh; display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + 18px) 20px calc(var(--safe-bottom) + 20px);
}
.quiz-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.quiz-progress { font-family: var(--font-hand); color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.quiz-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.quiz-kicker { font-family: var(--font-hand); color: var(--clay-deep); font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.warmup-sub { font-family: var(--font-hand); color: var(--ink-soft); font-size: 14px; margin: -4px 0 16px; }
.quiz-q { font-family: var(--font-display); font-weight: 800; font-size: clamp(22px, 6.5vw, 26px); line-height: 1.2; margin-bottom: 22px; color: var(--ink); text-wrap: balance; }

.options { display: flex; flex-direction: column; gap: 11px; }
.option {
  text-align: left; width: 100%; display: flex; align-items: center; gap: 13px;
  background: var(--paper-2); border: 2.5px solid var(--edge-strong);
  border-radius: 14px; padding: 15px 16px; font-size: 15.5px; line-height: 1.35; font-weight: 600;
  box-shadow: var(--sticker);
  transition: border-color .12s, background .12s, transform .1s;
}
.option:active { transform: translateY(2px); }
.option .mark { flex: 0 0 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--edge-strong); display: grid; place-items: center; font-size: 14px; color: #fff; }
.option.correct { border-color: var(--good); background: color-mix(in oklab, var(--good) 14%, var(--paper-2)); }
.option.correct .mark { border-color: var(--good); background: var(--good); }
.option.wrong { border-color: var(--bad); background: color-mix(in oklab, var(--bad) 12%, var(--paper-2)); }
.option.wrong .mark { border-color: var(--bad); background: var(--bad); }
.option:disabled { cursor: default; }

.explain {
  margin-top: 18px; background: var(--paper-3);
  border: 2px solid var(--edge-strong); border-left: 6px solid var(--accent);
  border-radius: 12px; padding: 14px 16px; font-size: 14.5px; line-height: 1.5; color: var(--ink);
  animation: frameIn .3s ease;
}
.explain b { font-family: var(--font-hand); color: var(--clay-deep); }
.from-label { margin-top: 8px; font-family: var(--font-hand); font-size: 12.5px; color: var(--ink-soft); }

.quiz-next {
  margin-top: 16px; width: 100%;
  background: var(--clay); color: #fdf6e6;
  font-family: var(--font-display); font-weight: 800; font-size: 17px;
  padding: 16px; border-radius: 14px;
  border: 2.5px solid var(--clay-deep);
  box-shadow: 0 4px 0 var(--clay-deep);
  transition: transform .1s, box-shadow .1s;
}
.quiz-next:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--clay-deep); }
.skip-link { align-self: center; font-family: var(--font-hand); color: var(--ink-soft); font-size: 14px; padding: 12px; margin-top: 8px; text-decoration: underline dashed; text-underline-offset: 3px; }
.skip-link:active { color: var(--ink); }

/* ============================================================
   RESULT — merit badge + camp logbook
   ============================================================ */
.result { min-height: 100dvh; padding: calc(var(--safe-top) + 28px) 22px calc(var(--safe-bottom) + 28px); display: flex; flex-direction: column; }
.result-hero { text-align: center; margin-bottom: 4px; }
.result-hero .big {
  font-size: 56px; width: 116px; height: 116px; margin: 0 auto 8px;
  display: grid; place-items: center;
  background: var(--sun); border-radius: 50%;
  border: 4px solid var(--pine-deep);
  box-shadow: var(--lift); transform: rotate(-4deg);
  position: relative;
}
.result-hero .big::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 3px dashed var(--pine-deep); opacity: .35; transform: rotate(8deg);
}
.result-hero h2 { font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 28px; margin: 10px 0 2px; color: var(--pine-deep); }
.result-hero p { font-family: var(--font-hand); color: var(--ink-soft); margin: 0; font-size: 15px; }

.score-pills { display: flex; gap: 10px; justify-content: center; margin: 18px 0 24px; }
.pill { background: var(--paper-2); border: 2px dashed var(--edge-strong); border-radius: 14px; padding: 10px 16px; text-align: center; box-shadow: var(--sticker); }
.pill:nth-child(1) { transform: rotate(-1.5deg); }
.pill:nth-child(3) { transform: rotate(1.5deg); }
.pill .n { font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.pill .l { font-family: var(--font-hand); font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }

/* assignment = a field-notebook page */
.assignment-card {
  background: var(--paper-2);
  border: 2.5px solid var(--edge-strong);
  border-radius: 18px; padding: 20px; margin-bottom: 18px;
  box-shadow: var(--lift);
  background-image: repeating-linear-gradient(transparent 0 31px, color-mix(in oklab, var(--lake) 18%, transparent) 31px 32px);
}
.assignment-card .tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--pine); color: #fdf6e6;
  font-family: var(--font-hand); font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 5px 11px; border-radius: 999px; margin-bottom: 12px;
  transform: rotate(-1.5deg); box-shadow: var(--sticker);
}
.assignment-card h3 { font-family: var(--font-display); font-weight: 800; margin: 0 0 12px; font-size: 19px; color: var(--ink); }
.prompt-box {
  background: var(--paper); border: 2px dashed var(--edge-strong); border-radius: 12px;
  padding: 14px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; color: var(--ink); margin-bottom: 12px;
}
.copy-btn {
  width: 100%; background: var(--lake); color: #fdf6e6;
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  padding: 13px; border-radius: 12px; margin-bottom: 14px;
  border: 2.5px solid color-mix(in oklab, var(--lake) 70%, var(--ink));
  box-shadow: 0 3px 0 color-mix(in oklab, var(--lake) 70%, var(--ink));
}
.copy-btn:active { transform: translateY(2px); box-shadow: none; }
.copy-btn.copied { background: var(--good); border-color: var(--pine-deep); box-shadow: 0 3px 0 var(--pine-deep); }
.lookfor { font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.lookfor b { font-family: var(--font-hand); color: var(--clay-deep); }

.result-actions { margin-top: auto; padding-top: 18px; }
.done-btn {
  width: 100%; background: var(--pine); color: #fdf6e6;
  font-family: var(--font-display); font-weight: 800; font-size: 17px;
  padding: 16px; border-radius: 14px;
  border: 2.5px solid var(--pine-deep); box-shadow: 0 4px 0 var(--pine-deep);
}
.done-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--pine-deep); }

/* ============================================================
   COMING SOON — trail under construction
   ============================================================ */
.coming { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; }
.coming .emoji {
  font-size: 52px; width: 110px; height: 110px; margin-bottom: 20px;
  display: grid; place-items: center; background: var(--sun);
  border-radius: 50%; border: 4px dashed var(--clay-deep); transform: rotate(-5deg);
  box-shadow: var(--lift);
}
.coming h2 { font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 24px; margin: 0 0 8px; color: var(--pine-deep); }
.coming p { font-family: var(--font-hand); color: var(--ink-soft); max-width: 22em; line-height: 1.5; margin: 0 0 24px; font-size: 15px; }
.coming .idea { background: var(--paper-2); border: 2px dashed var(--edge-strong); border-radius: 14px; padding: 16px; font-size: 14.5px; line-height: 1.5; max-width: 26em; margin-bottom: 26px; box-shadow: var(--sticker); }
.coming .idea b { font-family: var(--font-hand); color: var(--clay-deep); }
.back-btn { font-family: var(--font-display); font-weight: 800; background: var(--paper-2); border: 2.5px solid var(--edge-strong); padding: 13px 28px; border-radius: 12px; box-shadow: var(--sticker); }

/* ============================================================
   HOME LINKS (project + glossary entry points)
   ============================================================ */
.home-links { display: flex; gap: 10px; margin: 0 0 28px; }
.home-link {
  flex: 1; display: block; text-align: center;
  background: var(--paper-2); border: 2px solid var(--edge-strong);
  border-radius: 16px; padding: 14px 8px;
  font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--ink);
  box-shadow: var(--sticker);
  transition: transform .1s;
}
.home-link:active { transform: translateY(2px); }
.home-link .hl-emoji { display: block; font-size: 24px; margin-bottom: 3px; }
.home-link small { display: block; font-family: var(--font-hand); font-weight: 600; font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

/* ============================================================
   SUB-SCREENS shared header (project + glossary)
   ============================================================ */
.project, .glossary { padding: 0 18px calc(var(--safe-bottom) + 34px); }
.sub-head { padding: 14px 2px 8px; }
.back-btn.small {
  font-family: var(--font-display); font-weight: 800; font-size: 13.5px;
  background: var(--paper-2); border: 2px solid var(--edge-strong);
  padding: 8px 16px; border-radius: 10px; box-shadow: var(--sticker); margin-bottom: 14px;
}
.sub-head h2 { font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 26px; color: var(--pine-deep); margin: 2px 0 8px; }
.sub-intro { color: var(--ink); font-size: 15px; line-height: 1.5; margin: 0 0 10px; }

/* --- camp project milestones --- */
.proj-tip { font-family: var(--font-hand); color: var(--clay-deep); font-size: 14px; line-height: 1.45; background: var(--paper-2); border: 2px dashed var(--edge-strong); border-radius: 12px; padding: 11px 13px; margin: 0 0 20px; box-shadow: var(--sticker); }
.ms-trail { position: relative; padding-left: 6px; }
.ms-trail::before { content: ""; position: absolute; left: 29px; top: 16px; bottom: 34px; border-left: 3px dashed var(--edge-strong); }
.ms { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 6px 4px 16px; }
.ms-node { flex: 0 0 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: var(--paper-2); border: 3px solid var(--edge-strong); box-shadow: var(--sticker); position: relative; z-index: 1; }
.ms-done .ms-node { background: var(--accent); border-color: rgba(54,41,27,.5); }
.ms-active .ms-node { background: var(--sun); border-color: var(--pine-deep); animation: bob 1.8s ease-in-out infinite; }
.ms-locked { opacity: .6; }
.ms-locked .ms-node { border-style: dashed; }
.ms-body { flex: 1; padding-top: 2px; }
.ms-top { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.ms-week { font-family: var(--font-hand); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: #fdf6e6; background: var(--accent); padding: 2px 9px; border-radius: 999px; }
.ms-flag { font-family: var(--font-hand); font-weight: 700; font-size: 12px; color: var(--ink-soft); }
.ms-title { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--ink); }
.ms-text { font-size: 14px; line-height: 1.46; color: var(--ink-soft); margin-top: 3px; }

/* --- glossary / trail guide --- */
.glossary .sub-head { position: sticky; top: 0; z-index: 3; background: var(--paper); padding-top: calc(var(--safe-top) + 14px); padding-bottom: 10px; }
.gl-search {
  width: 100%; margin-top: 6px; font-family: var(--font-body); font-size: 16px;
  padding: 12px 14px; border-radius: 12px; border: 2.5px solid var(--edge-strong);
  background: var(--paper-2); color: var(--ink); box-shadow: var(--sticker);
}
.gl-search:focus { outline: none; border-color: var(--pine); }
.gl-list { margin-top: 8px; }
.gl-item { padding: 12px 2px; border-bottom: 1.5px dashed var(--edge); }
.gl-term { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--ink); display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.gl-trail { font-family: var(--font-hand); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: #fdf6e6; background: var(--accent); padding: 2px 8px; border-radius: 999px; }
.gl-def { font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); margin-top: 4px; }
.gl-empty { text-align: center; color: var(--ink-soft); font-family: var(--font-hand); font-size: 15px; padding: 36px 12px; }

/* ============================================================
   DESKTOP MODE — persistent roadmap sidebar + lesson "stage"
   ============================================================ */
#sidebar { display: none; }

/* welcome / empty stage (desktop, no lesson open) */
.welcome { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 30px; }
.welcome-card { text-align: center; max-width: 420px; background: var(--paper-2); border: 2.5px dashed var(--edge-strong); border-radius: 22px; padding: 36px 28px; box-shadow: var(--lift); }
.welcome-mark { font-size: 52px; width: 110px; height: 110px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--sun); border-radius: 50%; border: 4px solid var(--pine-deep); transform: rotate(-4deg); box-shadow: var(--sticker); }
.welcome-card h2 { font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 28px; color: var(--pine-deep); margin: 0 0 8px; }
.welcome-card p { font-family: var(--font-hand); color: var(--ink-soft); font-size: 15px; line-height: 1.5; margin: 0 0 20px; }
.welcome-card .continue-btn { margin: 0; }

/* the open lesson, highlighted in the sidebar */
.session-row.active { background: var(--paper-3); border-radius: 12px; }
.session-row.active .session-num { box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent, var(--pine)) 45%, transparent), var(--sticker); }

@media (min-width: 880px) {
  body { display: flex; align-items: stretch; }
  #sidebar {
    display: block; flex: 0 0 380px; width: 380px; height: 100dvh; overflow-y: auto;
    border-right: 3px solid var(--edge-strong);
    background:
      radial-gradient(120% 36% at 50% -8%, rgba(242, 180, 48, 0.16), transparent 55%),
      var(--paper-2);
  }
  #sidebar .sidebar-home { max-width: none; min-height: 0; margin: 0; box-shadow: none; }
  #app { flex: 1 1 auto; height: 100dvh; overflow-y: auto; }
}

/* ============================================================
   AUTH (login / sign-up) + account row
   ============================================================ */
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 28px; }
.login-card { width: 100%; max-width: 380px; text-align: center; background: var(--paper-2); border: 2.5px solid var(--edge-strong); border-radius: 22px; padding: 30px 26px; box-shadow: var(--lift); }
.login-card h2 { font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 30px; color: var(--pine-deep); margin: 6px 0 4px; }
.login-sub { font-family: var(--font-hand); color: var(--ink-soft); font-size: 14.5px; line-height: 1.45; margin: 0 0 20px; }
#auth-form { display: flex; flex-direction: column; gap: 11px; text-align: left; }
.auth-input { font-family: var(--font-body); font-size: 16px; padding: 13px 14px; border-radius: 12px; border: 2.5px solid var(--edge-strong); background: var(--paper); color: var(--ink); }
.auth-input:focus { outline: none; border-color: var(--pine); }
.auth-msg { min-height: 18px; font-size: 13px; line-height: 1.35; color: var(--berry); font-weight: 600; }
.auth-submit { margin-top: 2px; background: var(--pine); color: #fdf6e6; font-family: var(--font-display); font-weight: 800; font-size: 16px; padding: 14px; border-radius: 12px; border: 2.5px solid var(--pine-deep); box-shadow: 0 4px 0 var(--pine-deep); }
.auth-submit:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--pine-deep); }
.auth-submit:disabled { opacity: .7; }
.auth-toggle { margin-top: 16px; font-family: var(--font-hand); color: var(--clay-deep); font-size: 14px; text-decoration: underline dashed; text-underline-offset: 3px; }

.account { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 12px 6px 4px; border-top: 1.5px dashed var(--edge); }
.acct-email { font-family: var(--font-hand); font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-out { font-family: var(--font-hand); font-weight: 700; font-size: 13px; color: var(--clay-deep); background: var(--paper-2); border: 2px solid var(--edge-strong); padding: 6px 12px; border-radius: 999px; box-shadow: var(--sticker); flex: 0 0 auto; }

/* ============================================================
   LANDING (logged-out marketing page + sign-up)
   ============================================================ */
.landing { max-width: 900px; min-height: 100dvh; }
.lp { padding: 4px 20px calc(var(--safe-bottom) + 48px); }
.lp-hero { text-align: center; padding: 20px 4px 6px; }
.mbadge { display: block; width: 100%; height: 100%; filter: drop-shadow(0 2px 2px rgba(42, 33, 24, 0.22)); }
.lp-badge { width: 90px; height: 90px; margin: 0 auto 16px; }
.lp-form-badge { width: 56px; height: 56px; margin: 0 auto 12px; }
.lp-title { font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: clamp(40px, 12vw, 62px); color: var(--pine-deep); margin: 0; line-height: .95; letter-spacing: -.02em; }
.lp-tag { font-family: var(--font-display); font-style: italic; color: var(--clay-deep); font-size: clamp(17px, 4.5vw, 21px); font-weight: 600; margin: 12px 0 0; }
.lp-lede { font-size: clamp(15px, 4vw, 17px); line-height: 1.6; color: var(--ink); max-width: 33em; margin: 18px auto 0; }
.lp-lede b { color: var(--pine-deep); }
.lp-cta { display: inline-block; margin: 24px 0 14px; background: var(--clay); color: #fdf6e6; font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: .01em; padding: 14px 30px; border-radius: 13px; border: 2.5px solid var(--clay-deep); box-shadow: 0 4px 0 var(--clay-deep); }
.lp-cta:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--clay-deep); }
.lp-facts { font-family: var(--font-body); color: var(--ink-soft); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; margin-top: 12px; }

.lp-sec { margin-top: 36px; }
.lp-h2 { font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: clamp(22px, 6vw, 28px); color: var(--pine-deep); text-align: center; margin: 0 0 18px; }
.lp-trails { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 12px; }
.lp-trail { display: flex; gap: 13px; align-items: center; background: var(--paper-2); border: 2px solid var(--edge-strong); border-left: 6px solid var(--accent); border-radius: 14px; padding: 14px 15px; box-shadow: var(--sticker); }
.lp-trail-badge { width: 50px; height: 50px; flex: 0 0 auto; }
.lp-trail-body { min-width: 0; }
.lp-trail-k { font-family: var(--font-hand); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.lp-trail-t { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--ink); line-height: 1.15; margin: 1px 0 4px; }
.lp-trail-d { font-size: 13.5px; line-height: 1.42; color: var(--ink-soft); }

.lp-how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.lp-step { background: var(--paper-2); border: 2px dashed var(--edge-strong); border-radius: 14px; padding: 18px 16px; box-shadow: var(--sticker); }
.lp-step-badge { width: 46px; height: 46px; margin-bottom: 12px; }
.lp-step b { font-family: var(--font-display); font-size: 16px; color: var(--ink); display: block; margin-bottom: 4px; }
.lp-step span:last-child { font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); }

.lp-project { text-align: center; background: var(--paper-3); border: 2px dashed var(--edge-strong); border-radius: 18px; padding: 22px; box-shadow: var(--sticker); }
.lp-project p { font-size: 15px; line-height: 1.55; color: var(--ink); max-width: 36em; margin: 0 auto; }

#start { scroll-margin-top: 14px; }
#start .login-card { margin: 0 auto; }
.lp-foot { text-align: center; font-family: var(--font-hand); color: var(--ink-soft); font-size: 13px; margin-top: 34px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
