/* DoodleNest site. Colours come from the app's tokens (src/theme/tokens.ts). */
@font-face { font-family: "Baloo 2"; src: url("assets/fonts/baloo2-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Baloo 2"; src: url("assets/fonts/baloo2-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Baloo 2"; src: url("assets/fonts/baloo2-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Baloo 2"; src: url("assets/fonts/baloo2-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --desk: #26104F;
  --desk-raised: #37196A;
  --action: #7B2CF4;
  --action-pressed: #6420D2;
  --paper: #FFFCF5;
  --paper-edge: #EFE6D2;
  --paper-under: #E2D6BE;
  --ink: #26104F;
  --ink-soft: #4B3A78;
  --text: #271C36;
  --text-2: #5E5470;
  --on-desk: #FFF9ED;
  --on-desk-2: #DBCEE9;
  --sun: #F2C96D;
  --graphite: #34363A;
  --lesson: #7055C6;
  --radius-page: 20px;
  --gutter: clamp(12px, 2.2vw, 36px);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; scrollbar-color: var(--action) var(--desk); }
body {
  margin: 0;
  background: var(--desk);
  color: var(--text);
  font-family: "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(17px, 1.05vw + 10px, 20px);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--sun); color: var(--desk); }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-weight: 800; line-height: 1.05; margin: 0; color: var(--ink); text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 8px; }
.sheet :focus-visible, .note :focus-visible { outline-color: var(--action); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--sun); color: var(--desk); padding: 8px 14px; border-radius: 12px; font-weight: 700; }
.skip:focus { top: 12px; }

/* Nav on the desk */
.nav {
  display: flex; align-items: center; gap: clamp(16px, 3vw, 48px);
  max-width: 1600px; margin: 0 auto;
  padding: clamp(12px, 1.3vw, 20px) calc(var(--gutter) + clamp(4px, 2.6vw, 56px));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand-mark { width: clamp(48px, 5vw, 76px); }
.brand-word { color: var(--on-desk); font-weight: 800; font-size: clamp(28px, 2.9vw, 46px); line-height: 1; letter-spacing: -.01em; }
.nav-links { display: flex; gap: clamp(20px, 3vw, 48px); list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--on-desk); text-decoration: none; font-weight: 600; font-size: clamp(16px, 1.25vw, 20px); }
.nav-links a:hover { text-decoration: underline; text-decoration-color: var(--sun); }
.nav-pill {
  white-space: nowrap; background: var(--action); color: #fff; text-decoration: none; font-weight: 700;
  font-size: clamp(16px, 1.25vw, 20px); padding: .55em 1.15em .5em; border-radius: 999px;
  transition: background-color .2s var(--ease);
}
.nav-pill:hover { background: var(--action-pressed); }

/* A sketchbook page on the desk. The sheet under it peeks out at the bottom. */
.sheet {
  position: relative; isolation: isolate;
  max-width: 1600px; margin: clamp(28px, 2.6vw, 44px) var(--gutter) clamp(56px, 7vw, 120px);
  background: var(--paper); border-radius: var(--radius-page);
  padding: clamp(56px, 6vw, 92px) clamp(20px, 5vw, 96px) clamp(40px, 5vw, 80px);
}
@media (min-width: 1680px) { .sheet { margin-inline: auto; } }
.sheet::before {
  content: ""; position: absolute; inset: 10px -4px -10px 6px; z-index: -1;
  background: var(--paper-under); border-radius: var(--radius-page); transform: rotate(.6deg);
}
.sheet::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--paper); border-radius: var(--radius-page);
  box-shadow: inset 0 -3px 0 var(--paper-edge);
}

/* Spiral rings straddle the top edge */
.rings {
  position: absolute; top: -26px; left: clamp(36px, 3.6vw, 60px); right: clamp(36px, 3.6vw, 60px); height: 56px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='39' height='56' viewBox='0 0 39 56'%3E%3Cellipse cx='20' cy='46' rx='5.5' ry='4' fill='%2326104F'/%3E%3Cpath d='M15 46 V12 a5.5 5.5 0 0 1 11 0 V44' fill='none' stroke='%232A2730' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M17.3 40 V13 a3 3 0 0 1 3-3' fill='none' stroke='%23A39DAE' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x left top / 39px 56px;
  pointer-events: none;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 52px; padding: .55em 1.4em .5em; border-radius: 999px; border: 0;
  font: inherit; font-weight: 700; font-size: clamp(17px, 1.3vw, 22px); line-height: 1.1; text-decoration: none; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--action); color: #fff; }
.btn-primary:hover { background: var(--action-pressed); }
.btn-quiet { background: #EFE7FA; color: var(--ink); }
.btn-quiet:hover { background: #E3D6F7; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.ico { width: 1.3em; height: 1.3em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; flex: none; }

/* Hero page */
.hero { text-align: center; padding-top: clamp(48px, 4vw, 64px); padding-bottom: clamp(20px, 1.8vw, 36px); }
.hero h1 { font-size: clamp(2.6rem, min(6.1vw, 9.6vh), 6rem); letter-spacing: -.012em; line-height: .98; }
.lede { font-size: clamp(19px, 1.7vw, 28px); line-height: 1.32; color: var(--ink-soft); max-width: 29em; margin: clamp(12px, 1.2vw, 20px) auto 0; }
.status {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px clamp(18px, 2vw, 32px);
  margin: clamp(18px, 1.8vw, 28px) auto 0;
}
.status-text { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-weight: 600; font-size: clamp(16px, 1.3vw, 21px); text-align: left; }
.status .btn { min-height: clamp(52px, 4.4vw, 66px); padding-inline: 1.5em; }
.status-note { margin-top: 10px; color: var(--ink-soft); font-weight: 600; font-size: clamp(15px, 1.1vw, 18px); }

.steps {
  list-style: none; margin: clamp(16px, 1.8vw, 30px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 2vw, 36px);
  width: min(100%, 1080px); margin-right: auto;
}
.steps li { display: grid; justify-items: center; gap: 6px; position: relative; }
.steps img { width: auto; max-width: 100%; height: clamp(130px, 18vh, 240px); object-fit: contain; }
.num {
  justify-self: start; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--action); color: #fff; font-weight: 800; font-size: 24px; line-height: 1; padding-top: 3px;
}
.cap { font-weight: 700; color: var(--ink-soft); font-size: clamp(15px, 1.1vw, 18px); }
.pip-wave {
  position: absolute; right: clamp(-12px, 1vw, 24px); bottom: 6px;
  width: clamp(150px, min(18vw, 30vh), 320px); transform-origin: 60% 90%;
}

/* Live lesson page */
.lesson-board { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 72px); align-items: center; }
.artboard { margin: 0; aspect-ratio: 1; background: #FFFDF9; border-radius: 28px; border: 2px dashed #E0D6C4; }
.artboard svg { width: 100%; height: 100%; display: block; }
.artboard path { stroke-linecap: round; stroke-linejoin: round; }
.art-pencil { opacity: 0; transition: opacity .25s var(--ease); }
.art-pencil.on { opacity: 1; }
.lesson-panel h2 { font-size: clamp(2.1rem, 3.6vw, 3.6rem); }
.level { display: inline-flex; margin-top: 20px; padding: 5px; gap: 4px; background: #F1EAF9; border-radius: 999px; }
.level button {
  font: inherit; font-weight: 700; font-size: 17px; border: 0; border-radius: 999px; padding: 10px 18px 8px; min-height: 44px;
  background: transparent; color: var(--ink-soft); cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease);
}
.level button[aria-checked="true"] { background: var(--action); color: #fff; }
.step-count { margin-top: 26px; color: var(--lesson); font-weight: 800; font-size: 20px; }
.instruction { margin-top: 4px; font-weight: 700; font-size: clamp(24px, 2.2vw, 34px); line-height: 1.3; color: var(--text); min-height: 3.75em; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn-next { min-width: 150px; min-height: 64px; }
.pip-says { display: flex; align-items: center; gap: 14px; margin-top: 30px; }
.pip-says img { width: 104px; flex: none; }
.pip-says p {
  position: relative; background: #FFF4D6; border-radius: 22px; padding: 14px 18px 12px;
  font-weight: 600; color: var(--text); font-size: clamp(16px, 1.2vw, 19px);
}
.pip-says p::before {
  content: ""; position: absolute; left: -10px; top: 50%; translate: 0 -50%;
  border: 11px solid transparent; border-right-color: #FFF4D6; border-left: 0;
}
.lesson-note { margin-top: 22px; color: var(--text-2); font-size: clamp(15px, 1.05vw, 17px); max-width: 34em; }

/* Catalogue page */
.sheet-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(16px, 4vw, 72px); align-items: end; }
.sheet-head h2 { font-size: clamp(2.6rem, 5.4vw, 5.4rem); }
.sheet-head p { color: var(--text-2); max-width: 36em; }
.doodles {
  list-style: none; margin: clamp(32px, 4vw, 64px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(104px, 10vw, 150px), 1fr)); gap: clamp(18px, 2.4vw, 40px) clamp(12px, 1.8vw, 28px);
}
.doodles li { display: grid; justify-items: center; align-content: end; gap: 6px; text-align: center; }
.doodles img { width: 82%; aspect-ratio: 1; object-fit: contain; }
.doodles span { font-weight: 600; font-size: clamp(13px, .95vw, 15.5px); line-height: 1.2; color: var(--text-2); }

/* Stories, journal, studio */
.extras-grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(28px, 4vw, 64px) clamp(16px, 3vw, 48px); align-items: center;
}
.extras h3 { font-size: clamp(1.9rem, 2.9vw, 2.9rem); }
.extras-text p { margin-top: 12px; color: var(--text-2); max-width: 30em; }
.extras-text h3 + p + h3 { margin-top: 36px; }
.pasted { position: relative; margin: 0; background: #fff; padding: clamp(8px, .9vw, 14px); padding-bottom: 0; border-radius: 3px; box-shadow: 0 0 0 1px #EDE3CF; }
.tape { position: absolute; z-index: 1; width: clamp(80px, 9vw, 130px); aspect-ratio: 360 / 109; background: url("assets/art/tape.webp") center / contain no-repeat; }
.tape-l { top: -14px; left: -22px; rotate: -32deg; }
.tape-r { top: -14px; right: -22px; rotate: 30deg; }
.tape-c { top: -16px; left: 50%; translate: -50% 0; rotate: -3deg; }
.pasted img { border-radius: 2px; }
.pasted figcaption { padding: 10px 6px 12px; font-weight: 600; color: var(--text-2); font-size: clamp(15px, 1.05vw, 17px); line-height: 1.35; }
.story { grid-column: 1 / span 7; transform: rotate(-1.4deg); }
.story-text { grid-column: 8 / span 5; }
.journal-text { grid-column: 1 / span 6; padding-left: clamp(0px, 4vw, 64px); }
.journal { grid-column: 8 / span 4; transform: rotate(1.8deg); background: #FFFCF5; }
.journal-kitten { width: 74%; margin: 18px auto 0; }
.studio { grid-column: 2 / span 4; transform: rotate(-1deg); }
.studio-text { grid-column: 7 / span 6; }

/* Grown-ups: a ruled notepad sheet on the desk */
.note {
  max-width: 1600px; margin: 0 var(--gutter) clamp(56px, 7vw, 120px);
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 72px); align-items: center;
  padding-inline: clamp(0px, 3vw, 56px);
}
@media (min-width: 1680px) { .note { margin-inline: auto; } }
.note-sheet {
  --line: 2.25rem;
  background: var(--paper);
  border-radius: 6px; padding: clamp(28px, 3vw, 48px) clamp(20px, 3vw, 52px) clamp(28px, 3vw, 44px) clamp(52px, 6vw, 96px);
  position: relative; transform: rotate(-.6deg);
}
.note-sheet::before { content: ""; position: absolute; top: 0; bottom: 0; left: clamp(36px, 4.4vw, 72px); width: 2px; background: #E7A7C3; }
.note-sheet h2 { font-size: clamp(2.1rem, 3.6vw, 3.4rem); }
.checks {
  list-style: none; margin: 22px 0 0; padding: 0; line-height: var(--line);
  background: repeating-linear-gradient(to bottom, transparent 0 calc(var(--line) - 2px), #D9E2EE calc(var(--line) - 2px) var(--line));
  background-position: 0 -3px; border-top: 2px solid #D9E2EE;
}
.checks li { position: relative; padding-left: 2em; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: calc(var(--line) / 2 - .72em); width: 1.25em; height: 1.25em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 13.5 9.5 19 20.5 5' fill='none' stroke='%237B2CF4' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
.checks strong { font-weight: 800; color: var(--ink); }
.note-side { color: var(--on-desk); display: grid; justify-items: center; text-align: center; }
.supply.paper { width: 62%; }
.supply.pencil { width: 74%; margin-top: -32%; rotate: -8deg; }
.note-side p { margin-top: 18px; font-weight: 600; font-size: clamp(18px, 1.5vw, 24px); max-width: 16em; color: var(--on-desk); }

/* Close */
.close {
  display: flex; align-items: center; justify-content: center; gap: clamp(16px, 3vw, 48px);
  max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter) clamp(40px, 5vw, 80px);
}
.close img { width: clamp(150px, 18vw, 260px); }
.close h2 { color: var(--on-desk); font-size: clamp(2.2rem, 4.4vw, 4.4rem); max-width: 11em; }
.close p { margin-top: 10px; color: var(--on-desk-2); font-size: clamp(18px, 1.4vw, 22px); }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  max-width: 1600px; margin: 0 auto; padding: 22px calc(var(--gutter) + clamp(4px, 2.6vw, 56px)) 32px;
  border-top: 1px solid var(--desk-raised); color: var(--on-desk-2); font-size: 16px;
}

/* Arrival: Pip waves once; the hero steps settle in order. Content is visible without it. */
@media (prefers-reduced-motion: no-preference) {
  .pip-wave { animation: wave 1.6s var(--ease) .5s both; }
  @keyframes wave { 0% { rotate: 0deg; } 25% { rotate: -6deg; } 50% { rotate: 4deg; } 75% { rotate: -3deg; } 100% { rotate: 0deg; } }
  .js .steps li { animation: settle .7s var(--ease) both; animation-delay: calc(var(--i) * 140ms + 200ms); }
  @keyframes settle { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: 0s !important; } }

/* If the lesson data cannot load, show the finished kitten instead of an empty board */
.offline .artboard { background: #FFFDF9 url("assets/plates/step4.png") center / 60% no-repeat; }
.offline .controls, .offline .level, .offline .step-count { display: none; }

/* Tablet */
@media (max-width: 1100px) {
  .lesson-board { grid-template-columns: 1fr; }
  .artboard { max-width: 560px; width: 100%; justify-self: center; }
  .sheet-head { grid-template-columns: 1fr; }
  .story, .journal-text, .studio { grid-column: 1 / span 6; }
  .story-text, .studio-text { grid-column: 7 / span 6; }
  .journal { grid-column: 8 / span 4; }
  .note { grid-template-columns: 1fr; }
  .note-side { grid-template-columns: auto 1fr; justify-items: start; text-align: left; align-items: center; gap: 0 20px; }
  .note-side img { grid-row: 1; width: 120px !important; margin: 0 !important; }
  .supply.pencil { display: none; }
}

/* Phone */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .brand-word { font-size: 26px; }
  .brand-mark { width: 44px; }
  .nav-pill { font-size: 15px; }
  .steps img { height: auto; }
  .nav { padding-inline: 16px; }
  .sheet { margin-inline: 8px; padding-inline: 18px; }
  .rings { left: 22px; right: 22px; background-size: 30px 44px; height: 44px; top: -20px; }
  .status-text { justify-content: center; text-align: center; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; width: 100%; padding-bottom: 150px; }
  .pip-wave { width: 150px; right: 6px; bottom: -14px; }
  .controls .btn { flex: 1 1 auto; }
  .btn-next { flex-basis: 100% !important; }
  .extras-grid > * { grid-column: 1 / -1 !important; padding-left: 0 !important; }
  .journal { justify-self: center; width: 70%; }
  .studio { justify-self: center; width: 70%; }
  .note { margin-inline: 8px; padding-inline: 0; }
  .note-sheet { transform: none; padding-left: 44px; }
  .note-sheet::before { left: 28px; }
  .close { flex-direction: column; text-align: center; }
  .foot { padding-inline: 16px; }
}

/* Sun-yellow pencil ticks, as in the app's celebrations */
.ticks { position: absolute; width: 56px; height: 56px; fill: none; stroke: var(--sun); stroke-width: 5; stroke-linecap: round; pointer-events: none; }
.ticks-pip { right: clamp(170px, 18vw, 310px); bottom: clamp(150px, 17vw, 300px); width: clamp(40px, 4vw, 64px); height: clamp(40px, 4vw, 64px); rotate: -20deg; }
.ticks-done { right: 14%; bottom: -6px; width: 34px; height: 34px; rotate: 60deg; }

/* Pip in the margins */
.catalogue { position: relative; }
.pip-corner { position: absolute; right: clamp(12px, 3vw, 56px); top: clamp(-70px, -4vw, -40px); width: clamp(90px, 9vw, 150px); }
.pip-margin { width: clamp(90px, 9vw, 140px); margin-top: 10px; }
.sheet-head { padding-right: clamp(0px, 9vw, 150px); }

@media (max-width: 1100px) {
  .lesson-board { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .lesson-panel { display: contents; }
  .lesson-panel h2 { order: 1; }
  .level { order: 2; align-self: flex-start; }
  .step-count { order: 3; }
  .instruction { order: 4; min-height: 0; }
  .artboard { order: 5; margin-top: 14px; }
  .controls { order: 6; }
  .pip-says { order: 7; }
  .lesson-note { order: 8; }
}
@media (max-width: 760px) {
  .doodles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 8px; }
  .doodles span { font-size: 12.5px; }
  .doodles img { width: 92%; }
  .ticks-pip { right: 128px; bottom: 120px; width: 36px; height: 36px; }
  .ticks-done { width: 30px; height: 30px; }
  .pip-corner { top: -48px; width: 84px; }
  .sheet-head { padding-right: 0; }
  .status { flex-direction: column-reverse; }
  .status .btn { width: 100%; }
}

/* Privacy policy: one sketchbook page set for reading */
.policy { max-width: 980px; }
@media (min-width: 1060px) { .policy { margin-inline: auto; } }
.policy h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
.policy-date { margin-top: 10px; color: var(--text-2); font-weight: 600; }
.policy section { margin-top: clamp(32px, 4vw, 48px); max-width: 40em; }
.policy h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-bottom: 12px; }
.policy p, .policy li { font-size: clamp(17px, 1.25vw, 19px); line-height: 1.6; color: var(--ink); }
.policy p + p, .policy p + ul, .policy ul + p { margin-top: 12px; }
.policy ul:not(.checks) { padding-left: 1.2em; }
.policy .checks { margin-top: 8px; }
@media (max-width: 760px) { .policy .checks { background: none; border-top: 0; line-height: 1.45; } .policy .checks li { padding-block: 6px; } .policy .checks li::before { top: .5em; } }
.policy a { color: var(--action); }
.foot a { color: var(--on-desk); }
