/* ==========================================================================
   GARY ALTHAUS — GAME NIGHT COLLECTION
   main.css · design tokens, base, typography, layout, shared components
   (Homepage sections: home.css · Inner pages: pages.css · Motion: animations.css)
   ========================================================================== */

/* ---------- 1. Design tokens (brand guideline palette) ---------- */
:root {
  /* Official palette */
  --forest: #0F3B32;        /* Primary */
  --red: #B4311E;           /* Secondary */
  --gold: #F4B13D;          /* Accent */
  --cream: #F7F1E3;         /* Background */
  --wood: #6B4226;          /* Textures */
  --leaf: #5A8F5A;          /* Supporting */

  /* Tints & shades derived from the palette */
  --forest-700: #164A3F;
  --forest-800: #12423A;
  --forest-900: #0A2B24;
  --forest-100: #DCE7E1;
  --red-700: #8F2616;
  --red-100: #F3D6CC;
  --gold-700: #D99520;
  --gold-300: #F8CB72;
  --gold-100: #FBE7BF;
  --cream-200: #EFE5CF;
  --cream-300: #E6D8BB;
  --paper: #FBF7EE;
  --paper-white: #FFFDF7;
  --wood-500: #8A5A36;
  --wood-300: #B88A5E;
  --wood-900: #4A2D19;
  --leaf-700: #3F6E45;
  --leaf-300: #7FB07A;
  --leaf-100: #DDEAD3;

  --ink: #2A2018;           /* body text on cream (contrast 14:1) */
  --ink-soft: #5B4B3D;      /* secondary text (contrast 7.4:1) */
  --line: #3B2416;          /* illustration outline */

  /* Typography */
  --font-display: 'Leckerli One', 'Georgia', cursive;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Lora', Georgia, 'Times New Roman', serif;
  --font-hand: 'Patrick Hand', 'Segoe Print', 'Comic Sans MS', cursive;

  --fs-hero: clamp(2.5rem, 1.3rem + 3vw, 4.1rem);
  --fs-h2: clamp(2rem, 1.25rem + 2.3vw, 3.4rem);
  --fs-h3: clamp(1.4rem, 1.08rem + 1.05vw, 1.95rem);
  --fs-h4: clamp(1.18rem, 1.05rem + .45vw, 1.4rem);
  --fs-lead: clamp(1.14rem, 1.02rem + .42vw, 1.36rem);
  --fs-body: 1.125rem;      /* 18px minimum for comfortable reading */
  --fs-small: .98rem;
  --fs-eyebrow: .86rem;

  /* Space */
  --gutter: clamp(1rem, .6rem + 2vw, 2.5rem);
  --section: clamp(3.25rem, 2rem + 3.6vw, 6rem);
  --container: 1240px;
  --container-narrow: 820px;

  /* Shape & depth */
  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-xl: 44px;
  --shadow-soft: 0 18px 40px -22px rgba(42, 32, 24, .45);
  --shadow-card: 0 2px 0 rgba(59, 36, 22, .08), 0 22px 50px -28px rgba(42, 32, 24, .55);
  --shadow-pop: 0 4px 0 var(--line);
  --ring: 0 0 0 3px var(--paper-white), 0 0 0 6px var(--red);

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --header-h: 84px;
  color-scheme: light;
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.68;
  color: var(--ink);
  background-color: var(--cream);
  background-image: url('../images/textures/grain.webp');
  background-size: 128px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
/* Decorative art and 3D entrances may poke past the edges; never let them widen the page.
   `clip` (unlike `hidden`) does not create a scroll container, so sticky/pinned elements keep working. */
main, .site-footer { overflow-x: clip; }
.mobile-menu[hidden] { display: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
svg { overflow: visible; }
a { color: var(--forest); text-decoration-thickness: 1.5px; text-underline-offset: .18em; }
a:hover { color: var(--red); }
button { font: inherit; color: inherit; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.25em; }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.12; color: var(--forest); font-weight: 700; }
h3, h4, h5 { font-family: var(--font-serif); }
hr { border: 0; height: 2px; background: var(--cream-300); margin: 2.5rem 0; }
::selection { background: var(--gold); color: var(--forest-900); }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--forest); outline-offset: 3px; border-radius: 6px; }
.btn:focus-visible { outline: none; box-shadow: 0 5px 0 var(--btn-shadow), 0 0 0 4px var(--paper-white), 0 0 0 7px var(--forest); }
.on-dark .btn:focus-visible { box-shadow: 0 5px 0 var(--btn-shadow), 0 0 0 4px var(--forest), 0 0 0 7px var(--gold); }
.on-dark :focus-visible, .section--forest :focus-visible { outline-color: var(--gold); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 1000;
  background: var(--forest); color: var(--cream); padding: .75rem 1.25rem; border-radius: var(--r-sm);
  font-weight: 600; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 1rem; color: var(--cream); }

