/* =====================================================================
   Jasmine's Sketchbook — "The Illuminated Sketchbook"
   A personalised sketching course. Aged paper · graphite · lavender · gold.
   Hand-built, no framework. Design tokens first, then components.
   ===================================================================== */

/* ----------------------------- Tokens ------------------------------ */
:root {
  /* Paper & ink */
  --paper:        #F3EAD8;
  --paper-card:   #FCF6EA;
  --paper-deep:   #E8DCC4;
  --paper-edge:   #DCCEB2;
  --line:         #DACDB2;

  --ink:          #2C2A31;
  --graphite:     #524C57;
  --graphite-soft:#897F8E;

  /* Lavender / heather — Jasmine's signature */
  --heather:      #7B5A9C;
  --heather-deep: #4B3868;
  --heather-mid:  #9377B3;
  --heather-tint: #ECE3F4;
  --heather-line: #D9C9E8;

  /* Antique gold — illumination & achievement */
  --gold:         #B5872F;
  --gold-bright:  #E2BE63;
  --gold-pale:    #F3E6C2;

  /* Support tones */
  --sage:         #6E8B66;
  --sage-tint:    #E4ECDD;
  --rose:         #C2727F;
  --rose-tint:    #F6E4E5;

  /* Semantics */
  --bg:           var(--paper);
  --text:         var(--ink);
  --muted:        var(--graphite);

  /* Shape & depth */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;
  --r-xl: 30px;
  --shadow-sm: 0 2px 8px rgba(44,42,49,.08);
  --shadow:    0 10px 30px -12px rgba(44,42,49,.30);
  --shadow-lg: 0 28px 60px -22px rgba(44,42,49,.45);
  --ring: 0 0 0 3px var(--heather-line);

  /* Type */
  --display: "Fraunces", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --hand:    "Caveat", "Segoe Script", "Bradley Hand", cursive;
  --body:    "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;

  --maxw: 1080px;
}

/* ----------------------------- Reset ------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--body);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.62;
  font-size: 1.06rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: var(--heather-deep); text-decoration-color: var(--heather-line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--heather); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
h1,h2,h3,h4 { font-family: var(--display); font-weight: 600; line-height: 1.1; color: var(--ink); font-optical-sizing: auto; }

/* Paper grain + warm vignette over the whole page */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%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.5'/%3E%3C/svg%3E");
  opacity: .05; mix-blend-mode: multiply;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255,250,238,.7), transparent 55%),
    radial-gradient(140% 120% at 50% 120%, rgba(75,56,104,.10), transparent 60%);
}
#app, .site-header, .site-footer { position: relative; z-index: 1; }

