/* =========================================================
   Void Fang — site styles
   Palette + type follow the live site and the Mossbrook
   "Witches' Recipe" design system (.claude/rules/design-system.md).
   ========================================================= */

@font-face { font-family: "Cinzel Decorative"; src: url("/assets/fonts/CinzelDecorative-Bold.0b0b1e6d84.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("/assets/fonts/Cinzel-VariableFont_wght.aa616f4498.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Komika"; src: url("/assets/fonts/KomikaText-Regular.691fa7c991.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  --studio: #1c1228;
  --deep: #241338;
  --plum-800: #371f57;
  --plum-700: #4f2f78;
  --purple: #674195;
  --violet: #9466bd;
  --lavender: #d9c4ec;
  --lavender-100: #efe6f7;
  --gold: #e8b13f;
  --gold-300: #f0cf6f;
  --gold-600: #b67a20;
  --parchment: #fbf3df;
  --parch-100: #f4e9cd;
  --parch-200: #ecdcb6;
  --parch-300: #ddc999;
  --light: #f3e7cf;
  --light-muted: #c3a988;
  --ink: #2b1d11;
  --body-ink: #4a3520;
  --ink-muted: #6b5742;
  --green: #437a2a;
  --green-400: #6fae47;
  --wood: #2e1c10;
  --line: rgba(243, 231, 207, 0.12);
  --line-strong: rgba(243, 231, 207, 0.26);
  --ink-line: rgba(43, 29, 17, 0.14);

  --font-wordmark: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --font-serif: "Cinzel", Georgia, serif;
  --font-story: "Komika", "Trebuchet MS", Georgia, sans-serif;
  --font-sans: "Helvetica Neue", Arial, Helvetica, sans-serif;

  --gutter: clamp(20px, 4.4vw, 64px);
  --header-h: 80px;
  --max: 1440px;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
}
@media (max-width: 760px) { :root { --header-h: 64px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--studio); color: var(--light);
  font: 400 1rem/1.6 var(--font-sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
/* Keep real proportions when CSS sets only a width (the width/height attributes still reserve space). */
img, video { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.05; text-wrap: balance; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--gold); color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
#main:focus { outline: none; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: calc(var(--header-h) + 12px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 300; padding: 10px 16px;
  background: var(--gold); color: var(--ink); font-weight: 700; border-radius: 4px;
}
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { position: relative; padding: clamp(72px, 10vw, 140px) 0; }
.section--tight { padding: clamp(48px, 6vw, 88px) 0; }
.deep { background: var(--deep); }
.blend-light { mix-blend-mode: screen; }

/* ---------- Type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 14px; margin: 0 0 22px;
  font: 700 0.74rem/1 var(--font-sans); letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold);
}
.eyebrow::before { content: ""; width: 36px; height: 1px; background: currentColor; }
.eyebrow--center { justify-content: center; }
.studio-title {
  font: 700 clamp(2.6rem, 5.8vw, 5.4rem)/0.96 var(--font-sans); letter-spacing: -0.055em; color: var(--parchment);
}
.studio-title span { display: block; }
.lav { color: var(--lavender); }
.gold { color: var(--gold); }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.6; max-width: 46ch; color: var(--light); }
.muted { color: var(--light-muted); }
.wordmark {
  font: 700 clamp(2.8rem, 7.4vw, 6.4rem)/0.95 var(--font-wordmark); color: var(--gold);
  letter-spacing: 0.01em; text-shadow: 0 2px 0 var(--gold-600), 0 12px 40px rgba(232, 177, 63, 0.25);
}
.mb-subtitle { font: 600 0.82rem var(--font-serif); letter-spacing: 0.08em; color: var(--light-muted); margin: 10px 0 30px; }
.mb-title {
  font: 700 clamp(1.5rem, 2.8vw, 2.4rem)/1.15 var(--font-serif); text-transform: uppercase; letter-spacing: 0.01em;
}
.mb-title--xl { font-size: clamp(2rem, 4.6vw, 3.8rem); line-height: 1.05; }
.mb-body { font: 400 clamp(0.95rem, 1.2vw, 1.06rem)/1.7 var(--font-story); }
.status-line {
  display: flex; width: fit-content; align-items: center; gap: 10px; margin: 22px 0 28px;
  font: 700 0.8rem var(--font-sans); color: var(--light);
}
.status-line::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.caption-note { font: 400 0.82rem/1.5 var(--font-story); color: var(--ink-muted); }

/* ---------- Buttons ---------- */
.btn-gold, .btn-line, .btn-ink {
  display: inline-flex; align-items: center; gap: 16px; padding: 17px 24px; border-radius: 4px; cursor: pointer;
  font: 700 0.95rem/1 var(--font-sans); border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(232, 177, 63, 0.7); }
.btn-line { border-color: var(--line-strong); color: var(--light); background: rgba(28, 18, 40, 0.35); }
.btn-line:hover { border-color: var(--gold); color: var(--gold); }
.btn-ink { background: var(--ink); color: var(--parchment); }
.btn-ink:hover { background: var(--purple); }
.arrow { font-size: 1.15em; color: inherit; }
.link-arrow { display: inline-flex; align-items: center; gap: 12px; font: 700 0.95rem var(--font-sans); color: var(--light); }
.link-arrow::after { content: "↗"; color: var(--gold); font-size: 1.25em; transition: transform 0.25s var(--ease); }
.link-arrow:hover::after { transform: translate(3px, -3px); }
.link-arrow--down::after { content: "↓"; }
.link-arrow--down:hover::after { transform: translateY(3px); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 36px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--header-h);
  display: flex; align-items: center; border-bottom: 1px solid var(--line);
  background: rgba(28, 18, 40, 0.72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 14px; }
.brand img { height: 40px; width: auto; }
.brand span { font: 700 0.95rem/1 var(--font-sans); letter-spacing: 0.32em; text-transform: uppercase; color: var(--parchment); }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a { font: 700 0.9rem var(--font-sans); color: var(--light); padding: 6px 0; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.nav a:hover { color: var(--gold); }
.nav a[aria-current="page"] { color: var(--gold); border-color: var(--gold); }
.motion-toggle {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 0; border: 0; background: none; cursor: pointer;
  font: 700 0.9rem var(--font-sans);
}
.motion-toggle::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lavender); opacity: 0.6; }
.motion-toggle[aria-pressed="true"]::after { background: var(--gold); opacity: 1; box-shadow: 0 0 10px var(--gold); }
.menu-toggle { display: none; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 4px; background: none; cursor: pointer; font: 700 0.85rem var(--font-sans); }
@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; gap: 8px; }
  .brand img { height: 34px; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 24px; background: rgba(28, 18, 40, 0.98); border-bottom: 1px solid var(--line);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }
  .site-header.is-open .nav { opacity: 1; visibility: visible; transform: none; }
  .nav a, .nav .motion-toggle { padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav a[aria-current="page"] { border-color: var(--line); }
}

/* ---------- Arches ---------- */
.arch {
  position: relative; overflow: hidden; border-radius: 999px 999px 26px 26px;
  background: radial-gradient(70% 60% at 50% 35%, var(--plum-700), var(--deep) 75%);
}
.arch img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Decorative image layers ----------
   Pictures used in several places are CSS backgrounds, so the single-file build stores each one once. */