/* Animated character rigs repaint every frame: keep them on their own layer and contained,
   so their redraws never force the textured backgrounds behind them to repaint. */
svg[data-mascot] { will-change: transform; }

/* Text inside SVG illustrations */
svg .hand { font-family: var(--font-hand); }
svg .serif-caps { font-family: var(--font-serif); font-weight: 700; }
svg .display { font-family: var(--font-display); }

/* ---------- 3. Layout ---------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.container--narrow { width: min(100% - 2 * var(--gutter), var(--container-narrow)); margin-inline: auto; }
.section { position: relative; padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * .6); }
.section--forest { background: var(--forest); color: var(--cream); }
.section--forest h2, .section--forest h3 { color: var(--cream); }
.section--paper { background-color: var(--paper); }
.stack > * + * { margin-top: var(--stack, 1rem); }
.center { text-align: center; }
.flow-row { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; }
.flow-row--center { justify-content: center; }

/* ---------- 4. Textures ---------- */
.tex-parchment {
  background-color: var(--paper);
  background-image: url('../images/textures/grain.webp'), radial-gradient(120% 90% at 50% 0%, rgba(255, 253, 247, .95), rgba(239, 229, 207, .55));
  background-size: 128px, 100% 100%;
}
.tex-grain { position: relative; }
.tex-grain::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: url('../images/textures/grain.webp'); background-size: 128px; opacity: .55; mix-blend-mode: multiply;
}
.tex-wood {
  background-color: var(--wood-500);
  background-image:
    repeating-linear-gradient(90deg, rgba(74, 45, 25, .0) 0 38px, rgba(74, 45, 25, .28) 38px 40px, rgba(74, 45, 25, 0) 40px 120px),
    repeating-linear-gradient(0deg, rgba(255, 220, 170, .07) 0 2px, rgba(0, 0, 0, 0) 2px 9px, rgba(74, 45, 25, .12) 9px 11px, rgba(0, 0, 0, 0) 11px 23px),
    linear-gradient(180deg, #9A6942, #7A4E2E);
}
.tex-knit {
  background-color: var(--red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='60'%3E%3Crect width='24' height='20' fill='%23B4311E'/%3E%3Crect y='20' width='24' height='20' fill='%23264A7A'/%3E%3Crect y='40' width='24' height='20' fill='%23F3E8D2'/%3E%3Cpath d='M2 2l4 8 4-8M14 2l4 8 4-8M2 22l4 8 4-8M14 22l4 8 4-8M2 42l4 8 4-8M14 42l4 8 4-8' stroke='%23000' stroke-opacity='.16' stroke-width='2' fill='none'/%3E%3C/svg%3E");
}
.tex-forest {
  background-color: var(--forest);
  background-image:
    radial-gradient(90% 70% at 70% 20%, rgba(244, 177, 61, .12), transparent 60%),
    radial-gradient(60% 60% at 10% 90%, rgba(90, 143, 90, .18), transparent 60%),
    url('../images/textures/grain.webp');
  background-size: auto, auto, 128px;
}

/* Torn/deckled paper edges for section transitions */
.edge-top, .edge-bottom { position: absolute; left: 0; right: 0; height: clamp(26px, 3vw, 46px); z-index: 2; pointer-events: none; }
.edge-top { top: 2px; transform: translateY(-100%); }
.edge-bottom { bottom: 2px; transform: translateY(100%) scaleY(-1); }
.edge-top svg, .edge-bottom svg { width: 100%; height: 100%; }

/* ---------- 5. Typography components ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--font-body); font-weight: 700; font-size: var(--fs-eyebrow);
  letter-spacing: .2em; text-transform: uppercase; color: var(--red);
  margin: 0 0 1rem;
}
.eyebrow .icon { width: 1.15em; height: 1.15em; color: var(--gold-700); flex: none; }
.section--forest .eyebrow, .on-dark .eyebrow { color: var(--gold); }
.section--forest .eyebrow .icon, .on-dark .eyebrow .icon { color: var(--gold-300); }

.display {
  font-family: var(--font-display); font-weight: 400; letter-spacing: .005em;
  line-height: 1.08; color: var(--forest);
}
.h-hero { font-size: var(--fs-hero); }
.h-section { font-size: var(--fs-h2); margin-bottom: .45em; }
.h-sub { font-family: var(--font-serif); font-size: var(--fs-h3); font-weight: 700; color: var(--forest); }
.accent { color: var(--red); }
.accent-gold { color: var(--gold); }
.on-dark .display, .on-dark .h-section, .on-dark .h-sub { color: var(--cream); }
.on-dark .accent { color: var(--gold); }
.on-dark .swash > svg { color: var(--red); }
.lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--ink-soft); }
.section--forest .lead, .on-dark .lead { color: #DCE6DF; }
.measure { max-width: 62ch; }
.measure-sm { max-width: 46ch; }

/* Hand-drawn underline swash */
.swash { position: relative; display: inline-block; white-space: nowrap; }
.swash > svg { position: absolute; left: -2%; right: -2%; bottom: -.16em; width: 104%; height: .34em; color: var(--gold); pointer-events: none; z-index: -1; }
.swash > svg path { stroke: currentColor; }

.section-head { margin-bottom: clamp(1.75rem, 1.3rem + 1.4vw, 2.75rem); }
.section-head.center .lead { margin-inline: auto; }

/* ---------- 6. Buttons ---------- */
.btn {
  --btn-bg: var(--red); --btn-fg: var(--paper-white); --btn-shadow: var(--red-700);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 52px; padding: .85em 1.55em;
  font-family: var(--font-serif); font-weight: 700; font-size: 1.06rem; line-height: 1.15; letter-spacing: .01em;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 2.5px solid var(--line); border-radius: 999px;
  box-shadow: 0 5px 0 var(--btn-shadow), 0 14px 26px -16px rgba(42, 32, 24, .7);
  text-decoration: none; cursor: pointer; user-select: none;
  transition: transform .25s var(--ease-spring), box-shadow .25s var(--ease-out), background-color .2s;
}
.btn:hover { color: var(--btn-fg); transform: translateY(-2px); box-shadow: 0 7px 0 var(--btn-shadow), 0 18px 30px -16px rgba(42, 32, 24, .7); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--btn-shadow), 0 8px 16px -12px rgba(42, 32, 24, .7); }
.btn .icon { width: 1.2em; height: 1.2em; flex: none; transition: transform .3s var(--ease-spring); }
.btn:hover .icon--arrow-right { transform: translateX(4px); }
.btn--forest { --btn-bg: var(--forest); --btn-fg: var(--cream); --btn-shadow: var(--forest-900); }
.btn--gold { --btn-bg: var(--gold); --btn-fg: var(--forest-900); --btn-shadow: var(--gold-700); }
.btn--cream { --btn-bg: var(--paper-white); --btn-fg: var(--forest); --btn-shadow: var(--cream-300); }
.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--forest); --btn-shadow: transparent;
  box-shadow: none; border-color: currentColor;
}
.btn--ghost:hover { --btn-bg: rgba(15, 59, 50, .06); box-shadow: none; }
.on-dark .btn--ghost, .section--forest .btn--ghost { --btn-fg: var(--cream); }
.on-dark .btn--ghost:hover, .section--forest .btn--ghost:hover { --btn-bg: rgba(247, 241, 227, .1); }
.btn--sm { min-height: 44px; padding: .6em 1.15em; font-size: .98rem; box-shadow: 0 4px 0 var(--btn-shadow); }
.btn--lg { min-height: 60px; padding: 1em 1.9em; font-size: 1.14rem; }
.btn[aria-disabled='true'], .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.link-arrow {
  display: inline-flex; align-items: center; gap: .45em; font-weight: 700; font-family: var(--font-serif);
  color: var(--forest); text-decoration: none; border-bottom: 2px solid var(--gold); padding-bottom: 2px;
}
.link-arrow .icon { width: 1.1em; height: 1.1em; transition: transform .3s var(--ease-spring); }
.link-arrow:hover .icon { transform: translateX(4px); }

