/* Leafwren — site stylesheet
   Layout concept: the site is set like a well-made book — running head, figure
   captions, fold rules between parts, a colophon at the end. */

:root {
  /* Colour — Paper theme (from tokens.json) */
  --paper: #ebeae2;
  --paper-2: #dedcd2;
  --paper-3: #d3d0c4;
  --rule: #c9c6b8;
  --ink: #14181f;
  --ink-2: #565c69;
  --indigo: #1e3160;
  --indigo-soft: #3e5894;
  --marigold: #d98a14;
  --madder: #9e3a28;
  --band: #1e3160;
  --band-ink: #ebeae2;
  --band-muted: rgba(235, 234, 226, .74);
  --band-rule: rgba(235, 234, 226, .14);
  --shadow: 20, 24, 31;

  /* Book worlds — fixed, they are the books' own palettes */
  --rd-navy: #1f2a5a;
  --rd-navy-2: #18224b;
  --rd-yellow: #ffc93c;
  --rd-coral: #f2675a;
  --rd-teal: #2ba59b;
  --rd-cream: #fff8ec;
  --rd-lilac: #e7e4f5;
  --bc-ink: #16233f;

  /* Type */
  --serif: Spectral, Georgia, "Times New Roman", serif;
  --dev: "Tiro Devanagari Hindi", "Noto Serif Devanagari", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --round: "Baloo 2", "Segoe UI", sans-serif; /* children's list only */

  --fs-display: clamp(3.25rem, 1.6rem + 6.6vw, 8.5rem);
  --fs-h2: clamp(2.25rem, 1.4rem + 3.2vw, 4.25rem);
  --fs-h3: clamp(1.45rem, 1.2rem + 1vw, 2rem);
  --fs-lead: clamp(1.125rem, 1rem + .45vw, 1.4rem);
  --fs-body: 1.0625rem;
  --fs-small: .9rem;
  --fs-label: .72rem;

  /* Space */
  --gutter: clamp(20px, 5vw, 64px);
  --wrap: 1280px;
  --section: clamp(72px, 4rem + 7vw, 168px);
  --radius: 4px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14161b; --paper-2: #1c2028; --paper-3: #242934; --rule: #2e333d;
    --ink: #e9e7df; --ink-2: #9ba0ac;
    --indigo: #7f9bd8; --indigo-soft: #a8bce6; --marigold: #e8a63a; --madder: #d4705c;
    --band: #18213f; --band-ink: #e9e7df; --band-muted: rgba(233, 231, 223, .72); --band-rule: rgba(233, 231, 223, .12);
    --shadow: 0, 0, 0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14161b; --paper-2: #1c2028; --paper-3: #242934; --rule: #2e333d;
  --ink: #e9e7df; --ink-2: #9ba0ac;
  --indigo: #7f9bd8; --indigo-soft: #a8bce6; --marigold: #e8a63a; --madder: #d4705c;
  --band: #18213f; --band-ink: #e9e7df; --band-muted: rgba(233, 231, 223, .72); --band-rule: rgba(233, 231, 223, .12);
  --shadow: 0, 0, 0;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "onum";
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.05; text-wrap: balance; letter-spacing: -.012em; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
[lang="hi"] { font-family: var(--dev); letter-spacing: 0; font-feature-settings: normal; }
::selection { background: var(--marigold); color: #14181f; }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius); text-decoration: none; font-size: .95rem; }
.skip:focus { top: 12px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.label {
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
  line-height: 1.4;
}
.eyebrow { display: inline-flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--marigold); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 50px; padding: 0 22px;
  border-radius: var(--radius);
  font-family: var(--serif); font-size: 1.02rem; font-weight: 500; line-height: 1;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .25s, color .25s, border-color .25s, transform .25s;
}
.btn .arrow { transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.btn:hover .arrow { transform: translateX(4px); }
.btn--primary { background: var(--indigo); color: var(--paper); }
.btn--primary:hover { background: var(--ink); }
.btn--ghost { border-color: var(--ink-2); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); background: var(--paper-2); }
.text-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size .35s;
}
.text-link:hover { background-size: 0 1px; }

/* ---------- Header ---------- */
/* The frosted glass sits on a pseudo-element: a backdrop-filter on the header itself
   would make it the containing block for the fixed mobile menu and clip it to 72px. */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  backdrop-filter: blur(12px) saturate(1.15);
}
.menu-open .site-header::before { background: var(--paper); }
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.header-inner { display: flex; align-items: center; height: 72px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand svg { width: 30px; height: 30px; color: var(--indigo); }
.brand-name { font-size: 1.4rem; font-weight: 500; letter-spacing: .02em; line-height: 1; }
/* ™ until the registration certificate issues; then ®. Small, raised, never louder than the name. */
.brand-name .tm { font-size: .5em; font-weight: 400; letter-spacing: 0; vertical-align: .8em; margin-left: .08em; opacity: .75; }
.running-head {
  margin-left: 4px; padding-left: 18px; border-left: 1px solid var(--rule);
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity .3s;
}
.running-head.is-changing { opacity: 0; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 30px; }
.nav a {
  position: relative; text-decoration: none; font-size: 1.02rem; padding: 6px 0;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--marigold); transform: scaleX(0); transform-origin: left;
  transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav .btn { min-height: 42px; padding: 0 18px; font-size: .95rem; }
.nav .btn::after { display: none; }
.menu-btn {
  display: none; margin-left: auto; width: 46px; height: 46px; border: 1px solid var(--rule);
  border-radius: var(--radius); background: transparent; color: var(--ink); cursor: pointer;
  align-items: center; justify-content: center;
}
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  display: block; width: 18px; height: 1.5px; background: currentColor; position: relative; transition: transform .3s, background-color .3s;
}
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -6px; }
.menu-btn span::after { top: 6px; }
.menu-open .menu-btn span { background: transparent; }
.menu-open .menu-btn span::before { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-btn span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1020px) { .running-head { display: none; } }
@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .nav {
    position: fixed; inset: 72px 0 0 0; z-index: 49;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px));
    background: var(--paper);
    border-top: 1px solid var(--rule);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s, transform .3s, visibility 0s .3s;
  }
  .menu-open .nav { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .3s; }
  .nav a { font-size: 1.75rem; padding: 16px 0; border-bottom: 1px solid var(--rule); }
  .nav a::after { display: none; }
  .nav .btn { margin-top: 24px; min-height: 54px; font-size: 1.1rem; justify-content: center; border: 1px solid var(--ink-2); }
  .menu-open { overflow: hidden; }
}

