/* DM Sans - pragmatic geometric sans
   Variable font: 100-1000 weight range */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("../assets/fonts/dm-sans-latin.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: italic;
  font-weight: 100 1000;
  font-display: swap;
  src: url("../assets/fonts/dm-sans-italic-latin.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans Fallback";
  font-style: normal;
  src: local("Arial");
  size-adjust: 106.85%;
  ascent-override: 92.84%;
  descent-override: 29.01%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "DM Sans Fallback";
  font-style: italic;
  src: local("Arial Italic"), local("Arial");
  size-adjust: 106.85%;
  ascent-override: 92.84%;
  descent-override: 29.01%;
  line-gap-override: 0%;
}

/* ═══════════════════════════════════════════
   BASE - Design tokens, reset, utilities
   Ink and Ember dark landing system
   ═══════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  interpolate-size: allow-keywords;
  /* Surfaces */
  --bg:          #0a0908;
  --bg-deep:     #0a0908;
  --bg-base:     #0f0e0c;
  --bg-elevated: #171512;
  --bg-raised:   #1e1b17;
  --bg-hover:    #252219;
  /* Borders */
  --border:      rgba(255 255 255 / .06);
  --border-lit:  rgba(255 255 255 / .10);
  /* Text */
  --fg:          #ede8df;
  --fg-muted:    #9a9288;
  --fg-dim:      #8a8174;
  /* Accent - ember (primary) */
  --accent:      #c9a96e;
  --accent-hover: #d4b67a;
  --accent-glow: rgba(201 169 110 / .15);
  --accent-fg:   #0a0908;
  /* Accent - sage (growth, life) */
  --sage:        #7db8a0;
  --sage-glow:   rgba(125 184 160 / .08);
  /* Accent - sakura (warmth) */
  --sakura:      #d4a0a0;
  --sakura-glow: rgba(212 160 160 / .06);
  /* Accent - warm coral (energy) */
  --warm:        #e8a87c;
  --warm-glow:   rgba(232 168 124 / .08);
  /* Accent - red (pitch) */
  --red:         #d32f2f;
  /* Glass */
  --glass-blur:   16px;
  --glass-bg:     rgba(15 13 10 / .55);
  --glass-border: rgba(201 169 110 / .08);
  --glass-shadow: 0 8px 40px rgba(0 0 0 / .4);
  --glass-glow:   0 0 60px rgba(201 169 110 / .03);
  /* Radii */
  --r-sm:  6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  /* Spacing */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 32px;
  --space-lg: 64px;
  --space-xl: 120px;
  --space-2xl: 120px;
  /* Easing */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-out: cubic-bezier(.33, 1, .68, 1);
  /* Typography */
  --font-serif: "DM Sans", "DM Sans Fallback", system-ui, -apple-system, sans-serif;
  --font-sans:  "DM Sans", "DM Sans Fallback", system-ui, -apple-system, sans-serif;
  --font-jp-serif: "Yu Mincho", "Hiragino Mincho ProN", "BIZ UDPMincho", "MS PMincho", serif;
  /* Container */
  --contain: 1120px;
  --contain-narrow: 800px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 220;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(12 11 9 / .96);
  color: var(--fg);
  border: 1px solid var(--border-lit);
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

body {
  position: relative;
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

body.public-page {
  display: flex;
  flex-direction: column;
}

body.public-page > main {
  flex: 1 0 auto;
  min-height: 100svh;
}

body.public-page .s-footer {
  margin-top: 0;
}

body.nav-open > main {
  margin-top: var(--mobile-nav-offset, 0px);
}

/* Lift all page content above fixed canvas layers */
main, .s-footer, footer {
  position: relative;
  z-index: 5;
}

#kanji-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

section[id],
[data-section],
.faq-section,
.gal-section {
  scroll-margin-top: 112px;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(2.8rem, 8vw, 5.5rem); }
h2 { font-size: clamp(2rem, 5.5vw, 3.5rem); }
h3 { font-size: clamp(1.1rem, 2.2vw, 1.4rem); }
.serif { font-family: var(--font-serif); font-weight: 700; letter-spacing: 0; }

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }

.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;
}

.nowrap { white-space: nowrap; }