/* Shine sweep on hover */
.btn { overflow: hidden; isolation: isolate; }
.btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .42) 50%, transparent 65%);
  transform: translateX(-130%); transition: transform .8s var(--ease-out);
}
.btn:hover::before, .btn:focus-visible::before { transform: translateX(130%); }

/* Sticker-style eyebrows on section headings */
.section-head .eyebrow {
  padding: .5em 1.1em .5em .85em; background: var(--paper-white); border: 2px solid var(--line); border-radius: 999px;
  box-shadow: 0 3px 0 var(--line); transform: rotate(-1.5deg); letter-spacing: .16em;
}
.on-dark .section-head .eyebrow { background: var(--gold); color: var(--forest-900); }
.on-dark .section-head .eyebrow .icon { color: var(--red); }

/* Doodles beside centred headings */
.section-head.center { position: relative; }
.head-doodle { position: absolute; pointer-events: none; width: clamp(44px, 3.6vw, 66px); }
.head-doodle svg { width: 100%; height: auto; }
.head-doodle--l { left: max(0px, calc(50% - 480px)); top: 22%; transform: rotate(-12deg); }
.head-doodle--r { right: max(0px, calc(50% - 470px)); top: 4%; transform: rotate(16deg); }
/* Inside the eyebrow sticker (its transform makes it the containing block): sit just outside each end of the pill. */
.eyebrow .head-doodle { width: clamp(40px, 3vw, 54px); }
.eyebrow .head-doodle--l { left: auto; right: calc(100% + .7rem); top: -45%; }
.eyebrow .head-doodle--r { right: auto; left: calc(100% + .5rem); top: -75%; }
@media (max-width: 760px) { .head-doodle { display: none; } }

