/* The Wife of My Youth — styles.
 * Layers, lowest priority first: reset → tokens → base → layout → components → utilities.
 * Native CSS nesting, :has(), container queries, @starting-style and color-mix() are used
 * throughout; every one of them degrades to a working (if plainer) page where unsupported.
 * No inline style attributes anywhere: the Content-Security-Policy forbids them. */
@layer reset, tokens, base, layout, components, utilities;

/* ---------- fonts (self-hosted, SIL OFL 1.1 — licences beside the files) ----------
 * Bricolage Grotesque for display, Inter for body text. Instrument Sans is still declared but no longer
 * referenced, so browsers never download it. */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  src: url("../fonts/bricolage-grotesque-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; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  src: url("../fonts/bricolage-grotesque-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; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
  src: url("../fonts/instrument-sans-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; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
  src: url("../fonts/instrument-sans-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; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; 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; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; 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; }

/* ---------- tokens ---------- */
@layer tokens {
  :root {
    color-scheme: light;
    --bg: #f6f0e6;
    --surface: #fffcf6;
    --line: #e7dccb;
    --line-2: #e2d5c2;
    --ink: #1c1611;
    --muted: #4f443a;
    --muted-2: #5d5045;
    --accent: #c4481a;
    --accent-d: #a93b12;
    --tint: #fbe3d3;
    --peach: #f0b48a;
    --sand: #f6d7b3;
    --dark: #1c1611;
    --dark-2: #2a2119;
    --dark-line: #5a4b3d;
    --on-dark: #f6f0e6;
    --on-dark-muted: #d9ccb9;
    --on-dark-soft: #b8a892;
    --underline: #c9b9a2;
    --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
    --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
    --wrap: 1240px;
    --pad: clamp(20px, 4vw, 40px);
    --section: clamp(88px, 10vw, 136px);
    --r-sm: 6px; --r-md: 10px; --r-lg: 18px; --r-xl: 24px; --r-2xl: 28px;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --reveal-duration: .8s;
    --shadow-warm: 0 24px 40px -24px rgb(60 30 10 / .35);
    --on-accent: #fff;
    --accent-hover: #a93b12;
    --accent-text: #c4481a; /* accent as normal-size text (links, hovers); lighter in dark mode to keep 4.5:1 */
    --inverse: #1c1611;
    --on-inverse: #fff;
    --inverse-hover: #3a2c20;
    --glow-1: #f0b48a;
    --glow-2: #f6d7b3;
    --field: #fff;
    --field-hover: #efe4d3;
    --slot: #eadfce;
    --selection: #f5c9ad;
    --dotted: #d9b79b;
    --wa-tint: #dcf8c6;
    --wa-ink: #075e54;
    --wa-bubble: #dcf8c6;
    --wa-bubble-ink: #111b21;
    --faq-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a93b12' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
    @media (max-width: 640px) { --section: 72px; }
  }
  /* Dark: follows the system unless the visitor picked a theme (data-theme, set before first paint by the boot script). */
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #15110d;
    --surface: #1f1914;
    --line: #33291f;
    --line-2: #43362a;
    --ink: #f2eadf;
    --muted: #d3c6b5;
    --muted-2: #b9aa96;
    --accent-d: #f0946a;
    --accent-text: #f0946a;
    --tint: #3a2216;
    --sand: #4a3322;
    --dark: #241c15;
    --dark-2: #2e241b;
    --underline: #5f4e3e;
    --inverse: #f2eadf;
    --on-inverse: #15110d;
    --inverse-hover: #fff;
    --glow-1: #4a2818;
    --glow-2: #2b1f17;
    --field: #15110d;
    --field-hover: #2c231b;
    --slot: #2c231b;
    --selection: #6b3a22;
    --dotted: #8a6a52;
    --wa-tint: #103529;
    --wa-ink: #25d366;
    --wa-bubble: #005c4b;
    --wa-bubble-ink: #e9edef;
    --faq-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f0946a' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
    --shadow-warm: 0 24px 40px -24px rgb(0 0 0 / .7);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
    --bg: #15110d;
    --surface: #1f1914;
    --line: #33291f;
    --line-2: #43362a;
    --ink: #f2eadf;
    --muted: #d3c6b5;
    --muted-2: #b9aa96;
    --accent-d: #f0946a;
    --accent-text: #f0946a;
    --tint: #3a2216;
    --sand: #4a3322;
    --dark: #241c15;
    --dark-2: #2e241b;
    --underline: #5f4e3e;
    --inverse: #f2eadf;
    --on-inverse: #15110d;
    --inverse-hover: #fff;
    --glow-1: #4a2818;
    --glow-2: #2b1f17;
    --field: #15110d;
    --field-hover: #2c231b;
    --slot: #2c231b;
    --selection: #6b3a22;
    --dotted: #8a6a52;
    --wa-tint: #103529;
    --wa-ink: #25d366;
    --wa-bubble: #005c4b;
    --wa-bubble-ink: #e9edef;
    --faq-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f0946a' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
    --shadow-warm: 0 24px 40px -24px rgb(0 0 0 / .7);
    }
  }
}

/* ---------- reset ---------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  img { display: block; max-width: 100%; }
  button, input { font: inherit; color: inherit; }
  [hidden] { display: none !important; }
}

/* ---------- base ---------- */
@layer base {
  html {
    scroll-behavior: smooth; scroll-padding-top: 84px; overflow-x: clip;
    interpolate-size: allow-keywords; /* lets <details> animate to height:auto */
    accent-color: var(--accent);
    /* No page scroll behind an open dialog (lightbox, WhatsApp fallback). */
    &:has(dialog[open]) { overflow: hidden; }
  }
  body {
    margin: 0; overflow-x: clip; background: var(--bg); color: var(--ink);
    font-family: var(--font-body); font-size: 16px; line-height: 1.55; letter-spacing: -.011em;
    font-feature-settings: "cv11", "ss03"; /* Inter: single-storey a, rounded quotes — softer beside Bricolage */
    -webkit-font-smoothing: antialiased; text-wrap: pretty;
  }
  h1, h2, h3 { text-wrap: balance; }
  a { color: var(--accent-d); &:hover { color: var(--accent-text); } }
  ::selection { background: var(--selection); color: var(--ink); }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  /* main is focusable only so Skip to content and Back to top move keyboard focus; it needs no ring */
  main:focus { outline: none; }
}

/* ---------- layout ---------- */
@layer layout {
  .wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }
  .section { padding-top: var(--section); }
  .split {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 40px clamp(28px, 5vw, 88px);
    & > * { min-width: 0; }
  }
  .split--center { align-items: center; }
  .stack { display: flex; flex-direction: column; }
  .row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
}

