/* werewolfden.com — the landing's one stylesheet (CONTRACTS.md C9). Plain CSS, no build step, no JS.
   Colours = the app's night theme (tools/brand/palette.json → lib/core/design/app_palette.dart), type = the app's
   Baloo 2 (a Latin subset made by tools/web/make_landing_assets.py), art = the app's own village layers
   (served from the Flutter build at /assets/assets/backgrounds/…) and role characters. */

@font-face {
  font-family: "WD Baloo";
  src: url("/main/fonts/baloo2-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-017F, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  /* AppPalette night* + brand */
  --bg: #0e0e3b;
  --bg-deep: #050424;
  --surface: #1c204e;
  --surface-raised: #2a305f;
  --border: #434a72;
  --fg: #eef1ff;
  --body: #c4c9e2;
  --muted: #979db8;
  --accent: #f8cb48;
  --button: #ebbe37;
  --button-top: #feda7b;
  --button-edge: #966c00;
  --on-button: #281e00;
  --secondary: #383f84;
  --secondary-top: #4d5799;
  --secondary-edge: #151749;
  --wood: #6e4019;
  --wood-light: #805534;
  --wood-dark: #462405;
  --on-wood: #fff2ea;
  --village-ink: #55d399;
  --village-fill: #3ebf87;
  --werewolf-ink: #ff9592;
  --werewolf-fill: #d32f3e;
  --clown-ink: #fdde15;
  --clown-fill: #fdde15;
  --glass: rgb(5 4 36 / 0.62);
  --glass-line: rgb(238 241 255 / 0.08);
  --font: "WD Baloo", "Baloo 2", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --page: 1120px;
  --gutter: 20px;
  --radius-card: 22px;
  --radius-button: 16px;
  --shadow-card: 0 8px 20px -6px rgb(0 0 0 / 0.25);
  --shadow-lg: 0 18px 36px -10px rgb(0 0 0 / 0.33), 0 4px 8px rgb(0 0 0 / 0.13);
  --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --badge-h: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg-deep); }
body {
  margin: 0;
  min-height: 100vh;
  font: 500 17px/1.55 var(--font);
  color: var(--body);
  background: linear-gradient(180deg, var(--bg) 0, var(--bg-deep) 100%) var(--bg-deep);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--fg); }
:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { color: var(--fg); line-height: 1.12; margin: 0; font-weight: 800; }
p { margin: 0; }
strong { color: var(--fg); font-weight: 700; }
.wrap { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }
.skip {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 999px;
  background: var(--fg); color: var(--bg-deep); font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Header ─────────────────────────────────────────────────────────────────────────────────────── */
.top { position: absolute; inset: 0 0 auto; z-index: 20; }
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--accent); font-weight: 800; font-size: 20px; letter-spacing: 0.2px; }
.brand img { width: 40px; height: 40px; }
.brand:hover { color: var(--fg); }
.nav { display: none; gap: 22px; }
.nav a, .lang a { color: var(--body); text-decoration: none; font-weight: 700; font-size: 15px; }
.nav a:hover, .lang a:hover, .lang a[aria-current="true"] { color: var(--fg); }
.lang { display: flex; align-items: center; gap: 2px; font-size: 15px; }
.lang a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 8px; }
.lang span { color: var(--border); }
.top-end { display: flex; align-items: center; gap: 18px; }

/* ── The village scene (the app's MoonlitBackdrop, frozen): layers placed on a frame that covers the box,
   bottom-aligned. The rects come from assets/backgrounds/scenes.json. ──────────────────────────────── */