/* Floating brand motifs */
.motifs { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.motif { position: absolute; width: var(--s); height: var(--s); transform: rotate(var(--r)); --icon-hole: transparent; }
.motif .icon { width: 100%; height: 100%; }
.motif--gold { color: var(--gold); opacity: .55; }
.motif--red { color: var(--red); opacity: .3; }
.motif--leaf { color: var(--leaf); opacity: .4; }
.motif--forest { color: var(--forest); opacity: .2; }

/* Rotating sticker badge */
.spin-badge { position: relative; aspect-ratio: 1; filter: drop-shadow(0 12px 14px rgba(42, 32, 24, .35)); }
.spin-badge__ring { width: 100%; height: auto; animation: badge-spin 24s linear infinite; }
.spin-badge__center { position: absolute; inset: 28%; display: grid; place-items: center; border-radius: 50%; background: var(--red); border: 3px solid var(--line); color: var(--paper-white); }
.spin-badge__center .icon { width: 52%; height: 52%; }
@keyframes badge-spin { to { transform: rotate(360deg); } }

/* ---------- 7. Badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .45em; padding: .38em .9em;
  font-family: var(--font-body); font-size: .9rem; font-weight: 700; letter-spacing: .02em;
  border-radius: 999px; border: 2px solid var(--line); background: var(--paper-white); color: var(--forest);
}
.badge .icon { width: 1.05em; height: 1.05em; }
.badge--soon { background: var(--gold-100); color: var(--wood-900); }
.badge--live { background: var(--leaf-100); color: var(--leaf-700); }
.badge--red { background: var(--red); color: var(--paper-white); }

.seal {
  --size: 132px;
  position: relative; display: grid; place-items: center; text-align: center;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: var(--red); color: var(--paper-white);
  border: 3px solid var(--line); box-shadow: inset 0 0 0 5px var(--red), inset 0 0 0 7px rgba(255, 253, 247, .65), 0 10px 22px -10px rgba(42, 32, 24, .6);
  font-family: var(--font-serif); font-weight: 800; line-height: 1;
}
.seal__num { display: block; font-size: calc(var(--size) * .3); letter-spacing: -.01em; }
.seal__label { display: block; margin-top: .3em; font-size: calc(var(--size) * .082); letter-spacing: .08em; text-transform: uppercase; max-width: 80%; margin-inline: auto; line-height: 1.15; }

/* Trust strip (players / ages / time) */
.trust { display: flex; flex-wrap: wrap; gap: .7rem; padding: 0; margin: 0; list-style: none; }
.trust li {
  display: inline-flex; align-items: center; gap: .55em; padding: .55em 1em .55em .7em;
  background: var(--paper-white); border: 2px solid var(--line); border-radius: 999px;
  font-weight: 600; font-size: 1rem; color: var(--forest); line-height: 1.2;
}
.trust .icon { width: 1.5em; height: 1.5em; padding: .22em; border-radius: 50%; background: var(--forest); color: var(--cream); flex: none; --icon-hole: var(--forest); }

/* ---------- 8. Header & navigation ---------- */
.announce {
  position: relative; z-index: 60; background: var(--forest-900); color: var(--cream);
  font-size: .98rem; line-height: 1.35;
}
.announce__inner { display: flex; align-items: center; justify-content: center; gap: .9rem; min-height: 44px; padding: .45rem 3rem; text-align: center; }
.announce__motif { display: inline-flex; gap: .4rem; color: var(--gold); }
.announce__motif .icon { width: 1.05rem; height: 1.05rem; --icon-hole: var(--forest-900); }
.announce p { margin: 0; font-weight: 600; letter-spacing: .01em; }
.announce__close {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: var(--cream); cursor: pointer;
}
.announce__close:hover { background: rgba(247, 241, 227, .12); }
.announce__close .icon { width: 1.1rem; height: 1.1rem; }
.announce.is-hidden { display: none; }
@media (max-width: 600px) { .announce__motif { display: none; } .announce__inner { padding-left: 1rem; justify-content: flex-start; text-align: left; } }

.site-header {
  position: sticky; top: 0; z-index: 50;
  transition: background-color .35s var(--ease-out), box-shadow .35s var(--ease-out), transform .4s var(--ease-out);
}
.site-header.is-scrolled {
  background: rgba(251, 247, 238, .94);
  -webkit-backdrop-filter: saturate(1.2) blur(10px); backdrop-filter: saturate(1.2) blur(10px);
  box-shadow: 0 1px 0 rgba(59, 36, 22, .12), 0 14px 30px -24px rgba(42, 32, 24, .55);
}
.site-header__inner { display: flex; align-items: center; gap: 1.5rem; min-height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--forest); flex: none; }
.brand:hover { color: var(--forest); }
.brand__mark { width: 48px; height: 48px; flex: none; transition: transform .5s var(--ease-spring); }
.brand:hover .brand__mark { transform: rotate(-12deg) scale(1.05); }
.brand__text { display: grid; line-height: 1; }
.brand__by { font-family: var(--font-serif); font-weight: 700; font-size: .7rem; letter-spacing: .28em; text-transform: uppercase; color: var(--wood); }
.brand__name { font-family: var(--font-display); font-size: 1.62rem; color: var(--forest); margin-top: .12rem; }
.brand__name span { color: var(--red); }

