/* Layout and components. Colors come only from theme.css tokens.
 * Contrast note: muted and terracotta measure ~4.4:1 on cream, below the 4.5:1 needed for small
 * text, so small text stays ink; muted/terracotta are for lines, shapes and large bold text. */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
/* Snap only on the full-screen home page. */
html.snap { scroll-behavior: smooth; scroll-snap-type: y proximity; }
@media (min-width: 1024px) {
  html.snap { scroll-snap-type: y mandatory; }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-weight: var(--weight-body);
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a { color: inherit; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
p, h1, h2, figure { margin: 0; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--color-ink);
  color: var(--color-bg);
}
.skip:focus { top: 8px; }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--nav-height);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg-veil);
  -webkit-backdrop-filter: blur(var(--nav-blur));
  backdrop-filter: blur(var(--nav-blur));
  transition: background-color 200ms ease;
}
.nav.is-clear {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: var(--weight-title);
  letter-spacing: var(--tracking-title);
  text-decoration: none;
}
.nav-link { text-decoration: none; font-size: 15px; }
.nav a:hover { text-decoration: underline; }

/* ---------- sections ---------- */
.section {
  min-height: 100svh;
  padding: calc(var(--nav-height) + 24px) var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 4svh, 48px);
  text-align: center;
  scroll-snap-align: start;
}
.copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
h1, h2, .sub, .line { text-wrap: balance; }

.hero-title {
  font-family: var(--font-serif);
  font-weight: var(--weight-serif);
  font-size: var(--fs-h1);
  letter-spacing: var(--tracking-title);
  line-height: 1.2;
}
.title {
  font-size: var(--fs-h2);
  font-weight: var(--weight-title);
  letter-spacing: var(--tracking-title);
  line-height: 1.2;
}
.title-xl { font-size: var(--fs-h1); }
.sub { font-size: var(--fs-sub); max-width: 40em; }
.line { font-size: var(--fs-small); }
.line::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: middle;
  background: var(--tone, var(--color-accent));
}
.meta { font-size: var(--fs-small); }

[data-accent="accent"] { --tone: var(--color-accent); }
[data-accent="accent-green"] { --tone: var(--color-accent-green); }
[data-accent="muted"] { --tone: var(--color-muted); }

/* ---------- buttons ---------- */
.actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--button-width);
  height: var(--button-height);
  padding: 0 24px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-button);
  font-weight: var(--weight-button);
  text-decoration: none;
  transition: transform 150ms ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--color-accent); color: var(--color-on-accent); }
.btn-secondary { border: 1px solid var(--color-ink); color: var(--color-ink); }
.btn:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
}
@media (max-width: 599px) {
  .actions { flex-direction: column; align-self: stretch; }
  .btn { width: 100%; }
}

/* ---------- hero ---------- */
.hero { position: relative; }
.hero > * { animation: fade-in var(--dur-hero) ease-out both; }
.hero-visual { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.hero-logo { width: clamp(88px, 13svh, 160px); height: auto; }
.mascots { display: flex; gap: 12px; }
.mascot { width: clamp(44px, 6svh, 64px); height: auto; aspect-ratio: 1; object-fit: contain; }
.cue {
  position: absolute;
  bottom: 16px;
  left: 50%;
  width: 24px;
  margin-left: -12px;
  fill: none;
  stroke: var(--color-ink);
  stroke-width: 2;
  animation: cue 2s ease-in-out infinite;
}

/* ---------- product ---------- */
.visual { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.shot {
  height: clamp(220px, 46svh, 600px);
  width: auto;
  aspect-ratio: 9 / 19.5;
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
}
.ph { background: var(--color-placeholder); }

/* ---------- story ---------- */
.village { width: min(75vw, 480px); height: auto; }
.house { fill: var(--color-ink); }
.house-soon {
  fill: none;
  stroke: var(--color-muted);
  stroke-width: 2.5;
  stroke-dasharray: 6 5;
  stroke-linejoin: round;
}

/* ---------- faq ---------- */
.faq { min-height: auto; padding-top: calc(var(--nav-height) + 64px); padding-bottom: 64px; }
.faq-list { width: min(100%, var(--page-max)); margin-top: 24px; text-align: left; }
.faq details { border-top: 1px solid var(--color-line); }
.faq details:last-child { border-bottom: 1px solid var(--color-line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 20px; }

/* ---------- next ---------- */
.soon-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 0; padding: 0; list-style: none; }
.soon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 200px;
  padding: 28px 16px;
  border: 1px dashed var(--color-muted);
  border-radius: 20px;
}
.soon-house { width: 64px; height: 64px; }

/* ---------- sub pages ---------- */
.page {
  width: min(100%, var(--page-max));
  min-height: calc(100svh - 120px);
  margin: 0 auto;
  padding: calc(var(--nav-height) + 48px) var(--gutter) 64px;
}
.page h1 {
  margin-bottom: 24px;
  font-size: var(--fs-h2);
  font-weight: var(--weight-title);
  letter-spacing: var(--tracking-title);
  line-height: 1.2;
}
.page p + p { margin-top: 16px; }
.page .actions { justify-content: flex-start; }
.lost {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.lost .actions { justify-content: center; }
.tool-list { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--color-line);
  border-radius: 20px;
}
.tool-card h2 { font-size: 24px; letter-spacing: var(--tracking-title); }
.tool-card .actions { margin-top: 8px; }
.badge { font-size: var(--fs-small); }
.badge::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: middle;
  background: var(--tone);
}
.badge-soon::before { background: none; border: 1px dashed var(--color-muted); }

/* ---------- footer ---------- */
.footer {
  padding: 32px var(--gutter);
  border-top: 1px solid var(--color-line);
  font-size: var(--fs-small);
  text-align: center;
  scroll-snap-align: end;
}

/* ---------- motion ---------- */
.will-reveal {
  opacity: 0;
  transform: translateY(var(--rise));
  transition: opacity var(--dur-section) ease-out, transform var(--dur-section) ease-out;
}
.will-reveal.is-in { opacity: 1; transform: none; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes cue { 50% { transform: translateY(8px); } }

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