/* Kindwell landing page styles. */

/* Self-hosted fonts (SIL Open Font License, see fonts/OFL-*.txt). */
/* Caveat latin-ext */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(fonts/caveat-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Caveat latin */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(fonts/caveat-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Fraunces latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url(fonts/fraunces-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Fraunces latin */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url(fonts/fraunces-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Inter latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Inter latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  /* Surfaces */
  --kw-bg: #FAF3EE;
  --kw-paper: #FFFDF8;
  --kw-light-fill: #F1E3DC;
  --kw-note: #FBE6D8;
  --kw-stamp: #F6D9C8;
  --kw-card: #FAF3EE;
  --kw-card-border: #E3D3CC;

  /* Text */
  --kw-ink: #3A2430;
  --kw-text: #3C2730;
  --kw-muted: #6E5560;
  --kw-date-ink: #8A4A28;

  /* Cover */
  --kw-primary: #6B3F4D;
  --kw-cover: #6B3F4D;
  --kw-cover-dark: #58323F;
  --kw-cover-deep: #4E2C38;
  --kw-cover-edge: #7D4E5D;
  --kw-on-cover: #FAF3EE;
  --kw-on-cover-muted: #F1E3DC;

  /* Peach (tint is decorative only, never text) */
  --kw-peach-tint: #E8A17E;
  --kw-peach-solid: #A85C33;

  /* Paper texture */
  --kw-rule: #E8DAD2;
  --kw-grid: #F0E4DD;
  --kw-binding: #EFE2DA;
  --kw-binding-edge: #DCCAC1;
  --kw-stitch: #E3D3CC;
  --kw-margin-line: #E8A17E;
  --kw-tape: rgb(168 104 122 / .55);

  /* Form */
  --kw-field-border: #8C7B74;
  --kw-error: #B3261E;

  /* Support area: deliberately outside the brand palette */
  --safety-bg: #F5F5F4;
  --safety-surface: #FFFFFF;
  --safety-text: #1F2328;
  --safety-muted: #4B5058;
  --safety-border: #8A9099;
  --safety-link: #1F4E8C;
  --safety-focus: #1F2328;

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", cursive;
  --fs-display: clamp(2.5rem, 1.7rem + 4vw, 4.25rem);
  --fs-h2: clamp(1.875rem, 1.45rem + 2.1vw, 2.75rem);
  --fs-h3: clamp(1.25rem, 1.15rem + .5vw, 1.5rem);
  --fs-hand-xl: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --fs-hand: 1.5rem;
  --fs-lead: clamp(1.125rem, 1.06rem + .3vw, 1.3125rem);
  --fs-body: 1.0625rem;
  --fs-small: .875rem;
  --fs-eyebrow: .75rem;
  --measure: 62ch;

  /* Space */
  --gutter: clamp(20px, 5vw, 48px);
  --container: 1120px;
  --rule: 32px;
  --rule-top: 20px;

  /* Shape */
  --r-paper: 4px 14px 14px 4px;
  --r-pill: 999px;
  --r-field: 18px;
  --r-blob: 38px 30px 30px 34px / 34px 40px 36px 30px;
  --r-blob-alt: 30px 40px 28px 36px / 40px 30px 34px 28px;

  /* Shadows */
  --shadow-card: 0 12px 24px rgb(58 36 48 / .08);
  --shadow-note: 0 8px 12px -6px rgb(58 36 48 / .28);
  --shadow-slip: 0 7px 10px -7px rgb(58 36 48 / .25);
  --shadow-sheet: 0 -10px 30px -12px rgb(58 36 48 / .30);
  --shadow-phone: 0 30px 60px -20px rgb(58 36 48 / .45);

  /* Motion */
  --ease-paper: cubic-bezier(.2, .7, .2, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --ease-ink: cubic-bezier(.4, 0, .2, 1);

  interpolate-size: allow-keywords;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--kw-bg);
  color: var(--kw-text);
  font: 400 var(--fs-body)/1.65 var(--font-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--kw-ink); margin: 0; text-wrap: balance; }
h2 { font-size: var(--fs-h2); font-weight: 600; line-height: 1.12; margin-bottom: 20px; }
h3 { font-size: var(--fs-h3); font-weight: 700; line-height: 1.25; }
h4 { font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
p { margin: 0 0 16px; max-width: var(--measure); text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
abbr[title] { text-decoration: none; }
svg { overflow: visible; }

a { color: var(--kw-primary); text-decoration-line: underline; text-decoration-thickness: 1.5px; text-underline-offset: .2em; transition: text-decoration-thickness 150ms var(--ease-ink); }
a:hover, a:focus-visible { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--kw-primary); outline-offset: 3px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

.skip-link {
  position: absolute; z-index: 100; left: 12px; top: 12px;
  padding: 12px 20px; border-radius: var(--r-pill);
  background: var(--kw-paper); color: var(--kw-primary); font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.eyebrow { font: 600 var(--fs-eyebrow)/1.4 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--kw-muted); margin: 0 0 12px; }
.eyebrow--cover { color: var(--kw-on-cover-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 28px; border: 2px solid transparent; border-radius: var(--r-pill);
  font: 600 1rem/1.2 var(--font-display); text-decoration: none; cursor: pointer;
  transition: background-color 150ms, color 150ms;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--kw-primary); color: #FFFFFF; }
.btn--primary:hover { background: var(--kw-cover-dark); }
.btn--cream { background: var(--kw-on-cover); color: var(--kw-primary); }
.btn--cream:hover { background: #FFFFFF; }
.btn--sm { min-height: 48px; padding: 0 20px; }
.btn[aria-pressed="true"] { background: var(--kw-paper); color: var(--kw-primary); border-color: var(--kw-primary); }

.link--cover {
  display: inline-flex; align-items: center; min-height: 48px; color: var(--kw-on-cover);
  font: 600 1rem/1.2 var(--font-display);
}
.link--cover::after { content: "→"; margin-left: 8px; font-family: var(--font-body); }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: var(--r-pill);
  background: var(--kw-light-fill); color: var(--kw-ink); font-size: .8125rem; font-weight: 500; line-height: 1.6;
}
.pill--label { margin: -4px 0 20px; padding: 6px 14px; font-size: .875rem; font-weight: 600; }

/* ---------- Header ---------- */
.site-header { position: absolute; z-index: 5; top: 0; left: 0; right: 0; color: var(--kw-on-cover); }
.site-header__inner { display: flex; align-items: center; gap: 16px; min-height: 80px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; color: var(--kw-on-cover); text-decoration: none; }
.brand__mark { width: 32px; height: 32px; color: var(--kw-on-cover); --dot: var(--kw-peach-tint); }
.brand__name { font: 600 1.25rem/1 var(--font-display); }
.site-nav { display: none; margin-left: auto; }
.site-nav ul { display: flex; gap: 4px; list-style: none; }
.site-nav a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 12px; color: var(--kw-on-cover); font-weight: 500; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; }
.site-header .btn { margin-left: auto; }
.site-nav + .btn { margin-left: 8px; }
.site-header :focus-visible, .hero :focus-visible, .site-footer :focus-visible { outline-color: var(--kw-on-cover); }

/* ---------- Cover / hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 112px 0 112px;
  background-color: var(--kw-cover);
  /* Linen texture: inline feTurbulence at very low opacity. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9 .06' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
  color: var(--kw-on-cover);
}
.hero__band { position: absolute; top: 0; bottom: 0; right: 24px; width: 12px; background: var(--kw-cover-dark); box-shadow: inset 1px 0 0 rgb(255 255 255 / .06), 2px 0 6px rgb(0 0 0 / .12); }
.hero__tabs { position: absolute; right: 0; top: 150px; display: flex; flex-direction: column; gap: 8px; }
.hero__tabs span { display: block; width: 18px; height: 44px; border-radius: 8px 0 0 8px; background: var(--c); box-shadow: -1px 2px 3px rgb(0 0 0 / .25); }
.hero__tabs span:nth-child(n+5) { display: none; }
.hero__grid { position: relative; display: grid; gap: 40px; }
.hero__text { max-width: 640px; padding-right: 24px; }
.hero h1 { color: var(--kw-on-cover); font-size: var(--fs-display); font-weight: 600; line-height: 1.05; letter-spacing: -.01em; }
.hero__hand { margin: 14px 0 20px; font: 700 var(--fs-hand-xl)/1.15 var(--font-hand); color: var(--kw-on-cover-muted); }
.lead { font-size: var(--fs-lead); line-height: 1.6; }
.hero .lead { color: var(--kw-on-cover); }
.hero__actions { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin: 28px 0 20px; }
.hero__actions .link--cover { justify-content: center; }
.hero__note { font-size: var(--fs-small); line-height: 1.5; color: var(--kw-on-cover-muted); }
.hero__figure { display: none; position: relative; margin: 0; text-align: center; }
.hero__figure figcaption { position: relative; max-width: 320px; margin: 20px auto 0; font-size: var(--fs-small); line-height: 1.5; color: var(--kw-on-cover-muted); }
.hero__deco { display: flex; justify-content: flex-end; gap: 6px; margin-top: -12px; padding-right: 32px; }
.hero__deco .sticker { width: 56px; height: 56px; }

.blob { position: absolute; border-radius: 58% 42% 47% 53% / 46% 55% 45% 54%; background: var(--kw-peach-tint); opacity: .2; pointer-events: none; }
.blob--hero { width: min(440px, 110%); aspect-ratio: 1; left: 50%; top: 46%; translate: -50% -50%; }

/* ---------- Contents ---------- */
.toc { position: relative; z-index: 2; margin-top: -48px; padding: 0 36px 0 8px; }
.toc__sheet {
  position: relative; max-width: var(--container); margin-inline: auto;
  padding: 36px 0 40px 28px;
  border-radius: 6px 14px 0 0;
  box-shadow: var(--shadow-sheet);
  background:
    linear-gradient(to right, var(--kw-binding) 0 10px, var(--kw-binding-edge) 10px 11px, transparent 11px),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--rule) - 1px), var(--kw-rule) calc(var(--rule) - 1px) var(--rule)) 0 var(--rule-top),
    var(--kw-paper);
}
.toc__side { padding-right: 24px; }
.toc__intro { color: var(--kw-muted); font-size: var(--fs-small); }
.taped-note {
  position: relative; margin: 28px 0 8px; padding: 20px 18px 14px;
  background: var(--kw-note); box-shadow: var(--shadow-note); transform: rotate(-.8deg);
}
.taped-note::before { content: ""; position: absolute; top: -10px; left: 50%; width: 72px; height: 20px; margin-left: -36px; background: var(--kw-tape); }
.taped-note p { margin: 0; font-size: .9375rem; line-height: 1.55; color: var(--kw-ink); }
.toc__stickers { display: none; }
.toc__list { list-style: none; margin-top: 20px; }
.toc__row {
  display: grid; grid-template-columns: auto minmax(16px, 1fr) 34px; grid-template-rows: 34px minmax(30px, auto);
  align-items: end; min-height: 64px; color: var(--kw-ink); text-decoration: none;
}
.toc__title { grid-column: 1; grid-row: 1; font: 700 1.625rem/1 var(--font-hand); white-space: nowrap; }
.hl { position: relative; z-index: 0; }
.hl::before {
  content: ""; position: absolute; z-index: -1; left: -5px; right: -7px; bottom: 1px; height: 12px;
  border-radius: 4px; background: var(--c); opacity: .55;
  transform: rotate(-.7deg); transform-origin: bottom; transition: transform 150ms var(--ease-ink), opacity 150ms;
}
.toc__dots { grid-column: 2; grid-row: 1; align-self: end; height: 4px; margin: 0 12px 8px; background: radial-gradient(circle, var(--c) 1.1px, transparent 1.5px) 0 50% / 6px 4px repeat-x; }
.toc__tab {
  grid-column: 3; grid-row: 1 / span 2; align-self: start; display: grid; place-items: center;
  width: 34px; height: 58px; margin-right: -34px; margin-top: 4px;
  border-radius: 0 8px 8px 0; background: var(--c); box-shadow: 1px 2px 3px rgb(0 0 0 / .22);
  font: 700 1.375rem/1 var(--font-hand); color: var(--kw-ink);
  transition: transform 150ms var(--ease-ink);
}
.toc__desc { grid-column: 1 / span 2; grid-row: 2; align-self: start; padding-top: 6px; padding-bottom: 6px; font-size: var(--fs-small); line-height: 1.3; color: var(--kw-muted); padding-right: 8px; }
.toc__row:hover .hl::before, .toc__row:focus-visible .hl::before { transform: rotate(-.7deg) scaleY(1.7); opacity: .8; }
.toc__row:hover .toc__tab, .toc__row:focus-visible .toc__tab { transform: translateX(5px); }
.toc__row:focus-visible { outline-offset: 2px; border-radius: 4px; }

/* ---------- Paper pages ---------- */
.page { position: relative; padding: 20px 8px; }
.page:first-of-type { padding-top: 40px; }
.page__sheet {
  position: relative; max-width: var(--container); margin-inline: auto;
  padding: 48px 18px 48px 30px; border-radius: var(--r-paper);
  box-shadow: 0 1px 0 var(--kw-card-border), var(--shadow-card);
}
.paper {
  --bind: 10px;
  --binding: linear-gradient(to right, var(--kw-binding) 0 var(--bind), var(--kw-binding-edge) var(--bind) calc(var(--bind) + 1px), transparent calc(var(--bind) + 1px));
  background: var(--binding), var(--kw-paper);
}
.paper--lined { background: var(--binding), repeating-linear-gradient(to bottom, transparent 0 calc(var(--rule) - 1px), var(--kw-rule) calc(var(--rule) - 1px) var(--rule)) 0 var(--rule-top), var(--kw-paper); }
.paper--grid {
  background: var(--binding),
    linear-gradient(to right, var(--kw-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(to bottom, var(--kw-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--kw-paper);
}
.page__no { position: absolute; top: 14px; right: 22px; font: 700 1.75rem/1 var(--font-hand); color: var(--kw-date-ink); }
.page__grid { display: grid; gap: 40px; }
.page__text > p { max-width: var(--measure); }
.page__head { max-width: 720px; margin-bottom: 32px; }
.page__figure { margin: 0; text-align: center; }
.page__figure figcaption { max-width: 320px; margin: 18px auto 0; font-size: var(--fs-small); line-height: 1.5; color: var(--kw-muted); }
.sub-title { margin: 40px 0 12px; }

.feature-list { list-style: none; margin: 24px 0 8px; display: grid; gap: 14px; max-width: var(--measure); }
.feature-list li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.feature-list strong { color: var(--kw-ink); font-weight: 600; }
.feature-list--compact { gap: 8px; }
.feature-list--compact li { align-items: center; }
.optional { font-style: normal; color: var(--kw-muted); font-size: .9375rem; }

/* Stickers (inline SVG) */
.sticker { display: inline-block; width: 56px; height: 56px; transform: rotate(var(--r, 0deg)); filter: drop-shadow(0 3px 2px rgb(58 36 48 / .18)); }
.sticker--bullet { width: 34px; height: 34px; margin-top: -2px; }
.sticker-sheet { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 16px; margin: 40px 0 0; padding: 28px 0 8px; border-top: 1px dashed var(--kw-card-border); max-width: var(--measure); }
.word-sticker {
  display: inline-block; padding: 5px 12px; transform: rotate(var(--r, 0deg));
  box-shadow: 0 2px 1px rgb(58 36 48 / .25); white-space: nowrap;
}
.word-sticker--tape { background: #F2B8C6; color: var(--kw-ink); font: 700 1.5rem/1 var(--font-hand); border-radius: 1px; }
.word-sticker--label { margin-top: 24px; background: var(--kw-ink); color: var(--kw-paper); font: 700 .875rem/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, "Courier New", monospace; letter-spacing: .18em; text-transform: uppercase; border-radius: 3px; }

/* Handwriting line ("written" on reveal) */
.hand-line { display: inline-block; position: relative; }

/* ---------- Theme picker ---------- */
.page__aside { display: grid; gap: 8px; }
.themes { max-width: 460px; margin: 32px auto 0; padding: 0; border: 0; min-width: 0; text-align: left; }
.themes legend { padding: 0; font: 700 var(--fs-h3)/1.25 var(--font-display); color: var(--kw-ink); }
.themes__hint { margin: 8px 0 16px; font-size: var(--fs-small); line-height: 1.5; color: var(--kw-muted); }
.themes__grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.theme-chip {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px;
  border: 1.5px solid var(--kw-card-border); border-radius: 12px; background: var(--kw-paper); cursor: pointer;
  transition: border-color 150ms, background-color 150ms;
}
.theme-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.theme-chip__cover {
  flex: none; position: relative; width: 34px; height: 46px; border-radius: 3px 7px 7px 3px;
  background: linear-gradient(to right, var(--sw2) 0 5px, transparent 5px), linear-gradient(to left, transparent 6px, var(--sb) 6px 9px, transparent 9px), var(--sw);
  box-shadow: 0 3px 5px -2px rgb(58 36 48 / .35);
}
.theme-chip__cover::after { content: ""; position: absolute; left: 9px; top: 12px; width: 14px; height: 10px; border-radius: 2px; background: var(--sl); }
.theme-chip__cover--stars { background: radial-gradient(circle, #E9D49A 0 1px, transparent 1.4px) 0 0 / 9px 11px, linear-gradient(to right, var(--sw2) 0 5px, transparent 5px), linear-gradient(to left, transparent 6px, var(--sb) 6px 9px, transparent 9px), var(--sw); }
.theme-chip__cover--marble { background: radial-gradient(ellipse at 30% 30%, transparent 40%, rgb(251 251 246 / .55) 42%, transparent 46%), radial-gradient(ellipse at 70% 80%, transparent 35%, rgb(251 251 246 / .45) 37%, transparent 41%), var(--sw); }
.theme-chip__cover--gradient { background: linear-gradient(135deg, #FFD0B0, #F29DB0, #D9B5F0); }
.theme-chip__text { display: grid; line-height: 1.3; }
.theme-chip__name { font-weight: 600; color: var(--kw-ink); font-size: .9375rem; }
.theme-chip__tag { font-size: .75rem; color: var(--kw-muted); }
.theme-chip:hover { border-color: var(--kw-field-border); }
.theme-chip:has(input:checked) { border-color: var(--kw-primary); background: var(--kw-note); box-shadow: inset 0 0 0 1px var(--kw-primary); }
.theme-chip:has(input:focus-visible) { outline: 3px solid var(--kw-primary); outline-offset: 3px; }

/* ---------- Phone mockups ---------- */
.phone {
  /* Mockup palette: Dusk Berry, swapped by the theme picker. */
  --m-cover: #6B3F4D; --m-cover-bg: var(--m-cover); --m-desk: #4E2C38; --m-on-cover: #FAF3EE;
  --m-paper: #FFFDF8; --m-rule: #E8DAD2; --m-binding: #EFE2DA; --m-binding-edge: #DCCAC1; --m-margin: #E8A17E;
  --m-ink: #3A2430; --m-muted: #6E5560; --m-date: #8A4A28; --m-stamp: #F6D9C8; --m-accent: #A85C33;
  --m-primary: #6B3F4D; --m-note: #FBE6D8; --m-card: #FAF3EE; --m-card-border: #E3D3CC; --m-tape: rgb(168 104 122 / .55);
  --m-hand: var(--font-hand); --m-hand-scale: 1;
  --m-pattern: repeating-linear-gradient(to bottom, transparent 0 23px, var(--m-rule) 23px 24px) 0 13px;
  position: relative; display: inline-block; width: clamp(232px, 64vw, 300px); max-width: 100%; aspect-ratio: 9 / 19.5;
  padding: 10px; border-radius: 44px; background: #2A1A21; text-align: left;
  box-shadow: var(--shadow-phone), inset 0 0 0 2px var(--kw-cover-deep);
}
.phone__notch { position: absolute; z-index: 3; top: 18px; left: 50%; width: 84px; height: 22px; margin-left: -42px; border-radius: 999px; background: #2A1A21; }
.phone__screen { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 34px; background: var(--m-paper); color: var(--m-ink); font-family: var(--font-body); }
.phone__screen--desk { background: var(--m-desk); }
.phone__bar {
  flex: none; display: flex; align-items: center; gap: 8px; height: 76px; padding: 28px 18px 0;
  background: var(--m-cover-bg); color: var(--m-on-cover);
}
.phone__bar--tall { height: 84px; }
.phone__title { flex: 1; min-width: 0; text-align: center; font: 600 15px/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone__title small { display: block; white-space: normal; margin-top: 2px; font: 500 10px/1.2 var(--font-body); opacity: .9; }
.pi { flex: none; position: relative; width: 20px; height: 20px; }
.pi--back::before { content: ""; position: absolute; left: 5px; top: 5px; width: 9px; height: 9px; border-left: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); }
.pi--cal::before { content: ""; position: absolute; inset: 3px 2px 2px; border: 2px solid; border-top-width: 4px; border-radius: 3px; }
.pi--book::before { content: ""; position: absolute; inset: 4px 1px 3px; border: 2px solid; border-radius: 2px; }
.pi--book::after { content: ""; position: absolute; left: 9px; top: 4px; bottom: 3px; width: 2px; background: currentColor; }
.pi--ink::before { content: ""; position: absolute; left: 4px; right: 4px; top: 6px; bottom: 1px; border: 2px solid; border-radius: 4px; background: linear-gradient(to top, currentColor 55%, transparent 55%); }
.pi--ink::after { content: ""; position: absolute; left: 7px; right: 7px; top: 1px; height: 5px; border: 2px solid; border-bottom: 0; border-radius: 1px; }
.pi--send::before { content: ""; position: absolute; inset: 3px 2px 3px 4px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%, 15% 50%); }
.phone__foot { flex: none; height: 44px; display: grid; place-items: center; background: var(--m-cover-bg); color: var(--m-on-cover); font: 500 12px/1 var(--font-body); }

.m-hand { margin: 0; font-family: var(--m-hand); font-weight: 500; color: var(--m-ink); max-width: none; }
.m-eyebrow { margin: 0; font: 600 10px/24px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--m-muted); }
.m-paper {
  position: relative; flex: 1; min-height: 0; overflow: hidden; padding: 13px 14px 14px 22px;
  background: linear-gradient(to right, var(--m-binding) 0 10px, var(--m-binding-edge) 10px 11px, transparent 11px), var(--m-pattern), var(--m-paper);
}
.m-paper--plain { --m-pattern: linear-gradient(transparent, transparent); }
.m-paper--grid { --m-pattern: linear-gradient(to right, var(--m-rule) 1px, transparent 1px) 0 0 / 16px 16px, linear-gradient(to bottom, var(--m-rule) 1px, transparent 1px) 0 0 / 16px 16px; }

/* Hero: closed cover opening onto the contents page */
.book { position: relative; flex: 1; margin: 10px 10px 0 16px; perspective: 1200px; }
.leaf { position: absolute; inset: 0; border-radius: 6px 14px 0 0; }
.leaf--contents {
  padding: 13px 0 0 22px; overflow: hidden;
  background: linear-gradient(to right, var(--m-binding) 0 8px, var(--m-binding-edge) 8px 9px, transparent 9px), repeating-linear-gradient(to bottom, transparent 0 23px, var(--m-rule) 23px 24px) 0 13px, var(--m-paper);
}
.m-hand--title { font-size: 24px; font-weight: 700; line-height: 24px; color: var(--m-date); }
.m-hand--muted { font-size: 17px; line-height: 24px; color: var(--m-muted); }
.leaf--contents .m-eyebrow { margin-top: 24px; }
.m-toc { list-style: none; }
.m-toc li { position: relative; display: grid; height: 48px; padding-right: 40px; }
.m-toc b { position: relative; z-index: 0; align-self: end; justify-self: start; font: 700 19px/24px var(--font-hand); color: var(--m-ink); }
.m-toc b::before { content: ""; position: absolute; z-index: -1; left: -3px; right: -4px; bottom: 4px; height: 8px; border-radius: 3px; background: var(--c); opacity: .5; }
.m-toc small { font: 400 10px/24px var(--font-body); color: var(--m-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-toc i { position: absolute; right: 0; top: 4px; width: 26px; height: 40px; display: grid; place-items: center; border-radius: 0 6px 6px 0; background: var(--c); font: normal 700 16px/1 var(--font-hand); color: #3A2430; box-shadow: 1px 2px 3px rgb(0 0 0 / .25); }
.leaf--cover { display: none; }
.cover-art { position: absolute; inset: 0 0 18px; border-radius: 6px 14px 14px 6px; overflow: hidden; background: var(--kw-cover); box-shadow: 0 14px 24px -12px rgb(0 0 0 / .5); }
.cover-art__spine { position: absolute; left: 0; top: 0; bottom: 0; width: 10%; background: rgb(88 50 63 / .85); border-right: 2px solid var(--kw-cover-edge); }
.cover-art__band { position: absolute; right: 12%; top: 0; bottom: 0; width: 5.5%; background: var(--kw-peach-solid); }
.cover-art__label { position: absolute; left: 22%; top: 24%; width: 56%; display: grid; justify-items: center; padding: 12px 4px 10px; border: 2px solid var(--kw-peach-tint); border-radius: 6px; background: var(--kw-on-cover); color: var(--kw-primary); }
.cover-art__k { font: 700 46px/1.05 var(--font-display); }
.cover-art__title { font: 700 22px/1.1 var(--font-hand); }
.cover-art__year { margin-top: 2px; font: 600 10px/1.2 var(--font-body); letter-spacing: .15em; }

/* Diary mockup */
.m-paper--diary { padding-left: 40px; background: linear-gradient(to right, var(--m-binding) 0 10px, var(--m-binding-edge) 10px 11px, transparent 11px), linear-gradient(var(--m-margin), var(--m-margin)) 32px 0 / 1px 100% no-repeat, var(--m-pattern), var(--m-paper); }
.m-hand--date { padding-right: 50px; font-size: calc(22px * var(--m-hand-scale)); font-weight: 700; line-height: 24px; color: var(--m-date); margin-bottom: 24px; }
.m-line { font-size: calc(19px * var(--m-hand-scale)); line-height: 24px; padding-right: 6px; }
.m-stamp { position: absolute; top: 8px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px dashed var(--m-accent); background: var(--m-stamp); color: var(--m-primary); transform: rotate(-8deg); }
.m-stamp svg { width: 30px; height: 30px; }
.m-sticker { position: absolute; width: 58px; height: 58px; }
.m-sticker--cup { right: 20px; bottom: 36px; }
.m-sticker--leaf { left: 4px; top: 150px; width: 40px; height: 40px; }
.m-sticker--star { right: 90px; bottom: 64px; width: 40px; height: 40px; }
.phone--diary.is-swapping .m-paper { animation: paper-swap 520ms var(--ease-paper); transform-origin: left center; }
@keyframes paper-swap { from { transform: perspective(900px) rotateY(-28deg); opacity: .35; } to { transform: none; opacity: 1; } }

/* Theme picker swaps the diary mockup palette (CSS only, works without JS). */
#gunluk:has(input[value="kraft"]:checked) .phone--diary {
  --m-cover: #B08B5E; --m-desk: #B59467; --m-on-cover: #2B2622; --m-paper: #F7F1E5; --m-rule: #BDAE98; --m-binding: #EADFCB; --m-binding-edge: #D6C8AE;
  --m-margin: transparent; --m-ink: #2B2622; --m-muted: #675B4D; --m-date: #8E2F1C; --m-stamp: #F0DDB0; --m-accent: #A63A22; --m-primary: #2B2622;
  --m-hand: "Courier Prime", "Courier New", ui-monospace, monospace; --m-hand-scale: .7;
  --m-pattern: radial-gradient(circle, var(--m-rule) 0 1px, transparent 1.4px) 0 1px / 12px 12px;
}
#gunluk:has(input[value="midnight"]:checked) .phone--diary {
  --m-cover: #1D2440; --m-desk: #0F1324; --m-on-cover: #EDE7D6; --m-paper: #252B45; --m-rule: #3A4266; --m-binding: #1F2540; --m-binding-edge: #343C60;
  --m-margin: rgb(200 162 74 / .5); --m-ink: #EDE7D6; --m-muted: #B1B0C2; --m-date: #E9C46A; --m-stamp: #343C60; --m-accent: #E9C46A; --m-primary: #E9D49A;
  --m-cover-bg: radial-gradient(circle, #E9D49A 0 1px, transparent 1.5px) 0 0 / 19px 23px, #1D2440;
}
#gunluk:has(input[value="school"]:checked) .phone--diary {
  --m-cover: #17181C; --m-desk: #2A2C33; --m-on-cover: #FBFBF6; --m-paper: #FDFDF8; --m-rule: #C9DDEB; --m-binding: #EEF0EE; --m-binding-edge: #D5DAD8;
  --m-margin: #E0564A; --m-ink: #1F2A44; --m-muted: #5A6478; --m-date: #B5382E; --m-stamp: #FFF0B0; --m-accent: #B5382E; --m-primary: #1F2A44;
  --m-pattern: linear-gradient(to right, var(--m-rule) 1px, transparent 1px) 0 1px / 12px 12px, linear-gradient(to bottom, var(--m-rule) 1px, transparent 1px) 0 1px / 12px 12px;
}
#gunluk:has(input[value="sage"]:checked) .phone--diary {
  --m-cover: #5E7560; --m-desk: #3E5244; --m-on-cover: #FAF8F1; --m-paper: #FAF8F1; --m-rule: #E6E1D2; --m-binding: #EFEBDD; --m-binding-edge: #DDD8C8;
  --m-margin: transparent; --m-ink: #33402F; --m-muted: #636D5C; --m-date: #4B6050; --m-stamp: #E3EBD9; --m-accent: #80602F; --m-primary: #4B6050;
  --m-pattern: linear-gradient(transparent, transparent);
}
#gunluk:has(input[value="peach"]:checked) .phone--diary {
  --m-cover: #F29DB0; --m-desk: #EAA3B8; --m-on-cover: #4A1F38; --m-paper: #FFF9F4; --m-rule: #E7D6F5; --m-binding: #FBE9EE; --m-binding-edge: #F0D3DC;
  --m-margin: #F6A9B8; --m-ink: #4A2E46; --m-muted: #775B71; --m-date: #B83A6E; --m-stamp: #FFE0E6; --m-accent: #B83A6E; --m-primary: #8A3F5C;
  --m-cover-bg: linear-gradient(120deg, #FFD0B0, #F29DB0 55%, #D9B5F0);
}

/* Box breathing mockup */
.m-hand--hint { font-size: 17px; line-height: 24px; text-align: center; color: var(--m-muted); padding-right: 6px; }
.breath { position: relative; width: 184px; height: 184px; margin: 28px auto 20px; font-family: var(--font-hand); }
.breath__square { position: absolute; inset: 26px; border: 3px dashed #A8687A; border-radius: 10px; }
.breath__bar { position: absolute; border-radius: 3px; background: var(--kw-peach-solid); opacity: 0; }
.breath__bar--0 { top: -5px; left: -4px; right: -4px; height: 7px; transform-origin: left center; }
.breath__bar--1 { right: -5px; top: -4px; bottom: -4px; width: 7px; transform-origin: center top; }
.breath__bar--2 { bottom: -5px; left: -4px; right: -4px; height: 7px; transform-origin: right center; }
.breath__bar--3 { left: -5px; top: -4px; bottom: -4px; width: 7px; transform-origin: center bottom; }
.breath[data-phase="0"] .breath__bar--0, .breath[data-phase="2"] .breath__bar--2 { opacity: 1; animation: bar-x 4s linear both; }
.breath[data-phase="1"] .breath__bar--1, .breath[data-phase="3"] .breath__bar--3 { opacity: 1; animation: bar-y 4s linear both; }
@keyframes bar-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes bar-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.breath__core { position: absolute; inset: 20px; display: grid; place-content: center; text-align: center; border-radius: 50%; background: var(--m-note); }
.breath__name { font: 600 15px/1.2 var(--font-display); color: var(--m-ink); }
.breath__count { font: 600 48px/1 var(--font-display); color: var(--m-primary); font-variant-numeric: tabular-nums; }
.breath__side { position: absolute; font-size: 18px; line-height: 1; color: var(--m-muted); white-space: nowrap; }
.breath__side--0 { top: 0; left: 50%; translate: -50% 0; }
.breath__side--1 { right: 0; top: 50%; translate: 0 -50%; rotate: 90deg; }
.breath__side--2 { bottom: 0; left: 50%; translate: -50% 0; }
.breath__side--3 { left: 0; top: 50%; translate: 0 -50%; rotate: -90deg; }
.breath[data-phase="0"] .breath__side--0, .breath[data-phase="1"] .breath__side--1,
.breath[data-phase="2"] .breath__side--2, .breath[data-phase="3"] .breath__side--3 { color: var(--m-date); font-weight: 700; }
.m-pill { display: block; width: max-content; margin: 0 auto; padding: 8px 22px; border-radius: 999px; background: var(--m-primary); color: #FFFFFF; font: 600 13px/1.2 var(--font-display); }
.breath-controls { display: grid; justify-items: center; gap: 10px; margin-top: 20px; }
.breath-controls .small-note { max-width: 340px; margin: 0; font-size: var(--fs-small); line-height: 1.5; color: var(--kw-muted); }
.exercise-cols { display: grid; gap: 24px; margin-top: 28px; }
.exercise-cols h3 { margin-bottom: 8px; font-weight: 600; }
.plain-list { list-style: none; display: grid; gap: 6px; }
.plain-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.plain-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--kw-peach-solid); }

/* Test mockup */
.m-paper--plain { padding: 24px 16px 14px 24px; }
.m-instr { margin: 0 0 14px; font: 400 11.5px/1.45 var(--font-body); color: var(--m-muted); }
.m-pill--next { margin-top: 22px; }
.m-card { padding: 16px 14px 10px; background: var(--m-card); border: 1px solid var(--m-card-border); box-shadow: var(--shadow-slip); }
.m-card__q { margin: 0 0 12px; font: 600 14px/1.35 var(--font-body); color: var(--m-ink); }
.m-checks { list-style: none; }
.m-checks li { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 13px; line-height: 1.3; color: var(--m-ink); border-top: 1px solid var(--m-card-border); }
.m-box { flex: none; position: relative; width: 18px; height: 18px; border: 2px solid var(--m-ink); border-radius: 3px; }
.m-box svg { position: absolute; left: -2px; top: -7px; width: 24px; height: 24px; color: var(--m-primary); }
.m-checks .is-on { font-weight: 600; }
.m-progress { display: flex; align-items: center; gap: 10px; margin: 20px 0 0; font: 600 12px/1 var(--font-body); color: var(--m-muted); }
.m-progress span { flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--m-primary) calc(var(--p) * 100%), var(--m-card-border) 0); }

/* Chat mockup */
.m-chat { display: flex; flex-direction: column; gap: 14px; padding-top: 22px; }
.m-bubble--guide { position: relative; margin-right: 18px; padding: 14px 12px 10px; background: var(--m-note); box-shadow: var(--shadow-note); font: 400 11.5px/1.45 var(--font-body); color: var(--m-ink); transform: rotate(-.6deg); }
.m-bubble--guide::before { content: ""; position: absolute; top: -8px; left: 50%; width: 54px; height: 15px; margin-left: -27px; background: var(--m-tape); }
.m-bubble--me { align-self: flex-end; max-width: 80%; font-size: 19px; line-height: 24px; text-align: right; }
.m-typing { display: flex; gap: 4px; padding: 8px 10px; width: max-content; background: var(--m-note); border-radius: 10px; }
.m-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--m-muted); opacity: .7; }
.phone__input { flex: none; display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 16px 6px; background: var(--m-cover-bg); color: var(--m-on-cover); }
.phone__input span:first-child { flex: 1; padding: 8px 14px; border-radius: 18px; background: var(--m-paper); color: var(--m-muted); font-size: 12px; }

/* Community mockup */
.m-chips { flex: none; display: flex; gap: 6px; padding: 10px 12px; overflow: hidden; background: var(--m-cover-bg); }
.m-chips span { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--m-paper); color: var(--m-ink); font: 500 10.5px/1 var(--font-body); }
.m-chips span[style]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.m-chips .is-on { background: var(--m-note); font-weight: 700; }
.m-feed { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; }
.m-tape { margin: 0; padding: 6px 10px; background: var(--m-tape); color: var(--m-ink); font: 400 11px/1.3 var(--font-body); transform: rotate(-.6deg); }
.m-post { padding: 12px 12px 10px; background: var(--m-card); border: 1px solid var(--m-card-border); box-shadow: var(--shadow-slip); }
.m-tag { display: inline-block; padding: 2px 7px; border-radius: 4px; background: var(--c); color: #3A2430; font: 600 9.5px/1.4 var(--font-body); }
.m-post__title { margin: 6px 0 4px; font: 600 13.5px/1.3 var(--font-display); color: var(--m-ink); }
.m-post__body { margin: 0 0 4px; font-size: 11.5px; line-height: 1.4; color: var(--m-ink); }
.m-post__meta { margin: 6px 0 0; font-size: 10px; color: var(--m-muted); }
.m-fab { position: absolute; right: 16px; bottom: 16px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--m-primary); color: #FFFFFF; font: 400 26px/1 var(--font-body); box-shadow: 0 6px 12px -4px rgb(0 0 0 / .4); }

/* ---------- Tests ---------- */
.test-grid { list-style: none; display: grid; gap: 16px; margin-top: 24px; }
.slip { position: relative; padding: 18px 18px 16px; background: var(--kw-card); border: 1px solid var(--kw-card-border); box-shadow: var(--shadow-slip); }
.slip h3 { margin-bottom: 4px; padding-right: 64px; }
.slip p { margin: 0; font-size: .9375rem; line-height: 1.5; }
.slip__meta { position: absolute; top: 18px; right: 16px; font-size: .8125rem; font-weight: 600; color: var(--kw-muted); }
.slip .slip__note { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--kw-card-border); font-size: var(--fs-small); color: var(--kw-muted); }
.callout { margin-top: 40px; padding: 20px 22px; background: var(--kw-note); border-left: 4px solid var(--kw-primary); }
.callout p { margin: 0; max-width: 80ch; color: var(--kw-ink); }

/* ---------- Sirdas and guides ---------- */
.guide-grid { list-style: none; display: grid; gap: 16px; margin-top: 20px; }
.guide { padding: 20px 20px 18px; background: var(--kw-card); border-radius: var(--r-blob); box-shadow: var(--shadow-card); border: 1px solid var(--kw-card-border); }
.guide--alt { border-radius: var(--r-blob-alt); }
.guide__icon { width: 30px; height: 30px; margin-bottom: 8px; fill: none; stroke: var(--kw-primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.guide p { margin: 0; font-size: .9375rem; line-height: 1.55; }
.guide .guide__approach { margin: 2px 0 8px; font-size: var(--fs-small); font-style: italic; color: var(--kw-muted); }
.ink-row { display: flex; align-items: center; gap: 16px; margin: 32px 0 0; }
.ink-row p { margin: 0; }
.ink-bottle { flex: none; width: 40px; height: 50px; }
.ink-bottle__ink { transform-box: fill-box; transform-origin: center bottom; }
.know-box { margin-top: 32px; padding: 22px 22px 20px; background: var(--kw-light-fill); border-radius: 4px; max-width: 720px; }
.know-box h3 { margin-bottom: 12px; }
.know-box ul { display: grid; gap: 10px; padding-left: 20px; }
.know-box li { color: var(--kw-ink); line-height: 1.55; }
.know-box li::marker { color: var(--kw-primary); }

/* ---------- Community ---------- */
.cat-strip { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: -12px 0 28px; padding-right: 32px; }
.cat-strip span { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-small); font-weight: 500; color: var(--kw-ink); }
.cat-strip span::before { content: ""; width: 22px; height: 12px; border-radius: 2px 4px 4px 2px; background: var(--c); }

/* ---------- Privacy ---------- */
.privacy-grid { list-style: none; display: grid; gap: 16px; }
.privacy-card { display: grid; align-content: start; grid-template-columns: 28px 1fr; gap: 0 16px; padding: 20px 22px 18px; background: var(--kw-card); border: 1px solid var(--kw-card-border); box-shadow: var(--shadow-slip); }
.privacy-card svg { grid-row: span 2; width: 28px; height: 28px; margin-top: 2px; fill: none; stroke: var(--kw-primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.privacy-card h3 { margin-bottom: 6px; font-size: 1.1875rem; }
.privacy-card p { margin: 0; font-size: .9375rem; line-height: 1.55; }
.policy-note { margin: 28px 0 0; font-size: var(--fs-small); color: var(--kw-muted); }

/* ---------- Waitlist ---------- */
.waitlist { position: relative; overflow: hidden; padding: 72px 12px 88px; background: var(--kw-bg); }
.blob--waitlist { width: min(520px, 80vw); height: 460px; left: 50%; top: 50%; translate: -20% -50%; }
.waitlist__card {
  position: relative; max-width: 560px; margin-inline: auto; padding: 56px 22px 32px 30px; border-radius: var(--r-paper);
  background: linear-gradient(to right, var(--kw-binding) 0 10px, var(--kw-binding-edge) 10px 11px, transparent 11px), var(--kw-paper);
  box-shadow: var(--shadow-card), 0 1px 0 var(--kw-card-border);
}
.waitlist__card .page__no { left: 30px; right: auto; }
.stamp { position: absolute; top: -26px; right: 8px; display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: var(--kw-stamp); border: 2px dashed var(--kw-peach-solid); transform: rotate(-8deg); }
.stamp span { font: 700 .8125rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--kw-cover-dark); }
.waitlist__form { margin-top: 24px; }
.waitlist__form label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--kw-ink); }
.waitlist__row { display: flex; flex-wrap: wrap; gap: 12px; }
.waitlist__row input {
  flex: 1 1 220px; min-width: 0; min-height: 52px; padding: 0 18px; border: 1.5px solid var(--kw-field-border); border-radius: var(--r-field);
  background: #FFFFFF; color: var(--kw-ink); font: 400 1rem/1.2 var(--font-body);
}
.waitlist__row input::placeholder { color: var(--kw-muted); opacity: 1; }
.waitlist__row input[aria-invalid="true"] { border-color: var(--kw-error); border-width: 2px; }
.waitlist__row .btn { flex: 1 0 auto; }
.field-hint { margin: 10px 0 0; font-size: var(--fs-small); line-height: 1.5; color: var(--kw-muted); }
.field-error { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; font-size: .9375rem; font-weight: 500; color: var(--kw-error); }
.field-error[hidden] { display: none; }
.field-error svg { flex: none; width: 20px; height: 20px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.form-status { margin: 12px 0 0; color: var(--kw-ink); font-weight: 500; }
.form-status:empty { display: none; }
.waitlist__fallback { margin-top: 20px; font-weight: 500; }
.ink-bottle--empty { display: block; width: 48px; height: 60px; margin: 28px auto 0; }
#waitlist-ink { transform: scaleY(0); transition: transform 700ms var(--ease-ink); }
#waitlist-ink.is-filled { transform: scaleY(1); }

/* ---------- FAQ ---------- */
.page--faq .page__sheet { max-width: 880px; }
.faq { max-width: 760px; border-top: 1px solid var(--kw-card-border); }
.faq details { border-bottom: 1px solid var(--kw-card-border); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 10px 0;
  font: 600 1.125rem/1.35 var(--font-display); color: var(--kw-ink); cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 28px; text-align: center; font: 700 2rem/1 var(--font-hand); color: var(--kw-date-ink); transition: transform 200ms var(--ease-ink); }
.faq details[open] > summary::after { content: "−"; transform: rotate(180deg); }
.faq__body { padding: 0 40px 16px 0; }
.faq__body p { margin: 0; }
@supports selector(::details-content) {
  .faq details::details-content { block-size: 0; overflow: hidden; opacity: 0; transition: block-size 200ms var(--ease-ink), opacity 200ms, content-visibility 200ms allow-discrete; }
  .faq details[open]::details-content { block-size: auto; opacity: 1; }
}

/* ---------- Support (outside the notebook look; no motion) ---------- */
.support { padding: 64px 0 72px; background: var(--safety-bg); color: var(--safety-text); border-top: 1px solid #E2E2E0; }
.support__inner { width: min(100% - 2 * var(--gutter), 960px); margin-inline: auto; }
.support__eyebrow { margin-bottom: 10px; font: 600 var(--fs-eyebrow)/1.4 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--safety-muted); }
.support h2, .support h3 { color: var(--safety-text); }
.support h3 { margin: 36px 0 14px; font-weight: 600; }
.support__lead { font-size: var(--fs-lead); max-width: 64ch; }
.support__lines { list-style: none; display: grid; gap: 16px; }
.support__lines li p { margin: 8px 2px 0; font-size: .9375rem; line-height: 1.5; color: var(--safety-muted); }
.support__call {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 18px;
  background: var(--safety-surface); color: var(--safety-text); border: 1.5px solid var(--safety-text); border-radius: 8px; text-decoration: none;
}
.support__call:hover { background: #ECECEA; }
.support__call--static { border-color: var(--safety-border); }
.support .num { font: 700 1.75rem/1 var(--font-body); font-variant-numeric: tabular-nums; }
.support .num--word { font-size: 1.375rem; letter-spacing: .04em; }
.support__name { font-weight: 600; font-size: 1.0625rem; }
.support__list { display: grid; gap: 12px; padding-left: 20px; }
.support__list li { line-height: 1.55; }
.support a:not(.support__call) { color: var(--safety-link); }
.support :focus-visible { outline-color: var(--safety-focus); }
.support a { transition: none; }

/* ---------- Footer (back cover) ---------- */
.site-footer { padding: 56px 0 40px; background: var(--kw-cover-deep); color: var(--kw-on-cover); }
.site-footer__inner { display: grid; gap: 16px; }
.site-footer__brand { display: flex; align-items: center; gap: 10px; }
.site-footer__hand { margin: 0; font: 700 var(--fs-hand)/1.33 var(--font-hand); color: var(--kw-on-cover-muted); }
.site-footer__links { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: .9375rem; }
.site-footer__links li { display: flex; align-items: center; min-height: 48px; }
.site-footer a { color: var(--kw-on-cover); }
.site-footer__safety { margin: 0; font-size: var(--fs-small); line-height: 1.6; max-width: none; }
.site-footer__copy { margin: 0; font-size: var(--fs-small); color: var(--kw-on-cover-muted); }

/* ---------- Breakpoints ---------- */
@media (max-width: 22.49em) {
  .phone { transform: scale(.9); transform-origin: top center; margin-bottom: -10%; }
}

@media (min-width: 37.5em) {
  .hero__actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
  .hero__figure { display: block; }
  .hero__deco { display: none; }
  .hero__tabs span { width: 24px; height: 52px; }
  .hero__band { right: clamp(36px, 7vw, 120px); width: 14px; }
  .hero__tabs span:nth-child(n+5) { display: block; }
  .toc { padding: 0 48px 0 var(--gutter); }
  .toc__sheet { padding: 48px 0 48px 64px; background:
    linear-gradient(to right, var(--kw-binding) 0 14px, var(--kw-binding-edge) 14px 15px, transparent 15px),
    repeating-linear-gradient(to bottom, var(--kw-stitch) 0 5px, transparent 5px 10px) 20px 0 / 2px 100% no-repeat,
    linear-gradient(var(--kw-margin-line), var(--kw-margin-line)) 40px 0 / 1px 100% no-repeat,
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--rule) - 1px), var(--kw-rule) calc(var(--rule) - 1px) var(--rule)) 0 var(--rule-top),
    var(--kw-paper); }
  .toc__row { grid-template-columns: auto minmax(24px, 1fr) 40px; }
  .toc__tab { width: 40px; margin-right: -40px; }
  .page { padding: 28px var(--gutter); }
  .page__sheet { padding: 64px 40px 64px 64px; }
  .paper { --bind: 14px; }
  .paper--lined {
    background: var(--binding),
      repeating-linear-gradient(to bottom, var(--kw-stitch) 0 5px, transparent 5px 10px) 20px 0 / 2px 100% no-repeat,
      linear-gradient(var(--kw-margin-line), var(--kw-margin-line)) 40px 0 / 1px 100% no-repeat,
      repeating-linear-gradient(to bottom, transparent 0 calc(var(--rule) - 1px), var(--kw-rule) calc(var(--rule) - 1px) var(--rule)) 0 var(--rule-top),
      var(--kw-paper);
  }
  .page__no { top: 18px; right: 32px; font-size: 2rem; }
  .themes__grid { grid-template-columns: 1fr 1fr; }
  .test-grid, .guide-grid, .privacy-grid, .exercise-cols { grid-template-columns: 1fr 1fr; }
  .support__lines { grid-template-columns: 1fr 1fr; }
  .waitlist__card { padding: 64px 48px 40px 56px; }
  .waitlist__card .page__no { left: 56px; }
}

@media (min-width: 56.25em) {
  .site-nav { display: block; }
  .hero { padding: 128px 0 152px; }
  .hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; gap: 48px; }
  .hero__text { padding-right: 0; }
  .hero__tabs { top: 180px; }
  .toc__sheet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 56px; padding: 56px 0 56px 72px; }
  .toc__side { padding-right: 0; }
  .toc__list { margin-top: 0; }
  .toc__stickers { display: flex; gap: 8px; margin-top: 36px; padding-left: 12px; }
  .page__grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 56px; align-items: start; }
  .page--flip .page__grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  .page--flip .page__figure { order: -1; }
  .page__figure { position: sticky; top: 32px; }
  .page__sheet { padding: 80px 64px 80px 88px; }
  .page__aside .page__figure { position: static; }
  .waitlist { padding: 96px 24px 112px; }
}