.nav { margin-left: auto; }
.nav__list { display: flex; align-items: center; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.nav__link {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: .4rem .85rem;
  font-weight: 600; font-size: 1.02rem; color: var(--forest); text-decoration: none; border-radius: 999px;
}
.nav__link::after {
  content: ''; position: absolute; left: .85rem; right: .85rem; bottom: 6px; height: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'%3E%3Cpath d='M1 5 C 20 1, 35 8, 52 4 S 82 1, 99 4' stroke='%23F4B13D' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center/100% 100%;
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease-out);
}
.nav__link:hover { color: var(--forest); }
.nav__link:hover::after, .nav__link[aria-current='page']::after { transform: scaleX(1); }
.nav__link[aria-current='page'] { color: var(--red); }
.nav__cta { margin-left: .6rem; }
.nav-toggle {
  display: none; margin-left: auto; align-items: center; gap: .5rem; min-height: 48px; padding: .4rem .9rem .4rem .75rem;
  border: 2.5px solid var(--line); border-radius: 999px; background: var(--paper-white); color: var(--forest);
  font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 var(--cream-300);
}
.nav-toggle .icon { width: 1.4rem; height: 1.4rem; }

@media (max-width: 1100px) {
  .nav__link { padding-inline: .6rem; font-size: .98rem; }
  .nav__link::after { left: .6rem; right: .6rem; }
}
@media (max-width: 1023px) {
  :root { --header-h: 72px; }
  .nav, .nav__cta-wrap { display: none; }
  .nav-toggle { display: inline-flex; }
  .brand__mark { width: 42px; height: 42px; }
  .brand__name { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .site-header__inner { gap: .75rem; }
  .brand { gap: .5rem; min-width: 0; }
  .brand__mark { width: 38px; height: 38px; }
  .brand__name { font-size: 1.16rem; white-space: nowrap; }
  .brand__by { font-size: .6rem; letter-spacing: .22em; }
}
@media (max-width: 420px) {
  .nav-toggle { padding: .4rem .7rem; }
  .nav-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
}
@media (max-width: 340px) { .brand__name { font-size: 1rem; } }

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  background: var(--forest); color: var(--cream); overflow-y: auto;
  visibility: hidden; opacity: 0; transition: opacity .3s var(--ease-out), visibility 0s .3s;
}
.mobile-menu.is-open { visibility: visible; opacity: 1; transition: opacity .3s var(--ease-out); }
.mobile-menu__top { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); padding-inline: var(--gutter); }
.mobile-menu .brand, .mobile-menu .brand__name { color: var(--cream); }
.mobile-menu .brand__by { color: var(--gold-300); }
.mobile-menu__close {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 48px; padding: .4rem .9rem;
  border: 2px solid rgba(247, 241, 227, .5); border-radius: 999px; background: transparent; color: var(--cream); font-weight: 700; cursor: pointer;
}
.mobile-menu__close .icon { width: 1.3rem; height: 1.3rem; }
.mobile-menu__list { list-style: none; margin: 0; padding: 1.5rem var(--gutter) 1rem; display: grid; gap: .25rem; }
.mobile-menu__list a {
  display: flex; align-items: center; gap: .9rem; padding: .6rem 0; font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.4rem + 2.5vw, 2.6rem); color: var(--cream); text-decoration: none; line-height: 1.15;
  border-bottom: 1px solid rgba(247, 241, 227, .12);
}
.mobile-menu__list a .icon { width: 1.7rem; height: 1.7rem; color: var(--gold); --icon-hole: var(--forest); }
.mobile-menu__list a[aria-current='page'] { color: var(--gold); }
.mobile-menu__foot { margin-top: auto; padding: 1.5rem var(--gutter) 2rem; display: grid; gap: 1rem; }
.mobile-menu__books { display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .4rem; }
.mobile-menu__books a { flex: none; width: 74px; border-radius: 4px; overflow: hidden; border: 2px solid rgba(0,0,0,.4); box-shadow: 0 8px 18px -8px rgba(0,0,0,.6); }