.layer { display: block; background-repeat: no-repeat; background-position: center; background-size: contain; }
.bg-vine-l { background-image: url("/assets/media/live/mossbrook-foreground-left-640.0f994026cc.webp"); aspect-ratio: 640 / 960; }
.bg-vine-r { background-image: url("/assets/media/live/mossbrook-foreground-right-640.aee77ef9c5.webp"); aspect-ratio: 640 / 960; }
.bg-hazel-art { background-image: url("/assets/media/live/hazel-960.583a0fa99d.webp"); }
.bg-sage-art { background-image: url("/assets/media/live/sage-960.41632bfc3e.webp"); }
/* Phones get the same art at the smaller sizes they actually display. */
@media (max-width: 760px) {
  .bg-vine-l { background-image: url("/assets/media/live/mossbrook-foreground-left-384.6fe09ced32.webp"); }
  .bg-vine-r { background-image: url("/assets/media/live/mossbrook-foreground-right-384.5448644dbd.webp"); }
  .bg-hazel-art { background-image: url("/assets/media/live/hazel-480.3df0bbefcb.webp"); }
  .bg-sage-art { background-image: url("/assets/media/live/sage-480.78d7689e48.webp"); }
}
/* Second art batch: each scene has its own backdrop, so the cottage stays the home hero's signature. */
.bg-glade { background-image: url("/assets/media/live/mossbrook-brook-bank-1600.d9e220c907.webp"); }
.bg-ferns { background-image: url("/assets/media/live/mossbrook-foreground-ferns-1536.0458053e53.webp"); aspect-ratio: 3 / 2; }
.bg-shop { background-image: url("/assets/media/live/mossbrook-apothecary-interior-1600.f99bd0802a.webp"); }
.bg-herbs { background-image: url("/assets/media/live/mossbrook-hanging-herbs-1536.99fff29257.webp"); aspect-ratio: 3 / 2; }
.bg-bench { background-image: url("/assets/media/live/alchemy-workbench-1024.b15a2e7cdf.webp"); aspect-ratio: 3 / 2; }
.bg-sky { background-image: url("/assets/media/live/void-night-sky-1600.a13c4fa54f.webp"); }
.bg-hazel-wave { background-image: url("/assets/media/live/hazel-waving-768.d9061f5588.webp"); aspect-ratio: 2 / 3; }
.bg-sage-cut { background-image: url("/assets/media/live/sage-sitting-640.c5f51eab30.webp"); aspect-ratio: 1; }
.bg-cottage-scene { background-image: url("/assets/media/live/mossbrook-cottage-scene-1024.d2d4962300.webp"); }
.bg-restore-before { background-image: url("/assets/media/live/restore-corner-before-480.b2ebd8960b.webp"); }
.bg-restore-after { background-image: url("/assets/media/live/restore-corner-after-480.6930b2f009.webp"); }
.bg-lane { background-image: url("/assets/media/live/mossbrook-village-lane-1280.909448993e.webp"); }
@media (max-width: 760px) {
  .bg-glade { background-image: url("/assets/media/live/mossbrook-brook-bank-960.46b65525f6.webp"); }
  .bg-ferns { background-image: url("/assets/media/live/mossbrook-foreground-ferns-768.1373377f02.webp"); }
  .bg-shop { background-image: url("/assets/media/live/mossbrook-apothecary-interior-960.b845d29e05.webp"); }
  .bg-herbs { background-image: url("/assets/media/live/mossbrook-hanging-herbs-768.e15a2ec79e.webp"); }
  .bg-bench { background-image: url("/assets/media/live/alchemy-workbench-640.2fec183008.webp"); }
  .bg-sky { background-image: url("/assets/media/live/void-night-sky-960.9e4d6bc6d5.webp"); }
  .bg-hazel-wave { background-image: url("/assets/media/live/hazel-waving-512.29f3f82a0e.webp"); }
  .bg-sage-cut { background-image: url("/assets/media/live/sage-sitting-384.4064ca14a1.webp"); }
  .bg-cottage-scene { background-image: url("/assets/media/live/mossbrook-cottage-scene-640.bc1620c4ea.webp"); }
  .bg-lane { background-image: url("/assets/media/live/mossbrook-village-lane-768.4f5bc1f717.webp"); }
}
.bg-stage-1 { background-image: url("/assets/media/game/stages/stage_1.43f4e309d1.webp"); }
.arch-ring { padding: 10px; border: 1px solid rgba(232, 177, 63, 0.35); border-radius: 999px 999px 32px 32px; }

/* ---------- Home hero ---------- */
.hero { position: relative; padding: calc(var(--header-h) + clamp(40px, 6vw, 80px)) 0 0; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(50% 60% at 75% 45%, rgba(103, 65, 149, 0.45), transparent 70%), radial-gradient(40% 50% at 10% 90%, rgba(232, 177, 63, 0.07), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.08fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero-lead { margin-top: 30px; font-size: clamp(1.05rem, 1.3vw, 1.18rem); max-width: 31em; }
.hero-art { position: relative; margin: 0; justify-self: end; width: min(100%, 600px); }
.hero-art .arch { aspect-ratio: 0.86; }
.hero-art figcaption {
  display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 0 14px;
  font: 700 0.7rem var(--font-sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--light-muted);
}
.hero-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: clamp(40px, 6vw, 72px); padding-top: 22px; padding-bottom: 22px;
  border-top: 1px solid var(--line); font: 700 0.7rem var(--font-sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--light-muted);
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { justify-self: center; width: min(100%, 460px); }
}
/* ---------- Layered Mossbrook scenes ----------
   .scene-bg (far plate) → .scene-art (right half: .scene-mid, .scene-figure) → .scene-front / .scene-top
   (closest foliage). Layers carry data-depth for the parallax in main.js, so the far plate is
   oversized and never shows an edge while it drifts. */
.scene {
  position: relative; isolation: isolate; overflow: hidden; min-height: clamp(560px, 62vw, 760px);
  display: flex; align-items: center; border-radius: 28px; border: 1px solid rgba(232, 177, 63, 0.22);
}
.scene > .layer, .scene-art, .scene-art > .layer { position: absolute; pointer-events: none; }
.scene-bg { inset: -9% -2%; background-size: cover; z-index: -5; }
.scene-art { inset: 0 0 0 50%; isolation: isolate; z-index: -2; }
.scene-mid { left: -14%; bottom: 7%; width: 96%; z-index: 0; }
/* Portraits are chest-up crops: the flat bottom sits behind the front foliage. */
/* Full-figure characters stand on the floor of their backdrop. The backdrop and the characters
   share one plane (no parallax between them), so feet never slide; depth comes from the copy,
   the hanging foreground and the reveal. Sizes follow the scene height so nobody is cropped. */
.scene-figure { z-index: 3; filter: drop-shadow(0 16px 18px rgba(20, 10, 30, 0.5)); }
/* Hazel stands on the left, Sage sits at her right. */
.scene-figure--hazel { left: 16%; bottom: 13%; height: 62%; width: auto; }
.scene-figure--b { left: auto; right: 20%; bottom: 13%; height: 25%; width: auto; z-index: 2; }
.scene--shop .scene-figure--hazel { left: 22%; bottom: 10%; height: 68%; }
.scene--shop .scene-figure--b { right: 7%; bottom: 10%; height: 27%; }
.scene-front {
  right: -4%; bottom: -22%; width: 66%; z-index: -1; filter: brightness(0.82) saturate(1.05);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%); mask-image: linear-gradient(90deg, transparent, #000 22%);
}
.scene-top {
  right: -3%; top: 0; width: 56%; z-index: 0; transform-origin: top center; animation: sway 12s ease-in-out infinite;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%); mask-image: linear-gradient(90deg, transparent, #000 20%);
}
.scene--hero .scene-top { top: var(--header-h); }
.scene-vine-r { right: -2%; top: -2%; width: 42%; z-index: 2; animation: sway 9s ease-in-out infinite; transform-origin: top right; }
.scene-vine-l { left: -1%; top: -2%; width: 16%; z-index: 0; animation: sway 11s ease-in-out infinite reverse; transform-origin: top left; }
@keyframes sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
.scene::after {
  content: ""; position: absolute; inset: 0; z-index: -4;
  background: linear-gradient(90deg, rgba(28, 18, 40, 0.94) 0%, rgba(28, 18, 40, 0.78) 34%, rgba(28, 18, 40, 0.1) 62%, transparent), linear-gradient(0deg, rgba(28, 18, 40, 0.55), transparent 35%);
}
.scene-copy { position: relative; z-index: 1; padding: clamp(28px, 5vw, 72px); width: 50%; }
.scene-copy .wordmark { font-size: clamp(2.8rem, 5.4vw, 5.4rem); }
.scene--hero { min-height: min(92svh, 860px); border-radius: 0; border: 0; padding-top: var(--header-h); }
.scene--hero::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 15%; z-index: 4; pointer-events: none;
  background: linear-gradient(0deg, var(--deep) 4%, rgba(36, 19, 56, 0.6) 45%, transparent);
}
/* Mossbrook page: inside the apothecary, Sage keeping watch by the hearth. */
.scene--shop .scene-bg { background-position: 60% 50%; }