/* --------------------------- Utilities ----------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(18px, 4vw, 36px); }
.center { text-align: center; }
.hand { font-family: var(--hand); }
.eyebrow {
  font-family: var(--hand); font-size: 1.5rem; color: var(--heather);
  transform: rotate(-2deg); display: inline-block;
}
.kicker {
  font-family: var(--body); font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; font-size: .72rem; color: var(--gold);
}
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.gold-text { color: var(--gold); }

/* ----------------------------- Buttons ----------------------------- */
.btn {
  --b: var(--heather);
  display: inline-flex; align-items: center; gap: .55em;
  font-weight: 800; font-size: 1rem; line-height: 1;
  padding: .85em 1.4em; border-radius: 999px; border: none; cursor: pointer;
  background: var(--b); color: #fff; text-decoration: none;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--b) 70%, #000);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 12px 24px -8px color-mix(in srgb, var(--b) 70%, #000); }
.btn:active { transform: translateY(0); }
.btn.gold { --b: var(--gold); color: #3a2c08; background: linear-gradient(160deg, var(--gold-bright), var(--gold)); }
.btn.ghost {
  background: transparent; color: var(--heather-deep);
  box-shadow: inset 0 0 0 2px var(--heather-line);
}
.btn.ghost:hover { background: var(--heather-tint); filter: none; }
.btn.big { font-size: 1.12rem; padding: 1em 1.7em; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ------------------------- The passcode gate ----------------------- */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(130% 100% at 50% 0%, #fbf4e6, #efe2c9 60%, #e6d6ba 100%);
  overflow: hidden;
}
.gate[hidden] { display: none; }   /* the class would otherwise override [hidden] */
.gate.hide { animation: gateOut .6s ease forwards; }
@keyframes gateOut { to { opacity: 0; visibility: hidden; transform: scale(1.04); } }
.gate__card {
  position: relative; width: min(520px, 92vw);
  background: var(--paper-card);
  border-radius: var(--r-xl);
  padding: clamp(28px, 5vw, 46px) clamp(24px, 5vw, 42px) 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--paper-edge);
  text-align: center;
}
.gate__card::after { /* taped corner */
  content: ""; position: absolute; top: -12px; left: 50%; width: 96px; height: 26px;
  transform: translateX(-50%) rotate(-1.5deg);
  background: rgba(196,154,76,.30);
  box-shadow: inset 0 0 0 1px rgba(181,135,47,.35);
}
.gate__crest { width: 76px; height: 76px; margin: 0 auto 14px; }
.gate__title { font-size: clamp(1.9rem, 6vw, 2.5rem); }
.gate__sub { color: var(--muted); margin-top: 6px; }
.gate__form { margin-top: 26px; display: grid; gap: 12px; }
.gate__input {
  width: 100%; text-align: center; font-family: var(--hand); font-size: 1.7rem;
  padding: .35em .6em; border-radius: var(--r);
  border: 2px dashed var(--heather-line); background: #fff;
  color: var(--heather-deep);
}
.gate__input:focus { border-color: var(--heather); outline: none; }
.gate__hint { font-size: .9rem; color: var(--graphite-soft); margin-top: 4px; min-height: 1.2em; }
.gate__hint b { color: var(--heather); }
.gate.shake .gate__card { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-9px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-6px)} 80%{transform:translateX(4px)} }

/* ----------------------------- Header ------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__row { display: flex; align-items: center; gap: 16px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand__mark { width: 38px; height: 38px; flex: none; }
.brand__name { font-family: var(--display); font-weight: 600; font-size: 1.22rem; line-height: 1; }
.brand__name small { display:block; font-family: var(--hand); color: var(--heather); font-size: 1.05rem; font-weight:600; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--graphite); font-weight: 700; font-size: .94rem;
  padding: .5em .8em; border-radius: 999px;
}
.nav a:hover { background: var(--heather-tint); color: var(--heather-deep); }
.nav a.active { background: var(--heather); color: #fff; }
.header-progress { display: flex; align-items: center; gap: 9px; }
.ring { width: 40px; height: 40px; flex: none; }
.ring__track { fill: none; stroke: var(--paper-deep); stroke-width: 4; }
.ring__bar { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.6,0,.2,1); }
.ring__label { font-family: var(--display); font-size: .72rem; font-weight: 700; fill: var(--ink); }
.menu-toggle { display: none; }

/* ----------------------------- Footer ------------------------------ */
.site-footer {
  margin-top: 60px; padding: 34px 0 50px; border-top: 1px solid var(--line);
  text-align: center; color: var(--graphite-soft); font-size: .92rem;
}
.site-footer .hand { color: var(--heather); font-size: 1.25rem; }

/* ====================================================================
   COVER / HOME
   ==================================================================== */