/* ---------- 9. Footer ---------- */
.site-footer { position: relative; margin-top: clamp(7rem, 5rem + 6vw, 11rem); color: #DDE7E1; }
.site-footer a { color: var(--cream); text-decoration: none; }
.site-footer a:hover { color: var(--gold); text-decoration: underline; }
.footer-scene { position: absolute; left: 0; right: 0; bottom: 100%; height: clamp(150px, 16vw, 230px); pointer-events: none; z-index: 1; }
.footer-scene__inner { position: relative; height: 100%; width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.footer-scene .footer-pal { position: absolute; bottom: -6px; height: 100%; pointer-events: auto; }
.footer-scene .mascot { height: 100%; width: auto; }
.footer-pal--dog { left: 4%; height: 92% !important; }
.footer-pal--cat { left: 20%; height: 78% !important; }
.footer-pal--parrot { right: 22%; height: 96% !important; }
.footer-pal--horse { right: 4%; height: 112% !important; }
.footer-leaves { position: absolute; left: 0; right: 0; bottom: calc(100% - 2px); height: 70px; z-index: 2; pointer-events: none; }
.footer-leaves svg { width: 100%; height: 100%; }
.footer-main { position: relative; z-index: 3; padding: clamp(3.5rem, 3rem + 2vw, 5rem) 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: clamp(2rem, 1rem + 3vw, 4rem); }
.footer-brand .brand__name { color: var(--cream); font-size: clamp(1.5rem, 1.1rem + 2vw, 2.1rem); }
.footer-brand .brand__by { color: var(--gold-300); }
.footer-brand .brand__mark { width: 58px; height: 58px; }
.footer-tagline { font-family: var(--font-display); font-size: 1.6rem; color: var(--gold); margin: 1.2rem 0 .6rem; }
.footer-blurb { max-width: 36ch; font-size: 1.02rem; }
.footer-col h2 { font-family: var(--font-serif); font-size: 1.1rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-col a { font-size: 1.04rem; }
.footer-social { display: flex; gap: .6rem; margin-top: 1.2rem; }
.footer-social a { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 2px solid rgba(247, 241, 227, .35); }
.footer-social a:hover { background: var(--gold); border-color: var(--gold); color: var(--forest); text-decoration: none; }
.footer-social .icon { width: 1.35rem; height: 1.35rem; }
.footer-bottom { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(247, 241, 227, .16); display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; font-size: .95rem; }
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.footer-bottom p { margin: 0; }
.footer-note { font-size: .9rem; color: #B9CBC2; max-width: 70ch; }
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-pal--cat, .footer-pal--parrot { display: none; }
  .footer-pal--dog { left: 2%; }
  .footer-pal--horse { right: 2%; }
}

/* ---------- 10. Book mockup (3D, real cover art) ---------- */
.book3d {
  --w: 280px; --thick: calc(var(--w) * .11); --ry: 24deg; --rx: -3deg;
  position: relative; width: var(--w); aspect-ratio: 728 / 1024; flex: none;
  perspective: 1600px;
}
.book3d__body {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateY(var(--ry)) rotateX(var(--rx));
  transition: transform .7s var(--ease-out);
}
.book3d__front, .book3d__back { position: absolute; inset: 0; border-radius: 2px 6px 6px 2px; overflow: hidden; backface-visibility: hidden; }
.book3d__front { transform: translateZ(calc(var(--thick) / 2)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); background: #EFE5CF; }
.book3d__back { background: #EFE5CF; }
.book3d__front img, .book3d__back img { width: 100%; height: 100%; object-fit: cover; }
.book3d__front::before {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.32) 0, rgba(0,0,0,.08) 1.6%, rgba(255,255,255,.22) 2.6%, rgba(255,255,255,0) 4.5%, rgba(0,0,0,0) 100%),
    linear-gradient(115deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 32%, rgba(255,255,255,0) 70%, rgba(255,255,255,.08) 100%);
}
.book3d__front::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(60% 50% at var(--gx, 30%) var(--gy, 20%), rgba(255,255,255,.22), rgba(255,255,255,0) 70%);
  opacity: var(--glare, .0); transition: opacity .3s;
}
.book3d__back { transform: rotateY(180deg) translateZ(calc(var(--thick) / 2)); }
.book3d__spine {
  position: absolute; top: 0; bottom: 0; left: calc(var(--thick) / -2); width: var(--thick);
  transform: rotateY(-90deg); overflow: hidden; border-radius: 3px;
  filter: brightness(.92);
}
.book3d__spine img { width: 100%; height: 100%; object-fit: fill; }
.book3d__pages {
  position: absolute; top: 1%; bottom: 1%; left: calc(100% - var(--thick) / 2 - 2px); width: var(--thick);
  transform: rotateY(90deg);
  background: repeating-linear-gradient(90deg, #FBF6EA 0 2px, #E4D6BC 2px 3px);
  box-shadow: inset 0 0 8px rgba(0,0,0,.25);
}
.book3d__top {
  position: absolute; left: 1%; right: 2px; top: calc(var(--thick) / -2 + 1px); height: var(--thick);
  transform: rotateX(90deg);
  background: repeating-linear-gradient(0deg, #FBF6EA 0 2px, #E4D6BC 2px 3px);
}
.book3d__shadow {
  position: absolute; left: 4%; right: -6%; bottom: -7%; height: 12%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(42, 32, 24, .45), rgba(42, 32, 24, 0) 70%);
  filter: blur(4px); transform: translateZ(-1px); pointer-events: none;
}
.book3d--flat .book3d__body { transform: none; }
.book3d.is-tilting .book3d__body { transition: transform .12s linear; }

/* Simple flat cover with shadow (lists, small sizes) */
.cover {
  position: relative; border-radius: 2px 5px 5px 2px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,.2), 0 18px 34px -16px rgba(42, 32, 24, .65);
}
.cover::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.28) 0, rgba(255,255,255,.2) 3%, rgba(255,255,255,0) 6%); pointer-events: none; }