/* Home: the world reveal. A full-bleed scene pinned while it opens from an inset frame
   to the full viewport; --progress (0–1) comes from the scroll position (main.js). */
.world { position: relative; padding: clamp(48px, 6vw, 88px) 0; }
.world .scene { --p: var(--progress, 1); border: 0; border-radius: 0; min-height: min(calc(100svh - var(--header-h)), 900px); }
.world .scene-copy { padding-left: max(calc(var(--gutter) + clamp(28px, 4vw, 64px)), calc((100% - var(--max)) / 2 + var(--gutter) + 64px)); }
@media (min-width: 1001px) {
  html.js:not([data-motion="off"]) .world { height: 200svh; padding: 0; }
  html.js:not([data-motion="off"]) .world-stage { position: sticky; top: 0; height: 100svh; padding-top: var(--header-h); display: flex; align-items: center; }
  html.js:not([data-motion="off"]) .world .scene {
    width: 100%; height: calc(100svh - var(--header-h)); min-height: 0; border-radius: 0;
    clip-path: inset(calc((1 - var(--p)) * 7%) calc((1 - var(--p)) * max(var(--gutter), (100% - var(--max)) / 2 + var(--gutter))) round calc((1 - var(--p)) * 28px));
  }

}

@media (max-width: 1000px) {
  .scene { display: flex; flex-direction: column; align-items: stretch; min-height: 0; background: var(--studio); }
  .scene > .scene-bg, .scene::after { display: none; }
  .scene-copy { width: 100%; padding: 32px var(--gutter); }
  .world .scene-copy { padding: 32px var(--gutter); }
  .container > .scene-copy { padding-left: 0; padding-right: 0; }
  .scene-copy .wordmark { font-size: clamp(2.5rem, 8vw, 4.8rem); }
  .scene--hero { padding-top: var(--header-h); }
  .scene-art {
    position: relative; inset: auto; order: 1; flex: none; width: 100%; aspect-ratio: 4 / 3; overflow: hidden;
    background: var(--deep) center / cover no-repeat;
  }
  .scene--world .scene-art { background-image: url("/assets/media/live/mossbrook-brook-bank-960.46b65525f6.webp"); background-position: 62% 50%; }
  .scene--shop .scene-art { background-image: url("/assets/media/live/mossbrook-apothecary-interior-960.b845d29e05.webp"); background-position: 72% 50%; }
  .scene-mid { left: -14%; bottom: 7%; width: 96%; }
  .scene-figure--hazel, .scene--shop .scene-figure--hazel { left: 16%; bottom: 4%; height: 80%; }
  .scene-figure--b, .scene--shop .scene-figure--b { left: auto; right: 10%; bottom: 4%; height: 32%; }
  /* The glade is set back: the front foliage overlaps their feet. */
  .scene--world .scene-figure--hazel { bottom: 12%; height: 70%; }
  .scene--world .scene-figure--b { right: 16%; bottom: 12%; height: 27%; }
  .scene--hero::before { height: 8%; }
  .scene--shop .scene-figure--hazel { bottom: 9%; height: 76%; }
  .scene--shop .scene-figure--b { bottom: 9%; height: 30%; }
  /* Stacked layout: the front foliage spans the bottom of the art panel; the garland would cover the copy. */
  .scene > .scene-front { position: absolute; right: 0; bottom: -14%; width: 100%; -webkit-mask-image: none; mask-image: none; }
  .scene > .scene-top { display: none; }
  .scene > .scene-vine-l { position: relative; order: 1; flex: none; left: -2%; width: 32%; margin-bottom: -48%; }
}