.cover { padding: clamp(28px, 6vw, 60px) 0 10px; }
.cover__inner { display: grid; gap: 30px; }
.cover__hero {
  position: relative; text-align: center;
  padding: clamp(30px, 6vw, 56px) clamp(20px, 4vw, 40px);
  background:
    linear-gradient(180deg, rgba(255,255,255,.4), transparent 40%),
    var(--paper-card);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cover__hero::before { /* faint gold corner flourish */
  content: ""; position: absolute; inset: 10px; border-radius: calc(var(--r-xl) - 8px);
  border: 1.5px solid var(--gold); opacity: .28; pointer-events: none;
}
.cover__birthday {
  display: inline-flex; gap:.5em; align-items:center;
  background: linear-gradient(160deg, var(--gold-bright), var(--gold));
  color: #3a2c08; font-weight: 800; font-size: .82rem; letter-spacing: .04em;
  padding: .5em 1em; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.cover__title { font-size: clamp(2.6rem, 9vw, 5rem); line-height: .98; margin-top: 18px; letter-spacing: -.01em; }
.cover__title .hand { display: block; font-size: .42em; color: var(--heather); transform: rotate(-2deg); margin-bottom: -.1em; }
.cover__title em { font-style: normal; color: var(--heather); }
.cover__lede { max-width: 40ch; margin: 18px auto 0; color: var(--graphite); font-size: 1.12rem; }
.cover__cta { margin-top: 26px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.stats { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.stat { text-align: center; }
.stat b { display: block; font-family: var(--display); font-size: 1.8rem; color: var(--heather-deep); line-height: 1; }
.stat span { font-size: .82rem; color: var(--graphite-soft); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* Section headings */
.section { margin-top: clamp(40px, 7vw, 72px); }
.section__head { text-align: center; margin-bottom: 26px; }
.section__head h2 { font-size: clamp(1.8rem, 5vw, 2.7rem); }
.section__head p { color: var(--graphite); max-width: 52ch; margin: 8px auto 0; }

/* ====================================================================
   THE JOURNEY MAP  (the centrepiece)
   ==================================================================== */
.journey { position: relative; padding: 10px 0 20px; }
.unit {
  position: relative; margin: 0 auto clamp(26px, 5vw, 44px);
  max-width: 880px;
}
.unit__head {
  display: flex; align-items: center; gap: 16px; margin-bottom: 18px;
}
.unit__badge {
  width: 64px; height: 64px; flex: none; border-radius: 18px;
  display: grid; place-items: center; color: #fff;
  background: var(--u-color, var(--heather));
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.4);
  position: relative;
}
.unit__badge svg { width: 34px; height: 34px; }
.unit__badge .unit__num {
  position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--paper-card); color: var(--u-color, var(--heather)); border: 2px solid var(--u-color, var(--heather));
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: .85rem;
}
.unit__meta h3 { font-size: clamp(1.4rem, 4vw, 1.9rem); }
.unit__meta p { color: var(--graphite); font-size: .98rem; margin-top: 2px; }
.unit__bar { height: 7px; border-radius: 999px; background: var(--paper-deep); margin-top: 9px; max-width: 240px; overflow: hidden; }
.unit__bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold-bright), var(--gold)); transition: width .8s cubic-bezier(.6,0,.2,1); }