/* ---------- 11. Cards & panels ---------- */
.paper-card {
  position: relative; background: var(--paper-white); border: 2.5px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 6px 7px 0 rgba(59, 36, 22, .12), var(--shadow-card);
}
.paper-card--parchment { background-color: var(--paper); background-image: url('../images/textures/grain.webp'), radial-gradient(100% 80% at 50% 0%, #FFFDF7, var(--paper)); background-size: 128px, 100% 100%; }

.media-frame { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 3px solid var(--line); box-shadow: var(--shadow-card); background: var(--cream-200); }
.media-frame img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 12. Forms ---------- */
.field { display: grid; gap: .4rem; margin-bottom: 1.15rem; }
.field label, .field .label { font-weight: 700; color: var(--forest); font-size: 1.02rem; }
.field .hint { font-size: .92rem; color: var(--ink-soft); }
.input, .select, .textarea {
  width: 100%; min-height: 54px; padding: .75rem 1rem; font: inherit; font-size: 1.08rem; color: var(--ink);
  background: var(--paper-white); border: 2.5px solid var(--line); border-radius: var(--r-md);
  box-shadow: inset 0 3px 0 rgba(59, 36, 22, .06);
  transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 170px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 9l5 5 5-5' stroke='%230F3B32' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; background-size: 1.3rem; padding-right: 2.8rem; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 4px rgba(244, 177, 61, .55); }
.input[aria-invalid='true'], .select[aria-invalid='true'], .textarea[aria-invalid='true'] { border-color: var(--red); background-color: #FFF6F3; }
.field-error { display: flex; gap: .4rem; align-items: flex-start; color: var(--red-700); font-weight: 600; font-size: .96rem; }
.field-error:empty { display: none; }
.form-status { margin-top: 1rem; padding: .9rem 1.1rem; border-radius: var(--r-md); border: 2px solid var(--line); font-weight: 600; display: none; }
.form-status.is-visible { display: flex; gap: .6rem; align-items: flex-start; }
.form-status--ok { background: var(--leaf-100); color: var(--leaf-700); }
.form-status--error { background: #FBE5DF; color: var(--red-700); }
.form-status .icon { width: 1.3rem; height: 1.3rem; flex: none; margin-top: .15rem; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading::after { content: ''; width: 1em; height: 1em; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 13. Page hero (inner pages) ---------- */
.page-hero { position: relative; padding: clamp(2rem, 1.25rem + 2.5vw, 3.75rem) 0 clamp(2.5rem, 1.5rem + 3vw, 4.5rem); overflow: hidden; }
.page-hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: center; }
.page-hero h1 { font-size: clamp(2.6rem, 1.6rem + 3.8vw, 4.8rem); }
@media (max-width: 860px) { .page-hero__grid { grid-template-columns: 1fr; } }

.breadcrumbs { font-size: .95rem; margin-bottom: 1.2rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: '›'; margin-right: .4rem; color: var(--wood-300); }
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs [aria-current] { color: var(--forest); font-weight: 600; }

/* ---------- 14. Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 4vmin; background: rgba(10, 43, 36, .92); }
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: min(1200px, 100%); max-height: 84vh; width: auto; border-radius: var(--r-md); box-shadow: 0 30px 80px rgba(0,0,0,.5); background: var(--cream-200); }
.lightbox__caption { color: var(--cream); text-align: center; margin-top: 1rem; max-width: 70ch; }
.lightbox__close, .lightbox__nav {
  position: absolute; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  border: 2px solid rgba(247, 241, 227, .6); background: rgba(10, 43, 36, .6); color: var(--cream); cursor: pointer;
}
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__nav--prev { left: 1rem; top: 50%; }
.lightbox__nav--next { right: 1rem; top: 50%; }
.lightbox .icon { width: 1.5rem; height: 1.5rem; }

/* ---------- 15. Utilities ---------- */
.hide-sm { }
@media (max-width: 700px) { .hide-sm { display: none !important; } }
.only-sm { display: none; }
@media (max-width: 700px) { .only-sm { display: initial; } }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