/* ---------- Parchment ("everyday magic") ---------- */
/* "Parchment" sections keep parchment cards on a dark plum ground that matches the rest of the site. */
.parch {
  color: var(--light);
  background: radial-gradient(60% 55% at 50% 0%, rgba(103, 65, 149, 0.32), transparent 70%), linear-gradient(180deg, var(--studio), var(--deep));
}
.parch .eyebrow { color: var(--gold); }
.parch .mb-body { color: var(--light); }
.parch .pillar { color: var(--ink); }
.parch .pillar .mb-body { color: var(--body-ink); }
.parch .step .pillar-num { color: var(--lavender); }
.parch .phone + .caption-note { color: var(--light-muted); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px 40px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head .mb-title, .section-head .studio-title { max-width: 26ch; }
.counter { font: 700 0.78rem var(--font-sans); letter-spacing: 0.2em; color: var(--violet); }
.parch .counter { color: var(--lavender); }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .pillars { grid-template-columns: 1fr; } }
.pillar {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 28px;
  background: var(--parch-100); border: 1px solid var(--ink-line); border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 18px 40px -30px rgba(43, 29, 17, 0.5);
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
a.pillar:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -30px rgba(43, 29, 17, 0.6); }
.pillar-num { font: 700 0.74rem var(--font-sans); letter-spacing: 0.2em; color: var(--purple); }
.pillar h3 { font: 700 1.25rem/1.2 var(--font-serif); text-transform: uppercase; }
.pillar p { margin: 0; }
.pillar-stage {
  height: 150px; margin-bottom: 6px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(60% 70% at 50% 60%, #fff7e2, var(--parch-200)); border-radius: 12px; border: 1px solid var(--ink-line);
}
.merge-demo { display: flex; align-items: center; gap: 10px; font: 700 1.4rem var(--font-sans); color: var(--purple); }
.merge-demo img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(43, 29, 17, 0.25)); }
.merge-demo .result { animation: pop 2.4s var(--ease) infinite; }
@keyframes pop { 0%, 55% { transform: scale(0.6); opacity: 0.25; } 70% { transform: scale(1.18); opacity: 1; } 82%, 100% { transform: scale(1); opacity: 1; } }
/* Bubbling cauldron: a 10-frame sprite sheet stepped with CSS, so it animates without JavaScript. */
.cauldron {
  --cw: 120px; display: block; width: var(--cw); height: calc(var(--cw) * 150 / 136);
  background: url("/assets/media/game/cauldron-sprite.20e41af431.webp") 0 0 / calc(var(--cw) * 10) 100% no-repeat;
  filter: drop-shadow(0 8px 10px rgba(43, 29, 17, 0.3)); animation: cauldron 1.1s steps(10) infinite;
}
.cauldron--sm, .step-icon.cauldron { --cw: 56px; height: calc(var(--cw) * 150 / 136); }
@keyframes cauldron { to { background-position: calc(var(--cw) * -10) 0; } }
.mini-restore { position: relative; width: 100%; height: 100%; overflow: hidden; }
.mini-restore .layer { position: absolute; inset: 0; background-size: cover; background-position: 50% 50%; }
.mini-restore .after { clip-path: inset(0 0 0 0); animation: restore-wipe 7s var(--ease) infinite; }
.mini-restore .sweep {
  position: absolute; top: 0; bottom: 0; left: 0; width: 18%; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 236, 170, 0.75), transparent); mix-blend-mode: screen;
  animation: restore-sweep 7s var(--ease) infinite;
}
.mini-restore .fly { position: absolute; width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(20, 10, 0, 0.45)); opacity: 0; }
.fly--1 { left: 14%; top: 26%; --fx: -60px; --fy: 60px; animation: restore-fly 7s var(--ease) infinite 0.3s; }
.fly--2 { left: 46%; top: 12%; --fx: 10px; --fy: 90px; animation: restore-fly 7s var(--ease) infinite 0.6s; }
.fly--3 { left: 78%; top: 40%; --fx: 70px; --fy: 50px; animation: restore-fly 7s var(--ease) infinite 0.9s; }
@keyframes restore-wipe { 0%, 22% { clip-path: inset(0 100% 0 0); } 52%, 92% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 100% 0 0); } }
@keyframes restore-sweep { 0%, 20% { left: -18%; opacity: 0; } 24% { opacity: 1; } 50% { opacity: 1; } 54%, 100% { left: 100%; opacity: 0; } }
@keyframes restore-fly {
  0%, 12% { opacity: 0; transform: translate(var(--fx), var(--fy)) scale(0.6) rotate(-14deg); }
  20% { opacity: 1; }
  40% { opacity: 1; transform: translate(0, -8px) scale(1.15) rotate(4deg); }
  48% { transform: translate(0, 0) scale(1) rotate(0); }
  60%, 100% { opacity: 0; transform: translate(0, 0) scale(0.9); }
}

/* Gameplay explainer */
.gameplay { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
@media (max-width: 860px) { .gameplay { grid-template-columns: 1fr; } }
.phone {
  position: relative; padding: 12px; border-radius: 40px; background: linear-gradient(160deg, #4b3020, var(--wood));
  box-shadow: 0 40px 80px -40px rgba(43, 29, 17, 0.8), inset 0 0 0 2px rgba(232, 177, 63, 0.35); max-width: 320px; margin: 0 auto;
}
.phone img { border-radius: 30px; width: 100%; }
.phone + .caption-note { text-align: center; margin-top: 16px; }
.steps { display: grid; gap: 28px; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 6px 20px; align-items: start; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; padding-bottom: 0; }
.step-icon { grid-row: span 3; width: 56px; height: 56px; object-fit: contain; }
.step .pillar-num { margin: 4px 0 0; }
.step h3 { font: 700 1.3rem/1.2 var(--font-serif); text-transform: uppercase; }
.step p { margin: 0; }

/* ---------- Story dialogue ---------- */
.story { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (max-width: 900px) { .story { grid-template-columns: 1fr; } }
.dialogue {
  position: relative; overflow: hidden; aspect-ratio: 4 / 5; max-height: 720px; border-radius: 26px;
  border: 1px solid rgba(232, 177, 63, 0.3); background: var(--wood); isolation: isolate;
}
.dialogue-bg { position: absolute; inset: 0; display: block; background-size: cover; background-position: 50% 30%; z-index: -2; filter: saturate(0.9); }
.dialogue::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(20, 12, 8, 0.85) 18%, transparent 60%); }
.dialogue-portrait {
  position: absolute; bottom: 150px; width: 52%; transition: opacity 0.4s, transform 0.4s var(--ease), filter 0.4s;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.5));
}
.dialogue-portrait--sage { left: 0; }
.dialogue-portrait--hazel { right: -2%; }
.dialogue-portrait.is-quiet { opacity: 0.45; filter: grayscale(0.4) brightness(0.7); transform: scale(0.94); }
.dialogue-box {
  position: absolute; left: 16px; right: 16px; bottom: 16px; padding: 24px 22px 18px; min-height: 150px;
  background: var(--parch-100); color: var(--ink); border-radius: 16px; border: 2px solid var(--gold-600);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.dialogue-name {
  display: inline-block; margin-bottom: 6px; padding: 4px 14px; border-radius: 999px;
  background: var(--purple); color: var(--parchment); font: 700 0.8rem var(--font-serif); letter-spacing: 0.06em; border: 2px solid var(--gold);
}
.dialogue-lines { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.dialogue-text { margin: 0; font: 400 1rem/1.5 var(--font-story); }
/* With JavaScript: one line at a time, name tag sitting on the box edge, Next button. */
.js .dialogue-line { display: none; }
.js .dialogue-line.is-current { display: block; }
.js .dialogue-name { position: absolute; top: -16px; left: 18px; margin: 0; }
.js .dialogue-text { min-height: 3.1em; margin-bottom: 12px; font-size: 1.05rem; line-height: 1.55; }
html:not(.js) .dialogue-portrait { bottom: auto; top: 12%; width: 42%; }
.dialogue-text em { color: var(--purple); }
.dialogue-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialogue-progress { display: flex; gap: 6px; }
.dialogue-progress span { width: 8px; height: 8px; border-radius: 50%; background: var(--parch-300); }
.dialogue-progress span.is-on { background: var(--purple); }
.dialogue-next {
  padding: 9px 16px; border-radius: 999px; border: 0; cursor: pointer; background: var(--purple); color: var(--parchment);
  font: 700 0.85rem var(--font-sans);
}
.dialogue-next:hover { background: var(--plum-700); }
.dialogue-title {
  position: absolute; top: 18px; left: 18px; padding: 6px 14px; border-radius: 999px; background: rgba(28, 18, 40, 0.75);
  font: 700 0.72rem var(--font-sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold);
}

/* ---------- FAQ (native <details>, so answers open without JavaScript) ---------- */
.faq-list { display: grid; gap: 14px; max-width: 920px; }
.faq-item { border: 1px solid var(--line); border-radius: 18px; background: rgba(36, 19, 56, 0.55); }
.deep .faq-item { background: rgba(28, 18, 40, 0.6); }
.faq-item > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; cursor: pointer; list-style: none; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: "+"; flex: none; color: var(--gold); font-size: 1.4rem; line-height: 1; }
.faq-item[open] > summary::after { content: "–"; }
.faq-item > summary:hover h3 { color: var(--gold); }
.faq-item h3 { font: 700 clamp(1rem, 1.6vw, 1.15rem)/1.35 var(--font-serif); letter-spacing: 0.02em; transition: color 0.2s; }
.faq-answer { padding: 0 24px 22px; max-width: 72ch; color: var(--light-muted); }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.faq-answer cite { font-style: italic; color: var(--light); }

/* ---------- Almanac (merge explorer) ---------- */
.almanac-ui { display: grid; gap: 28px; }
.almanac.is-enhanced .almanac-static { display: none; }
/* Plain list version (no JavaScript): every family, chain and tier. */
/* minmax(0, 1fr) lets each long tier row scroll inside its own box instead of widening the page. */
.almanac-static { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.almanac-family, .almanac-chain { min-width: 0; }
.almanac-family { border: 1px solid var(--line); border-radius: 18px; background: rgba(36, 19, 56, 0.55); }
.almanac-family > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; cursor: pointer; list-style: none;
  font: 700 1.1rem var(--font-serif); text-transform: uppercase; letter-spacing: 0.04em;
}
.almanac-family > summary::-webkit-details-marker { display: none; }
.almanac-family > summary span { margin-left: auto; font: 700 0.68rem var(--font-sans); letter-spacing: 0.14em; color: var(--light-muted); }
.almanac-family > summary::after { content: "+"; color: var(--gold); font-size: 1.4rem; line-height: 1; }
.almanac-family[open] > summary::after { content: "–"; }
.almanac-chain { padding: 0 22px 18px; }
.almanac-chain h3 { margin: 4px 0 10px; font: 700 0.95rem var(--font-serif); letter-spacing: 0.04em; color: var(--gold); }
.chain-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.chain-row li { flex: 0 0 86px; display: grid; justify-items: center; align-content: start; gap: 6px; text-align: center; scroll-snap-align: start; }
.chain-row img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.35)); }
.chain-row span { font: 400 0.72rem/1.25 var(--font-story); color: var(--light); }
.chain-row b { display: block; font: 700 0.6rem var(--font-sans); color: var(--light-muted); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  padding: 10px 16px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line-strong); background: transparent;
  font: 700 0.85rem var(--font-sans); color: var(--light); transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tab:hover { border-color: var(--gold); color: var(--gold); }