/* ---------- components ---------- */
@layer components {
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .skip {
    position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--inverse); color: var(--on-inverse);
    padding: 10px 14px; border-radius: var(--r-sm); text-decoration: none;
    &:focus { top: 12px; color: var(--on-inverse); }
  }
  /* Bot trap for the order form: visually and audibly absent, but present to naive form-fillers. */
  .hp { position: absolute !important; inset-inline-start: -9999px; inline-size: 1px; block-size: 1px; overflow: hidden; }

  /* type */
  .display { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(54px, 6.6vw, 96px); line-height: .94; letter-spacing: -.04em;
    @media (max-width: 640px) { font-size: clamp(46px, 13vw, 64px); } }
  .h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 4.6vw, 60px); line-height: 1; letter-spacing: -.035em;
    @media (max-width: 640px) { font-size: clamp(34px, 9vw, 44px); } }
  .h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: -.01em; line-height: 1.25; }
  .lead { margin: 0; font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 40ch;
    @media (max-width: 640px) { font-size: 17px; } }
  .lead-display { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 20px; line-height: 1.45; letter-spacing: -.01em; }
  .body { margin: 0; font-size: 16px; line-height: 1.75; color: var(--muted); }
  .small { font-size: 13px; color: var(--muted-2); }
  .eyebrow { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
  .label { font-size: 14px; font-weight: 500; }

  /* kicker — Luganda label + English */
  .kicker {
    margin: 0 0 14px; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
    font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2);
    & [lang="lg"] { text-decoration: underline dotted var(--dotted); text-underline-offset: 5px; color: var(--accent-d); text-transform: none; letter-spacing: 0; font-family: var(--font-display); font-size: 16px; font-weight: 600; cursor: help; }
  }
  /* On phones a long kicker wraps and would strand the dot at a line end; colour and case already separate the two parts. */
  .kicker__dot { color: var(--line-2); @media (max-width: 480px) { display: none; } }
  .kicker--dark { color: var(--on-dark-soft); & [lang="lg"] { color: var(--peach); } }

  /* buttons & links */
  .btn {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 12px;
    border: 1px solid transparent; border-radius: var(--r-sm); padding: 14px 22px;
    font-weight: 600; font-size: 16px; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color .2s, border-color .2s, color .2s, translate .2s;
    &:active { translate: 0 1px; }
    @media (max-width: 640px) { white-space: normal; text-align: center; }
  }
  .btn--primary { background: var(--accent); color: var(--on-accent); &:hover { background: var(--accent-hover); color: var(--on-accent); } }
  .btn--sm { padding: 11px 18px; font-size: 14px; }
  .btn--block { display: flex; width: 100%; padding: 16px 20px; border-radius: 8px; }
  .btn--outline-dark { color: var(--on-dark); border-color: var(--dark-line); &:hover { color: var(--on-accent); border-color: var(--on-dark); } }
  .btn--dark { background: var(--inverse); color: var(--on-inverse); justify-content: flex-start; &:hover { background: var(--inverse-hover); color: var(--on-inverse); } }
  .btn--outline { border-color: var(--ink); color: var(--ink); justify-content: flex-start; &:hover { background: var(--inverse); color: var(--on-inverse); } }
  .link-u {
    background: none; border: 0; padding: 0; font-weight: 600; font-size: 15px; color: var(--ink);
    text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--underline); cursor: pointer;
    &:hover { color: var(--accent-text); text-decoration-color: currentColor; }
  }
  .link-u--accent { color: var(--accent-d); text-decoration-color: currentColor; }
  .link-u--sm { font-size: 14px; }

  /* nav */
  .nav {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent; transition: border-color .3s;
    &.is-scrolled { border-bottom-color: var(--line-2); }
  }
  .nav__inner { display: flex; align-items: center; gap: 28px; padding-block: 14px;
    @media (max-width: 640px) { gap: 12px; }
    @media (max-width: 400px) { gap: 8px; } }
  .brand {
    font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.02em;
    color: var(--accent); text-decoration: none; margin-right: auto; white-space: nowrap;
    min-width: 0; overflow: hidden; text-overflow: ellipsis;
    &:hover { color: var(--accent-d); }
    /* Phones: the title scales with the screen so the header controls never have to shrink. Under 19px the
       orange is no longer "large text" and needs 4.5:1, which --accent (4.3:1) misses. */
    @media (max-width: 480px) { font-size: clamp(15px, 4.2vw, 20px); color: var(--accent-d); }
  }
  .nav__links {
    display: flex; gap: 28px; margin: 0; padding: 0; list-style: none;
    & a { color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; &:hover { color: var(--accent-text); } }
    @media (max-width: 1080px) {
      display: none; position: absolute; inset-inline: var(--pad); top: calc(100% + 8px); flex-direction: column; gap: 0;
      background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px; box-shadow: var(--shadow-warm);
      transition: opacity .25s var(--ease), translate .25s var(--ease), display .25s allow-discrete;
      &.is-open { display: flex; @starting-style { opacity: 0; translate: 0 -10px; } }
      & a { display: block; padding: 14px 12px; font-size: 14px; border-radius: var(--r-md); &:hover { background: var(--bg); } }
    }
  }
  /* header actions: Explore ring (from 760px), theme toggle, menu (to 1080px) and Order, as one group.
     Every icon button is the same 40px circle (36px on small phones) and never shrinks; Order matches their
     height. Only the brand gives way, and on the narrowest phones "Order now" becomes "Order". */
  .nav__actions { display: flex; align-items: center; gap: 8px; flex: none;
    & .nav__cta { margin-left: 4px; } }
  .nav__icon { flex: none; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: var(--surface); color: var(--ink);
    cursor: pointer; display: grid; place-items: center; font-size: 18px; transition: border-color .2s, color .2s;
    &:hover { border-color: var(--accent); color: var(--accent-d); }
    &[hidden] { display: none; }
    &[aria-pressed="true"] { color: var(--accent-text); }
    @media (max-width: 400px) { width: 36px; height: 36px; font-size: 16px; } }
  /* The Explore ring is its own border: no second outline inside the progress track. */
  .nav__explore { border-color: transparent; &:hover { border-color: transparent; } @media (max-width: 759px) { display: none; } }
  html:not(.js) [data-theme-toggle] { display: none; }
  .menu-btn { display: none; @media (max-width: 1080px) { display: grid; } }
  .nav .nav__cta { flex: none; height: 40px; padding: 0 18px; justify-content: center; white-space: nowrap;
    @media (max-width: 640px) { padding: 0 14px; }
    @media (max-width: 400px) { height: 36px; padding: 0 12px; font-size: 13px; }
    @media (max-width: 340px) { display: none; } }
  .nav__cta-tail { @media (max-width: 440px) { display: none; } }

  /* hero */
  .hero { padding-top: clamp(32px, 5vw, 64px); }
  .hero__grid {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(24px, 3vw, 40px); align-items: end;
    @media (min-width: 1040px) { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, .58fr); }
  }
  .hero__copy { padding-bottom: clamp(24px, 5vw, 72px); }
  .hero__actions { display: flex; gap: 12px 18px; align-items: center; flex-wrap: wrap;
    @media (max-width: 640px) { & .btn { width: 100%; justify-content: center; } } }
  .hero__panel {
    position: relative; border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    background: linear-gradient(180deg, var(--glow-1) 0%, var(--glow-2) 70%, var(--bg) 100%);
    min-height: clamp(420px, 44vw, 560px); display: flex; align-items: center; justify-content: center;
    perspective: 1600px; padding: 40px 24px 72px;
    @media (max-width: 640px) { min-height: 380px; padding: 28px 16px 56px; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  }
  .book { position: relative; width: min(64vw, 300px); aspect-ratio: 524 / 776; transform-style: preserve-3d; transform: rotateY(-16deg) rotateX(3deg); will-change: transform; }
  .book__pages { position: absolute; top: 1.2%; bottom: 1.2%; right: 0; width: 26px; transform-origin: right center; transform: rotateY(90deg); background: repeating-linear-gradient(90deg, #fbf5ea 0 2px, #e6dac6 2px 3px); }
  .book__cover {
    position: absolute; inset: 0; border-radius: 2px 5px 5px 2px; overflow: hidden;
    box-shadow: 0 36px 60px -28px rgb(80 30 5 / .6), 0 8px 18px -8px rgb(80 30 5 / .35);
    & img { width: 100%; height: 100%; object-fit: cover; }
    &::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(0 0 0 / .3) 0, rgb(255 255 255 / .2) 2.2%, rgb(0 0 0 / .1) 4%, transparent 9%); }
  }
  .hero__side { display: grid; grid-template-columns: 1fr; gap: 14px; padding-bottom: clamp(24px, 5vw, 72px);
    @media (min-width: 640px) and (max-width: 1039px) { grid-template-columns: 1fr 1fr; } }
  .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
  .side-card {
    display: flex; flex-direction: column; gap: 12px; padding: 18px; color: var(--ink); text-decoration: none;
    transition: border-color .2s, translate .3s var(--ease);
    &:is(a):hover { border-color: var(--accent); translate: 0 -2px; color: var(--ink); }
  }
  .side-card__title { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.2; letter-spacing: -.01em; }
  .avatars { display: flex; & img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; border: 2px solid var(--surface); margin-right: -12px; } }
  .chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .chip {
    font-size: 13px; font-weight: 500; color: var(--ink); text-decoration: none; border: 1px solid var(--ink); border-radius: 999px; padding: 4px 11px;
    transition: background-color .2s, color .2s;
    &:hover { background: var(--inverse); color: var(--on-inverse); }
    @media (pointer: coarse), (max-width: 640px) { padding: 10px 14px; font-size: 14px; }
  }

  /* quote band — full bleed */
  .quote-band { position: relative; margin-top: clamp(24px, 4vw, 48px); background: var(--surface); border-block: 1px solid var(--line); overflow: hidden;
    & blockquote {
      margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 4vw, 52px); line-height: 1.12; letter-spacing: -.03em; max-width: 26ch; min-height: 3.36em;
      &.is-changing { animation: fadeInUp .55s var(--ease); }
    }
  }
  .quote-band__inner { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(16px, 4vw, 48px); align-items: start; padding-block: clamp(36px, 6vw, 72px);
    @media (max-width: 560px) { grid-template-columns: 1fr; } }
  .quote-band__mark { width: clamp(36px, 5vw, 64px); height: auto; color: var(--accent); margin-top: .2em; }
  .quote-band__fig { margin: 0; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
  .quote-band__foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted-2); }
  /* Progress runs on scale (compositor-only) rather than width. */
  .quote-band__progress { position: absolute; inset-inline: 0; bottom: 0; height: 3px;
    & i { display: block; height: 100%; background: var(--accent); transform-origin: left; scale: 0 1;
      &.is-running { animation: qProgress var(--q-dur, 6s) linear forwards; } } }
  .dots { display: flex; gap: 6px; }
  /* 24px hit target (WCAG 2.5.8); the visible bar is drawn inside it. */
  .dot {
    position: relative; width: 24px; height: 24px; border: 0; padding: 0; background: none; cursor: pointer; transition: width .3s var(--ease);
    &::before { content: ""; position: absolute; inset: 5px; border-radius: 3px; background: var(--slot); transition: background-color .3s; }
    &[aria-current="true"] { width: 38px; &::before { background: var(--accent); } }
  }
  .dots { gap: 0; }

  /* book list */
  .list-item { display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line-2); }
  #book .stack > .list-item:last-child { padding-bottom: 0; }
  .num {
    width: 44px; height: 44px; border-radius: 50%; background: var(--tint); color: var(--accent-d); display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 700; font-size: 15px;
    & .ti { width: 18px; height: 18px; }
  }
  .num--dark { background: var(--ink); color: var(--bg); }
  .media { border-radius: var(--r-xl); overflow: hidden; background: var(--line); & img { width: 100%; height: 100%; object-fit: cover; } }
  .media--tall { aspect-ratio: 4 / 4.6; @media (max-width: 759px) { aspect-ratio: 4 / 3.6; max-height: 70vh; } }
  .media--author { aspect-ratio: 4 / 4.4; & img { object-position: 58% 30%; } @media (max-width: 759px) { aspect-ratio: 4 / 3.6; max-height: 70vh; } }
  .thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .thumb {
    display: block; padding: 0; border: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: var(--line); cursor: zoom-in;
    & img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transition: scale .6s var(--ease); }
    &:hover img { scale: 1.08; }
  }

  /* launch — ticket (sized by its own width, not the viewport) */
  .ticket { position: relative; container: ticket / inline-size; background: var(--dark); color: var(--on-dark); border-radius: var(--r-2xl); overflow: hidden;
    & .lead { color: var(--on-dark-muted); max-width: 46ch; font-size: 17px; } }
  .ticket__main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding: clamp(28px, 5vw, 56px); align-items: start;
    & > * { min-width: 0; } }
  .ticket__date {
    display: flex; flex-direction: column; align-items: center; width: clamp(120px, 14vw, 168px); background: var(--bg); color: var(--ink);
    border-radius: var(--r-lg); padding: 16px 12px 18px; text-align: center; box-shadow: 0 20px 40px -24px rgb(0 0 0 / .8);
    rotate: -3deg; transition: rotate .5s var(--ease);
    .ticket:hover & { rotate: 0deg; }
  }
  .ticket__dow { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--on-accent); background: var(--accent); align-self: stretch; border-radius: 8px; padding: 4px 0; }
  .ticket__day { font-family: var(--font-display); font-weight: 700; font-size: clamp(64px, 8vw, 96px); line-height: 1; letter-spacing: -.05em; margin-top: 8px; }
  .ticket__mon { font-weight: 600; font-size: 15px; }
  .ticket__time { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-2); align-self: stretch; font-weight: 600; font-size: 14px; color: var(--accent-d); }
  .ticket__facts {
    list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px;
    & li { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
    & .ti { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--peach); }
    & a { color: var(--on-dark); text-decoration: underline; text-decoration-color: var(--dark-line); text-underline-offset: 4px;
      &:hover { color: var(--on-accent); text-decoration-color: currentColor; } }
  }
  .ticket__stub {
    position: relative; display: flex; justify-content: space-between; align-items: center; gap: 20px 32px; flex-wrap: wrap;
    padding: clamp(22px, 3.5vw, 32px) clamp(28px, 5vw, 56px); border-top: 2px dashed var(--dark-line); background: var(--dark-2);
    &::before, &::after { content: ""; position: absolute; top: -14px; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); }
    &::before { left: -13px; } &::after { right: -13px; }
  }
  .ticket__note { margin: 0; color: var(--on-dark); }
  .ticket__actions { display: flex; gap: 10px; flex-wrap: wrap; & .btn { font-size: 15px; padding: 12px 18px; } }
  .cd { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
  .cd__label { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--peach); }
  .cd__units { display: flex; align-items: flex-start; gap: 6px;
    & i { font-style: normal; font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 3.4vw, 40px); line-height: 1; color: var(--dark-line); } }
  .cd__unit {
    display: flex; flex-direction: column; align-items: center; min-width: 2.4ch;
    & b { font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 4vw, 48px); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
      &.is-tick { animation: cdTick .45s var(--ease); } }
    & small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--on-dark-soft); margin-top: 4px; }
  }

  @container ticket (width < 540px) {
    .ticket__main { grid-template-columns: 1fr; }
    .ticket__date { flex-direction: row; flex-wrap: wrap; width: auto; justify-content: center; gap: 4px 10px; rotate: none; }
    .ticket__dow { align-self: auto; padding: 4px 10px; }
    .ticket__day { font-size: 40px; margin: 0; }
    .ticket__time { border: 0; margin: 0; padding: 0; align-self: auto; }
    .ticket__actions { width: 100%; & .btn { flex: 1 1 100%; justify-content: center; } }
    .cd__units { gap: 4px; }
  }
  /* closing CTA (container-sized) */
  .tag { align-self: flex-start; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; background: var(--accent); color: var(--on-accent); padding: 6px 10px; border-radius: 4px; }
  .tag--light { background: var(--surface); color: var(--accent-d); }
  .cta-wrap { container: cta / inline-size; }
  .cta {
    position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: center;
    border-radius: var(--r-2xl); padding: clamp(32px, 5vw, 64px); background: linear-gradient(135deg, var(--glow-1) 0%, var(--glow-2) 100%);
    & > * { min-width: 0; }
    & .lead { color: var(--ink); }
  }
  .cta__title { font-size: clamp(40px, 5.4vw, 72px); max-width: 14ch; }
  .cta__books {
    position: relative; height: clamp(240px, 28vw, 340px);
    & img { position: absolute; height: auto; width: clamp(140px, 16vw, 200px); aspect-ratio: 524 / 776; object-fit: cover; border-radius: 2px 5px 5px 2px; box-shadow: 0 30px 50px -24px rgb(80 30 5 / .6); transition: rotate .6s var(--ease), translate .6s var(--ease); }
  }
  .cta__book--back { left: 12%; top: 8%; rotate: -9deg; z-index: 1; filter: brightness(.97); .cta:hover & { rotate: -13deg; translate: -14px 0; } }
  .cta__book--front { left: 40%; top: 2%; rotate: 5deg; z-index: 2; .cta:hover & { rotate: 8deg; translate: 12px -6px; } }
  @container cta (width < 700px) {
    .cta { grid-template-columns: 1fr; padding: 28px 20px; }
    .cta__books { height: 220px; order: -1; & img { width: 128px; } }
    .cta__book--back { left: 10%; } .cta__book--front { left: 42%; }
    .cta__title { font-size: clamp(32px, 10vw, 44px); }
    .cta .btn--dark { width: 100%; justify-content: center; }
  }

  /* readers — mosaic */
  .section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px 32px; flex-wrap: wrap; margin-bottom: 28px; }
  .count-pill { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: var(--tint); color: var(--accent-d); font-size: 13px; font-weight: 600; white-space: nowrap; vertical-align: 2px; }
  .mosaic {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(150px, 15vw, 210px); grid-auto-flow: dense; gap: 12px;
    & > .mosaic__item:nth-of-type(8n+1), & > .mosaic__item:nth-of-type(8n+7) { grid-column: span 2; grid-row: span 2; }
    & > .mosaic__item:nth-of-type(8n+3), & > .mosaic__item:nth-of-type(8n+5) { grid-row: span 2; }
    @media (max-width: 900px) and (min-width: 641px) {
      grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 180px;
      & > .mosaic__item:is(:nth-of-type(8n+3), :nth-of-type(8n+5), :nth-of-type(8n+7)) { grid-row: span 1; grid-column: span 1; }
      & > .mosaic__item:nth-of-type(8n+5) { grid-column: span 2; }
    }
    @media (max-width: 640px) {
      display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
      margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); scroll-padding-inline: var(--pad); scrollbar-width: none;
      & > .mosaic__item { flex: 0 0 74%; aspect-ratio: 4 / 5; scroll-snap-align: start; }
    }
  }
  .mosaic__item {
    position: relative; display: block; padding: 0; border: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--line); cursor: zoom-in; isolation: isolate;
    & img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: scale .8s var(--ease); }
    &::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgb(28 22 17 / .55)); opacity: 0; transition: opacity .35s; }
    &:is(:hover, :focus-visible) { & img { scale: 1.06; } &::after { opacity: 1; } & .mosaic__view { opacity: 1; translate: none; } }
  }
  .mosaic__view {
    position: absolute; left: 14px; bottom: 14px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 95%, transparent); color: var(--ink); font-size: 13px; font-weight: 600;
    opacity: 0; translate: 0 8px; transition: opacity .3s, translate .35s var(--ease);
    & .ti { width: 14px; height: 14px; }
    @media (max-width: 640px) { opacity: 1; translate: none; padding: 6px 10px; }
  }
  .mosaic__hint { display: none; @media (max-width: 640px) { display: block; margin: 12px 0 0; font-size: 13px; color: var(--muted-2); } }

  /* reviews & payment */
  .reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
  .review {
    margin: 0; padding: clamp(24px, 3vw, 32px); display: flex; flex-direction: column; gap: 18px;
    & blockquote { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 20px; line-height: 1.4; letter-spacing: -.01em;
      &::before { content: "“"; display: block; font-size: 56px; line-height: .6; color: var(--accent); margin-bottom: 8px; } }
    & figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--muted-2); & strong { color: var(--ink); font-size: 15px; } }
  }
  .pay { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
  .pay__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px;
    & li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; } }

  /* order */
  .order-meta { display: flex; gap: 18px; align-items: center; padding-top: 22px; border-top: 1px solid var(--line-2);
    & a { font-size: 14px; font-weight: 500; } }
  .form { border-radius: var(--r-xl); padding: clamp(24px, 3.5vw, 36px); display: flex; flex-direction: column; gap: 20px;
    @media (max-width: 640px) { padding: 20px; } }
  .form__product { display: flex; gap: 16px; align-items: center;
    & img { width: 60px; border-radius: 2px 4px 4px 2px; box-shadow: 0 10px 20px -10px rgb(60 30 10 / .6); }
    & .h3 { font-size: 19px; } }
  .field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; border: 0; margin: 0; padding: 0; min-width: 0;
    & legend { padding: 0; margin-bottom: 8px; } }
  .input {
    font-size: 16px; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-md);
    padding: 13px 14px; outline: none; transition: border-color .2s, background-color .2s; width: 100%;
    &:focus { border-color: var(--accent); background: var(--field); }
    &[aria-invalid="true"] { border-color: var(--accent); }
  }
  .stepper {
    display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-md);
    & button { width: 44px; height: 44px; border: 0; background: var(--bg); cursor: pointer; display: grid; place-items: center;
      &:hover { background: var(--field-hover); }
      &:first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
      &:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }
      & .ti { width: 16px; height: 16px; } }
    & input { width: 52px; height: 44px; border: 0; background: transparent; text-align: center; font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; appearance: textfield;
      &::-webkit-outer-spin-button, &::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } }
  }
  .seg {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    & label { position: relative; display: block; cursor: pointer; }
    & input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
    & span { display: block; text-align: center; font-weight: 600; font-size: 15px; padding: 13px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--bg); transition: border-color .2s, background-color .2s; }
    & input:checked + span { border-color: var(--accent); background: var(--tint); }
    & input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
  }
  .alert { margin: 0; font-size: 14px; font-weight: 500; color: var(--accent-d); background: var(--tint); border-radius: 8px; padding: 10px 12px;
    &.is-shaking { animation: headShake 1s ease-in-out; } }
  .success { display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; color: var(--muted); & strong { color: var(--ink); } }

  /* contact */
  .contact-head { align-items: end; flex-wrap: wrap; margin-bottom: 28px; }
  .contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }
  .contact-card {
    display: flex; flex-direction: column; gap: 14px; padding: 24px; color: var(--ink); text-decoration: none; transition: border-color .2s, translate .3s var(--ease);
    &:hover { border-color: var(--accent); translate: 0 -3px; color: var(--ink); }
    & .num { background: var(--tint); }
    & .ti { width: 20px; height: 20px; }
    & strong { font-family: var(--font-display); font-weight: 600; font-size: 19px; display: block; }
    & small { font-size: 15px; color: var(--muted); }
  }
  .contact-card--primary .num { background: var(--accent); color: var(--on-accent); }

  /* faq — exclusive accordion (<details name>) that animates to height:auto */
  .faq { border-top: 1px solid var(--line-2);
    & details { border-bottom: 1px solid var(--line-2); }
    & summary {
      list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 0;
      font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -.01em;
      &:hover { color: var(--accent-d); }
      &::-webkit-details-marker { display: none; }
      &::after { content: ""; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--tint) var(--faq-plus) center no-repeat; transition: rotate .3s var(--ease); }
    }
    & details[open] summary::after { rotate: 45deg; }
    & p { margin: 0 0 24px; font-size: 17px; line-height: 1.7; color: var(--muted); max-width: 64ch; }
    @supports selector(::details-content) {
      & details::details-content { block-size: 0; overflow: clip; transition: block-size .35s var(--ease), content-visibility .35s allow-discrete; }
      & details[open]::details-content { block-size: auto; }
      & details[data-instant]::details-content { transition: none; }
    }
    @supports not selector(::details-content) { & details[open] p { animation: fadeIn .4s var(--ease); } }
  }

  /* footer — brand column + three link columns; copyright and credits on one line; a wordmark bleeding off the page */
  .footer { margin-top: var(--section); border-top: 1px solid var(--line-2); overflow: hidden; font-size: 15px; color: var(--muted-2);
    & a { color: inherit; text-decoration: none; font-weight: 500; transition: color .2s; &:hover { color: var(--accent-text); } }
    & ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px;
      @media (pointer: coarse), (max-width: 640px) { gap: 0; } } }
  .footer__top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr); gap: 48px 64px; padding-block: clamp(56px, 7vw, 96px) clamp(40px, 5vw, 64px);
    @media (max-width: 900px) { grid-template-columns: minmax(0, 1fr); } }
  .footer__brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
  .footer__thanks { margin: 0 0 8px; }
  .footer .footer__title { font: 700 clamp(28px, 2.8vw, 38px)/1.05 var(--font-display); letter-spacing: -.035em; color: var(--ink); &:hover { color: var(--accent-d); } }
  .footer__sub { max-width: 30ch; margin: 8px 0 0; font: 500 clamp(17px, 1.4vw, 19px)/1.4 var(--font-display); letter-spacing: -.01em; color: var(--accent-d); }
  .footer__by { margin: 2px 0 0; font-size: 14px; }
  .footer .footer__totop { margin-top: 22px; display: inline-flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; border: 1px solid var(--line-2); border-radius: 999px;
    background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; transition: border-color .2s, color .2s;
    &:hover { border-color: var(--accent); color: var(--accent-d); & .footer__totop-icon { translate: 0 -2px; } } }
  .footer__totop-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 15px; transition: translate .25s var(--ease); }
  .footer__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px;
    @media (max-width: 560px) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .footer__h { margin: 0 0 18px; font: 600 14px/1.2 var(--font-body); letter-spacing: -.005em; color: var(--ink); }
  .footer__btn { border: 0; padding: 0; background: none; font: inherit; font-weight: 500; color: inherit; text-align: left; cursor: pointer; transition: color .2s; &:hover { color: var(--accent-text); } }
  .footer__bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 24px; padding-block: 22px 28px; border-top: 1px solid var(--line-2); font-size: 13px;
    @media (max-width: 560px) { flex-direction: column; align-items: flex-start; } }
  .footer .credit { margin: 0; flex-wrap: wrap; gap: 4px 10px; }
  .credit__dot { color: var(--muted-2); }
  .footer .credit__link { color: var(--ink); &:hover { color: var(--accent-text); } }
  .footer__mark { margin: 0; padding-inline: var(--pad); text-align: center; white-space: nowrap; user-select: none; pointer-events: none;
    font: 800 clamp(36px, 13.4vw, 186px)/.78 var(--font-display); letter-spacing: -.055em; color: var(--accent); translate: 0 14%;
    @media (max-width: 759px) { translate: 0 8%; } }
  .credit { display: inline-flex; align-items: center; gap: 6px; }
  .credit__link { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); text-decoration: none; padding-block: 6px;
    &:hover { color: var(--accent-text); }
    & strong { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--underline); } }
  .heart { color: var(--accent); display: inline-block; animation: heartBeat 1.6s ease-in-out infinite; }

  /* bigger tap targets on touch / small screens */
  @media (pointer: coarse), (max-width: 640px) {
    .link-u, .footer a, .footer__btn, .order-meta a, .brand { display: inline-flex; align-items: center; min-height: 40px; }
  }

  /* floating UI */
  .fab {
    position: fixed; right: 20px; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 40; width: 58px; height: 58px; border-radius: 50%;
    background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 14px 30px -10px rgb(120 40 10 / .55);
    scale: .6; opacity: 0; pointer-events: none; transition: scale .35s var(--ease), opacity .25s, background-color .2s;
    &.is-visible { scale: 1; opacity: 1; pointer-events: auto; }
    &:hover { background: var(--accent-hover); color: var(--on-accent); }
    & .ti { width: 26px; height: 26px; }
    &::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); z-index: -1; opacity: 0; }
    &.is-visible::before { animation: ping 2.4s cubic-bezier(0, 0, .2, 1) .6s 3; }
    &:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
    @media (max-width: 759px) { display: none; }
  }
  .buybar__explore { flex: none; width: 40px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; &[hidden] { display: none; } }
  .buybar {
    position: fixed; inset-inline: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 40; display: flex; gap: 12px; align-items: center;
    border-radius: 14px; padding: 8px 8px 8px 10px; box-shadow: 0 16px 36px -14px rgb(60 30 10 / .45); translate: 0 140%; transition: translate .35s var(--ease);
    &.is-visible { translate: none; }
    & img { width: 30px; border-radius: 2px; }
    & > span { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
    @media (min-width: 760px) { display: none; }
  }

  /* dialogs — native <dialog> in the top layer; fade in/out with @starting-style */
  dialog.lightbox, dialog.modal {
    opacity: 0; transition: opacity .25s, overlay .25s allow-discrete, display .25s allow-discrete;
    &[open] { opacity: 1; @starting-style { opacity: 0; } }
    &::backdrop { transition: background-color .25s, overlay .25s allow-discrete, display .25s allow-discrete; }
  }
  .lightbox {
    position: fixed; inset: 0; margin: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; border: 0;
    background: transparent; display: none; align-items: center; justify-content: center; padding: 64px 16px;
    &[open] { display: flex; background: rgb(28 22 17 / .92); }
    &::backdrop { background: transparent; }
    & img { max-width: min(92vw, 1000px); max-height: calc(100dvh - 128px); object-fit: contain; border-radius: 12px;
      &.is-changing { animation: zoomIn .3s var(--ease); } }
  }
  .lightbox__count { position: fixed; top: 24px; left: 24px; font-size: 14px; color: var(--on-dark-muted); font-variant-numeric: tabular-nums; }
  .lightbox__btn { position: fixed; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--bg); color: var(--ink); cursor: pointer; display: grid; place-items: center;
    & .ti { width: 20px; height: 20px; } }
  .lightbox__btn--close { top: 14px; right: 14px; }
  .lightbox__btn--prev { left: 14px; top: 50%; @media (max-width: 640px) { top: auto; bottom: 18px; left: calc(50% - 56px); } }
  .lightbox__btn--next { right: 14px; top: 50%; @media (max-width: 640px) { top: auto; bottom: 18px; right: calc(50% - 56px); } }

  /* modals — every <dialog data-modal> shares this card */
  .modal {
    width: min(100% - 24px, 640px); max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible;
    &::backdrop { background: rgb(28 22 17 / .6); backdrop-filter: blur(4px); }
    &[open] .modal__card { animation: zoomIn .25s var(--ease); }
  }
  .modal__card { position: relative; border-radius: var(--r-xl); padding: clamp(22px, 4vw, 34px); display: flex; flex-direction: column; gap: 20px; max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; }
  .modal__head { display: flex; gap: 14px; align-items: flex-start; padding-right: 44px; }
  .modal__icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--tint); color: var(--accent-d); & .ti { width: 22px; height: 22px; } }
  .modal__icon--wa { background: var(--wa-tint); color: var(--wa-ink); }
  .modal__title { font-size: 22px; }
  .modal__x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--bg); cursor: pointer; display: grid; place-items: center; & .ti { width: 18px; height: 18px; } &:hover { background: var(--tint); } }
  .modal__actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .wa-modal__alt { background: var(--bg); border-color: var(--line-2); color: var(--ink); justify-content: center; &:hover { border-color: var(--accent); color: var(--ink); } }

  /* WhatsApp modal */
  .wa-modal__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start;
    @media (max-width: 600px) { grid-template-columns: 1fr; } }
  .wa-modal[data-reason="blocked"] .qr { @media (pointer: coarse) { display: none; } }
  .wa-modal__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; @media (max-width: 380px) { grid-template-columns: 1fr; }
    &:has([data-wa-app][hidden]) { grid-template-columns: 1fr; } }
  .wa-modal__hint { padding: 10px 12px; border-radius: var(--r-md); background: var(--tint); color: var(--ink); & a { color: var(--accent-d); } }
  .wa-modal__preview { margin: 0; display: flex; flex-direction: column; gap: 6px; }
  .wa-bubble {
    position: relative; margin: 0; padding: 10px 12px; border-radius: 10px 10px 10px 2px; background: var(--wa-bubble); color: var(--wa-bubble-ink);
    font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9.5em; overflow: auto;
  }

  /* QR codes (drawn locally); a spinner until ready, hidden if drawing fails */
  .qr { position: relative; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px;
    & img { width: 200px; height: 200px; padding: 8px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); image-rendering: pixelated; object-fit: contain; }
    &[data-state="loading"] img { visibility: hidden; }
    &[data-state="failed"] { display: none; }
    &:not([data-state="loading"]) .qr__spinner { display: none; }
  }
  .share-modal .qr img { width: 160px; height: 160px; }
  .qr__spinner { position: absolute; top: 84px; left: 50%; width: 32px; height: 32px; margin-left: -16px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }

  /* share modal */
  .share-modal__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start;
    @media (max-width: 600px) { grid-template-columns: 1fr; & .qr { display: none; } } }
  .share-modal__copy { display: flex; gap: 8px; & .input { min-width: 0; font-size: 14px; } & .btn { flex: none; } }
  .share-modal__to { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; & .chip { display: inline-flex; min-height: 40px; align-items: center; padding-inline: 16px; } }

  /* privacy settings */
  .consent-list { display: flex; flex-direction: column; gap: 10px; }
  .consent-row {
    display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--bg); cursor: pointer;
    &:has(input:disabled) { cursor: default; }
    &:has(input:checked:not(:disabled)) { border-color: color-mix(in srgb, var(--accent) 50%, var(--line-2)); background: color-mix(in srgb, var(--tint) 50%, var(--bg)); }
    & input { width: 20px; height: 20px; margin: 2px 0 0; }
    & > span { display: flex; flex-direction: column; gap: 2px; }
  }

  /* first-visit privacy notice (non-modal) */
  .consent {
    position: fixed; z-index: 60; inset-inline: 12px; bottom: max(12px, env(safe-area-inset-bottom)); margin-inline: auto; max-width: 760px;
    display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding: 16px 18px; box-shadow: 0 24px 50px -20px rgb(60 30 10 / .45);
    animation: fadeInUp .4s var(--ease);
    & a { color: var(--accent-d); }
  }
  .consent__title { margin: 0; font: 600 16px/1.2 var(--font-display); }
  .consent__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
  body:has(.consent:not([hidden])) :is(.buybar, .fab) { visibility: hidden; }

  /* current page / section (active plugin): an underline that grows in, never colour alone */
  .nav__links a, .footer__col a { text-decoration: underline 2px transparent; text-underline-offset: 8px; transition: text-decoration-color .25s, color .2s; }
  .nav__links a:is([aria-current="location"], [aria-current="page"]) { color: var(--accent-d); text-decoration-color: currentColor;
    @media (max-width: 1080px) { background: var(--tint); } }
  .footer__col a[aria-current="page"] { color: var(--accent-d); text-decoration-color: currentColor; font-weight: 600; }
  .journey__dots a.is-active { border-color: var(--accent); }

  /* 404 */
  .notfound { min-height: 50vh; display: flex; flex-direction: column; justify-content: center; gap: 18px;
    & h1 { font-size: clamp(44px, 8vw, 80px); } & p { max-width: 42ch; font-size: 18px; } }


  /* legal pages */
  .legal { max-width: 760px; padding-top: clamp(32px, 6vw, 72px);
    & h1 { margin: 0 0 8px; font: 700 clamp(36px, 6vw, 56px)/1 var(--font-display); letter-spacing: -.03em; }
    & h2 { margin: 40px 0 10px; font: 600 22px/1.25 var(--font-display); letter-spacing: -.01em; }
    & h3 { margin: 24px 0 6px; font: 600 17px/1.3 var(--font-display); }
    & p, & li { font-size: 16px; line-height: 1.75; color: var(--muted); }
    & ul { padding-left: 20px; }
    & table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; }
    & th, & td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
    & th { font-weight: 600; color: var(--ink); background: var(--surface); }
    & .table-wrap { overflow-x: auto; }
    & code { font-size: .9em; background: var(--surface); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); }
  }
  .legal__meta { margin: 0; font-size: 14px; color: var(--muted-2); }
  .legal__toc { margin: 24px 0 0; padding: 16px 20px; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface);
    & ol { margin: 0; padding-left: 20px; columns: 2 220px; } & li { font-size: 15px; } }


  /* floating controls live in an <aside> landmark that adds no box of its own */
  .quick { display: contents; }

  /* reading progress — pure CSS scroll-driven animation; hidden where unsupported */
  .read-progress {
    position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: var(--accent); transform-origin: left; scale: 0 1; pointer-events: none;
    @supports (animation-timeline: scroll()) { animation: grow linear both; animation-timeline: scroll(root block); }
    @supports not (animation-timeline: scroll()) { display: none; }
  }

  /* journey — progress rings (header, buy bar) open the Explore pop-over; it fills as sections are seen (journey.js).
     It lives in the page chrome, out of the content's way: nothing shifts, nothing covers the page until asked. */
  .explore-ring { --journey: 0; position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; font-size: 18px; color: var(--ink);
    &::before { content: ""; position: absolute; inset: -1px; border-radius: 50%;
      background: conic-gradient(var(--accent) calc(var(--journey) * 360deg), var(--line-2) 0);
      -webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - 2.5px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, #0000 calc(100% - 2.5px), #000 calc(100% - 2px)); }
    &[data-complete] { color: var(--accent-d); } }
  .explore {
    position: fixed; inset: 76px max(var(--pad), calc((100vw - var(--wrap)) / 2 + var(--pad))) auto auto; margin: 0; width: min(340px, calc(100vw - 24px));
    padding: 20px; display: none; flex-direction: column; gap: 14px; border: 1px solid var(--line-2); box-shadow: var(--shadow-warm); color: var(--ink);
    &:popover-open, &.is-open { display: flex; }
    opacity: 0; translate: 0 -6px; transition: opacity .2s, translate .2s var(--ease), overlay .2s allow-discrete, display .2s allow-discrete;
    &:popover-open, &.is-open { opacity: 1; translate: none; @starting-style { opacity: 0; translate: 0 -6px; } }
    @media (max-width: 759px) { inset: auto 12px calc(max(12px, env(safe-area-inset-bottom)) + 72px) 12px; width: auto; }
    &[data-complete] .journey__count { background: var(--accent); color: var(--on-accent); }
  }
  .explore__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-right: 36px; }
  .explore__title { margin: 0; display: inline-flex; align-items: center; gap: 8px; font: 600 18px/1.2 var(--font-display); letter-spacing: -.01em; & .ti { color: var(--accent-d); } }
  .explore__hint { margin: 0; font-size: 13px; color: var(--muted-2); }
  .explore__x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--bg); color: var(--ink); cursor: pointer; display: grid; place-items: center; font-size: 16px; &:hover { background: var(--tint); } }
  .journey__count { font: 600 12px/1 var(--font-body); letter-spacing: .04em; padding: 5px 8px; border-radius: 999px; background: var(--tint); color: var(--accent-d); font-variant-numeric: tabular-nums; transition: background-color .3s, color .3s; }
  .journey__bar { --journey: 0; display: block; height: 4px; border-radius: 4px; background: var(--line);
    & i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transform-origin: left; scale: var(--journey) 1; transition: scale .6s var(--ease); } }
  .journey__dots {
    list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px;
    & a { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 10px 3px 8px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; transition: border-color .2s, color .2s, background-color .2s;
      &::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; transition: background-color .3s; }
      &:hover { border-color: var(--accent); color: var(--ink); } }
    & li[data-done] a { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); background: color-mix(in srgb, var(--tint) 60%, transparent);
      &::before { background: var(--accent); border-color: var(--accent); } }
    & li.is-pop a::before { animation: pop .5s var(--ease); }
  }

  /* order milestones */
  .milestone { margin: -8px 0 0; align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--accent-d); background: var(--tint); border-radius: 999px; padding: 6px 12px;
    &::before { content: "♥ "; }
    &.is-pop { animation: pop .5s var(--ease); } }

  /* toast — native popover in the top layer */
  .toast {
    position: fixed; inset: auto auto max(20px, env(safe-area-inset-bottom)) 50%; translate: -50% 0; margin: 0; width: min(100% - 24px, 520px);
    display: none; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: var(--r-lg); color: var(--ink);
    box-shadow: 0 24px 50px -20px rgb(60 30 10 / .5);
    transition: opacity .3s, translate .35s var(--ease), overlay .35s allow-discrete, display .35s allow-discrete; opacity: 0;
    &:popover-open, &.is-open { display: flex; opacity: 1; translate: -50% 0; @starting-style { opacity: 0; translate: -50% 16px; } }
    @media (max-width: 759px) { bottom: max(80px, calc(env(safe-area-inset-bottom) + 68px)); }
  }
  .toast__icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--tint); color: var(--accent); font-size: 18px; animation: heartBeat 1.6s ease-in-out 2; }
  .toast__title { font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 1.25; }
  .toast__x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--bg); cursor: pointer; display: grid; place-items: center; & .ti { width: 16px; height: 16px; } }

  /* tooltips — [data-tip], hover/focus on precise pointers only */
  :where([data-tip]) { position: relative; }
  @media (hover: hover) and (pointer: fine) {
    [data-tip]::after {
      content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 10px); translate: -50% 4px; z-index: 70;
      background: var(--inverse); color: var(--on-inverse); font: 500 12.5px/1.3 var(--font-body); letter-spacing: 0; text-transform: none; white-space: nowrap;
      padding: 7px 10px; border-radius: 6px; box-shadow: 0 8px 20px -8px rgb(0 0 0 / .5); opacity: 0; pointer-events: none;
      transition: opacity .15s, translate .15s var(--ease);
    }
    [data-tip]:is(:hover, :focus-visible)::after { opacity: 1; translate: -50% 0; transition-delay: .25s; }
    [data-tip-pos="bottom"]::after { bottom: auto; top: calc(100% + 10px); }
    [data-tip-pos="left"]::after { left: auto; right: calc(100% + 10px); bottom: 50%; translate: 4px 50%; }
    [data-tip-pos="left"]:is(:hover, :focus-visible)::after { translate: 0 50%; }
    [data-tip-pos="right"]::after { left: calc(100% + 10px); bottom: 50%; translate: -4px 50%; }
    [data-tip-pos="right"]:is(:hover, :focus-visible)::after { translate: 0 50%; }
    .lightbox [data-tip]::after { background: var(--bg); color: var(--ink); }
  }

  /* scroll reveal: hidden until app.js plays it (and shown at once if the script never runs) */
  .js [data-animate]:not(.is-in) { opacity: 0; }
  .js [data-animate].is-revealing { animation: var(--reveal-name, fadeInUp) var(--reveal-duration) var(--ease) var(--reveal-delay, 0ms) both; }
}