.scene { position: absolute; inset: 0; z-index: -1; overflow: hidden; container-type: size; pointer-events: none; }
.scene::after { content: ""; position: absolute; inset: auto 0 0; height: 14%; background: linear-gradient(180deg, rgb(5 4 36 / 0), var(--bg-deep)); }
.frame { position: absolute; left: 50%; bottom: 0; width: 100%; transform: translateX(-50%); }
.frame > * { position: absolute; display: block; max-width: none; }
.frame img { width: 100%; height: 100%; }
.stars { left: 0; top: 0; width: 100%; height: 36%; }
/* scene:begin — written by tools/web/make_landing_assets.py from scenes.json; checked by tools/web/seo_check.py */
.frame { width: max(100cqw, 177.778cqh); aspect-ratio: 2560 / 1440; }
.l-sky { left: 0%; top: -40%; width: 100%; height: 140%; }
.l-far { left: 0%; top: 65.749%; width: 100%; height: 34.236%; }
.l-village { left: 0%; top: 48.978%; width: 100%; height: 50.972%; }
.l-front { left: 0%; top: 91.006%; width: 100%; height: 8.958%; }
@media (orientation: portrait) {
  .frame { width: max(100cqw, 46.205cqh); aspect-ratio: 1242 / 2688; }
  .l-sky { left: 0%; top: -39.993%; width: 100%; height: 139.993%; }
  .l-far { left: 0%; top: 56.787%; width: 100%; height: 18.452%; }
  .l-village { left: 0%; top: 49.68%; width: 100%; height: 50.298%; }
  .l-front { left: 0%; top: 65.225%; width: 100%; height: 16.481%; }
}
/* scene:end */