.icon {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

.icon-mask {
  background-color: currentColor;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
  mask-size: contain;
  -webkit-mask-size: contain;
}

.icon-menu { mask-image: url("../assets/icons/menu.svg"); -webkit-mask-image: url("../assets/icons/menu.svg"); }
.icon-x { mask-image: url("../assets/icons/x.svg"); -webkit-mask-image: url("../assets/icons/x.svg"); }
.icon-file-input { mask-image: url("../assets/icons/file-input.svg"); -webkit-mask-image: url("../assets/icons/file-input.svg"); }
.icon-scan-text { mask-image: url("../assets/icons/scan-text.svg"); -webkit-mask-image: url("../assets/icons/scan-text.svg"); }
.icon-repeat-2 { mask-image: url("../assets/icons/repeat-2.svg"); -webkit-mask-image: url("../assets/icons/repeat-2.svg"); }
.icon-book-open-text { mask-image: url("../assets/icons/book-open-text.svg"); -webkit-mask-image: url("../assets/icons/book-open-text.svg"); }
.icon-audio-lines { mask-image: url("../assets/icons/audio-lines.svg"); -webkit-mask-image: url("../assets/icons/audio-lines.svg"); }
.icon-captions { mask-image: url("../assets/icons/captions.svg"); -webkit-mask-image: url("../assets/icons/captions.svg"); }
.icon-video { mask-image: url("../assets/icons/video.svg"); -webkit-mask-image: url("../assets/icons/video.svg"); }
.icon-library-big { mask-image: url("../assets/icons/library-big.svg"); -webkit-mask-image: url("../assets/icons/library-big.svg"); }
.icon-download { mask-image: url("../assets/icons/download.svg"); -webkit-mask-image: url("../assets/icons/download.svg"); }
.icon-circle-play { mask-image: url("../assets/icons/circle-play.svg"); -webkit-mask-image: url("../assets/icons/circle-play.svg"); }
.icon-mail { mask-image: url("../assets/icons/mail.svg"); -webkit-mask-image: url("../assets/icons/mail.svg"); }
.icon-bug { mask-image: url("../assets/icons/bug.svg"); -webkit-mask-image: url("../assets/icons/bug.svg"); }
.icon-message-circle-heart { mask-image: url("../assets/icons/message-circle-heart.svg"); -webkit-mask-image: url("../assets/icons/message-circle-heart.svg"); }
.icon-receipt-text { mask-image: url("../assets/icons/receipt-text.svg"); -webkit-mask-image: url("../assets/icons/receipt-text.svg"); }
.icon-shield-check { mask-image: url("../assets/icons/shield-check.svg"); -webkit-mask-image: url("../assets/icons/shield-check.svg"); }
.icon-image { mask-image: url("../assets/icons/image.svg"); -webkit-mask-image: url("../assets/icons/image.svg"); }
.icon-files { mask-image: url("../assets/icons/files.svg"); -webkit-mask-image: url("../assets/icons/files.svg"); }
.icon-brand-x { mask-image: url("../assets/icons/brand-x.svg"); -webkit-mask-image: url("../assets/icons/brand-x.svg"); }

.icon--sm {
  width: 0.875rem;
  height: 0.875rem;
}

.icon--lg {
  width: 1.25rem;
  height: 1.25rem;
}

.footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--fg);
  border: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}

.footer-social .icon {
  width: 14px;
  height: 14px;
}

.footer-social-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.footer-social:hover {
  color: var(--fg);
  border-color: rgba(255 255 255 / .06);
  background: rgba(255 255 255 / .03);
}

/* ── Container ── */
.contain { max-width: var(--contain); margin: 0 auto; padding: 0 24px; }

/* ── Eyebrow ── */
.eyebrow {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .25em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-sm);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}


/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--r-md);
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  border: none;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease), opacity .25s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 30px rgba(201 169 110 / .2);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-lit);
  color: var(--fg);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Grain overlay ── */