/* ---------- utilities ---------- */
@layer utilities {
  .gap-1 { gap: 2px; } .gap-2 { gap: 8px; } .gap-3 { gap: 14px; } .gap-4 { gap: 18px; } .gap-5 { gap: 22px; } .gap-6 { gap: 28px; }
  .mb-7 { margin-bottom: 28px; }
  .m-0 { margin: 0; }
  .items-start { align-items: flex-start; }
  .grow { flex: 1; }
  .nowrap { white-space: nowrap; }
  .tabular { font-variant-numeric: tabular-nums; }
  .measure-40 { max-width: 40ch; }
  .measure-44 { max-width: 44ch; }
}

/* ---------- keyframes (replaces the animate.css dependency; only what the site uses) ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; translate: 0 32px; } to { opacity: 1; translate: none; } }
@keyframes fadeInDown { from { opacity: 0; translate: 0 -32px; } to { opacity: 1; translate: none; } }
@keyframes zoomIn { from { opacity: 0; scale: .3; } 50% { opacity: 1; } }
@keyframes headShake {
  0% { translate: 0; } 6.5% { translate: -6px; rotate: y -9deg; } 18.5% { translate: 5px; rotate: y 7deg; }
  31.5% { translate: -3px; rotate: y -5deg; } 43.5% { translate: 2px; rotate: y 3deg; } 50% { translate: 0; rotate: none; }
}
@keyframes heartBeat { 0%, 28%, 70% { scale: 1; } 14%, 42% { scale: 1.3; } }
@keyframes qProgress { to { scale: 1 1; } }
@keyframes cdTick { from { translate: 0 -30%; opacity: 0; } to { translate: none; opacity: 1; } }
@keyframes grow { to { scale: 1 1; } }
@keyframes spin { to { rotate: 1turn; } }
@keyframes pop { 0% { scale: 1; } 40% { scale: 1.35; } 100% { scale: 1; } }
@keyframes ping { 0% { scale: 1; opacity: .4; } 80%, 100% { scale: 1.35; opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after, ::backdrop { animation: none !important; transition: none !important; }
  .js [data-animate]:not(.is-in) { opacity: 1; }
}
@media print { .nav, .fab, .buybar, .lightbox, .modal, .toast, .explore, .consent, .footer__totop, .footer__mark { display: none !important; } }