/* Lessons inside a unit: stepping-stone nodes joined by a dashed path */
.nodes { position: relative; display: grid; gap: 14px; padding-left: 6px; }
.node {
  position: relative; display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 16px;
  background: var(--paper-card); border: 1px solid var(--paper-edge);
  border-radius: var(--r-lg); padding: 14px 18px 14px 14px;
  text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.node:hover { transform: translateX(4px); box-shadow: var(--shadow); border-color: var(--heather-line); }
.node__dot {
  width: 50px; height: 50px; border-radius: 50%; flex: none; position: relative;
  display: grid; place-items: center;
  background: var(--paper-deep); color: var(--graphite-soft);
  border: 2px dashed var(--paper-edge); font-family: var(--display); font-weight: 700;
}
.node__dot svg { width: 24px; height: 24px; }
.node__title { display: block; font-family: var(--display); font-weight: 600; font-size: 1.18rem; line-height: 1.2; }
.node__sub { display: block; color: var(--graphite); font-size: .9rem; margin-top: 3px; }
.node__tag {
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--heather); background: var(--heather-tint); padding: .3em .7em; border-radius: 999px;
}
.node[data-type="story"] { background: linear-gradient(180deg, #fff9ea, var(--paper-card)); border-color: var(--gold-pale); }
.node[data-type="story"] .node__tag { color: var(--gold); background: var(--gold-pale); }
.node[data-type="reference"] .node__tag { color: var(--sage); background: var(--sage-tint); }
.node[data-type="milestone"] { background: linear-gradient(180deg, var(--heather-tint), var(--paper-card)); border-color: var(--heather-line); }

/* Completed state — a gold star "stamped" on */
.node.done .node__dot {
  background: linear-gradient(160deg, var(--gold-bright), var(--gold));
  border: 2px solid var(--gold); color: #fff;
}
.node.done .node__title { color: var(--graphite); }
.node__check {
  width: 30px; height: 30px; flex: none; opacity: 0; transform: scale(.4) rotate(-25deg);
}
.node.done .node__check { opacity: 1; transform: scale(1) rotate(0); transition: all .4s cubic-bezier(.3,1.5,.5,1); }
.node.current { border-color: var(--heather); box-shadow: 0 0 0 3px var(--heather-line), var(--shadow); }
.node.current .node__dot { border-style: solid; border-color: var(--heather); color: var(--heather); }

/* ====================================================================
   LESSON VIEW
   ==================================================================== */
.lesson { padding-top: 22px; }
.crumbs { display:flex; align-items:center; gap:8px; font-size:.85rem; color: var(--graphite-soft); font-weight:700; margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { color: var(--heather-deep); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.lesson__head { margin-bottom: 22px; }
.lesson__chip {
  display:inline-block; font-size:.74rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase;
  color: var(--heather); background: var(--heather-tint); padding:.35em .8em; border-radius:999px;
}
.lesson__title { font-size: clamp(2rem, 6vw, 3.1rem); margin-top: 12px; line-height: 1.02; text-wrap: balance; }
.lesson__sub { color: var(--graphite); font-size: 1.12rem; margin-top: 8px; max-width: 60ch; }

.lesson__grid { display: grid; grid-template-columns: 1fr; gap: 26px; }
/* Two columns only when there's a video to anchor the left side; otherwise a
   single, comfortably-capped column so video-less lessons don't leave a void. */
@media (min-width: 920px) { .lesson__grid.has-video { grid-template-columns: 1.55fr 1fr; align-items: start; } }
.lesson__grid:not(.has-video) { max-width: 760px; margin-inline: auto; }

.video-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden;
  background: #1a1820; box-shadow: var(--shadow);
  border: 1px solid var(--paper-edge);
}
.video-frame iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
.video-meta { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:10px; flex-wrap: wrap; }
.video-meta .by { color: var(--graphite); font-size:.9rem; }
.video-meta .by b { color: var(--ink); }
.video-meta a { font-size:.88rem; font-weight:700; }

.panel {
  background: var(--paper-card); border: 1px solid var(--paper-edge);
  border-radius: var(--r-lg); padding: 22px 22px; box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 18px; }
.panel h3 { font-size: 1.3rem; display:flex; align-items:center; gap:.5em; }
.panel h3 svg { width: 22px; height: 22px; color: var(--heather); }
.panel .intro p { margin-top: 10px; }
.panel .intro p + p { margin-top: 12px; }

.checklist { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 9px; }
.checklist li { display:flex; gap:10px; align-items:flex-start; }
.checklist li::before {
  content: ""; width: 18px; height: 18px; flex: none; margin-top: 3px; border-radius: 5px;
  background: var(--heather-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237B5A9C' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/13px no-repeat;
}
.kit { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kit span {
  font-size: .86rem; font-weight: 700; color: var(--graphite);
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .35em .8em;
  display: inline-flex; align-items: center; gap: .4em;
}
.kit span::before { content: "✏️"; font-size: .9em; }

/* Challenge card — the "your turn" */
.challenge {
  background: linear-gradient(180deg, var(--heather-tint), var(--paper-card));
  border: 1px solid var(--heather-line); border-radius: var(--r-lg);
  padding: 22px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.challenge h3 { color: var(--heather-deep); display:flex; align-items:center; gap:.5em; }
.challenge h3 svg { width: 22px; height: 22px; flex: none; color: var(--heather); }
.challenge__ref {
  margin-top: 14px; border-radius: var(--r); overflow: hidden; border: 6px solid #fff;
  box-shadow: var(--shadow); transform: rotate(-1.2deg);
}
.challenge__ref img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.challenge__ref figcaption { font-family: var(--hand); color: var(--heather); text-align:center; font-size:1.15rem; padding: 4px; background:#fff; }

.tips { margin-top: 0; }
.tips ul { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.tips li { padding-left: 30px; position: relative; }
.tips li::before { content: "💡"; position: absolute; left: 0; top: 0; }

/* Complete bar */
.lesson__foot {
  margin-top: 30px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 22px; border-top: 1px dashed var(--paper-edge);
}
.lesson__nav { display: flex; gap: 10px; }
.lesson__nav a { text-decoration:none; }
.complete-btn.is-done { background: var(--sage); box-shadow: none; }
.complete-btn.is-done::before { content: "★ "; }

/* ====================================================================
   STORY (Joan of Arc) — illuminated manuscript style
   ==================================================================== */
.manuscript {
  background:
    radial-gradient(120% 90% at 0% 0%, #fff8e6, transparent 50%),
    var(--paper-card);
  border: 1px solid var(--gold-pale);
  border-radius: var(--r-lg); padding: clamp(22px, 4vw, 38px);
  box-shadow: var(--shadow); position: relative;
}
.manuscript::before {
  content:""; position:absolute; inset: 8px; border: 1.5px solid var(--gold); opacity:.3; border-radius: calc(var(--r-lg) - 6px); pointer-events:none;
}
.manuscript .chapter-no { font-family: var(--hand); color: var(--gold); font-size: 1.4rem; }
.manuscript h2 { font-size: clamp(1.8rem, 5vw, 2.7rem); color: var(--heather-deep); margin-top: 2px; }
.manuscript .story { font-size: 1.12rem; margin-top: 16px; }
.manuscript .story p { margin-top: 12px; }
.manuscript .story > p:first-of-type::first-letter {
  font-family: var(--display); font-weight: 700; float: left; font-size: 3.4em; line-height: .72;
  padding: 6px 10px 0 0; color: var(--gold);
}
.scene-card {
  margin-top: 22px; background: var(--heather-tint); border: 1px solid var(--heather-line);
  border-radius: var(--r); padding: 18px 20px;
}
.scene-card .kicker { color: var(--heather); }
.scene-card h4 { font-family: var(--display); font-size: 1.25rem; margin-top: 4px; color: var(--heather-deep); }

/* ====================================================================
   PETS  (reference page) — taped Polaroids
   ==================================================================== */
.pets-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: clamp(12px, 2.5vw, 26px); }
.polaroid {
  background: #fff; padding: 12px 12px 16px; border-radius: 4px;
  box-shadow: var(--shadow); transform: rotate(var(--rot, -2deg));
  transition: transform .2s ease, box-shadow .2s ease; cursor: zoom-in;
}
.polaroid:hover { transform: rotate(0) scale(1.03); box-shadow: var(--shadow-lg); }
.polaroid img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 2px; background: var(--paper-deep); }
.polaroid figcaption { font-family: var(--hand); font-size: 1.5rem; text-align: center; color: var(--heather-deep); margin-top: 8px; }
.pet-block { margin-bottom: 40px; }
.pet-block__intro { display:flex; gap: 16px; align-items:flex-start; margin-bottom: 18px; }
.pet-block__intro .emoji { font-size: 2.2rem; }
.pet-block__intro h3 { font-size: 1.7rem; color: var(--heather-deep); }
.pet-block__intro p { color: var(--graphite); margin-top: 4px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(30,26,36,.86); display: grid; place-items: center; padding: 24px; opacity: 0; visibility: hidden; transition: opacity .25s; }
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img { max-width: min(94vw, 1100px); max-height: 88vh; border-radius: 8px; border: 8px solid #fff; box-shadow: var(--shadow-lg); }
.lightbox__close { position: absolute; top: 18px; right: 22px; width:46px;height:46px;border-radius:50%; border:none; background:#fff; cursor:pointer; font-size:1.4rem; box-shadow: var(--shadow); }

/* ====================================================================
   GENERIC CARDS / PROSE (about, etc.)
   ==================================================================== */
.card {
  background: var(--paper-card); border: 1px solid var(--paper-edge);
  border-radius: var(--r-lg); padding: clamp(22px, 4vw, 34px); box-shadow: var(--shadow-sm);
}
.prose p { margin-top: 14px; }
.prose h3 { margin-top: 24px; font-size: 1.4rem; }
.prose ul { margin-top: 12px; padding-left: 22px; }
.prose li { margin-top: 8px; }

/* ====================================================================
   CERTIFICATE
   ==================================================================== */
.certificate {
  background:
    radial-gradient(120% 90% at 50% 0%, #fffaef, transparent 55%),
    var(--paper-card);
  border: 2px solid var(--gold); border-radius: var(--r-lg);
  padding: clamp(28px, 6vw, 60px); text-align: center; position: relative;
  box-shadow: var(--shadow-lg);
}
.certificate::before { content:""; position:absolute; inset: 12px; border: 1px solid var(--gold); opacity:.45; border-radius: var(--r); pointer-events:none; }
.certificate h2 { font-size: clamp(2.2rem, 7vw, 3.6rem); color: var(--heather-deep); }
.certificate .name { font-family: var(--hand); font-size: clamp(3rem, 12vw, 5.5rem); color: var(--gold); line-height: 1; margin: 10px 0; }
.certificate p { color: var(--graphite); max-width: 46ch; margin: 8px auto; }

/* Locked overlay note */
.locked-note { text-align:center; color: var(--graphite-soft); margin-top: 14px; font-size: .92rem; }

/* ----------------------- Reveal animations ------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; animation: rise .6s ease forwards; }
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; }
  * { scroll-behavior: auto !important; }
}

/* Confetti burst layer */
.celebrate { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti { position: absolute; width: 10px; height: 14px; top: -20px; will-change: transform; }

/* ----------------------------- Mobile ------------------------------ */
/* Collapse the nav to a hamburger early enough that tablets in portrait
   (≈768px) never crowd the logo + links + progress ring on one row. */
@media (max-width: 860px) {
  .nav { display: none; position: absolute; top: 100%; right: 0; left: 0;
    flex-direction: column; background: var(--paper-card);
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    padding: 10px; gap: 4px; box-shadow: var(--shadow-lg); }
  .nav.open { display: flex; }
  .nav a { display: block; text-align: center; padding: .85em 1em; font-size: 1rem; min-height: 44px; }
  .menu-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--paper-card); cursor: pointer; }
}
@media (max-width: 760px) {
  .node { grid-template-columns: 46px 1fr; }
  .node__tag, .node__check { grid-column: 2; justify-self: start; }
  .node.done .node__check { position: absolute; top: 12px; right: 14px; }
}

/* ====================================================================
   Generated pencil-sketch imagery
   ==================================================================== */
.cover__sketch {
  margin: 26px auto 2px; max-width: 460px; background: #fff; padding: 12px 12px 8px;
  border-radius: 8px; box-shadow: var(--shadow); transform: rotate(-1.2deg);
  border: 1px solid var(--paper-edge);
}
.cover__sketch img { width: 100%; height: auto; border-radius: 4px; display: block; }
.cover__sketch figcaption { font-family: var(--hand); color: var(--heather); font-size: 1.35rem; text-align: center; padding-top: 5px; }

.unit__meta { flex: 1; min-width: 0; }
.unit__art {
  flex: none; width: 94px; height: 94px; border-radius: 12px; overflow: hidden;
  background: #fff; padding: 5px; box-shadow: var(--shadow-sm); transform: rotate(2.5deg);
  border: 1px solid var(--paper-edge); margin: 0;
}
.unit__art img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; display: block; }
@media (max-width: 760px) { .unit__art { display: none; } }

.joan-figure {
  margin: 22px 0 0; background: #fff; padding: 12px 12px 8px; border-radius: 10px;
  box-shadow: var(--shadow); border: 1px solid var(--paper-edge);
}
.joan-figure img { width: 100%; border-radius: 6px; display: block; }
.joan-figure figcaption { color: var(--graphite); font-size: .92rem; text-align: center; padding-top: 9px; }
.joan-figure.sketch figcaption { font-family: var(--hand); color: var(--heather); font-size: 1.3rem; }

.pet-goal {
  float: right; width: 210px; margin: 0 0 12px 20px; background: #fff; padding: 9px 9px 6px;
  border-radius: 8px; box-shadow: var(--shadow); transform: rotate(1.6deg); border: 1px solid var(--paper-edge);
}
.pet-goal img { width: 100%; border-radius: 4px; display: block; }
.pet-goal figcaption { font-family: var(--hand); color: var(--heather); text-align: center; font-size: 1.15rem; padding-top: 3px; }
@media (max-width: 560px) { .pet-goal { float: none; width: 100%; margin: 0 0 14px; } }

.lesson__emblem {
  float: right; width: 104px; height: 104px; border-radius: 14px; overflow: hidden;
  background: #fff; padding: 6px; box-shadow: var(--shadow-sm); border: 1px solid var(--paper-edge);
  transform: rotate(2.5deg); margin: 4px 0 8px 18px;
}
.lesson__emblem img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
@media (max-width: 560px) { .lesson__emblem { width: 76px; height: 76px; margin-left: 12px; } }

/* ====================================================================
   First-login birthday celebration (shown once, ever)
   ==================================================================== */
.party { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.pop { position: absolute; will-change: transform, opacity; }
@keyframes popFly {
  0%   { transform: translate(0, 0) rotate(0); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}
.balloon {
  position: absolute; bottom: -160px; width: 48px; height: 60px; border-radius: 50% 50% 48% 48%;
  background: var(--c); box-shadow: inset -7px -9px 0 rgba(0,0,0,.10); will-change: transform;
}
.balloon::before { content: ""; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 9px solid var(--c); }
.balloon::after { content: ""; position: absolute; top: 100%; left: 50%; width: 1px; height: 100px;
  background: rgba(80,70,90,.32); transform: translateX(-50%); }
@keyframes balloonRise {
  0%   { transform: translate(0, 0) rotate(-4deg); }
  50%  { transform: translate(var(--sway), -62vh) rotate(4deg); }
  100% { transform: translate(0, -140vh) rotate(-2deg); opacity: .85; }
}
.bday-msg {
  position: fixed; top: 32%; left: 50%; z-index: 90; pointer-events: none; text-align: center;
  font-family: var(--display); font-weight: 700; line-height: 1.04;
  font-size: clamp(2rem, 7vw, 4.2rem); color: var(--heather-deep);
  text-shadow: 0 3px 0 #fff, 0 8px 22px rgba(75,56,104,.30);
  transform: translate(-50%, -50%) scale(.4) rotate(-3deg); opacity: 0;
  transition: transform .55s cubic-bezier(.2,1.5,.45,1), opacity .45s ease;
}
.bday-msg.show { transform: translate(-50%, -50%) scale(1) rotate(-1deg); opacity: 1; }
.bday-msg span { display: block; font-family: var(--body); font-weight: 800; font-size: .46em; letter-spacing: .08em; }
@media (prefers-reduced-motion: reduce) {
  .bday-msg { transition: opacity .4s ease; transform: translate(-50%, -50%) scale(1); }
}

/* ====================================================================
   Responsive refinements (from the phone/tablet audit)
   ==================================================================== */
/* Centre sparse views (e.g. the locked certificate) in tall tablet viewports */
.section--center { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; }

/* Keep the About reading column comfortable on wide tablets */
.prose { max-width: 68ch; margin-inline: auto; }

/* Smallest phones: balance the four hero stats two-and-two */
@media (max-width: 400px) {
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 10px; }
}

/* Tiny phones: stop the Joan drop-cap crowding the first lines, and give the
   prev/next buttons real separation + tap size */
@media (max-width: 430px) {
  .manuscript .story > p:first-of-type::first-letter { font-size: 2.8em; padding: 4px 8px 0 0; }
  .lesson__foot { gap: 14px; }
  .lesson__nav { width: 100%; gap: 12px; }
  .lesson__nav a { flex: 1; justify-content: center; min-height: 44px; }
  .complete-btn, .lesson__foot > .btn { width: 100%; justify-content: center; }
}