/* Twinkling stars: three tiled fields of soft dots, each fading at its own pace. */
.stars::before, .stars::after, .stars span { content: ""; position: absolute; inset: 0; display: block; }
.stars::before {
  background-image:
    radial-gradient(1.6px 1.6px at 22px 34px, #fff9e6 60%, transparent 100%),
    radial-gradient(1.2px 1.2px at 140px 80px, #fff9e6 60%, transparent 100%),
    radial-gradient(2px 2px at 90px 150px, #fff9e6 60%, transparent 100%),
    radial-gradient(1.3px 1.3px at 200px 20px, #fff9e6 60%, transparent 100%);
  background-size: 230px 190px;
}
.stars::after {
  background-image:
    radial-gradient(1.4px 1.4px at 60px 110px, #fff9e6 60%, transparent 100%),
    radial-gradient(2.2px 2.2px at 250px 60px, #fff9e6 60%, transparent 100%),
    radial-gradient(1.2px 1.2px at 170px 170px, #fff9e6 60%, transparent 100%);
  background-size: 310px 230px;
}
.stars span {
  background-image:
    radial-gradient(1.8px 1.8px at 120px 30px, #fff9e6 60%, transparent 100%),
    radial-gradient(1.3px 1.3px at 30px 200px, #fff9e6 60%, transparent 100%),
    radial-gradient(1.5px 1.5px at 330px 140px, #fff9e6 60%, transparent 100%);
  background-size: 390px 270px;
}
.stars { -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent); }

/* ── Wood sign (the app's WoodSign), toy button (ToyButton), glass (GlassPanel) ─────────────────────────── */
.sign {
  display: inline-flex; align-items: center; gap: 16px; padding: 12px 22px; border-radius: var(--radius-button);
  background: linear-gradient(180deg, var(--wood-light) 0%, var(--wood) 48%, var(--wood-light) 52%, var(--wood) 100%);
  border: 2px solid var(--wood-dark); box-shadow: var(--shadow-card);
  color: var(--on-wood); text-shadow: 0 2px 0 var(--wood-dark);
}
.sign::before, .sign::after {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--wood-dark); box-shadow: 0 0 0 1px rgb(128 85 52 / 0.6);
}
.glass { background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }

.toy {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 0 30px; border-radius: var(--radius-button);
  font: 800 20px/1.1 var(--font); color: var(--on-button); text-decoration: none; white-space: nowrap;
  background: linear-gradient(180deg, var(--button-top), var(--button));
  border: 1.5px solid rgb(150 108 0 / 0.6);
  box-shadow: 0 6px 0 var(--button-edge), 0 9px 12px rgb(0 0 0 / 0.3);
  transition: transform 0.42s var(--pop), box-shadow 0.42s var(--pop);
}
.toy::before { content: ""; position: absolute; inset: 5px 10px auto; height: 28%; border-radius: 12px; background: rgb(255 255 255 / 0.22); }
.toy svg { width: 26px; height: 26px; flex: none; }
.toy:hover { color: var(--on-button); transform: translateY(-2px) scale(1.02); }
.toy:active { transform: translateY(5px) scale(0.97); box-shadow: 0 1px 0 var(--button-edge), 0 2px 4px rgb(0 0 0 / 0.3); transition-duration: 0.08s; }
.toy:focus-visible { outline-offset: 6px; border-radius: var(--radius-button); }
.toy-small { min-height: 40px; padding: 0 16px; gap: 6px; font-size: 16px; border-radius: 12px; box-shadow: 0 4px 0 var(--button-edge), 0 6px 8px rgb(0 0 0 / 0.3); }
.toy-small::before { inset: 4px 8px auto; border-radius: 8px; }
.toy-small svg { width: 20px; height: 20px; }

/* Official store badges, hotlinked (Apple: SVG 119.66×40; Google: PNG 646×250 with its own clear space,
   cropped here to the badge so both read the same height). */
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.store { display: block; height: var(--badge-h); border-radius: 9px; overflow: hidden; transition: transform 0.42s var(--pop); }
.store:hover { transform: translateY(-2px); }
.store:active { transform: scale(0.97); transition-duration: 0.08s; }
.store img { height: 100%; width: auto; max-width: none; }
.store-apple { width: calc(var(--badge-h) * 119.664 / 40); }
.store-play { width: calc(var(--badge-h) * 564 / 168); }
.store-play img { height: calc(var(--badge-h) * 250 / 168); margin: calc(var(--badge-h) * -41 / 168) 0 0 calc(var(--badge-h) * -41 / 168); }
.store-play-ms { width: calc(var(--badge-h) * 646 / 192); }
.store-play-ms img { height: calc(var(--badge-h) * 250 / 192); margin: calc(var(--badge-h) * -29 / 192) 0 0; }
.cta { display: flex; flex-direction: column; align-items: center; gap: 18px; }

/* ── Hero ───────────────────────────────────────────────────────────────────────────────────────── */
.hero { position: relative; isolation: isolate; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--bg), var(--bg-deep)); }
.hero-body { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 76px; padding-bottom: 27vh; gap: 14px; }
.hero-logo { width: 96px; height: 96px; filter: drop-shadow(0 10px 18px rgb(0 0 0 / 0.35)); }
.hero h1 { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hero h1 .sign { font-size: clamp(30px, 8.6vw, 54px); line-height: 1.05; letter-spacing: 0.3px; }
.hero h1 .h1-sub { font-size: clamp(18px, 4.8vw, 24px); font-weight: 700; color: var(--accent); text-shadow: 0 2px 10px rgb(5 4 36 / 0.9), 0 1px 2px rgb(5 4 36 / 0.9); max-width: 26ch; }
.hero .cta { margin-top: 10px; }

/* ── Sections ───────────────────────────────────────────────────────────────────────────────────── */
.section { padding-block: 64px; }
.section h2, .closing h2 { font-size: clamp(28px, 6.4vw, 42px); color: var(--accent); text-align: center; text-wrap: balance; }
.intro { max-width: 60ch; margin: 14px auto 0; text-align: center; font-size: 18px; text-wrap: pretty; }
.grid { display: grid; gap: 16px; margin-top: 36px; padding: 0; list-style: none; }

.steps { counter-reset: step; }
.step { padding: 22px; }
.step-head { display: flex; align-items: center; gap: 12px; }
.step-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--secondary); box-shadow: inset 0 -3px 0 var(--secondary-edge); color: var(--accent); }
.step-icon svg { width: 28px; height: 28px; }
.step h3 { font-size: 22px; }
.step h3::before { counter-increment: step; content: counter(step) ". "; color: var(--accent); }
.step p { margin-top: 10px; }

.roles { margin-top: 20px; }
.role { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px 20px; overflow: hidden; }
.role-art { flex: none; width: 104px; height: 156px; object-fit: contain; filter: drop-shadow(0 10px 10px rgb(0 0 0 / 0.35)); transform-origin: 50% 100%; }
.role h3 { font-size: 24px; }
.role p { margin-top: 6px; }
.team { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; }
.team-village { color: var(--village-ink); }
.team-werewolf { color: var(--werewolf-ink); }
.team-clown { color: var(--clown-ink); }
.role-werewolf { box-shadow: var(--shadow-card), inset 0 3px 0 var(--werewolf-fill); }
.role-village { box-shadow: var(--shadow-card), inset 0 3px 0 var(--village-fill); }
.role-clown { box-shadow: var(--shadow-card), inset 0 3px 0 var(--clown-fill); }
.win { margin: 22px auto 0; max-width: 62ch; text-align: center; }

.feature { padding: 22px; }
.feature-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(180deg, var(--button-top), var(--button)); color: var(--on-button); box-shadow: inset 0 -3px 0 var(--button-edge); }
.feature-icon svg { width: 30px; height: 30px; }
.feature h3 { margin-top: 14px; font-size: 21px; }
.feature p { margin-top: 8px; }

.faq { max-width: 800px; margin: 32px auto 0; display: grid; gap: 12px; }
.faq details { padding: 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; font-size: 19px; font-weight: 700; color: var(--fg); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--secondary); color: var(--accent); font-size: 22px; line-height: 1; transition: transform 0.26s var(--pop); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 20px 18px; }

/* The closing scene: the twilight village under the last call to action. */
.closing { position: relative; isolation: isolate; overflow: hidden; min-height: 640px; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 72px var(--gutter) 300px; gap: 16px; }
.closing p { max-width: 46ch; color: var(--fg); text-shadow: 0 1px 8px rgb(5 4 36 / 0.95); }
.closing .scene::after { height: 22%; }

/* ── Footer ─────────────────────────────────────────────────────────────────────────────────────── */
.foot { background: var(--bg-deep); border-top: 1px solid var(--glass-line); padding-block: 36px 44px; font-size: 15px; }
.foot-grid { display: grid; gap: 22px; }
.foot .brand { font-size: 18px; }
.foot p { margin-top: 8px; color: var(--muted); max-width: 46ch; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--body); text-decoration: none; font-weight: 700; }
.foot a:hover { color: var(--fg); text-decoration: underline; }
.foot small { display: block; margin-top: 18px; color: var(--muted); font-size: 14px; }

/* ── Inner pages (about, privacy, terms) ───────────────────────────────────────────────────────── */
.page-hero { position: relative; isolation: isolate; overflow: hidden; padding: 112px 0 48px; text-align: center; }
.page-hero .stars { position: absolute; inset: 0 0 30%; width: auto; height: auto; z-index: -1; }
.page-hero h1 { font-size: clamp(28px, 7vw, 44px); }
.page-hero p { max-width: 60ch; margin: 18px auto 0; font-size: 18px; color: var(--fg); }
.doc { max-width: 800px; margin: 0 auto; padding: 28px 22px; }
.doc h2 { font-size: 24px; color: var(--accent); margin-top: 34px; scroll-margin-top: 24px; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { font-size: 18px; margin: 20px 0 6px; }
.doc p, .doc ul, .doc ol { margin: 10px 0 0; }
.doc ul, .doc ol { padding-inline-start: 22px; }
.doc li { margin: 4px 0; }
.doc .toc { background: rgb(238 241 255 / 0.05); border-radius: 14px; padding: 12px 18px; margin: 18px 0 8px; }
.doc .toc ol { margin: 6px 0 0; }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; }
.doc th, .doc td { text-align: start; vertical-align: top; padding: 8px; border-bottom: 1px solid rgb(238 241 255 / 0.14); }
.doc th { color: var(--fg); }
.doc .scroll { overflow-x: auto; margin-top: 10px; }
.doc .meta { color: var(--muted); }
.about-grid { display: grid; gap: 16px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin: 16px 0 0; }
.facts dt { font-size: 14px; color: var(--muted); }
.facts dd { margin: 2px 0 0; color: var(--fg); font-weight: 700; }
.cast { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin-top: 26px; }
.cast img { width: 84px; height: auto; filter: drop-shadow(0 10px 10px rgb(0 0 0 / 0.35)); transform-origin: 50% 100%; }

/* ── Wider screens ──────────────────────────────────────────────────────────────────────────────── */
@media (min-width: 640px) {
  :root { --badge-h: 54px; --gutter: 28px; }
  .cta { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .hero-logo { width: 124px; height: 124px; }
  .hero-body { padding-top: 92px; }
  .steps, .features, .roles { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .about-grid { grid-template-columns: 1fr 1fr; }
  .cast img { width: 110px; }
}
@media (min-width: 900px) {
  .nav { display: flex; }
  .hero-body { padding-bottom: 34vh; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .roles { grid-template-columns: repeat(4, 1fr); }
  .role { flex-direction: column; text-align: center; padding: 22px 20px 24px; }
  .role-art { width: 128px; height: 200px; }
  .features { grid-template-columns: repeat(3, 1fr); }
  .section { padding-block: 88px; }
}
@media (min-width: 1100px) {
  .roles { grid-template-columns: repeat(5, 1fr); }
}
@media (orientation: landscape) and (max-height: 560px) {
  .hero-body { padding-bottom: 28vh; }
  .hero-logo { width: 72px; height: 72px; }
}

/* ── Motion: gentle, CSS only, off for people who ask for less ─────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .stars::before { animation: twinkle 3.2s ease-in-out infinite alternate; }
  .stars::after { animation: twinkle 4.6s ease-in-out -1.7s infinite alternate; }
  .stars span { animation: twinkle 6.1s ease-in-out -3.1s infinite alternate; }
  .hero .l-far { animation: rise 1.5s var(--pop) 0.15s both; --from: 14%; }
  .hero .l-village { animation: rise 1.7s var(--pop) 0.25s both; --from: 22%; }
  .hero .l-front { animation: rise 1.8s var(--pop) 0.35s both; --from: 60%; }
  .hero-body > * { animation: arrive 0.7s cubic-bezier(0.2, 0, 0, 1) both; }
  .hero-body > :nth-child(2) { animation-delay: 0.08s; }
  .hero-body > :nth-child(3) { animation-delay: 0.16s; }
  .role-art, .cast img { animation: breathe 3.4s ease-in-out infinite; }
  .role:nth-child(2) .role-art, .cast img:nth-child(2) { animation-delay: -1.1s; }
  .role:nth-child(3) .role-art, .cast img:nth-child(3) { animation-delay: -2.2s; }
  .role:nth-child(4) .role-art, .cast img:nth-child(4) { animation-delay: -0.55s; }
  .role:nth-child(5) .role-art { animation-delay: -1.65s; }
  .role:nth-child(6) .role-art { animation-delay: -2.75s; }
  .role:nth-child(7) .role-art { animation-delay: -0.3s; }
  .role:nth-child(8) .role-art { animation-delay: -1.4s; }
  .role:nth-child(9) .role-art { animation-delay: -2.5s; }
  .role:nth-child(10) .role-art { animation-delay: -0.85s; }
  .role:nth-child(11) .role-art { animation-delay: -1.95s; }
  .role:nth-child(12) .role-art { animation-delay: -3.05s; }
  .role:nth-child(13) .role-art { animation-delay: -0.15s; }
  .role:nth-child(14) .role-art { animation-delay: -1.25s; }
  @supports (animation-timeline: view()) {
    .closing .l-village { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; --from: 18%; }
    .closing .l-front { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; --from: 40%; }
  }
}
@keyframes twinkle { from { opacity: 1; } to { opacity: 0.25; } }
@keyframes rise { from { transform: translateY(var(--from, 20%)); } to { transform: translateY(0); } }
@keyframes arrive { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.03); } }