.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.18;
  transition: opacity .16s linear;
}
html.is-scrolling .grain {
  opacity: 0;
}
html.is-scrolling .video-controls,
html.is-scrolling .how-step,
html.is-scrolling .faq-item {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ── Topbar ── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 14px 24px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.topbar.scrolled {
  background: rgba(10, 9, 8, .96);
  border-bottom-color: transparent;
  box-shadow: 0 4px 30px rgba(0 0 0 / .5);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--fg);
  flex-shrink: 0;
  transition: opacity .25s var(--ease);
}
.brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  transition: filter .25s var(--ease);
}
.brand:hover img {
  filter: drop-shadow(0 0 10px rgba(201 169 110 / .18));
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  margin-right: auto;
  min-width: 0;
}
.topnav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .85rem;
  font-weight: 600;
  color: var(--fg-muted);
  transition: color .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.topnav a:hover {
  color: var(--fg);
  background: rgba(255 255 255 / .03);
  border-color: rgba(255 255 255 / .06);
}
.topnav a.active {
  color: var(--fg);
  background: transparent;
  border-color: transparent;
}

.s-footer {
  margin-top: clamp(36px, 5vw, 72px);
  padding: 32px 0 38px;
  border-top: 1px solid rgba(255 255 255 / .08);
  background:
    linear-gradient(180deg, rgba(10 9 8 / .14) 0%, rgba(10 9 8 / .56) 28%, rgba(10 9 8 / .9) 100%),
    radial-gradient(ellipse 70% 120% at 50% 0%, rgba(201 169 110 / .06), transparent 65%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.footer-brand {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.footer-copy {
  color: var(--fg-muted);
  font-size: .85rem;
}

.footer-note {
  color: rgba(239 233 224 / .56);
  font-size: .75rem;
  margin-top: 4px;
}

.footer-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 10px;
  order: 1;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  order: 2;
}

.footer-links a {
  color: var(--fg-muted);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
  transition: color .2s var(--ease);
}

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

.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: color .2s var(--ease), opacity .2s var(--ease);
}

.mobile-nav-toggle:hover {
  color: var(--accent);
}

.mobile-nav-toggle.is-open {
  color: var(--fg);
  box-shadow: none;
}

.mobile-nav {
  position: fixed;
  top: 62px;
  left: 0;
  right: 0;
  bottom: auto;
  z-index: 130;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(255 255 255 / .04);
  border-bottom: 1px solid rgba(255 255 255 / .04);
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: rgba(10 9 8 / .92);
  box-shadow: none;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform .24s var(--ease), opacity .24s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.mobile-nav.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mobile-nav-links a {
  padding: 14px 0;
  border-radius: 0;
  border: 0;
  border-bottom: 0;
  background: transparent;
  color: var(--fg-muted);
  font-size: .95rem;
  font-weight: 600;
  transition: color .2s var(--ease), opacity .2s var(--ease);
}

.mobile-nav-links a.active,
.mobile-nav-links a:hover {
  color: var(--fg);
  background: transparent;
  transform: none;
}

.mobile-nav-links a.active {
  color: var(--fg);
}

.mail-compose-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(0 0 0 / .58);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}

.mail-compose-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mail-compose {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 150;
  width: min(560px, calc(100vw - 32px));
  padding: 24px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-lit);
  background: rgba(10 9 8 / .96);
  box-shadow: 0 24px 70px rgba(0 0 0 / .52);
  transform: translate(-50%, calc(-50% + 12px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}

.mail-compose.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.mail-compose-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.mail-compose-title {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.mail-compose-email {
  color: var(--accent);
  font-size: .9rem;
}

.mail-compose-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  flex-shrink: 0;
}

.mail-compose-fields {
  display: grid;
  gap: 12px;
}

.mail-compose-field {
  display: grid;
  gap: 8px;
}

.mail-compose-label {
  color: var(--fg-muted);
  font-size: .82rem;
  font-weight: 600;
}

.mail-compose-input,
.mail-compose-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(255 255 255 / .03);
  color: var(--fg);
  font: inherit;
  padding: 14px 16px;
}

.mail-compose-input::placeholder,
.mail-compose-textarea::placeholder {
  color: var(--fg-dim);
}

.mail-compose-textarea {
  min-height: 180px;
  resize: vertical;
}

.mail-compose-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

body.mail-compose-open {
  overflow: hidden;
}

body.nav-open {
  overflow: visible;
}

/* ── Focus states (accessibility) ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .mobile-nav,
  .mail-compose,
  .mail-compose-backdrop {
    transition: none !important;
  }
}

/* Shared non-home public page shell */
.tree-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  bottom: auto;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  min-height: 100vh;
  min-height: 100lvh;
  z-index: 0;
  background: radial-gradient(125% 95% at 50% 46%, #0f0c0a 0%, #0a0908 48%, #070706 100%);
  pointer-events: none;
  overflow: hidden;
  contain: paint;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.tree-bg picture {
  display: block;
  width: 100%;
  height: 100%;
}

.tree-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
  filter: grayscale(0.35) contrast(1.2) brightness(0.45) saturate(1.3);
  opacity: 0.34;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.grain {
  display: none;
  opacity: 0;
}

body.public-page .topbar {
  position: fixed;
  z-index: 100;
}

body.public-page main {
  position: relative;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .tree-bg-img { transition: none; object-position: center 50% !important; }
}

/* FAQ page */

/* ── Hero ── */
.faq-hero {
  padding: calc(60px + var(--space-xl)) 0 clamp(26px, 4vw, 48px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.faq-hero h1 { margin: 0 auto; }

/* ── Sections ── */
.faq-section {
  padding: clamp(34px, 5vw, 64px) 0;
}


.faq-section .contain {
  max-width: var(--contain-narrow);
}

.faq-section-title {
  margin-bottom: clamp(18px, 3vw, 30px);
  color: var(--fg);
  font-size: clamp(1.45rem, 3vw, 2rem);
}

/* ── FAQ Items ── */
.faq-page .faq-item {
  position: relative;
  border-radius: var(--r-md);
  background: rgba(15 13 10 / .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  overflow: hidden;
  contain: layout;
  scroll-margin-top: 104px;
  transition: border-color .3s var(--ease);
}
.faq-page .faq-item:hover { border-color: var(--border-lit); }
.faq-page .faq-item[open] { border-color: rgba(201 169 110 / .15); }
.faq-page .faq-item[open] summary { color: var(--accent); }

.faq-page .faq-item summary {
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  color: var(--fg);
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: color .2s var(--ease);
  outline: none;
  border: none;
  -webkit-tap-highlight-color: transparent;
}
.faq-page .faq-item summary:focus { outline: none; }
.faq-page .faq-item summary:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; border-radius: var(--r-md); }
.faq-page .faq-item summary:hover { color: var(--accent); }

.faq-page .faq-item summary::before {
  content: '+';
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--fg-dim);
  transition: transform .3s var(--ease), color .3s var(--ease);
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}
.faq-page .faq-item[open] summary::before {
  content: '\2212';
  color: var(--accent);
  transform: scale(1.12);
}
.faq-page .faq-item summary::-webkit-details-marker { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .faq-page .faq-item::details-content {
    block-size: 0;
    overflow: clip;
    opacity: 0;
    transition: block-size .42s var(--ease), opacity .34s var(--ease) .04s, content-visibility .42s var(--ease);
    transition-behavior: allow-discrete;
  }
  .faq-page .faq-item[open]::details-content {
    block-size: auto;
    opacity: 1;
  }
  .faq-page .faq-answer {
    transform: translateY(-5px);
    transition: transform .42s var(--ease);
  }
  .faq-page .faq-item[open] .faq-answer {
    transform: translateY(0);
  }
}

.faq-answer {
  padding: 0 var(--space-md) var(--space-md) var(--space-md);
}
.faq-answer p {
  color: var(--fg-muted);
  font-size: .9rem;
  line-height: 1.7;
  margin-bottom: 12px;
}
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer code {
  font-size: .82rem;
  color: var(--accent);
  background: rgba(201 169 110 / .1);
  padding: 2px 7px;
  border-radius: 4px;
}
.faq-answer a {
  color: var(--accent);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(201 169 110 / .09);
}
.faq-answer a:hover {
  color: var(--accent-hover);
  background: rgba(201 169 110 / .14);
}
.faq-answer em {
  font-style: italic;
  color: var(--fg);
}

/* ── Topbar glass scroll state ── */
.topbar.scrolled {
  background: rgba(10, 9, 8, .88);
  border-bottom-color: transparent;
  box-shadow: 0 4px 30px rgba(0 0 0 / .5);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .faq-hero { padding: 140px 0 var(--space-md); }
  .faq-hero h1 { font-size: clamp(2rem, 8vw, 3rem); }

  .faq-section { padding: clamp(30px, 8vw, 48px) 0; }
  .faq-section-title { font-size: 1.4rem; margin-bottom: var(--space-md); }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: var(--space-md); }
  .faq-page .faq-item { scroll-margin-top: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  .faq-page .faq-item {
    transition: none;
  }
}

/* ═══════════════════════════════════════════
   RESPONSIVE - 375 / 768 / 1024 / 1440
   v3: unified flow, no dividers
   ═══════════════════════════════════════════ */

@media (max-width: 1024px) {
  .how-step h3 {
    white-space: normal;
    text-wrap: balance;
  }
  .app-pair { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .feat { grid-template-columns: 1fr; text-align: center; }
  .feat--right .feat-art,
  .feat--left .feat-art { order: 1; justify-content: center; }
  .feat--right .feat-text,
  .feat--left .feat-text { order: 2; text-align: center; }
  .feat--left .feat-text p { margin-left: auto; margin-right: auto; }
  .feat-text p { margin: 0 auto; }
  .feat::before { display: none; }

  .final-grid { grid-template-columns: 1fr; max-width: 760px; align-items: stretch; }
  .final-cta {
    align-self: stretch;
    text-align: center;
    min-height: 0;
    padding-bottom: clamp(28px, 7vw, 38px);
  }
  .final-cta-title {
    max-width: none;
    font-size: clamp(2.35rem, 9vw, 3.4rem);
    line-height: .96;
    white-space: normal;
  }
  .final-cta-body { max-width: none; }
  .final-cta .btn {
    width: 100%;
    margin-top: clamp(14px, 4vw, 20px);
  }
  .faq-list {
    gap: 2px;
    margin-top: clamp(16px, 4vw, 22px);
  }
  .faq-panel h3,
  .faq-more,
  .final-cta { text-align: center; }
  .faq-more { margin-top: clamp(12px, 2vw, 18px); }
}

@media (max-width: 920px) {
  .card-layout { grid-template-columns: 1fr; max-width: 760px; margin: 0 auto; }
  .card-copy { align-items: center; text-align: center; }
  .card-copy-body { margin-left: auto; margin-right: auto; }
  .card-gallery-link { align-self: center; text-align: center; }
}

@media (max-width: 768px) {
  html.mobile-nav-ready .topnav { display: none; }
  .mobile-nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }
  .topbar {
    padding: 12px var(--space-sm);
    flex-wrap: nowrap;
    align-items: center;
  }
  .topnav { scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
}

@media (max-width: 640px) {
  .topbar {
    padding: 10px 16px;
    gap: 12px;
  }

  .brand {
    gap: 8px;
    font-size: 1.05rem;
  }

  .topnav {
    gap: 4px;
    margin-left: 0;
  }

  .topnav a {
    padding: 8px 10px;
    font-size: .78rem;
  }

  .video-showcase {
    width: 100%;
    max-width: 540px;
  }

  .how-grid,
  .how-grid.how-grid-merged {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 540px;
    gap: 16px;
  }

  .how-step {
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 6px;
    padding: 18px 16px;
    border-radius: 14px;
  }

  .how-num {
    grid-column: 1;
    grid-row: 1 / span 2;
    font-size: clamp(2rem, 9vw, 2.35rem);
    margin-left: -3px;
  }

  .how-step h3,
  .how-step p {
    grid-column: 2;
  }

  .how-step h3 {
    font-size: clamp(1.18rem, 5.5vw, 1.36rem);
    line-height: 1.06;
  }

  .how-step p {
    font-size: .92rem;
    line-height: 1.5;
  }
}

@media (max-width: 600px) {
  :root {
    --space-xl: 80px;
    --space-2xl: 88px;
  }

  .mail-compose {
    width: calc(100vw - 20px);
    padding: 18px;
  }
  .mail-compose-actions {
    justify-content: stretch;
  }
  .mail-compose-actions .btn {
    width: 100%;
  }

  .tree-bg-img { opacity: 0.22 !important; }
  .grain { display: none; opacity: 0; transition: none; }

  h1 { font-size: clamp(2rem, 7.5vw, 3rem); }
  h2 { font-size: clamp(1.5rem, 5vw, 2.2rem); }

  .hero-inner {
    padding: 88px 18px 56px;
    transform: translateY(clamp(10px, 3vh, 24px));
  }
  .hero-watermark { width: 260px; }
  .s-hero h1 {
    max-width: 11.5ch;
    font-size: clamp(2.3rem, 8.4vw, 3.55rem);
    line-height: 1.02;
  }
  .hero-sub {
    max-width: 30ch;
    font-size: .98rem;
  }
  .feat {
    gap: clamp(12px, 4vw, 22px);
    padding: clamp(34px, 8vw, 48px) 20px;
  }
  .feat-art {
    padding: clamp(8px, 2.8vw, 14px);
  }
  .feat-frame { width: min(100%, 292px); }
  .feat-text {
    padding: 10px 10px 0;
  }
  .feat-text p {
    max-width: 31ch;
    font-size: clamp(1rem, 4.15vw, 1.12rem);
    line-height: 1.6;
  }
  .s-app-header h2 { max-width: 14ch; }
  .s-app-header h2 { text-align: center; }
  .app-layout {
    align-items: center;
    padding-left: 20px;
    padding-right: 20px;
    gap: 16px;
  }
  .video-showcase {
    width: 100%;
    max-width: 540px;
    border-radius: 12px;
  }
  .video-controls {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    left: 8px;
    right: 8px;
    bottom: 7px;
  }
  .video-toggle {
    width: 38px;
    height: 36px;
  }
  .how-grid,
  .how-grid.how-grid-merged {
    width: 100%;
    max-width: 540px;
    gap: 16px;
  }
  .how-step {
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 6px;
    padding: 18px 16px;
    border-radius: 14px;
  }
  .how-num {
    grid-column: 1;
    grid-row: 1 / span 2;
    font-size: clamp(2rem, 9vw, 2.35rem);
    margin-left: -3px;
  }
  .how-step h3 {
    grid-column: 2;
    font-size: clamp(1.18rem, 5.5vw, 1.36rem);
    line-height: 1.06;
  }
  .how-step p {
    grid-column: 2;
    font-size: .92rem;
    line-height: 1.5;
  }
  .card-copy { text-align: center; }
  .card-copy-body { margin-left: auto; margin-right: auto; }
  .card-copy,
  .card-gallery-link { align-items: center; text-align: center; }

  /* Disable scroll-char animations on mobile for perf */
  .scroll-char {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }


  /* Disable feat-art/how-step/proof/faq spotlight on touch */
  .feat-art::after,
  .how-step::after,
  .faq-item::after { display: none; }

  .feat-frame::before,
  .how-step::before,
  .card-flipper::before,
  .pricing-card::before,
  .gallery-page .anki-card-mock::before { display: none; }

  /* Card mock: full width */
  .s-card .card-flipper,
  .s-card .anki-card-mock {
    max-width: min(520px, calc(100vw - 52px));
  }
  .anki-card-mock { max-width: min(520px, calc(100vw - 52px)); }
  .anki-card-mock .card { padding: 20px 14px; }

}

@media (max-width: 540px) {
  .video-showcase,
  .how-grid,
  .how-grid.how-grid-merged {
    width: min(100%, 340px);
    max-width: 340px;
  }

  .how-grid,
  .how-grid.how-grid-merged {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .how-step {
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 6px;
    padding: 18px 16px;
  }

  .how-num {
    grid-column: 1;
    grid-row: 1 / span 2;
    font-size: clamp(2rem, 9vw, 2.35rem);
    margin-left: -3px;
  }

  .how-step h3,
  .how-step p {
    grid-column: 2;
  }

  .how-step h3 {
    font-size: clamp(1.18rem, 5.5vw, 1.36rem);
  }

  .how-step p {
    font-size: .92rem;
    line-height: 1.5;
  }
}

@media (max-width: 600px) {
  html.reveal-ready .reveal,
  html.reveal-ready .reveal-left,
  html.reveal-ready .reveal-right,
  html.reveal-ready .reveal-up,
  html.reveal-ready .reveal-scale {
    transform: translateY(10px);
    transition-duration: .45s;
    will-change: auto;
  }

  html.reveal-ready .reveal.visible,
  html.reveal-ready .reveal-left.visible,
  html.reveal-ready .reveal-right.visible,
  html.reveal-ready .reveal-up.visible,
  html.reveal-ready .reveal-scale.visible {
    transform: translateY(0);
  }

  [data-delay="1"],
  [data-delay="2"],
  [data-delay="3"],
  [data-delay="4"] {
    transition-delay: .06s;
  }
}

@media (hover: none), (pointer: coarse) {
  .feat-frame,
  .card-flipper,
  .video-showcase video,
  .video-progress,
  .how-step {
    cursor: default;
  }

  .feat-frame-media {
    will-change: auto;
  }

  .feat-frame:hover img,
  .video-showcase:hover,
  .how-step:hover,
  .card-flipper:hover {
    transform: none;
  }

  .feat--right .feat-frame:hover .feat-frame-media,
  .feat--left .feat-frame:hover .feat-frame-media,
  .feat-frame:hover .feat-frame-media::before,
  .feat-frame:focus-visible .feat-frame-media::before,
  .feat-frame:hover .feat-frame-media::after,
  .feat-frame:focus-visible .feat-frame-media::after {
    transform: none;
  }
}

@media (max-width: 560px) {
  .footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 20px;
  }
  .footer-meta { align-items: center; width: auto; gap: 14px; }
  .footer-socials { justify-content: flex-end; }
  .footer-links { justify-content: flex-end; gap: 16px; }
}

@media (max-width: 375px) {
  :root {
    --space-md: 20px;
    --space-lg: 48px;
    --space-xl: 64px;
    --space-2xl: 72px;
  }
  .word-left { font-size: 1.8rem; }
  .plan-price { font-size: 2.2rem; }
  .feat-frame { width: min(100%, 280px); }
  .video-showcase,
  .how-grid,
  .how-grid.how-grid-merged {
    width: min(100%, 322px);
    max-width: 322px;
  }

  .anki-card-mock .card { padding: 16px 12px; }
  .pitch-reading-label { font-size: .9rem; }

  .footer-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-meta {
    align-items: flex-start;
    width: 100%;
  }

  .footer-socials,
  .footer-links {
    justify-content: flex-start;
  }
}

@media (min-width: 1440px) {
  :root { --contain: 1200px; }
}

/* Dark-scheme and forced-dark compatibility
   The landing is already a dark UI. These rules keep browser/extension
   dark-mode tooling from double-processing fragile surfaces. */

:root {
  color-scheme: dark;
}

html,
body {
  background-color: var(--bg);
}

html,
body,
input,
textarea,
select,
button {
  color-scheme: dark;
}

::selection {
  background: rgba(201 169 110 / .32);
  color: var(--fg);
}

.tree-bg-img,
.hero-watermark,
#kanji-canvas {
  forced-color-adjust: none;
}

@media (forced-colors: active) {
  .grain,
  .tree-bg,
  .hero-watermark,
  #kanji-canvas {
    display: none !important;
  }

  .topbar,
  .mobile-nav,
  .mobile-nav-meta,
  .s-footer,
  .feat-body,
  .feat-icon,
  .feat-formats span,
  .examples-note,
  .how-step,
  .faq-item,
  .faq-page .faq-item,
  .video-showcase,
  .source-badge,
  .contact-card,
  .footer-social {
    forced-color-adjust: none;
    background: Canvas !important;
    color: CanvasText !important;
    border-color: GrayText !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .topnav a,
  .footer-links a,
  .card-gallery-link a,
  .faq-more a {
    color: LinkText !important;
  }

  .btn-primary,
  .plan-badge {
    forced-color-adjust: none;
    background: Highlight !important;
    color: HighlightText !important;
    border-color: Highlight !important;
    box-shadow: none !important;
  }

  .btn-ghost {
    forced-color-adjust: none;
    background: Canvas !important;
    color: CanvasText !important;
    border-color: GrayText !important;
  }

  .anki-card-mock .card,
  .anki-card-mock .card * {
    forced-color-adjust: none;
  }
}