.tab[aria-selected="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.tabs--chains .tab { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; }
.tabs--chains .tab img { width: 30px; height: 30px; object-fit: contain; }
.almanac-body { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .almanac-body { grid-template-columns: 1fr; } }
.tier-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 520px) { .tier-grid { grid-template-columns: repeat(3, 1fr); } }
.tier {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 10px; cursor: pointer;
  border-radius: 14px; border: 1px solid var(--line); background: radial-gradient(70% 70% at 50% 45%, rgba(148, 102, 189, 0.28), rgba(36, 19, 56, 0.6));
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.tier img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35)); }
.tier span { position: absolute; top: 6px; left: 8px; font: 700 0.62rem var(--font-sans); color: var(--light-muted); }
.tier:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.tier[aria-pressed="true"] { border-color: var(--gold); background: radial-gradient(70% 70% at 50% 45%, rgba(232, 177, 63, 0.35), rgba(36, 19, 56, 0.7)); }
.tier-detail {
  position: sticky; top: calc(var(--header-h) + 20px); display: grid; justify-items: center; text-align: center; gap: 10px; padding: 32px 26px;
  background: var(--parch-100); color: var(--ink); border-radius: 22px; border: 2px solid var(--gold-600);
}
.tier-detail-art { width: 148px; height: 148px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, #fff6dc, var(--parch-200)); }
.tier-detail-art img { width: 112px; height: 112px; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(43, 29, 17, 0.3)); }
.tier-detail-art.is-pop img { animation: merge-pop 0.55s var(--ease); }
@keyframes merge-pop { 0% { transform: scale(0.5) rotate(-8deg); opacity: 0.3; } 60% { transform: scale(1.18) rotate(3deg); opacity: 1; } 100% { transform: scale(1); } }
.tier-detail h3 { font: 700 1.35rem/1.2 var(--font-serif); text-transform: uppercase; }
.tier-detail .chain-label { font: 700 0.72rem var(--font-sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--purple); }
.tier-detail p { margin: 0; font: 400 0.95rem/1.55 var(--font-story); color: var(--body-ink); }
.tier-meter { width: 100%; height: 8px; border-radius: 999px; background: var(--parch-300); overflow: hidden; margin: 6px 0; }
.tier-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--gold)); transition: width 0.4s var(--ease); }
.tier-actions { display: flex; gap: 10px; margin-top: 6px; }
.tier-actions button {
  padding: 10px 16px; border-radius: 999px; cursor: pointer; border: 1px solid var(--ink-line); background: transparent; color: var(--ink);
  font: 700 0.85rem var(--font-sans);
}
.tier-actions .merge-btn { background: var(--purple); border-color: var(--purple); color: var(--parchment); }
.tier-actions button:disabled { opacity: 0.4; cursor: default; }