/* ---------- Home: the leaves ----------
   The opening plate is always night-indigo, in both themes. Behind the words,
   leaves.js draws a few thousand paper leaves in WebGL. They assemble into the
   colophon (its wing in marigold leaves), and re-form as an open book and as the
   name. The pointer is a wind through them. Without WebGL2 the flat mark shows. */
.hero {
  --h-ink: #ebeae2; --h-muted: rgba(235, 234, 226, .7); --h-rule: rgba(235, 234, 226, .18); --h-gold: #e8a63a;
  position: relative; overflow: hidden;
  min-height: max(620px, calc(100svh - 72px));
  display: flex; flex-direction: column;
  color: var(--h-ink);
  background:
    radial-gradient(60% 70% at 72% 46%, rgba(217, 138, 20, .16), transparent 70%),
    radial-gradient(120% 100% at 70% 40%, #263d78 0%, #1a2b58 38%, #0d1530 100%);
}
/* One canvas for the whole home page, pinned to the screen. Section backgrounds
   paint beneath it and every section's content sits above it, so the leaves
   travel down the page with the reader. */
.leaves-gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; pointer-events: none; }
.page-home main > section > .wrap, .page-home .site-footer { position: relative; z-index: 2; }
/* Elsewhere the leaves only drift through the background, behind every section */
body:not(.page-home) .leaves-gl { z-index: 0; }
body:not(.page-home) main, body:not(.page-home) .site-footer { position: relative; z-index: 1; }
.hero-grid {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center; column-gap: 24px;
  padding-block: clamp(40px, 6vw, 96px) 16px;
}
.hero-copy { position: relative; z-index: 1; }
.hero .eyebrow { color: var(--h-muted); }
.hero-title { font-size: clamp(3.1rem, 1.4rem + 5vw, 7rem); line-height: .94; font-weight: 500; letter-spacing: -.02em; margin-top: 28px; }
.hero-copy { text-shadow: 0 1px 24px rgba(13, 21, 48, .55); }
.hero-title em { font-style: italic; font-weight: 400; color: var(--h-gold); }
.hero-hindi { font-size: clamp(1.3rem, 1rem + 1.1vw, 1.9rem); line-height: 1.7; color: var(--h-muted); margin-top: 22px; }
.hero-lead { font-size: var(--fs-lead); line-height: 1.55; max-width: 30em; margin-top: 22px; color: var(--h-ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn--light { background: var(--h-ink, #ebeae2); color: #1e3160; }
.btn--light:hover { background: #fff; }
.btn--outline { border-color: var(--h-rule); color: var(--h-ink); background: rgba(13, 21, 48, .25); }
.btn--outline:hover { border-color: var(--h-ink); background: rgba(255, 255, 255, .06); }
.hero-art { align-self: stretch; position: relative; min-height: 440px; }
.hero-fallback { position: absolute; left: 10%; top: 12%; width: 80%; height: 76%; color: var(--h-ink); }
.gl-on .hero-fallback { visibility: hidden; }

.hero-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 32px; padding-bottom: clamp(20px, 3vw, 32px); }
.hero-hint { color: var(--h-muted); margin: 0 0 0 auto; text-align: right; }
.hero-hint b { color: var(--h-ink); font-weight: 500; }
.hint { display: none; }
.figures {
  display: none; gap: 4px; padding: 4px; border-radius: 999px;
  border: 1px solid var(--h-rule); background: rgba(13, 21, 48, .45);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.gl-on .figures { display: inline-flex; }
.gl-on .hint--hover { display: inline; }
@media (hover: none) { .gl-on .hint--hover { display: none; } .gl-on .hint--touch { display: inline; } }
.fig {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  font: 500 .7rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--h-muted); background: transparent;
  transition: background-color .35s, color .35s;
}
.fig:hover { color: var(--h-ink); }
.fig .n { color: var(--h-gold); font-family: var(--serif); font-size: .95rem; letter-spacing: 0; text-transform: none; font-style: italic; }
.fig[aria-pressed="true"] { background: var(--h-ink); color: #1e3160; }
.fig[aria-pressed="true"] .n { color: #b06d0c; }
.fig .bar { position: absolute; left: 16px; right: 16px; bottom: 6px; height: 2px; background: #d98a14; transform: scaleX(0); transform-origin: left; }
.auto .fig[aria-pressed="true"] .bar { animation: fill var(--cycle, 9s) linear forwards; }
.fig:focus-visible { outline: 2px solid var(--h-gold); outline-offset: 2px; }
@keyframes fill { to { transform: scaleX(1); } }

/* A wind cursor: a soft ring that trails the pointer, swelling with speed */
.wind {
  position: fixed; left: 0; top: 0; width: 72px; height: 72px; margin: -36px 0 0 -36px;
  border-radius: 50%; border: 1px solid rgba(235, 234, 226, .35);
  pointer-events: none; opacity: 0; transition: opacity .4s; z-index: 60;
}
.wind span { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: var(--marigold); }
.wind.is-on { opacity: 1; }
@media (hover: none), (prefers-reduced-motion: reduce) { .wind { display: none; } }

@media (max-width: 860px) {
  .hero { min-height: 0; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); padding-top: 8px; }
  .hero-art { order: -1; min-height: 0; height: clamp(250px, 72vw, 400px); }
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .hero-hint { margin: 0; text-align: left; }
}
@media (max-width: 520px) { .fig { padding: 0 18px; } .fig .t { display: none; } .fig .n { font-size: 1.05rem; } }

/* The copy settles into place once the page is visible. Nothing starts invisible. */
@media (prefers-reduced-motion: no-preference) {
  .play .hero-copy > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .play .hero-copy > :nth-child(2) { animation-delay: .06s; }
  .play .hero-copy > :nth-child(3) { animation-delay: .14s; }
  .play .hero-copy > :nth-child(4) { animation-delay: .2s; }
  .play .hero-copy > :nth-child(5) { animation-delay: .26s; }
}
@keyframes rise { from { transform: translateY(12px); } to { transform: none; } }

/* The creed: one large paragraph, set like the opening of a book */
.creed-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 28px; }
.creed-grid { align-items: center; }
.creed-copy { grid-column: 1 / span 7; }
.creed-text {
  margin: 28px 0 0;
  font-size: clamp(1.7rem, 1.1rem + 2.2vw, 3.25rem); line-height: 1.18; letter-spacing: -.015em; text-wrap: pretty;
}
.creed-text em { color: var(--indigo); }
.creed-text::first-letter { color: var(--marigold); }
@media (max-width: 900px) { .creed-copy { grid-column: 1 / -1; } }
.principle .rule-n { font-size: 2.6rem; line-height: 1; font-style: italic; color: var(--marigold); margin: 0 0 14px; }

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }
.section--tight { padding-top: 0; }
.part-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  border-top: 1.5px solid var(--ink); padding-top: 18px;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.part-title { font-size: var(--fs-h2); line-height: 1; }
.part-head .label { white-space: nowrap; }
@media (max-width: 560px) {
  .part-head { flex-wrap: wrap; row-gap: 10px; }
  .part-head .label { white-space: normal; }
}
.intro { font-size: var(--fs-lead); line-height: 1.55; max-width: 36em; color: var(--ink-2); margin-top: -32px; margin-bottom: clamp(40px, 6vw, 72px); }

/* ---------- Book spreads ---------- */
.spread {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center;
  padding: clamp(40px, 6.5vw, 96px) clamp(24px, 6vw, 88px);
  position: relative; overflow: hidden;
}
.spread + .spread { margin-top: clamp(20px, 2.5vw, 32px); }
.spread-media { grid-column: 1 / span 5; display: flex; justify-content: center; }
.spread-text { grid-column: 7 / -1; min-width: 0; }
.spread--flip .spread-media { grid-column: 8 / -1; order: 2; }
.spread--flip .spread-text { grid-column: 1 / span 6; order: 1; }
@media (max-width: 900px) {
  .spread-media, .spread--flip .spread-media { grid-column: 1 / -1; order: 1; margin-bottom: 48px; }
  .spread-text, .spread--flip .spread-text { grid-column: 1 / -1; order: 2; }
}

/* Rhyme & Draw world — Baloo 2, the book's own palette */
.spread--rd { background: var(--rd-navy); color: #fff; }
.spread--rd::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 201, 60, .14) 0 2px, transparent 3px) 0 0 / 120px 120px,
    radial-gradient(circle at 70% 64%, rgba(255, 224, 138, .1) 0 1.5px, transparent 2.5px) 0 0 / 90px 90px;
}
.spread--rd > * { position: relative; }
.rd { font-family: var(--round); }
.rd-series { font-family: var(--round); font-weight: 600; font-size: 1.05rem; color: var(--rd-yellow); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.rd-series [lang="hi"] { font-family: var(--round); color: #fff; opacity: .9; }
.rd-title { font-family: var(--round); font-weight: 800; font-size: clamp(3rem, 2rem + 4vw, 5.5rem); line-height: .95; letter-spacing: -.01em; color: var(--rd-yellow); margin-top: 14px; }
.rd-title span { display: block; font-size: .42em; color: #fff; font-weight: 700; letter-spacing: 0; margin-top: 10px; }
.rd-motto { font-family: var(--round); font-weight: 600; font-size: clamp(1.2rem, 1rem + .7vw, 1.55rem); margin-top: 22px; line-height: 1.5; color: var(--rd-lilac); }
.rd-motto [lang="hi"] { font-family: var(--round); color: #fff; display: block; font-weight: 700; }
.rd-body { font-family: var(--round); font-size: 1.12rem; line-height: 1.6; color: var(--rd-lilac); margin-top: 20px; max-width: 32em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chip { font-family: var(--round); font-weight: 700; font-size: .95rem; line-height: 1; padding: 9px 15px 8px; border-radius: 999px; color: #14181f; }
.chip--y { background: var(--rd-yellow); }
.chip--c { background: var(--rd-coral); color: #fff; }
.chip--t { background: var(--rd-teal); color: #fff; }
.chip--l { background: var(--rd-lilac); color: var(--rd-navy); }
.spread--rd .price { color: #fff; font-family: var(--round); font-weight: 700; }
.spread--rd .price small { color: var(--rd-lilac); font-family: var(--round); font-weight: 500; }
.spread--rd .note, .spread--rd .text-link { font-family: var(--round); font-weight: 600; }
.spread--rd .label { color: var(--rd-lilac); }
.spread--rd .text-link { color: var(--rd-yellow); }
.spread--rd .note { color: var(--rd-lilac); }
.spread--rd .note a { color: #fff; }

/* Before Coffee world — the house's paper and ink */
.spread--bc { background: var(--paper-2); }
.bc-kicker { color: var(--ink-2); }
.bc-title { font-size: clamp(3rem, 2rem + 4vw, 5.75rem); line-height: .92; letter-spacing: -.02em; margin-top: 16px; }
.bc-sub { font-size: var(--fs-lead); font-style: italic; color: var(--ink-2); margin-top: 16px; line-height: 1.4; max-width: 24em; }
.bc-by { margin-top: 14px; font-size: 1rem; }
.bc-by b { font-weight: 500; }
.pull { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2.1rem); line-height: 1.25; margin-top: 30px; padding-left: 22px; border-left: 2px solid var(--marigold); letter-spacing: -.01em; }
.bc-body { margin-top: 22px; max-width: 32em; color: var(--ink-2); }
.facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 26px; }
.facts li { list-style: none; font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; color: var(--ink); display: flex; gap: 8px; align-items: baseline; }
.facts li::before { content: ""; width: 6px; height: 6px; background: var(--marigold); transform: translateY(-1px); flex-shrink: 0; }

/* Buy block — store links are pasted into the href; "#" means not live yet */
.buy-block { margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--rule); }
.spread--rd .buy-block { border-top-color: rgba(255, 255, 255, .16); }
.buy-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 22px; margin-bottom: 16px; }
.price { font-size: 1.6rem; font-weight: 500; line-height: 1; font-feature-settings: "lnum"; }
.price small { font-size: .82rem; color: var(--ink-2); font-weight: 400; margin-left: 6px; letter-spacing: .02em; }
.soon-chip { display: none; align-items: center; gap: 8px; font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; padding: 6px 10px; border: 1px solid currentColor; border-radius: 999px; color: var(--ink-2); }
.spread--rd .soon-chip { color: var(--rd-yellow); }
.buy-block:not(:has(.buy:not([href="#"]))) .soon-chip { display: inline-flex; }
.buy-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.buy {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px;
  border-radius: var(--radius); text-decoration: none; font-weight: 500; font-size: 1rem; line-height: 1;
  background: var(--ink); color: var(--paper); transition: background-color .25s, transform .25s;
}
.buy:hover { background: var(--indigo); }
.buy .store-sub { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.spread--rd .buy { background: var(--rd-yellow); color: var(--rd-navy); font-family: var(--round); font-weight: 700; }
.spread--rd .buy:hover { background: #fff; }
/* Not live yet: an outline, clearly deliberate, rather than a faded button */
.buy[href="#"], .spread--rd .buy[href="#"] {
  background: transparent; color: var(--ink-2); border: 1px dashed currentColor;
  pointer-events: none; cursor: default;
}
.spread--rd .buy[href="#"] { color: var(--rd-lilac); }
.buy-more { margin-left: 8px; }
.note { font-size: .95rem; color: var(--ink-2); margin-top: 20px; }
.note a { font-weight: 500; }

/* ---------- Books as objects ---------- */
.book-stage { position: relative; perspective: 1600px; padding: 10px 26px 44px; }
.book-stage::after {
  content: ""; position: absolute; left: 14%; right: 4%; bottom: 18px; height: 34px;
  background: radial-gradient(closest-side, rgba(var(--shadow), .42), transparent);
  filter: blur(8px); z-index: 0;
}
.spread--rd .book-stage::after { background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); }
.book3d {
  --w: clamp(210px, 23vw, 320px);
  --d: 12px;
  --ry: -26deg;
  --rx: 4deg;
  width: var(--w); aspect-ratio: var(--ratio, 2 / 3);
  position: relative; z-index: 1; transform-style: preserve-3d;
  transform: rotateY(var(--ry)) rotateX(var(--rx));
  transition: transform .9s cubic-bezier(.2, .7, .2, 1);
}
.book-stage:hover .book3d { --ry: -14deg; --rx: 2deg; }
.book3d > * { position: absolute; }
.book3d .front, .book3d .back { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.book3d .front { inset: 0; transform: translateZ(calc(var(--d) / 2)); }
.book3d .front img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 2px 2px 0; }
.book3d .front::after {
  content: ""; position: absolute; inset: 0; border-radius: 0 2px 2px 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .24) 0, rgba(0, 0, 0, 0) 3.5%, rgba(255, 255, 255, .1) 4.5%, rgba(255, 255, 255, 0) 9%),
    linear-gradient(115deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 40%);
}
.book3d .back { inset: 0; transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); background: var(--spine, #1f2a5a); }
.book3d .spine { top: 0; bottom: 0; left: calc(var(--d) / -2); width: var(--d); transform: rotateY(-90deg); background: var(--spine, #1f2a5a); }
.book3d .pages {
  top: 3px; bottom: 3px; right: calc(var(--d) / -2); width: var(--d); transform: rotateY(90deg);
  background: repeating-linear-gradient(90deg, #f6f3ea 0 1px, #d9d3c3 1px 2px);
}
.book3d--thin { --d: 8px; }
.book3d--sm { --w: clamp(150px, 16vw, 210px); }

/* ---------- Craft ---------- */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(32px, 4vw, 64px); }
.principle { border-top: 2px solid var(--marigold); padding-top: 24px; }
.principle h3 { font-size: var(--fs-h3); line-height: 1.12; }
.principle p { margin-top: 16px; color: var(--ink-2); }
.specimen { margin-top: 26px; padding: 20px 22px; background: var(--paper-2); display: grid; gap: 4px; }
.specimen .en { font-size: 1rem; line-height: 26px; }
.specimen .hi { font-size: 1.0625rem; line-height: 30px; }
.specimen .label { margin-top: 8px; }
@media (max-width: 900px) { .principles { grid-template-columns: 1fr; } }

/* ---------- The name (indigo band) ---------- */
.band {
  background-color: var(--band); color: var(--band-ink);
  background-image:
    linear-gradient(var(--band-rule), var(--band-rule)),
    linear-gradient(var(--band-rule), var(--band-rule)),
    linear-gradient(var(--band-rule), var(--band-rule));
  background-size: 100% 1px;
  background-position: 0 33.33%, 0 66.66%, 0 100%;
  background-repeat: no-repeat;
}
.band .part-head { border-top-color: var(--band-ink); }
.band .label { color: var(--band-muted); }
.entries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 6vw, 96px); }
.entry .hw { font-size: clamp(3.5rem, 2rem + 6vw, 7.5rem); line-height: .9; font-weight: 500; letter-spacing: -.02em; }
.entry .gram { display: flex; gap: 14px; align-items: baseline; margin-top: 18px; }
.entry .pron { font-family: var(--mono); font-size: .95rem; }
.entry .pos { font-style: italic; color: var(--ink-2); }
.band .entry .pos { color: var(--band-muted); }
.entry p.def { font-size: var(--fs-lead); line-height: 1.5; margin-top: 16px; max-width: 26em; }
.entry p.def b { font-weight: 500; }
.together { margin-top: clamp(56px, 7vw, 104px); display: flex; flex-wrap: wrap; gap: 28px 48px; align-items: center; justify-content: space-between; padding-top: 32px; border-top: 1px solid var(--band-rule); }
.together p { font-size: clamp(1.35rem, 1.05rem + 1.1vw, 2rem); line-height: 1.3; max-width: 30em; letter-spacing: -.01em; }
.together p em { color: #e8a63a; font-style: italic; }
.band .btn--ghost { color: var(--band-ink); border-color: var(--band-muted); }
.band .btn--ghost:hover { background: rgba(255, 255, 255, .08); border-color: var(--band-ink); }
@media (max-width: 760px) { .entries { grid-template-columns: 1fr; } }

/* ---------- Trade ---------- */
.trade { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 40px; align-items: start; }
.trade-copy { grid-column: 1 / span 6; }
.trade-copy h2 { font-size: var(--fs-h2); line-height: 1; }
.trade-copy p { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2); margin-top: 24px; max-width: 30em; }
.trade-copy p.label { font-size: var(--fs-label); line-height: 1.4; margin-top: 0; }
.order-card { grid-column: 8 / -1; border: 1px solid var(--rule); background: var(--paper-2); padding: clamp(24px, 3vw, 40px); }
.order-card h3 { font-size: 1.5rem; }
.order-card ul { margin-top: 18px; display: grid; gap: 12px; }
.order-card li { list-style: none; display: grid; grid-template-columns: 22px 1fr; gap: 10px; color: var(--ink-2); }
.order-card li::before { content: ""; width: 12px; height: 2px; background: var(--marigold); margin-top: 13px; }
.order-card .btn { margin-top: 28px; width: 100%; justify-content: space-between; }
@media (max-width: 900px) { .trade-copy, .order-card { grid-column: 1 / -1; } }

/* ---------- Footer / colophon ---------- */
.site-footer { background: var(--paper-2); border-top: 1px solid var(--rule); padding-block: clamp(64px, 8vw, 112px) 36px; }
.footer-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 48px; }
.footer-brand { grid-column: 1 / span 6; }
.footer-brand .brand svg { width: 44px; height: 44px; }
.footer-brand .brand-name { font-size: 2rem; }
.colophon { margin-top: 28px; max-width: 30em; font-size: .98rem; line-height: 1.7; color: var(--ink-2); }
.colophon b { font-style: normal; font-weight: 500; color: var(--ink); font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; display: block; margin-bottom: 6px; }
.colophon i { color: var(--ink); }
.footer-col { grid-column: span 3; }
.footer-col ul { margin-top: 16px; display: grid; gap: 10px; }
.footer-col li { list-style: none; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--marigold); }
.footer-base { margin-top: clamp(56px, 7vw, 88px); padding-top: 22px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
@media (max-width: 760px) { .footer-brand { grid-column: 1 / -1; } .footer-col { grid-column: span 6; } }

/* ---------- Inner pages ---------- */
.page-head { padding-block: clamp(48px, 7vw, 104px) clamp(40px, 5vw, 72px); }
.page-title { font-size: clamp(3rem, 1.8rem + 5vw, 7rem); line-height: .94; letter-spacing: -.02em; margin-top: 24px; }
.page-lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2); max-width: 34em; margin-top: 26px; }
.crumbs { display: flex; gap: 10px; align-items: center; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

.prose { max-width: 38em; }
.prose p + p { margin-top: 1.1em; }
.prose h3 { font-size: var(--fs-h3); margin-top: 1.6em; margin-bottom: .5em; }

.two-col { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 40px; }
.two-col > .side { grid-column: 1 / span 4; }
.two-col > .main { grid-column: 6 / -1; min-width: 0; }
@media (max-width: 900px) { .two-col > .side, .two-col > .main { grid-column: 1 / -1; } }

.side-title { font-size: var(--fs-h3); line-height: 1.12; }
.side p { color: var(--ink-2); margin-top: 14px; max-width: 26em; }

.checklist { display: grid; gap: 0; }
.checklist li { list-style: none; display: grid; grid-template-columns: 2.4rem 1fr; gap: 8px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.checklist li:first-child { border-top: 1px solid var(--rule); }
.checklist .n { font-family: var(--mono); font-size: .78rem; color: var(--marigold); padding-top: 5px; font-weight: 500; }
.checklist .n:empty::before { content: ""; display: block; width: 8px; height: 8px; background: var(--marigold); margin-top: 6px; }
.strokes { list-style: none; padding: 0; }
.checklist b { font-weight: 500; }
.checklist p { color: var(--ink-2); margin-top: 2px; }

.specs { display: grid; grid-template-columns: max-content 1fr; border-top: 1px solid var(--ink); }
.specs dt, .specs dd { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.specs dt { padding-right: 32px; }
.specs dd { font-feature-settings: "lnum"; }
@media (max-width: 560px) { .specs { grid-template-columns: 1fr; } .specs dt { padding-bottom: 0; border-bottom: 0; } }

/* Five strokes — Rhyme & Draw's pre-writing ladder */
.strokes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stroke { background: var(--rd-cream); color: var(--rd-navy); padding: 20px 18px 22px; display: flex; flex-direction: column; gap: 10px; border-radius: 14px; }
.stroke svg { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.stroke svg * { fill: none; stroke: var(--rd-navy); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.stroke .dash { stroke-dasharray: 2 11; stroke: var(--rd-coral); }
.stroke .step { font-family: var(--round); font-weight: 800; font-size: .95rem; color: var(--rd-coral); }
.stroke h4 { font-family: var(--round); font-weight: 700; font-size: 1.15rem; line-height: 1.15; letter-spacing: 0; }
@media (max-width: 1020px) { .strokes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .strokes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stroke:last-child { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; align-items: center; column-gap: 16px; }
  .stroke:last-child svg { grid-row: span 2; }
}

.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pair { background: var(--rd-navy); color: #fff; padding: 26px; border-radius: 14px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.pair .en, .pair .hi { font-family: var(--round); font-weight: 700; font-size: 1.25rem; line-height: 1.25; }
.pair .en { color: var(--rd-yellow); }
.pair .theme { font-family: var(--round); font-weight: 800; font-size: 1.9rem; line-height: 1; color: var(--rd-coral); text-align: center; }
.pair .hi { text-align: right; }
.pair small { display: block; font-family: var(--round); font-weight: 500; font-size: .85rem; color: var(--rd-lilac); margin-top: 4px; }
@media (max-width: 760px) { .pairs { grid-template-columns: 1fr; } }

.series { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.level { border: 1px solid var(--rule); padding: 24px; display: flex; flex-direction: column; gap: 6px; }
.level--now { border-color: var(--ink); background: var(--paper-2); }
.level h4 { font-family: var(--round); font-weight: 700; font-size: 1.3rem; letter-spacing: 0; line-height: 1.2; }
.level p { color: var(--ink-2); font-size: .95rem; }
.level .label { margin-top: auto; padding-top: 14px; }
.level--now .label { color: var(--ink); }
@media (max-width: 760px) { .series { grid-template-columns: 1fr; } }

.routines { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1.5px solid var(--ink); }
.routine { padding: 24px 22px 28px 0; border-right: 1px solid var(--rule); }
.routine + .routine { padding-left: 22px; }
.routine:last-child { border-right: 0; }
.routine h4 { font-size: 2rem; letter-spacing: -.015em; margin-top: 10px; }
.routine p { color: var(--ink-2); margin-top: 10px; font-size: .98rem; }
@media (max-width: 900px) {
  .routines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .routine { border-bottom: 1px solid var(--rule); }
  .routine:nth-child(2) { border-right: 0; }
  .routine:nth-child(3) { padding-left: 0; }
}
@media (max-width: 480px) {
  .routines { grid-template-columns: 1fr; }
  .routine, .routine + .routine { padding-left: 0; border-right: 0; }
}

.author-card { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; background: var(--paper-2); padding: clamp(24px, 3.5vw, 44px); }
.author-card .mono-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--bc-ink); color: #f3e8d0; display: grid; place-items: center; font-size: 1.5rem; font-weight: 500; }
.author-card blockquote { margin: 0; font-size: 1.12rem; line-height: 1.65; }
.author-card blockquote p + p { margin-top: .9em; }

.disclaimer { font-size: .9rem; color: var(--ink-2); font-style: italic; max-width: 40em; }

/* The mark, shown as a construction plate */
.plate { background: var(--paper-2); padding: clamp(28px, 4vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.plate-fig { aspect-ratio: 1; background:
    linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 12.5% 12.5%,
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 12.5% 12.5%;
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  position: relative; display: grid; place-items: center; }
.plate-fig svg { width: 86%; color: var(--indigo); }
.plate-fig .wing { fill: var(--paper-2); }
.plate-fig .guide { fill: none; stroke: var(--marigold); stroke-width: .35; stroke-dasharray: 1.2 1.2; }
.plate-fig .tick { position: absolute; font-family: var(--mono); font-size: .62rem; color: var(--ink-2); }
.plate-notes { display: grid; gap: 22px; }
.plate-notes div { border-top: 1px solid var(--rule); padding-top: 14px; }
.plate-notes h4 { font-size: 1.2rem; }
.plate-notes p { color: var(--ink-2); margin-top: 6px; font-size: .98rem; }
@media (max-width: 760px) { .plate { grid-template-columns: 1fr; } }

.type-specimens { display: grid; gap: 0; border-top: 1.5px solid var(--ink); }
.type-row { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.type-row .sample { font-size: clamp(1.8rem, 1.2rem + 2vw, 3rem); line-height: 1.25; min-width: 0; overflow-wrap: anywhere; }
.type-row p { color: var(--ink-2); font-size: .95rem; margin-top: 6px; }
@media (max-width: 760px) { .type-row { grid-template-columns: 1fr; gap: 10px; } }

/* ---------- Contact ---------- */
.form { display: grid; gap: 22px; }
.field { display: grid; gap: 8px; }
.field label { font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.field label .opt { text-transform: none; letter-spacing: 0; font-family: var(--serif); font-style: italic; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--ink-2); border-radius: 2px;
  padding: 13px 14px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 180px; resize: vertical; line-height: 1.6; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px color-mix(in srgb, var(--indigo) 22%, transparent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; }
.form .btn { justify-self: start; }
.form-fine { font-size: .9rem; color: var(--ink-2); }

.contact-aside { display: grid; gap: 28px; }
@media (max-width: 900px) { .two-col > .contact-aside { order: 2; } }
.contact-aside div { border-top: 1px solid var(--rule); padding-top: 16px; }
.contact-aside h3 { font-size: 1.25rem; }
.contact-aside p { color: var(--ink-2); margin-top: 6px; }

/* ---------- Small pages ---------- */
.lost { min-height: 62vh; display: grid; align-content: center; padding-block: 80px; }
.lost .page-title em { color: var(--indigo); }

/* ---------- Reveal (content is visible at rest; this only adds a gentle rise) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
  .js .reveal.is-pending { transform: translateY(22px); }
}

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

@media print {
  .site-header, .menu-btn, .actions, .buy-block, .site-footer .footer-col { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- One night scene, site-wide ----------
   Every page wears the hero's night-indigo, so the paper leaves read
   everywhere: the home page's figures, and the drift behind the other pages. */
body {
  --paper: #0e1631; --paper-2: #141f45; --paper-3: #1b2857; --rule: rgba(235, 234, 226, .16);
  --ink: #ebeae2; --ink-2: #aab1c8;
  --indigo: #a9bdf0; --indigo-soft: #c3d1f5; --marigold: #e8a63a; --madder: #d4705c;
  --band: #131d42; --band-ink: #ebeae2; --band-muted: rgba(235, 234, 226, .72); --band-rule: rgba(235, 234, 226, .1);
  --shadow: 0, 0, 0;
  color-scheme: dark;
}
.page-home .hero { background:
    radial-gradient(60% 70% at 72% 46%, rgba(217, 138, 20, .16), transparent 70%),
    radial-gradient(120% 100% at 70% 40%, #263d78 0%, #1a2b58 38%, #0e1631 100%); }
.specimen { background: rgba(255, 255, 255, .05); }
.site-footer { background: #0b1229; }
html { color-scheme: dark; background: #0e1631; }

/* Where the leaves gather in each section. Empty without WebGL, so hidden then. */
.leaf-slot { display: none; min-height: 380px; }
.leaves-on .leaf-slot { display: block; }
.leaf-slot--tall { min-height: 520px; }
.creed .leaf-slot { grid-column: 8 / -1; }

.rules-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.rules-grid > .principles { grid-column: 1 / -1; }
.leaves-on .rules-grid > .principles { grid-column: 7 / -1; grid-template-columns: minmax(0, 1fr); gap: clamp(48px, 6vw, 80px); }
.leaf-slot--stick { grid-column: 1 / span 5; position: sticky; top: 96px; align-self: start; height: min(72vh, 600px); }

.name-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
.name-grid > .entries { grid-column: 1 / -1; }
.leaves-on .name-grid > .entries { grid-column: 1 / span 7; }
.name-grid > .leaf-slot { grid-column: 8 / -1; }

.trade > .leaf-slot { grid-column: 7 / -1; }

@media (max-width: 900px) {
  .leaf-slot, .leaf-slot--tall, .leaf-slot--stick { grid-column: 1 / -1 !important; order: -1; position: static; height: clamp(240px, 64vw, 340px); min-height: 0; }
  .leaves-on .rules-grid > .principles, .leaves-on .name-grid > .entries { grid-column: 1 / -1; }
  .leaves-on .rules-grid > .principles { margin-top: 24px; }
}

