/* Scratchy Us landing — tokens from lib/core/constants/app_colors.dart */
:root {
  --bg: #EAE3D8;
  --surface: #FFFDFA;
  --field: #F1ECE4;
  --ink: #22201E;
  --muted: #6E675F;
  --line: #E4DED4;
  --ghost: #DCD5CA;
  --accent: #9E3B52;
  --accent-deep: #7C2E41;
  --accent-soft: #F3E4E6;
  --on-accent: #FFFFFF;
  --partner: #41647C;
  --partner-deep: #2F4C60;
  --partner-soft: #E2E8EC;
  --gold: #C79A4B;
  --gold-soft: #FFF8E5;
  --foil: #C9C4BB;
  --land: #A39C93;
  --ocean: #DFE6E8;
  --radius-card: 24px;
  --radius-btn: 16px;
  --radius-chip: 20px;
  --radius-pill: 999px;
  --shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
  --font: Pretendard, "Pretendard JP", "Segoe UI", system-ui, sans-serif;
  --nav-h: 64px;
  --max: 1120px;
  --space-s: 8px;
  --space-m: 16px;
  --space-l: 24px;
  --space-xl: 40px;
  --space-xxl: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 600;
}

.skip-link:focus { top: 12px; }

.caption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.section-lead {
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: 32px;
  font-size: 1.05rem;
}

section { padding: var(--space-xxl) 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
  user-select: none;
}

.btn:hover:not([aria-disabled="true"]) {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover:not([aria-disabled="true"]) { background: var(--accent-deep); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover:not([aria-disabled="true"]) {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 14px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, backdrop-filter 160ms ease;
}

.site-header.is-scrolled {
  background: rgba(247, 244, 239, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}

.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links {
  display: flex;
  gap: 18px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.nav-links a:hover { color: var(--ink); }

/* Hero */
.hero {
  padding: 48px 0 64px;
}

.hero-copy {
  max-width: 40rem;
  margin-bottom: 32px;
}

.hero-tag {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.125rem;
  max-width: 42ch;
  margin-bottom: 0;
}

.hero-map {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  touch-action: pan-y;
}

.hero-scratch-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(ellipse at center, var(--gold-soft) 0%, var(--surface) 64%);
}

.hero-logo {
  width: clamp(104px, 28%, 200px);
  height: auto;
  border-radius: 22%;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
  user-select: none;
}

.hero-foil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: grab;
}

.hero-map.is-scratching .hero-foil { cursor: grabbing; }
.hero-map.is-open .hero-foil { cursor: default; }

.hero-map-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 14px;
  background: rgba(255, 253, 250, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  pointer-events: none;
  box-shadow: var(--shadow);
  transition: opacity 400ms ease;
}

.hero-map-hint.is-fading { opacity: 0; }

.no-js .hero-foil,
.no-js .hero-map-hint { display: none; }

.hero-cta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-avail {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* Screenshot rail */
.shot-rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 8px max(16px, calc((100% - var(--max)) / 2 + 16px)) 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--ghost) transparent;
}

.shot-rail:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.shot {
  flex: 0 0 auto;
  width: min(220px, 58vw);
  scroll-snap-align: start;
  margin: 0;
}

.shot img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.shot figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Postcard grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px 16px;
}

.postcard {
  margin: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.postcard:nth-child(odd) { transform: rotate(-1.4deg); }
.postcard:nth-child(even) { transform: rotate(1.1deg); }
.postcard:nth-child(3n) { transform: rotate(0.6deg); }

.postcard img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}

/* How it works */
.how-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.how-card .step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 16px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 700;
}

.how-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.how-card p { color: var(--muted); font-size: 0.95rem; }

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.feature-card p { color: var(--muted); font-size: 0.95rem; }

/* Private */
.private {
  background: var(--accent-soft);
}

.private .section-title { margin-bottom: 12px; }

.private .section-lead {
  max-width: 58ch;
  margin-bottom: 24px;
  color: var(--accent-deep);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 10px;
  max-width: 720px;
}

.faq-list details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 4px 20px;
  box-shadow: var(--shadow);
}

.faq-list summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: "+";
  float: right;
  color: var(--muted);
  font-weight: 500;
}

.faq-list details[open] summary::after { content: "–"; }

.faq-list details p {
  color: var(--muted);
  padding-bottom: 16px;
}

.faq-list a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Final CTA */
.final-cta {
  text-align: center;
  padding-block: 96px 80px;
}

.final-cta h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  max-width: 22ch;
  margin: 0 auto 24px;
}

.final-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 40px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.footer-brand img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.footer-links a:hover { color: var(--accent-deep); }

.footer-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  max-width: 62ch;
}

/* Reveal — gated on .reveal-on so a missing site.js does not hide copy */
.reveal-on .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.reveal-on .reveal.is-in {
  opacity: 1;
  transform: none;
}

.reveal-on .reveal-delay-1 { transition-delay: 60ms; }
.reveal-on .reveal-delay-2 { transition-delay: 120ms; }
.reveal-on .reveal-delay-3 { transition-delay: 180ms; }
.reveal-on .reveal-delay-4 { transition-delay: 240ms; }

/* Legal */
.page-legal .legal-wrap {
  width: min(100% - 32px, 720px);
  margin-inline: auto;
  padding: 40px 0 72px;
}

.page-legal .legal-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.page-legal .legal-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 12px 0 14px;
  line-height: 1.25;
}

.page-legal .legal-meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.page-legal .legal-disclaimer {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--field);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.page-legal .legal-toc {
  margin: 0 0 36px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.page-legal .legal-toc h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.page-legal .legal-toc ol {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.page-legal .legal-toc a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-legal .legal-toc a:hover { color: var(--accent-deep); }

.page-legal .legal-section {
  margin-bottom: 32px;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.page-legal .legal-section h2 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--accent-deep);
}

.page-legal .legal-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 16px 0 8px;
}

.page-legal .legal-section p,
.page-legal .legal-section li {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
}

.page-legal .legal-section p { margin-bottom: 10px; }

.page-legal .legal-section ul,
.page-legal .legal-section ol {
  margin: 0 0 12px;
  padding-left: 1.25rem;
}

.page-legal .legal-section li { margin-bottom: 6px; }

.page-legal .legal-section a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-legal .table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0 16px;
}

.page-legal .data-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
}

.page-legal .data-table th,
.page-legal .data-table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.page-legal .data-table th {
  background: var(--field);
  font-size: 13px;
  font-weight: 600;
}

.page-legal .data-table td { background: var(--surface); }

.page-error {
  text-align: center;
  padding: 96px 0 120px;
}

.page-error h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 12px 0 16px;
}

.page-error p {
  color: var(--muted);
  margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 1023px) {
  .how-grid,
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .nav-links { display: none; }

  .hero { padding-top: 24px; }

  .how-grid,
  .features-grid {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .shot {
    width: min(200px, 62vw);
  }

  section { padding: 64px 0; }
  .final-cta { padding-block: 72px 64px; }
}

@media (max-width: 640px) {
  .hero-map { aspect-ratio: 3 / 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal-on .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn, .card, .postcard { transition: none; }

  .postcard:nth-child(odd),
  .postcard:nth-child(even),
  .postcard:nth-child(3n) {
    transform: none;
  }

  .hero-foil,
  .hero-map-hint { display: none; }
}