/* ---------- Restoration stages ---------- */
.restore { display: grid; grid-template-columns: minmax(280px, 460px) 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
@media (max-width: 860px) { .restore { grid-template-columns: 1fr; } }
.stage-frame { position: relative; aspect-ratio: 520 / 924; width: 100%; max-width: 460px; margin: 0 auto; }
.stage-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s ease; }
.stage-frame img:first-child { opacity: 1; }
.stage-video { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.45s ease; pointer-events: none; }
.stage-video.is-on { opacity: 1; }
html[data-motion="off"] .stage-video { display: none; }
.stage-label { margin: 18px 0 10px; font: 700 0.75rem var(--font-sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.stage-label span { display: none; }
.stage-label span:first-child { display: inline; }
/* Stage picker: radio buttons + labels, so tapping a stage works without JavaScript. */
.stage-picker { display: flex; gap: 6px; }
.stage-picker label {
  flex: 1; padding: 10px 0; border-radius: 999px; border: 1px solid var(--line-strong); cursor: pointer; text-align: center;
  font: 700 0.85rem var(--font-sans); color: var(--light-muted); transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.stage-picker label:hover { border-color: var(--gold); color: var(--gold); }
.stage-picker input:checked + label { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.stage-picker input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 3px; }
.stage-ticks { margin-top: 8px; }
.stage-ticks { display: flex; justify-content: space-between; font: 700 0.68rem var(--font-sans); color: var(--light-muted); padding: 0 4px; }
.stage-buttons { display: flex; gap: 10px; margin-top: 20px; }

/* ---------- Area before / after compare ---------- */
.compare-wrap { display: grid; gap: 22px; }
.compare {
  --pos: 50%; position: relative; overflow: hidden; border-radius: 22px; aspect-ratio: 16 / 10; max-height: 640px; width: 100%;
  border: 1px solid rgba(232, 177, 63, 0.28); background: radial-gradient(60% 70% at 50% 50%, var(--plum-800), var(--studio)); user-select: none;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; pointer-events: none; }
.compare.is-wide img { object-fit: contain; }
.compare .before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; background: var(--gold); transform: translateX(-1px); pointer-events: none; }
.compare-handle::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%; background: var(--gold); color: var(--ink); font: 700 1rem var(--font-sans); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.compare-tag {
  position: absolute; top: 16px; padding: 6px 12px; border-radius: 999px; background: rgba(28, 18, 40, 0.78);
  font: 700 0.7rem var(--font-sans); letter-spacing: 0.16em; text-transform: uppercase; pointer-events: none;
}
.compare-tag--before { left: 16px; }
.compare-tag--after { right: 16px; color: var(--gold); }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }

/* ---------- Characters ---------- */
.duo { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(24px, 4vw, 56px); }
@media (max-width: 760px) { .duo { grid-template-columns: 1fr; } }
.hero-char { text-align: center; }
.hero-char .arch { aspect-ratio: 0.92; max-width: 420px; margin: 0 auto; background: radial-gradient(70% 60% at 50% 45%, rgba(148, 102, 189, 0.55), var(--deep) 78%); }
.arch-figure { position: absolute; inset: 8% 0 0; background-position: 50% 100%; }
.char-name { margin-top: 26px; font: 700 clamp(1.6rem, 3vw, 2.2rem) var(--font-serif); letter-spacing: 0.12em; color: var(--gold); }
.char-tag { margin: 8px auto 0; font: 400 1.05rem/1.5 var(--font-story); max-width: 30ch; text-wrap: balance; }
.char-bio { margin: 16px auto 0; max-width: 42ch; color: var(--light-muted); font-size: 0.98rem; }
.villager-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.search {
  width: min(100%, 360px); padding: 13px 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(28, 18, 40, 0.6); color: var(--light); font: 400 0.95rem var(--font-sans);
}
.search::placeholder { color: var(--light-muted); }
.search:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 177, 63, 0.18); }
.villager-count { font: 700 0.75rem var(--font-sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--light-muted); }
/* Column counts that divide the 48 villagers evenly at every width. */
.villagers { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
@media (max-width: 1180px) { .villagers { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 800px) { .villagers { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (max-width: 540px) { .villagers { grid-template-columns: repeat(2, 1fr); } }
.villager {
  display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(103, 65, 149, 0.35), rgba(36, 19, 56, 0.85)); transition: transform 0.3s var(--ease), border-color 0.3s;
}
.villager:hover { transform: translateY(-4px); border-color: rgba(232, 177, 63, 0.45); }
.villager-art { aspect-ratio: 1024 / 1100; display: grid; place-items: end center; overflow: hidden; background: radial-gradient(60% 60% at 50% 55%, rgba(217, 196, 236, 0.35), transparent 70%); }
.villager-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.villager-body { padding: 16px 18px 20px; }
.villager h3 { font: 700 1rem/1.25 var(--font-serif); color: var(--gold); letter-spacing: 0.03em; }
.villager p { margin: 8px 0 0; font: 400 0.88rem/1.5 var(--font-story); color: var(--light); }
.villager p::before { content: "“"; color: var(--gold); }
.villager p::after { content: "”"; color: var(--gold); }
.empty-note { padding: 48px 20px; text-align: center; color: var(--light-muted); border: 1px dashed var(--line-strong); border-radius: 18px; }

/* ---------- Studio ---------- */
.studio-section { overflow: hidden; isolation: isolate; background: radial-gradient(40% 70% at 74% 50%, rgba(103, 65, 149, 0.35), transparent 70%); }
.studio-section .sky-stars { position: absolute; inset: -10% 0; }
.studio-mark { position: relative; }
.orbit { position: absolute; left: 50%; top: 40%; width: min(120%, 480px); aspect-ratio: 1; translate: -50% -50%; z-index: -1; pointer-events: none; }
.orbit span { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(232, 177, 63, 0.22); animation: orbit 26s linear infinite; }
.orbit span::after { content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px var(--gold); }
.orbit span:nth-child(2) { inset: 14%; border-color: rgba(217, 196, 236, 0.18); border-style: dashed; animation-duration: 18s; animation-direction: reverse; }
.orbit span:nth-child(2)::after { background: var(--lavender); box-shadow: 0 0 12px var(--lavender); width: 6px; height: 6px; }
.orbit span:nth-child(3) { inset: 28%; border: 0; background: radial-gradient(circle, rgba(148, 102, 189, 0.45), transparent 70%); animation: glow 5s ease-in-out infinite; }
.orbit span:nth-child(3)::after { display: none; }
@keyframes orbit { to { rotate: 360deg; } }
@keyframes glow { 0%, 100% { opacity: 0.6; scale: 1; } 50% { opacity: 1; scale: 1.08; } }
.studio-band { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
@media (max-width: 860px) { .studio-band { grid-template-columns: 1fr; } }
.studio-band p { max-width: 44ch; font-size: 1.05rem; }
.studio-mark { display: grid; justify-items: center; gap: 24px; }
.studio-mark img { width: min(100%, 340px); }
.values { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
@media (max-width: 860px) { .values { grid-template-columns: 1fr; } }
.value { padding: 36px 32px 8px 0; }
.value + .value { padding-left: 32px; border-left: 1px solid var(--line); }
@media (max-width: 860px) { .value + .value { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); } }
.value h3 { font: 700 clamp(1.6rem, 2.6vw, 2.2rem) var(--font-sans); letter-spacing: -0.04em; color: var(--parchment); margin-bottom: 14px; }
.value p { color: var(--light-muted); max-width: 34ch; }
.cards-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 760px) { .cards-2 { grid-template-columns: 1fr; } }
.work-card {
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px;
  min-height: 420px; padding: 32px; border-radius: 24px; border: 1px solid var(--line); transition: transform 0.3s var(--ease), border-color 0.3s;
}
.work-card:hover { transform: translateY(-4px); border-color: rgba(232, 177, 63, 0.45); }
.work-card-art { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: 50% 35%; }
.work-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(28, 18, 40, 0.95) 30%, rgba(28, 18, 40, 0.2)); }
.work-card h3 { font: 700 clamp(1.6rem, 3vw, 2.2rem) var(--font-sans); letter-spacing: -0.04em; }
.work-card p { margin: 0; color: var(--light); max-width: 40ch; }
.work-card--wraps { background: radial-gradient(70% 80% at 70% 30%, rgba(148, 102, 189, 0.45), var(--deep)); }
.work-card--wraps svg { position: absolute; inset: 10% 0 auto; width: 100%; height: 55%; z-index: -1; }

/* Ident video (a native <details>, so it opens without JavaScript) */
.ident-btn { display: inline-flex; align-items: center; gap: 12px; padding: 12px 20px; border: 1px solid var(--line-strong); border-radius: 4px; background: none; cursor: pointer; font: 700 0.9rem var(--font-sans); list-style: none; }
.ident-btn::-webkit-details-marker { display: none; }
.ident-btn:hover { border-color: var(--gold); color: var(--gold); }
.ident-btn::before { content: "▷"; color: var(--gold); }
.ident { display: grid; justify-items: center; }
.ident[open] .ident-btn::before { content: "✕"; }
.ident video { width: min(100%, 300px); margin-top: 18px; border-radius: 14px; border: 1px solid var(--line-strong); background: #000; }

/* ---------- Under Wraps ---------- */
.wraps { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
@media (max-width: 860px) { .wraps { grid-template-columns: 1fr; } }
.wraps .studio-title { color: var(--lavender); }
.wraps-note { margin-top: 28px; font: 700 0.85rem var(--font-sans); color: var(--gold); }
.rhythm { position: relative; }
.rhythm svg { width: 100%; height: auto; overflow: visible; }
.tuner text { font: 700 11px var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; fill: var(--light-muted); transition: fill 0.2s; }
.tuner .knob { transition: fill 0.2s; }
.tuner .is-active .knob { fill: var(--gold-300); }
.tuner .is-active text { fill: var(--gold); }
.tuner .hand { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35)); }
.rhythm-label { font: 700 0.68rem var(--font-sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--light-muted); }
.rhythm-label--top { text-align: center; margin-bottom: 8px; }
.rhythm-label--bottom { text-align: right; margin-top: 8px; }
.rhythm::before { content: ""; position: absolute; inset: 10% 20%; z-index: -1; background: radial-gradient(circle, rgba(148, 102, 189, 0.4), transparent 70%); filter: blur(10px); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 760px) { .trio { grid-template-columns: 1fr; } }
.trio div { padding: 28px; border-radius: 18px; border: 1px solid var(--line); background: rgba(103, 65, 149, 0.16); }
.trio h3 { font: 700 1.5rem var(--font-sans); letter-spacing: -0.03em; color: var(--lavender); margin-bottom: 10px; }
.trio p { margin: 0; color: var(--light-muted); }

/* ---------- AI use ---------- */
.ai-intro { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.ai-intro-copy { min-width: 0; }
.ai-intro .studio-title { font-size: clamp(2.8rem, 5.5vw, 5rem); line-height: 1; }
.ai-intro .muted { max-width: 46ch; }
.ai-world { margin: 0; min-width: 0; }
.ai-world-art {
  position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 1.08;
  border: 1px solid rgba(232, 177, 63, 0.3); border-radius: 50% 50% 24px 24px;
  background: var(--deep);
}
.ai-world-art .layer { position: absolute; }
.ai-world-art { background: radial-gradient(60% 55% at 50% 62%, rgba(148, 102, 189, 0.55), transparent 70%), radial-gradient(90% 80% at 50% 0%, var(--plum-800), var(--deep) 70%); }
.ai-world-art::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: 12%; height: 10%; border-radius: 50%; background: rgba(12, 6, 20, 0.55); filter: blur(14px); z-index: -1; }
.ai-world-bench { width: 104%; left: -2%; bottom: 6%; filter: drop-shadow(0 22px 26px rgba(12, 6, 20, 0.55)); animation: bob 8s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.ai-world figcaption { margin-top: 20px; text-align: center; font: 700 1.05rem var(--font-sans); color: var(--parchment); }
.ai-world figcaption span { display: block; margin-top: 8px; font: 700 0.68rem/1.6 var(--font-sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--light-muted); }
.ai-practice .studio-title { color: var(--parchment); }
.ai-practice .head-note { color: var(--light-muted); }
.ai-workflow { border-top: 1px solid var(--line); }
.ai-workflow li { display: grid; grid-template-columns: 56px 1.3fr 1fr; gap: 32px; padding: 36px 0; border-bottom: 1px solid var(--line); }
.ai-step { font: 700 0.8rem/1.5 var(--font-sans); letter-spacing: 0.16em; color: var(--lavender); padding-top: 6px; }
.ai-workflow h3 { font: 700 clamp(1.55rem, 2.5vw, 2rem)/1.15 var(--font-sans); letter-spacing: -0.035em; margin-bottom: 16px; }
.ai-workflow p { margin: 0; color: var(--light-muted); max-width: 44ch; }
.ai-human-note { border-left: 1px solid var(--line); padding-left: 32px; }
.ai-human-note strong { display: block; margin-bottom: 12px; font: 700 0.72rem/1.5 var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.ai-closing { background: radial-gradient(50% 100% at 50% 100%, rgba(103, 65, 149, 0.25), transparent); }
@media (max-width: 860px) {
  .ai-intro { grid-template-columns: 1fr; }
  .ai-world { width: min(100%, 520px); margin: 0 auto; }
  .ai-workflow li { grid-template-columns: 32px 1fr; gap: 16px; }
  .ai-human-note { grid-column: 2; padding-left: 16px; }
}

/* ---------- Layout helpers ---------- */
.studio-title--md { font-size: clamp(2.2rem, 4.6vw, 4rem); }
.lead--spaced { margin-top: 28px; }
.head-note { max-width: 42ch; margin: 0; }
.duo--spaced { margin-top: clamp(40px, 5vw, 64px); }
.actions--center { justify-content: center; }
.deep .caption-note, .section:not(.parch) .caption-note { color: var(--light-muted); }
.section .tier-detail .caption-note { color: var(--ink-muted); }
.elspeth { margin: clamp(40px, 5vw, 64px) auto 0; max-width: 52ch; text-align: center; font: 400 1rem/1.6 var(--font-story); color: var(--light-muted); }
.elspeth strong { display: block; margin-bottom: 6px; font: 700 0.75rem var(--font-sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }

/* Arch with the layered Mossbrook scene (home hero) */
.arch--scene { aspect-ratio: 0.86; }
.arch--scene .layer { position: absolute; }
.arch--scene .as-scene { inset: -7% -4%; background-size: cover; background-position: 50% 62%; }
.arch--scene .as-vine-l { left: -2%; top: -2%; width: 62%; height: auto; animation: sway 10s ease-in-out infinite; transform-origin: top left; }
.arch--scene .as-vine-r { right: -2%; top: -2%; width: 62%; height: auto; animation: sway 12s ease-in-out infinite reverse; transform-origin: top right; }

/* Places (area before/after picker) */
.places { display: grid; grid-template-columns: 1fr minmax(280px, 460px); gap: clamp(32px, 6vw, 96px); align-items: center; }
@media (max-width: 860px) { .places { grid-template-columns: 1fr; } }
.place-list { display: grid; gap: 6px; counter-reset: place; }
.place {
  display: flex; align-items: baseline; gap: 18px; width: 100%; padding: 16px 4px; cursor: pointer; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--light-muted);
  font: 700 clamp(1.15rem, 2vw, 1.6rem)/1.2 var(--font-serif); text-transform: uppercase; transition: color 0.2s, padding 0.25s var(--ease);
}
.place span { font: 700 0.72rem var(--font-sans); letter-spacing: 0.16em; color: var(--lavender); }
.place:hover { color: var(--light); }
.place-list input:checked + .place { color: var(--gold); padding-left: 14px; }
.place-list input:focus-visible + .place { outline: 2px solid var(--gold); outline-offset: 2px; }
.places .compare { aspect-ratio: 520 / 924; max-height: none; max-width: 460px; margin: 0 auto; }
/* Room picker: radio buttons pick which room shows, so it works without JavaScript. */
.compare-stack > .compare { display: none; }
.compare-stack > .compare:first-child { display: block; }
html:not(.js) .compare input { display: none; }

/* ---------- Page heads ---------- */
.page-head { position: relative; padding: calc(var(--header-h) + clamp(56px, 8vw, 110px)) 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.page-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(45% 70% at 80% 0%, rgba(103, 65, 149, 0.5), transparent 70%), radial-gradient(30% 50% at 0% 100%, rgba(232, 177, 63, 0.06), transparent 70%);
}
.page-head .lead { margin-top: 26px; }
.center { text-align: center; }
.center .lead, .center .mb-body { margin-left: auto; margin-right: auto; }

/* ---------- Night sky (Studio hero) and star fields ---------- */
.page-head--sky { isolation: isolate; min-height: min(100svh, 920px); display: flex; align-items: center; }
.page-head--sky::before { z-index: -2; background: linear-gradient(90deg, rgba(28, 18, 40, 0.92) 0%, rgba(28, 18, 40, 0.6) 40%, transparent 70%), linear-gradient(0deg, var(--studio), transparent 30%); }
.page-head--sky > .layer, .sky-stars { position: absolute; pointer-events: none; }
.sky-bg { inset: -12% 0; z-index: -3; background-size: cover; background-position: 60% 40%; }
.page-head--sky .studio-mark img { filter: drop-shadow(0 0 40px rgba(217, 196, 236, 0.35)); }
/* Two layers of CSS stars at different depths; tiny gradients, no images. */
.sky-stars { inset: -10% 0; z-index: -1; opacity: 0.9; background-repeat: repeat; will-change: transform, opacity; }
.sky-stars--far { background-image: url("/assets/media/live/stars-far.db67df1a76.webp"); background-size: 340px 300px; animation: twinkle 6s ease-in-out infinite; }
.sky-stars--near { background-image: url("/assets/media/live/stars-near.9eb5da02ed.webp"); background-size: 620px 520px; animation: twinkle 9s ease-in-out infinite reverse; }
.ai-world-art .sky-stars { z-index: 0; }
@keyframes twinkle { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.45; } }

/* ---------- CTA strip ---------- */
.cta-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(28px, 4vw, 48px);
  border-radius: 24px; border: 1px solid rgba(232, 177, 63, 0.3); background: radial-gradient(80% 140% at 100% 0%, rgba(103, 65, 149, 0.5), transparent 60%), var(--deep);
}
.cta-strip .mb-title { max-width: 22ch; }
.cta-strip--motes { position: relative; overflow: hidden; isolation: isolate; }
.cta-strip--motes > :not(.motes) { position: relative; }
.motes { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
html[data-motion="off"] .motes { opacity: 0.5; }
.cta-side { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 32px; }
.cta-faces { display: flex; padding-left: 18px; }
.cta-faces li {
  width: 76px; height: 76px; margin-left: -18px; overflow: hidden; border-radius: 50%; border: 2px solid var(--gold-600);
  background: radial-gradient(70% 70% at 50% 40%, var(--plum-700), var(--deep)); box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.7);
  transition: transform 0.3s var(--ease);
}
.cta-faces li:nth-child(even) { transform: translateY(8px); }
.cta-strip:hover .cta-faces li { transform: translateY(-4px); }
.cta-faces img { width: 100%; height: 118%; object-fit: cover; object-position: 50% 0; }
@media (max-width: 560px) { .cta-faces li { width: 60px; height: 60px; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: clamp(56px, 7vw, 88px) 0 28px; background: var(--studio); }
.footer-top { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 40px; align-items: start; }
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 22px; }
.footer-brand img { width: 46px; }
.footer-brand strong { display: block; font: 700 1rem var(--font-sans); letter-spacing: 0.3em; }
.footer-brand span { color: var(--light-muted); font-size: 0.95rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.footer-nav a { font: 700 0.9rem var(--font-sans); color: var(--light-muted); }
.footer-nav a:hover { color: var(--gold); }
.back-top { font: 700 0.9rem var(--font-sans); white-space: nowrap; }
.back-top::after { content: " ↑"; color: var(--gold); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line);
  font: 700 0.72rem var(--font-sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--light-muted);
}
.footer-legal { display: flex; gap: 20px; }
.footer-legal a:hover { color: var(--gold); }

/* ---------- Legal pages (Privacy, Terms) ---------- */
.legal-head { max-width: calc(72ch + 2 * var(--gutter)); }
.legal .container { max-width: calc(72ch + 2 * var(--gutter)); }
.legal-body { color: var(--light); font-size: 1.02rem; line-height: 1.7; }
.legal-body h2 { margin: 2.4em 0 0.7em; font: 700 clamp(1.15rem, 1.6vw, 1.35rem)/1.25 var(--font-serif); color: var(--lavender); }
.legal-body h2:first-child { margin-top: 0; }
.legal-body ul { margin: 0 0 1em; padding-left: 1.2em; list-style: disc; }
.legal-body li { margin-bottom: 0.6em; }
.legal-body li::marker { color: var(--gold); }
.legal-body strong { color: var(--light); }
.legal-body a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.legal-body a:hover { color: var(--lavender); }
.legal-see { margin-top: 3em; padding-top: 1.4em; border-top: 1px solid var(--line); color: var(--light-muted); }

/* ---------- Not found ---------- */
.not-found { min-height: 80vh; display: grid; place-items: center; text-align: center; padding: calc(var(--header-h) + 40px) var(--gutter) 60px; }
.not-found p { color: var(--light-muted); margin: 18px auto 28px; max-width: 40ch; }

/* ---------- Single-file build: pages switch with :target ----------
   Each page is a <div class="page" id="...">; Home is last and shows unless another page
   (or something inside one) is the link target. Pure CSS, so it works in iPhone previews. */
html:has(main > .page) { scroll-behavior: auto; }
main > .page { display: none; }
main > #home, main > .page:target, main > .page:has(:target) { display: block; }
main > .page:target ~ #home { display: none; }
main:has(> .page:not(#home):target, > .page:not(#home) :target) > #home { display: none; }
body:has(#mossbrook:target, #mossbrook :target) .nav a[href="#mossbrook"],
body:has(#characters:target, #characters :target) .nav a[href="#characters"],
body:has(#studio:target, #studio :target) .nav a[href="#studio"],
body:has(#under-wraps:target, #under-wraps :target) .nav a[href="#under-wraps"],
body:has(#ai-use:target, #ai-use :target) .nav a[href="#ai-use"] { color: var(--gold); border-color: var(--gold); }

/* ---------- Without JavaScript (e.g. iPhone Files/Mail previews) ---------- */
html:not(.js) [data-js-only], html:not(.js) [data-motion-toggle] { display: none !important; }
@media (max-width: 900px) {
  html:not(.js) { --header-h: 120px; }
  html:not(.js) .menu-toggle { display: none; }
  html:not(.js) .brand img { height: 30px; }
  html:not(.js) .site-header { height: auto; min-height: var(--header-h); padding: 8px 0; }
  html:not(.js) .site-header .container { flex-wrap: wrap; row-gap: 2px; }
  html:not(.js) .nav {
    position: static; width: 100%; flex-direction: row; flex-wrap: wrap; gap: 0 18px; padding: 0 0 4px;
    opacity: 1; visibility: visible; transform: none; background: none; border: 0;
  }
  html:not(.js) .nav a { padding: 6px 0; border-bottom: 1px solid transparent; font-size: 0.95rem; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  html:not(.js) *, html:not(.js) *::before, html:not(.js) *::after { animation: none !important; transition: none !important; }
}

/* ---------- Reveal + motion ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
html[data-motion="off"] { scroll-behavior: auto; }
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { animation: none !important; transition: none !important; }
html[data-motion="off"] .reveal { opacity: 1 !important; transform: none !important; }
html[data-motion="off"] .mini-restore .after { opacity: 1; clip-path: none; }
html[data-motion="off"] .merge-demo .result { opacity: 1; transform: none; }