@media (min-width: 75em) {
  .page { padding: 32px 0; }
}

/* ---------- Motion (only with .motion: JS on, no reduced motion, no ?static) ---------- */
.motion .hero__tabs span { animation: tab-in 400ms var(--ease-paper) both; animation-delay: calc(var(--i) * 50ms + 200ms); }
@keyframes tab-in { from { transform: translateX(12px); opacity: 0; } }
.motion .hero__deco .sticker { animation: stick 420ms var(--ease-pop) both; animation-delay: calc(var(--i) * 80ms + 700ms); }
@keyframes stick { from { transform: scale(.6) rotate(calc(var(--r) - 12deg)); opacity: 0; } }
.motion .blob { animation: blob-breathe 16s ease-in-out infinite alternate; }
.motion.is-tab-hidden .blob { animation-play-state: paused; }
@keyframes blob-breathe { from { transform: scale(1) rotate(0); } to { transform: scale(1.04) rotate(6deg); } }

/* Hero phone: cover turns from the spine, revealing the contents page. */
.motion .leaf--cover { display: block; transform-origin: left center; backface-visibility: hidden; animation: cover-open 900ms var(--ease-paper) 1300ms both; }
@keyframes cover-open { from { transform: rotateY(0); } to { transform: rotateY(-180deg); } }
.motion .leaf--contents::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, rgb(58 36 48 / .35), transparent 70%); pointer-events: none; animation: fade-out 900ms var(--ease-paper) 1300ms both; }
@keyframes fade-out { to { opacity: 0; } }

/* Handwriting: revealed left to right with a travelling ink nib. */
.motion [data-hand] { clip-path: inset(-10% 100% -10% 0); }
.motion [data-hand]::after { content: ""; position: absolute; inset: 0 -6px 0 0; background: radial-gradient(circle at calc(100% - 4px) 62%, currentColor 0 2.6px, transparent 3.2px); transform: translateX(-100%); opacity: 0; }
.motion [data-hand].is-in { animation: hand-write var(--hand-dur, 1100ms) linear both; }
.motion [data-hand].is-in::after { animation: hand-nib var(--hand-dur, 1100ms) linear both; }
/* Hero line: CSS-timed (≈ when Caveat has swapped in) so it never depends on JS timers. */
.motion .hero [data-hand] { animation: hand-write var(--hand-dur, 1140ms) linear 900ms both; }
.motion .hero [data-hand]::after { animation: hand-nib var(--hand-dur, 1140ms) linear 900ms both; }
@keyframes hand-write { from { clip-path: inset(-10% 100% -10% 0); } to { clip-path: inset(-10% -12px -10% 0); } }
@keyframes hand-nib { from { transform: translateX(-100%); opacity: 1; } 85% { opacity: 1; } to { transform: translateX(0); opacity: 0; } }

/* Entrance: only elements that started below the fold get .rv (see main.js). */
.motion .rv .page__sheet, .motion .rv.waitlist .waitlist__card { opacity: 0; transform: translateY(16px); }
.motion .rv.is-in .page__sheet, .motion .rv.is-in .waitlist__card { opacity: 1; transform: none; transition: opacity 500ms var(--ease-paper), transform 500ms var(--ease-paper); }
.motion .rv .sticker, .motion .rv .word-sticker { opacity: 0; transform: scale(.6) rotate(calc(var(--r, 0deg) - 12deg)); }
.motion .rv.is-in .sticker, .motion .rv.is-in .word-sticker { opacity: 1; transform: scale(1) rotate(var(--r, 0deg)); transition: transform 420ms var(--ease-pop) calc(var(--i, 0) * 80ms + 350ms), opacity 200ms linear calc(var(--i, 0) * 80ms + 350ms); }
.motion .rv [data-ink] { transform: scaleY(0); }
.motion .rv.is-in [data-ink] { transform: scaleY(1); transition: transform 700ms var(--ease-ink) 500ms; }
@media (min-width: 56.25em) {
  .motion .rv .page__sheet { transform: perspective(1600px) rotateY(-9deg); transform-origin: left center; }
  .motion .rv .page__sheet::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(to right, rgb(58 36 48 / .25), transparent 60%); }
  .motion .rv.is-in .page__sheet { transition: opacity 800ms var(--ease-paper), transform 800ms var(--ease-paper); }
  .motion .rv.is-in .page__sheet::after { opacity: 0; transition: opacity 800ms var(--ease-paper); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* ---------- Forced colors / print ---------- */
@media (forced-colors: active) {
  .btn, .slip, .privacy-card, .guide, .theme-chip, .taped-note, .callout, .know-box, .support__call, .toc__tab { border: 1px solid transparent; }
  .hl::before, .toc__dots { forced-color-adjust: auto; }
  svg { forced-color-adjust: auto; }
}
@media print {
  .site-header, .hero__tabs, .hero__band, .blob, .phone, .sticker-sheet, .breath-controls { display: none !important; }
  .hero { background: none; color: #000; padding: 24px 0; }
  .hero h1, .hero .lead, .hero__note, .hero__hand { color: #000; }
  .motion [data-hand], [data-hand] { clip-path: none !important; }
  .rv .page__sheet, .rv .sticker { opacity: 1 !important; transform: none !important; }
}
