/* ============================================================
   Mitsuki — website stylesheet
   Design tokens ported from the app:
     Theme.swift        → .sakura (light) / .indigoNight (dark)
     MotionTokens.swift → easing curves, durations, stagger
   ============================================================ */

/* ---------- Animatable registered properties ---------- */
@property --halo-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@property --spot-opacity {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

/* ---------- Fonts ---------- */
/* Fraunces (display) + Inter (text), loaded in <head>. System fallbacks keep
   the page readable if fonts are blocked. */

/* ---------- Tokens ---------- */
:root {
  /* Motion — verbatim from MotionTokens.swift */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);          /* Motion.easeOut   */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);      /* Motion.easeInOut */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);       /* Motion.drawer    */
  --dur-press: 0.16s;
  --dur-fast: 0.22s;
  --dur-move: 0.24s;
  --dur-drawer: 0.3s;
  --stagger: 40ms;                                      /* Motion.stagger step */
  /* Motion.snap / Motion.bouncy approximated as linear() springs */
  --spring-snap: linear(
    0, 0.157 1.5%, 0.501 4.7%, 0.785 8.2%, 0.965 11.9%, 1.055 15.9%,
    1.085 20.2%, 1.075 25%, 1.035 32.2%, 1.005 41.4%, 0.995 53%, 1
  );
  --spring-bouncy: linear(
    0, 0.18 1.6%, 0.55 5%, 0.85 8.8%, 1.04 12.9%, 1.135 17.3%,
    1.155 22%, 1.115 27.4%, 1.04 35.1%, 0.99 44%, 0.985 52.5%, 1.005 66%, 1
  );

  /* Type */
  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-text: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-md: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --text-xl: clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem);
  --text-hero: clamp(2.625rem, 1.8rem + 4.2vw, 5rem);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --container: 1140px;
  --nav-h: 64px;
}

/* Theme.sakura — light */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fff5f7;                                   /* appBackground */
  --bg-deep: #ffedf2;
  --surface: #fffafc;                              /* surface */
  --surface-border: rgba(217, 140, 166, 0.18);     /* surfaceBorder */
  --glass: rgba(255, 250, 252, 0.72);
  --ink: #38222b;
  --ink-2: rgba(56, 34, 43, 0.72);
  --ink-3: rgba(56, 34, 43, 0.56);
  --accent: #eb6b94;                               /* accent  */
  --accent-strong: #d94f7e;
  --accent-ink: #ffffff;                           /* accentForeground */
  --accent-soft: rgba(235, 107, 148, 0.14);        /* accentSoft */
  --accent-border: rgba(235, 107, 148, 0.32);      /* accentSoftBorder */
  --chip-bg: rgba(235, 107, 148, 0.1);             /* chipBackground */
  --chip-text: #8c334d;                            /* chipText */
  --example: #ffe6ed;                              /* exampleBox */
  --success: #33a673;                              /* success */
  --success-soft: rgba(51, 166, 115, 0.14);
  --petal-a: #f6a8c0;
  --petal-b: #eb6b94;
  --shadow-soft: 0 2px 8px rgba(140, 51, 77, 0.06), 0 12px 32px rgba(140, 51, 77, 0.08);
  --shadow-lift: 0 4px 12px rgba(140, 51, 77, 0.08), 0 24px 56px rgba(140, 51, 77, 0.14);
  --shadow-accent: 0 6px 20px rgba(235, 107, 148, 0.35);
  --hero-mesh:
    radial-gradient(42% 50% at 12% 18%, rgba(246, 168, 192, 0.4) 0%, transparent 100%),
    radial-gradient(38% 48% at 88% 12%, rgba(255, 214, 165, 0.32) 0%, transparent 100%),
    radial-gradient(46% 60% at 75% 80%, rgba(235, 107, 148, 0.16) 0%, transparent 100%),
    radial-gradient(30% 40% at 35% 92%, rgba(190, 167, 255, 0.18) 0%, transparent 100%);
}

/* Theme.indigoNight — dark */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121424;                                   /* appBackground */
  --bg-deep: #0d0f1c;
  --surface: #212638;                              /* surface */
  --surface-border: rgba(255, 255, 255, 0.08);     /* surfaceBorder */
  --glass: rgba(18, 20, 36, 0.66);
  --ink: rgba(255, 255, 255, 0.92);
  --ink-2: rgba(255, 255, 255, 0.7);
  --ink-3: rgba(255, 255, 255, 0.54);
  --accent: #8c9eff;                               /* accent */
  --accent-strong: #a5b3ff;
  --accent-ink: #10122b;
  --accent-soft: rgba(140, 158, 255, 0.18);        /* accentSoft */
  --accent-border: rgba(140, 158, 255, 0.4);       /* accentSoftBorder */
  --chip-bg: rgba(255, 255, 255, 0.08);            /* chipBackground */
  --chip-text: rgba(255, 255, 255, 0.92);          /* chipText */
  --example: #2e3352;                              /* exampleBox */
  --success: #66d9a6;                              /* success */
  --success-soft: rgba(102, 217, 166, 0.18);
  --petal-a: #f6a8c0;
  --petal-b: #8c9eff;
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 4px 12px rgba(0, 0, 0, 0.35), 0 24px 56px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 6px 20px rgba(140, 158, 255, 0.3);
  --hero-mesh:
    radial-gradient(42% 50% at 12% 18%, rgba(140, 158, 255, 0.2) 0%, transparent 100%),
    radial-gradient(38% 48% at 88% 12%, rgba(235, 107, 148, 0.14) 0%, transparent 100%),
    radial-gradient(46% 60% at 75% 80%, rgba(140, 158, 255, 0.1) 0%, transparent 100%),
    radial-gradient(30% 40% at 35% 92%, rgba(246, 168, 192, 0.08) 0%, transparent 100%);
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--text-md);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  transition: background-color var(--dur-move) var(--ease-in-out),
    color var(--dur-move) var(--ease-in-out);
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

@media (pointer: fine) {
  ::-webkit-scrollbar {
    width: 12px;
  }
  ::-webkit-scrollbar-track {
    background: var(--bg-deep);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--accent-border);
    border-radius: 8px;
    border: 3px solid var(--bg-deep);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
  }
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease-out);
}

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

.container {
  width: min(var(--container), 100% - 48px);
  margin-inline: auto;
}

/* ---------- View-transition theme reveal ---------- */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 150;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}

@supports (animation-timeline: scroll()) {
  .scroll-progress {
    animation: progress-grow linear both;
    animation-timeline: scroll(root);
  }
  @keyframes progress-grow {
    from {
      transform: scaleX(0);
    }
    to {
      transform: scaleX(1);
    }
  }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur-drawer) var(--ease-drawer),
    border-color var(--dur-drawer) var(--ease-drawer),
    backdrop-filter var(--dur-drawer) var(--ease-drawer);
}

.nav.scrolled {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  border-bottom-color: var(--surface-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(var(--container), 100% - 48px);
  margin-inline: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 540;
  transition: color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--accent-soft);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }
  .nav-actions {
    margin-left: auto;
  }
}

/* Theme toggle */
.theme-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform var(--dur-press) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.theme-toggle:hover {
  border-color: var(--accent-border);
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-toggle svg {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: transform 0.45s var(--spring-snap), opacity var(--dur-fast) var(--ease-out);
}

.theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.4);
}

.theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
}

/* ---------- Buttons (PressableButtonStyle-inspired) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-text);
  font-size: var(--text-sm);
  font-weight: 620;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur-press) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

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

.btn-ghost:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.75;
}

.btn[aria-disabled="true"]:hover,
.btn[aria-disabled="true"]:active {
  transform: none;
}

.soon-pill {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
}

.btn-ghost .soon-pill {
  background: var(--accent-soft);
  color: var(--chip-text);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + clamp(56px, 10vh, 120px)) 0 clamp(64px, 9vh, 110px);
  overflow: clip;
}

.hero-mesh {
  position: absolute;
  inset: -20% -10%;
  background: var(--hero-mesh);
  filter: blur(0.5px);
  z-index: -2;
  transition: opacity var(--dur-move) var(--ease-in-out);
}

#petals {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

@media (max-width: 920px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--accent-border);
  color: var(--chip-text);
  font-size: var(--text-xs);
  font-weight: 640;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-eyebrow-jp {
  font-weight: 700;
}

/* Drop the English gloss before the pill would have to wrap its label */
@media (max-width: 480px) {
  .hero-eyebrow-en {
    display: none;
  }
}

.hero-eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s var(--ease-in-out) infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--accent-soft);
  }
  50% {
    box-shadow: 0 0 0 7px transparent;
  }
}

.hero h1 {
  font-size: var(--text-hero);
  margin: 22px 0 18px;
  font-variation-settings: "opsz" 72;
  transition: font-variation-settings 0.6s var(--ease-out);
}

.hero h1 em {
  font-style: italic;
  font-weight: 480;
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-strong) 60%, var(--accent) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-slide 6s var(--ease-in-out) infinite;
}

@keyframes gradient-slide {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.hero-sub {
  font-size: var(--text-lg);
  color: var(--ink-2);
  max-width: 34ch;
  margin-bottom: 34px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}

.hero-note {
  font-size: var(--text-xs);
  color: var(--ink-3);
}

/* ---------- App mockup ---------- */
.mockup {
  position: relative;
  perspective: 1200px;
}

.mockup-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 22px;
  transform: rotateY(-4deg) rotateX(2deg);
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out);
  animation: float 7s var(--ease-in-out) infinite;
}

.mockup:hover .mockup-card {
  transform: rotateY(0deg) rotateX(0deg);
}

@keyframes float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -10px;
  }
}

.mockup-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 1.0625rem;
}

.mockup-search svg {
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--ink-3);
}

.mockup-query {
  font-weight: 560;
  letter-spacing: 0.01em;
  min-height: 1.4em;
}

.mockup-query .caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.06s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.mockup-result {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--example);
  border: 1px solid var(--accent-border);
  opacity: 0;
  translate: 0 12px;
  scale: 0.985;
}

.mockup-result.show {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  transition: opacity 0.45s var(--ease-out), translate 0.5s var(--spring-snap),
    scale 0.5s var(--spring-snap);
}

.mockup-word {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.mockup-expression {
  font-size: 2.375rem;
  line-height: 1.1;
  font-weight: 600;
  font-family: var(--font-text);
}

.mockup-reading {
  font-size: 1.0625rem;
  color: var(--ink-2);
}

.mockup-def {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.mockup-chips {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 620;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
}

.chip.success {
  background: var(--success-soft);
  color: var(--success);
}

.mockup-example-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--example);
  border: 1px solid var(--accent-border);
}

.mockup-example-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.mockup-example-jp {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-1);
}

.mockup-mark {
  background: none;
  color: var(--accent-strong);
  font-weight: 600;
}

.mockup-example-en {
  font-size: var(--text-xs);
  color: var(--ink-3);
  line-height: 1.4;
}

.mockup-example-audio {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--accent-soft);
  color: var(--accent-strong);
  cursor: default;
  transition: background var(--dur-press) var(--ease-out);
}

.mockup-example-audio:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.mockup-add {
  margin-top: 18px;
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 640;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--dur-press) var(--ease-out);
}

.mockup-add:active {
  transform: scale(0.97);
}

.mockup-glow {
  position: absolute;
  inset: 8% -6% -10% -6%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, var(--accent-soft) 0%, transparent 75%);
  filter: blur(8px);
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(72px, 11vh, 130px) 0;
  position: relative;
}

.section-head {
  max-width: 620px;
  margin-bottom: clamp(36px, 5vh, 56px);
}

.section-eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: var(--text-xl);
  margin-bottom: 14px;
}

.section-head p {
  color: var(--ink-2);
  font-size: var(--text-md);
}

/* ---------- Bento feature grid ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.bento-card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  grid-column: span 2;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    background-color var(--dur-move) var(--ease-in-out);
}

.bento-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-soft);
}

/* cursor-tracking spotlight */
.bento-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    260px circle at var(--mx) var(--my),
    var(--accent-soft) 0%,
    transparent 70%
  );
  opacity: var(--spot-opacity);
  transition: --spot-opacity 0.45s var(--ease-out);
  pointer-events: none;
}

.bento-card:hover::before {
  --spot-opacity: 1;
}

.bento-card.wide {
  grid-column: span 3;
}

.bento-card.tall {
  grid-column: span 2;
  grid-row: span 2;
}

@media (max-width: 980px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }
  .bento-card,
  .bento-card.wide,
  .bento-card.tall {
    grid-column: span 1;
    grid-row: auto;
  }
}

@media (max-width: 600px) {
  .bento {
    grid-template-columns: 1fr;
  }
}

.bento-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  margin-bottom: 18px;
  transition: transform 0.5s var(--spring-bouncy);
}

.bento-card:hover .bento-icon {
  transform: scale(1.08) rotate(-4deg);
}

.bento-icon svg {
  width: 22px;
  height: 22px;
}

.bento-card h3 {
  font-family: var(--font-text);
  font-size: 1.0625rem;
  font-weight: 660;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.bento-card p {
  font-size: var(--text-sm);
  color: var(--ink-2);
}

/* small "kind" tag on companion-tool cards */
.bento-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--chip-text);
  background: var(--chip-bg);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.bento-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  font-size: var(--text-sm);
  font-weight: 640;
  color: var(--accent-strong);
}

.bento-link[aria-disabled="true"] {
  cursor: not-allowed;
}

.bento-link:hover {
  text-decoration: none;
  gap: 12px;
}

.bento-link .soon-pill {
  background: var(--accent-soft);
  color: var(--chip-text);
}

/* ---------- Pro section ---------- */
.pro-card {
  position: relative;
  border-radius: var(--radius-xl);
  padding: clamp(36px, 5vw, 64px);
  background: var(--surface);
  overflow: hidden;
  isolation: isolate;
}

/* animated conic halo border via @property */
.pro-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--halo-angle),
    var(--accent),
    var(--accent-soft),
    var(--accent-strong),
    var(--accent-soft),
    var(--accent)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: halo-spin 7s linear infinite;
  pointer-events: none;
}

@keyframes halo-spin {
  to {
    --halo-angle: 360deg;
  }
}

.pro-card::after {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: -1;
  background: radial-gradient(40% 40% at 70% 20%, var(--accent-soft) 0%, transparent 70%);
}

.pro-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

@media (max-width: 860px) {
  .pro-grid {
    grid-template-columns: 1fr;
  }
}

.pro-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-accent);
}

.pro-card h2 {
  font-size: var(--text-xl);
  margin-bottom: 14px;
}

.pro-card > .pro-grid p {
  color: var(--ink-2);
}

.pro-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.pro-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: var(--text-sm);
  transition: transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.pro-list li:hover {
  transform: translateX(4px);
  border-color: var(--accent-border);
}

.pro-list .tick {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--success-soft);
  color: var(--success);
  margin-top: 1px;
}

.pro-list .tick svg {
  width: 12px;
  height: 12px;
}

/* ---------- Ecosystem ---------- */
.eco-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 860px) {
  .eco-grid {
    grid-template-columns: 1fr;
  }
}

.eco-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 3.4vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.eco-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-soft);
}

.eco-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.eco-logo {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  flex: none;
}

.eco-logo svg {
  width: 25px;
  height: 25px;
}

.eco-head h3 {
  font-family: var(--font-text);
  font-size: 1.1875rem;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.eco-head .eco-kind {
  display: block;
  font-size: var(--text-xs);
  font-weight: 560;
  color: var(--ink-3);
  margin-top: 2px;
}

.eco-card > p {
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.eco-steps {
  list-style: none;
  counter-reset: step;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.eco-steps li {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--accent-border);
  background: var(--bg);
  color: var(--ink-3);
  font-size: var(--text-sm);
}

.eco-steps li::before {
  content: counter(step);
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: var(--text-xs);
  font-weight: 700;
}

.eco-foot {
  margin-top: auto;
  padding-top: 8px;
}

/* ---------- Privacy strip ---------- */
.privacy-strip {
  background: var(--bg-deep);
  border-block: 1px solid var(--surface-border);
  transition: background-color var(--dur-move) var(--ease-in-out);
}

.privacy-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 860px) {
  .privacy-cols {
    grid-template-columns: 1fr;
  }
}

.privacy-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--surface-border);
}

.privacy-col h3 {
  font-family: var(--font-text);
  font-size: 1.0625rem;
  font-weight: 660;
  display: flex;
  align-items: center;
  gap: 10px;
}

.privacy-col h3 svg {
  width: 19px;
  height: 19px;
  color: var(--accent-strong);
  flex: none;
}

.privacy-col p {
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.privacy-more {
  margin-top: 36px;
  text-align: center;
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  padding: clamp(48px, 7vh, 80px) 0 40px;
}

.footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-border), transparent);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
}

.footer-brand {
  max-width: 320px;
}

.footer-brand .brand {
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.footer-links {
  display: flex;
  gap: clamp(32px, 6vw, 80px);
}

.footer-links nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links h4 {
  font-family: var(--font-text);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--ink-2);
}

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

.footer-legal {
  border-top: 1px solid var(--surface-border);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-legal p {
  font-size: var(--text-xs);
  color: var(--ink-3);
}

/* ---------- Reveal-on-scroll ---------- */
/* Native scroll-driven animations when supported… */
@supports (animation-timeline: view()) {
  .js .reveal {
    animation: rise-in both;
    animation-timeline: view();
    animation-range: entry 0% entry 38%;
  }
}

/* …IntersectionObserver fallback otherwise. */
.js.no-sda .reveal {
  opacity: 0;
  translate: 0 26px;
}

.js.no-sda .reveal.in-view {
  opacity: 1;
  translate: 0 0;
  transition: opacity 0.55s var(--ease-out) var(--reveal-delay, 0s),
    translate 0.65s var(--ease-out) var(--reveal-delay, 0s);
}

@keyframes rise-in {
  from {
    opacity: 0;
    translate: 0 26px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

/* staggered children (Motion.stagger: 40 ms steps) */
.stagger > *:nth-child(1) { --reveal-delay: 0ms; }
.stagger > *:nth-child(2) { --reveal-delay: 40ms; }
.stagger > *:nth-child(3) { --reveal-delay: 80ms; }
.stagger > *:nth-child(4) { --reveal-delay: 120ms; }
.stagger > *:nth-child(5) { --reveal-delay: 160ms; }
.stagger > *:nth-child(6) { --reveal-delay: 200ms; }
.stagger > *:nth-child(7) { --reveal-delay: 240ms; }
.stagger > *:nth-child(8) { --reveal-delay: 280ms; }
.stagger > *:nth-child(9) { --reveal-delay: 320ms; }
.stagger > *:nth-child(10) { --reveal-delay: 360ms; }

/* ---------- Privacy policy page ---------- */
.policy {
  padding: calc(var(--nav-h) + 56px) 0 80px;
  max-width: 760px;
  margin-inline: auto;
  width: min(760px, 100% - 48px);
}

.policy-header {
  margin-bottom: 40px;
}

.policy-header h1 {
  font-size: var(--text-xl);
  margin-bottom: 10px;
}

.policy-header .effective {
  color: var(--ink-3);
  font-size: var(--text-sm);
}

.policy-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 32px);
  margin-bottom: 18px;
}

.policy-card h2 {
  font-family: var(--font-text);
  font-size: 1.125rem;
  font-weight: 680;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.policy-card h3 {
  font-family: var(--font-text);
  font-size: var(--text-sm);
  font-weight: 680;
  margin: 18px 0 8px;
}

.policy-card p,
.policy-card li {
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.policy-card ul {
  margin: 8px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 7px;
}

.policy-card ul li::marker {
  color: var(--accent);
}

.policy-kv {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 8px 16px;
  font-size: var(--text-sm);
}

.policy-kv dt {
  font-weight: 640;
  color: var(--ink);
}

.policy-kv dd {
  margin: 0;
  color: var(--ink-2);
}

@media (max-width: 560px) {
  .policy-kv {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .policy-kv dd {
    margin-bottom: 10px;
  }
}

.policy-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 620;
  margin-bottom: 28px;
}

/* ============================================================
   Showcase — "Inside the app" live previews
   App screens rebuilt in HTML/CSS; tokens match the app theme.
   ============================================================ */

:root,
:root[data-theme="light"] {
  --sc-trunk: #b08a6e;
  --sc-petal-c: #fbd0de;
  --rate-again: #e0524d;
  --rate-hard: #e88a3c;
  --rate-easy: #5b8def;
}

:root[data-theme="dark"] {
  --sc-trunk: #7d7390;
  --sc-petal-c: #d8a8c8;
  --rate-again: #ef7b76;
  --rate-hard: #f0a564;
  --rate-easy: #8cabff;
}

.sc-block {
  margin-top: clamp(56px, 8vh, 96px);
}

.sc-block:first-of-type {
  margin-top: 0;
}

.sc-block-head {
  max-width: 560px;
  margin-bottom: 28px;
}

.sc-block-head h3 {
  font-size: var(--text-lg);
  margin-bottom: 10px;
}

.sc-block-head p {
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.sc-block-head code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
  background: var(--chip-bg);
  color: var(--chip-text);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  padding: 1px 7px;
}

.sc-split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}

@media (max-width: 980px) {
  .sc-split {
    grid-template-columns: 1fr;
  }
}

/* ---------- Shared window chrome ---------- */
.sc-window {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  font-size: var(--text-sm);
}

.sc-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--surface-border);
}

.sc-titlebar strong {
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.sc-dots {
  display: inline-flex;
  gap: 6px;
}

.sc-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.sc-dots i:nth-child(1) { background: #ff5f57; }
.sc-dots i:nth-child(2) { background: #febc2e; }
.sc-dots i:nth-child(3) { background: #28c840; }

.sc-back {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--surface-border);
  color: var(--ink-2);
}

.sc-back svg {
  width: 14px;
  height: 14px;
}

.sc-tb-icons {
  margin-left: auto;
  display: inline-flex;
  gap: 12px;
  color: var(--ink-3);
}

.sc-tb-icons svg {
  width: 16px;
  height: 16px;
}

/* generic pop-in used by results / popovers */
@keyframes sc-pop-in {
  from {
    opacity: 0;
    translate: 0 10px;
    scale: 0.97;
  }
  to {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }
}

@keyframes sc-fade-up {
  from {
    opacity: 0;
    translate: 0 8px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

/* JS-driven typing (CJK ≈ 1em per glyph) */
@keyframes sc-typing {
  to {
    width: calc(var(--n) * 1em);
  }
}

.sc-type {
  --n: 8;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  width: 0;
}

.sc-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.06s steps(1) infinite;
}

/* small accent buttons inside previews */
.sc-add-mini {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 680;
  cursor: default;
}

.sc-add-mini svg {
  width: 12px;
  height: 12px;
}

.sc-jp-lg {
  font-size: 1.5rem;
  font-weight: 680;
  line-height: 1.2;
}

.sc-read {
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.sc-example {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--example);
  display: grid;
  gap: 3px;
}

.sc-example .jp {
  font-weight: 600;
  font-size: 0.9375rem;
}

.sc-example .en {
  color: var(--ink-2);
  font-size: var(--text-xs);
}

/* ---------- A. Command demo ---------- */
.sc-cmd-legend {
  display: grid;
  gap: 8px;
}

.sc-cmd-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    transform var(--dur-press) var(--ease-out);
}

.sc-cmd-row:hover {
  border-color: var(--accent-border);
  transform: translateX(3px);
}

.sc-cmd-row.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.sc-cmd-row kbd {
  flex: none;
  min-width: 52px;
  text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--chip-bg);
  color: var(--chip-text);
  border: 1px solid var(--accent-border);
}

.sc-cmd-row strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 660;
}

.sc-cmd-row em {
  display: block;
  font-style: normal;
  font-size: var(--text-xs);
  color: var(--ink-3);
}

.sc-cmd-body {
  position: relative;
  padding: 18px;
}

.sc-searchbar {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 560;
}

.sc-searchbar > svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--ink-3);
}

.sc-search-btn {
  margin-left: auto;
  flex: none;
  padding: 7px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--text-xs);
  font-weight: 680;
}

.sc-palette {
  position: absolute;
  top: 76px;
  left: 18px;
  right: 18px;
  z-index: 5;
  margin: 0;
  padding: 6px;
  list-style: none;
  display: none;
  flex-direction: column;
  gap: 2px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
}

.sc-palette.open {
  display: flex;
  animation: sc-pop-in 0.3s var(--ease-out) both;
}

.sc-palette li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: var(--text-xs);
}

.sc-palette li[hidden] {
  display: none;
}

.sc-palette li.selected {
  background: var(--accent-soft);
}

.sc-palette kbd {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 700;
  font-size: 0.75rem;
  min-width: 44px;
  text-align: center;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--chip-bg);
  color: var(--chip-text);
}

.sc-palette span {
  font-weight: 600;
}

.sc-cmd-results {
  position: relative;
  margin-top: 14px;
  min-height: 252px;
}

.sc-result {
  position: absolute;
  inset: 0 0 auto 0;
  display: none;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--example);
  border: 1px solid var(--accent-border);
}

.sc-result.show {
  display: block;
  animation: sc-pop-in 0.5s var(--spring-snap) both;
}

.sc-result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sc-result-sub {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.sc-result .sc-example {
  background: var(--surface);
}

.sc-clip {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 10px 13px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--accent-border);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.9375rem;
}

.sc-clip svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--ink-3);
}

.sc-clip em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 640;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.sc-verdict {
  display: grid;
  gap: 2px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.sc-verdict.warn {
  background: rgba(232, 138, 60, 0.13);
  color: var(--rate-hard);
}

.sc-verdict.good {
  background: var(--success-soft);
  color: var(--success);
}

.sc-verdict span {
  color: var(--ink-2);
  font-size: var(--text-xs);
}

.sc-verdict ins {
  text-decoration: none;
  border-bottom: 2px solid var(--success);
}

.sc-fix {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-weight: 600;
}

.sc-fix svg,
.sc-fix + svg {
  width: 15px;
  height: 15px;
  color: var(--success);
}

del {
  color: var(--rate-again);
  text-decoration-thickness: 2px;
}

.sc-stream {
  margin-top: 10px;
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: 1.7;
}

.sc-stream .w,
.sc-bubble.ai .w {
  opacity: 0;
  animation: sc-fade-up 0.35s var(--ease-out) both;
  animation-delay: calc(var(--i) * 0.1s + 0.4s);
  display: inline-block;
}

.sc-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
}

.sc-vs-col {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--surface-border);
}

.sc-vs-col p {
  margin-top: 6px;
  font-size: var(--text-xs);
  color: var(--ink-2);
}

.sc-vs-badge {
  align-self: center;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 5px 9px;
}

/* ---------- B. Review explorer ---------- */
.sc-split-rev {
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
}

@media (max-width: 980px) {
  .sc-split-rev {
    grid-template-columns: 1fr;
  }
}

.sc-tabs {
  display: grid;
  gap: 8px;
}

.sc-tab {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.sc-tab:hover {
  border-color: var(--accent-border);
}

.sc-tab strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 680;
}

.sc-tab em {
  display: none;
  font-style: normal;
  font-size: var(--text-xs);
  color: var(--ink-2);
  margin-top: 3px;
}

.sc-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.sc-tab.active em {
  display: block;
}

/* autoplay progress along the bottom edge of the active tab */
.sc-tab::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2.5px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.sc-tabs.running .sc-tab.active::after {
  animation: sc-tab-progress 7s linear both;
}

@keyframes sc-tab-progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@media (max-width: 980px) {
  .sc-tabs {
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .sc-tab em {
    display: none !important;
  }
}

.sc-review-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px 9px;
  font-size: var(--text-xs);
  font-weight: 640;
}

.sc-count-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-weight: 700;
}

.sc-meta-hint {
  margin-left: auto;
  color: var(--ink-3);
  font-weight: 560;
}

.sc-progress {
  height: 7px;
  margin: 0 18px 4px;
  border-radius: 999px;
  background: var(--accent-soft);
  overflow: hidden;
}

.sc-progress i {
  display: block;
  height: 100%;
  width: 24%;
  border-radius: inherit;
  background: var(--accent);
}

.sc-stage {
  position: relative;
  padding: 14px 18px;
  min-height: 318px;
}

.sc-scene {
  display: none;
}

.sc-scene.active {
  display: block;
  animation: sc-fade-up 0.4s var(--ease-out) both;
}

.sc-cardface {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
}

.sc-front {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sc-cardface-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--ink-3);
  font-weight: 640;
}

.sc-flag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.sc-flag::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1.6px solid var(--ink-3);
}

.sc-mits-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-weight: 680;
}

.sc-front-big {
  font-size: clamp(2.2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: auto 0 4px;
}

.sc-front .sc-front-big {
  margin-top: auto;
}

.sc-front-reading {
  font-size: 1.125rem;
  color: var(--ink-2);
  margin-bottom: auto;
}

.sc-peek {
  display: inline-block;
  filter: blur(7px);
  transition: filter 0.3s var(--ease-out);
}

.sc-scene.active .sc-peek {
  animation: sc-peek 5.6s var(--ease-in-out) infinite;
}

@keyframes sc-peek {
  0%, 28% {
    filter: blur(7px);
  }
  38%, 64% {
    filter: blur(0);
  }
  74%, 100% {
    filter: blur(7px);
  }
}

.sc-cardface-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: var(--text-xs);
  color: var(--ink-3);
  margin-top: 18px;
}

.sc-space-key {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--bg-deep);
  border: 1px solid var(--surface-border);
  border-bottom-width: 2.5px;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--ink-2);
}

.sc-scene.active .sc-space-key {
  animation: sc-key-press 5.6s var(--ease-in-out) infinite;
}

@keyframes sc-key-press {
  0%, 30%, 40%, 100% {
    transform: translateY(0);
    background: var(--bg-deep);
  }
  33%, 37% {
    transform: translateY(2px);
    background: var(--accent-soft);
  }
}

/* back-of-card (Quick Look scene) */
.sc-back-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.sc-back-head > div {
  margin-right: auto;
  display: grid;
}

.sc-back-word {
  font-size: 1.5rem;
  font-weight: 700;
}

.sc-back-read {
  color: var(--ink-2);
  font-size: var(--text-xs);
}

.sc-circle-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--accent-strong);
  box-shadow: var(--shadow-soft);
}

.sc-circle-btn.accent {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}

.sc-circle-btn svg {
  width: 16px;
  height: 16px;
}

.sc-answerbox {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  background: var(--surface);
}

.sc-answerbox em {
  display: block;
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 7px;
}

.sc-answerbox ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 3px;
  font-weight: 640;
  font-size: var(--text-sm);
}

.sc-answerbox ol li::marker {
  color: var(--accent);
  font-size: 0.8em;
}

.sc-ql-mark {
  background: transparent;
  color: inherit;
  border-radius: 4px;
  padding: 0 1px;
  transition: background-color 0.3s var(--ease-out);
}

.sc-review[data-active="quick"] .sc-ql-mark {
  animation: sc-mark-pulse 6s var(--ease-in-out) both;
}

@keyframes sc-mark-pulse {
  0%, 8% {
    background: transparent;
  }
  16%, 100% {
    background: var(--accent-soft);
    box-shadow: 0 0 0 2px var(--accent-soft);
  }
}

/* Kanji scene — 字 lives on the back card and opens a bottom sheet */
.sc-kanji-stage {
  position: relative;
  min-height: 302px;
  overflow: hidden;
}

.sc-kanji-stage .sc-back-card {
  min-height: 240px;
}

.sc-kanji-fab {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--accent-border);
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: var(--shadow-soft);
}

.sc-scene.active .sc-kanji-fab {
  animation: sc-fab-pulse 1.4s var(--ease-out) 2 both;
}

@keyframes sc-fab-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 var(--accent-soft), var(--shadow-soft);
    transform: scale(1);
  }
  45% {
    box-shadow: 0 0 0 12px transparent, var(--shadow-soft);
    transform: scale(1.1);
  }
}

.sc-kanji-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 15px 17px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow-lift);
  transform: translateY(118%);
}

.sc-scene.active .sc-kanji-sheet {
  animation: sc-sheet-up 0.55s var(--ease-drawer) 1.3s forwards;
}

@keyframes sc-sheet-up {
  to {
    transform: translateY(0);
  }
}

/* sheet grab handle */
.sc-kanji-sheet::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  translate: -50% 0;
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-border);
}

.sc-kanji-big {
  font-size: 2.7rem;
  font-weight: 700;
  line-height: 1;
}

.sc-kanji-info {
  flex: 1;
  min-width: 200px;
  display: grid;
  gap: 8px;
}

.sc-kanji-info strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 660;
}

.sc-kanji-sheet .sc-add-mini {
  margin-top: 0;
}

.sc-kanji-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sc-kanji-readings {
  display: flex;
  gap: 10px;
}

.sc-kanji-readings span {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--surface-border);
  font-weight: 640;
  font-size: var(--text-sm);
}

.sc-kanji-readings em {
  display: block;
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-strong);
}

/* Sheets (Word Trainer / Ask AI / Compare / AutoFill) */
.sc-sheet {
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.sc-scene.active .sc-sheet {
  animation: sc-pop-in 0.45s var(--spring-snap) both;
}

.sc-sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sc-sheet-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.sc-sheet-icon svg {
  width: 19px;
  height: 19px;
}

.sc-sheet-head strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 680;
}

.sc-sheet-head em {
  display: block;
  font-style: normal;
  font-size: var(--text-xs);
  color: var(--ink-2);
}

.sc-tool-card {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--surface-border);
}

.sc-tool-card em {
  display: block;
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.sc-tool-card p {
  font-size: var(--text-sm);
  font-weight: 560;
}

.sc-scene.active .sc-step-1 {
  animation: sc-fade-up 0.4s var(--ease-out) 0.3s both;
}

.sc-scene.active .sc-step-2 {
  animation: sc-fade-up 0.4s var(--ease-out) 0.9s both;
}

.sc-scene.active .sc-step-2 .sc-type {
  animation: sc-typing calc(var(--n) * 0.12s) steps(var(--n)) 1.4s forwards;
}

.sc-scene.active .sc-step-3 {
  animation: sc-pop-in 0.5s var(--spring-bouncy) 3.6s both;
}

.sc-grade {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: var(--success);
}

.sc-grade svg {
  flex: none;
  width: 24px;
  height: 24px;
}

.sc-grade strong {
  display: block;
  font-size: var(--text-sm);
}

.sc-grade em {
  display: block;
  font-style: normal;
  font-size: var(--text-xs);
  color: var(--ink-2);
}

.sc-score {
  margin-left: auto;
  font-size: 1.4rem;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.sc-score sub {
  font-size: 0.65rem;
  font-weight: 640;
  color: var(--ink-3);
  vertical-align: baseline;
}

.sc-bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: var(--text-sm);
  line-height: 1.55;
}

.sc-bubble.user {
  justify-self: end;
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom-right-radius: 5px;
  font-weight: 600;
}

.sc-scene.active .sc-bubble.user {
  animation: sc-pop-in 0.4s var(--spring-snap) 0.3s both;
}

.sc-bubble.ai {
  justify-self: start;
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-bottom-left-radius: 5px;
  color: var(--ink-2);
}

.sc-scene.active .sc-bubble.ai {
  animation: sc-fade-up 0.4s var(--ease-out) 0.9s both;
}

.sc-bubble.ai .w {
  animation-delay: calc(var(--i) * 0.11s + 1.2s);
}

.sc-compare-add {
  justify-self: start;
  margin-top: 4px;
}

.sc-scene.active .sc-compare-add {
  animation: sc-btn-press 0.5s var(--ease-out) 2.2s both;
}

@keyframes sc-btn-press {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.93);
  }
}

.sc-compare-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: var(--text-xs);
  font-weight: 680;
  justify-self: start;
  opacity: 0;
}

.sc-compare-toast svg {
  width: 13px;
  height: 13px;
}

.sc-scene.active .sc-compare-toast {
  animation: sc-pop-in 0.45s var(--spring-bouncy) 2.8s both;
}

.sc-fill-btns {
  margin-left: auto;
  display: inline-flex;
  gap: 6px;
}

.sc-fill-btn {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 680;
  background: var(--chip-bg);
  color: var(--chip-text);
}

.sc-fill-btn.auto {
  background: var(--accent);
  color: var(--accent-ink);
}

.sc-scene.active .sc-fill-btn.auto {
  animation: sc-btn-press 0.5s var(--ease-out) 0.7s both;
}

.sc-field {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--surface-border);
}

.sc-field em {
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
}

.sc-field span {
  font-weight: 600;
  font-size: var(--text-sm);
  opacity: 0;
}

.sc-scene.active .sc-fill-1 span {
  animation: sc-fade-up 0.45s var(--ease-out) 1.3s both;
}

.sc-scene.active .sc-fill-2 span {
  animation: sc-fade-up 0.45s var(--ease-out) 1.8s both;
}

.sc-scene.active .sc-fill-3 span {
  animation: sc-fade-up 0.45s var(--ease-out) 2.3s both;
}

/* rating buttons */
.sc-ratings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  padding: 4px 18px 0;
}

.sc-rate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 9px 6px;
  border-radius: 13px;
  font-size: 0.8125rem;
  font-weight: 720;
  border: 1px solid;
}

.sc-rate svg {
  width: 15px;
  height: 15px;
  margin-bottom: 2px;
}

.sc-rate em {
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 600;
  opacity: 0.75;
}

.sc-rate.again {
  color: var(--rate-again);
  background: rgba(224, 82, 77, 0.1);
  border-color: rgba(224, 82, 77, 0.28);
}

.sc-rate.hard {
  color: var(--rate-hard);
  background: rgba(232, 138, 60, 0.1);
  border-color: rgba(232, 138, 60, 0.28);
}

.sc-rate.good {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(51, 166, 115, 0.3);
}

.sc-rate.easy {
  color: var(--rate-easy);
  background: rgba(91, 141, 239, 0.1);
  border-color: rgba(91, 141, 239, 0.28);
}

.sc-quicklook {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 18px 18px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--bg);
  color: var(--ink-3);
  font-size: var(--text-sm);
  transition: border-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.sc-quicklook svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--accent-strong);
}

.sc-ql-typed {
  display: none;
  color: var(--ink);
  font-weight: 620;
}

.sc-review[data-active="quick"] .sc-quicklook {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.sc-review[data-active="quick"] .sc-ql-placeholder {
  display: none;
}

.sc-review[data-active="quick"] .sc-ql-typed {
  display: inline-block;
  animation: sc-typing calc(var(--n) * 0.16s) steps(var(--n)) 0.9s forwards;
}

.sc-ql-pop {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 72px;
  z-index: 6;
  display: none;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow-lift);
}

.sc-ql-pop > div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sc-ql-pop p {
  margin-top: 5px;
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.sc-ql-pop .sc-add-mini {
  margin-top: 10px;
}

.sc-review[data-active="quick"] .sc-ql-pop {
  display: block;
  animation: sc-pop-in 0.5s var(--spring-snap) 1.8s both;
}

.sc-dim {
  opacity: 0.92;
}

/* ---------- C. Deck dashboard ---------- */
.sc-split-dash {
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  align-items: center;
}

@media (max-width: 980px) {
  .sc-split-dash {
    grid-template-columns: 1fr;
  }
}

.sc-dash-hero {
  margin: 16px 18px 0;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg) 100%);
}

.sc-dash-toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sc-dash-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.0625rem;
  font-weight: 740;
  letter-spacing: -0.01em;
}

.sc-drop {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.sc-drop svg {
  width: 16px;
  height: 16px;
}

.sc-streak-pill {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  font-size: 0.6875rem;
  font-weight: 740;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-2);
}

.sc-streak-pill b {
  color: var(--accent-strong);
  font-size: 0.875rem;
  margin-left: 4px;
}

.sc-dash-pills {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 10px;
}

.sc-tree-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding: 4px 0 8px;
}

.sc-tree-wrap svg {
  width: min(230px, 70%);
  height: auto;
  overflow: visible;
}

.sc-tree-ground {
  fill: var(--accent-soft);
}

.sc-tree-line {
  fill: none;
  stroke: var(--sc-trunk);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.4s var(--ease-out);
}

.sc-tree-line.trunk {
  stroke-width: 11;
}

.sc-tree-line.thin {
  stroke-width: 5.5;
  transition-delay: 0.5s;
}

.sc-dash.play .sc-tree-line {
  stroke-dashoffset: 0;
}

.sc-bw circle {
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.7s var(--spring-bouncy);
}

.sc-bw circle:nth-child(1) { fill: var(--petal-a); transition-delay: 0s; }
.sc-bw circle:nth-child(2) { fill: var(--sc-petal-c); transition-delay: 0.08s; }
.sc-bw circle:nth-child(3) { fill: var(--petal-b); opacity: 0.92; transition-delay: 0.16s; }
.sc-bw circle:nth-child(4) { fill: var(--petal-a); transition-delay: 0.1s; }
.sc-bw circle:nth-child(5) { fill: var(--sc-petal-c); transition-delay: 0.18s; }
.sc-bw circle:nth-child(6) { fill: var(--petal-b); opacity: 0.92; transition-delay: 0.26s; }
.sc-bw circle:nth-child(7) { fill: var(--petal-a); transition-delay: 0.2s; }
.sc-bw circle:nth-child(8) { fill: var(--sc-petal-c); transition-delay: 0.28s; }
.sc-bw circle:nth-child(9) { fill: var(--petal-b); opacity: 0.92; transition-delay: 0.36s; }

.sc-tree-wrap[data-wave="1"] .sc-bw[data-w="1"] circle,
.sc-tree-wrap[data-wave="2"] .sc-bw[data-w="1"] circle,
.sc-tree-wrap[data-wave="2"] .sc-bw[data-w="2"] circle,
.sc-tree-wrap[data-wave="3"] .sc-bw[data-w="1"] circle,
.sc-tree-wrap[data-wave="3"] .sc-bw[data-w="2"] circle,
.sc-tree-wrap[data-wave="3"] .sc-bw[data-w="3"] circle {
  transform: scale(1);
}

.sc-fpetal {
  position: absolute;
  top: 12%;
  width: 8px;
  height: 8px;
  border-radius: 60% 40% 60% 40%;
  background: var(--petal-a);
  opacity: 0;
  pointer-events: none;
}

.sc-fpetal:nth-of-type(1) { left: 32%; }
.sc-fpetal:nth-of-type(2) { left: 52%; }
.sc-fpetal:nth-of-type(3) { left: 66%; }

.sc-tree-wrap[data-wave="3"] .sc-fpetal {
  animation: sc-fall 4.2s linear infinite;
}

.sc-fpetal:nth-of-type(2) { animation-delay: 1.4s !important; }
.sc-fpetal:nth-of-type(3) { animation-delay: 2.6s !important; }

@keyframes sc-fall {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 0.85;
  }
  100% {
    transform: translate(-26px, 150px) rotate(260deg);
    opacity: 0;
  }
}

.sc-stage-label {
  position: absolute;
  bottom: 4px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--surface-border);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink-2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.sc-stage-label.pop {
  animation: sc-label-pop 0.5s var(--spring-bouncy);
}

@keyframes sc-label-pop {
  0% {
    transform: scale(0.8);
  }
  100% {
    transform: scale(1);
  }
}

.sc-gauges {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 5vw, 52px);
  margin-top: 6px;
}

.sc-gauge {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.sc-gauge svg {
  width: 78px;
  height: 78px;
}

.sc-gauge .rbg,
.sc-gauge .rfg {
  fill: none;
  stroke-width: 5.5;
  stroke-linecap: round;
}

.sc-gauge .rbg {
  stroke: var(--accent-soft);
}

.sc-gauge .rfg {
  stroke: var(--accent);
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 1.1s var(--ease-out);
}

.sc-gauge-txt {
  position: absolute;
  top: 39px;
  translate: 0 -50%;
  display: grid;
  justify-items: center;
  line-height: 1.15;
}

.sc-gauge-txt b {
  font-size: 1.05rem;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.sc-gauge-txt b.sc-bloom-word {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sc-gauge-txt span {
  font-size: 0.625rem;
  color: var(--ink-3);
  font-weight: 600;
}

.sc-gauge > em {
  font-style: normal;
  font-size: var(--text-xs);
  font-weight: 640;
  color: var(--ink-2);
}

.sc-deck-health {
  padding: 16px 18px 0;
}

.sc-deck-health > em {
  display: block;
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
  margin-bottom: 10px;
}

.sc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.sc-stat {
  display: grid;
  gap: 2px;
  padding: 12px 13px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--surface-border);
}

.sc-stat-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  margin-bottom: 6px;
}

.sc-stat-icon svg {
  width: 15px;
  height: 15px;
}

.sc-stat.due .sc-stat-icon {
  background: rgba(224, 82, 77, 0.12);
  color: var(--rate-again);
}

.sc-stat.new .sc-stat-icon {
  background: rgba(91, 141, 239, 0.12);
  color: var(--rate-easy);
}

.sc-stat.learn .sc-stat-icon {
  background: var(--success-soft);
  color: var(--success);
}

.sc-stat b {
  font-size: 1.55rem;
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1;
}

.sc-stat span {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
}

.sc-dash-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 16px 18px 0;
  padding: 13px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 720;
  box-shadow: var(--shadow-accent);
}

.sc-dash-cta svg {
  width: 14px;
  height: 14px;
}

.sc-tabbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
  padding: 10px 18px 14px;
  border-top: 1px solid var(--surface-border);
}

.sc-tabbar span {
  display: grid;
  justify-items: center;
  gap: 3px;
  font-size: 0.6875rem;
  font-weight: 680;
  color: var(--ink-3);
}

.sc-tabbar span svg {
  width: 17px;
  height: 17px;
}

.sc-tabbar span.active {
  color: var(--accent-strong);
}

.sc-dash-side {
  display: grid;
  gap: 22px;
}

.sc-side-item h4 {
  font-family: var(--font-text);
  font-size: 1.0625rem;
  font-weight: 680;
  letter-spacing: -0.01em;
  margin-bottom: 7px;
}

.sc-side-item p {
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.sc-demo-slot {
  margin-top: 13px;
  min-height: 64px;
}

.sc-toast,
.sc-notif {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-radius: var(--radius-md);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  translate: 0 10px;
}

.sc-toast strong,
.sc-notif strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
}

.sc-toast em,
.sc-notif em {
  display: block;
  font-style: normal;
  font-size: var(--text-xs);
  color: var(--ink-2);
}

.sc-toast-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.sc-toast-icon svg {
  width: 18px;
  height: 18px;
}

.sc-notif img {
  border-radius: 8px;
}

.sc-notif-time {
  margin-left: auto;
  align-self: flex-start;
  font-size: 0.6875rem;
  color: var(--ink-3);
}

.sc-split-dash.play .sc-toast {
  animation: sc-slot-cycle 11s var(--ease-out) infinite;
}

.sc-split-dash.play .sc-notif {
  animation: sc-slot-cycle 11s var(--ease-out) 5.5s infinite;
}

@keyframes sc-slot-cycle {
  0%, 4% {
    opacity: 0;
    translate: 0 10px;
  }
  9%, 42% {
    opacity: 1;
    translate: 0 0;
  }
  48%, 100% {
    opacity: 0;
    translate: 0 -8px;
  }
}

/* ---------- B2. Media cards ---------- */
.sc-split-media {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
}

@media (max-width: 980px) {
  .sc-split-media {
    grid-template-columns: 1fr;
  }
}

.sc-media-body {
  padding: 14px 18px 4px;
  display: grid;
  gap: 12px;
}

.sc-media-wordrow {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
}

.sc-media-wordrow .sc-circle-btn {
  margin-left: auto;
}

.sc-seen-pill {
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-strong);
  font-size: var(--text-xs);
  font-weight: 680;
}

.sc-answerbox em .sc-more {
  float: right;
  color: var(--accent-strong);
  letter-spacing: 0.04em;
}

.sc-mediabox {
  padding: 13px 15px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  background: var(--surface);
}

.sc-mediabox > em {
  display: flex;
  align-items: center;
  gap: 7px;
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 10px;
}

.sc-mediabox > em svg {
  width: 14px;
  height: 14px;
}

.sc-media-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.sc-media-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.sc-onview.play .sc-media-frame img {
  animation: sc-media-zoom 1.4s var(--ease-out) both;
}

@keyframes sc-media-zoom {
  from {
    transform: scale(1.05);
  }
  to {
    transform: scale(1);
  }
}

.sc-play-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(38, 48, 54, 0.72);
  color: #fff;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.sc-play-btn svg {
  width: 17px;
  height: 17px;
  margin-left: 2px;
}

.sc-onview.play .sc-play-btn {
  animation: sc-play-pulse 3.2s var(--ease-in-out) infinite;
}

@keyframes sc-play-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(38, 48, 54, 0.3);
  }
  45% {
    box-shadow: 0 0 0 9px transparent;
  }
}

.sc-subline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px 5px;
  margin-top: 13px;
  font-weight: 620;
  font-size: 0.9375rem;
}

.sc-subline .tok {
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--chip-bg);
  color: var(--chip-text);
}

.sc-subline .tok.hit {
  background: var(--accent);
  color: var(--accent-ink);
}

.sc-subline .plain {
  color: var(--ink-2);
}

.sc-onview.play .sc-subline > * {
  opacity: 0;
  animation: sc-fade-up 0.4s var(--ease-out) both;
}

.sc-onview.play .sc-subline > :nth-child(1) { animation-delay: 0.55s; }
.sc-onview.play .sc-subline > :nth-child(2) { animation-delay: 0.62s; }
.sc-onview.play .sc-subline > :nth-child(3) { animation-delay: 0.69s; }
.sc-onview.play .sc-subline > :nth-child(4) { animation-delay: 0.76s; }
.sc-onview.play .sc-subline > :nth-child(5) { animation-delay: 0.83s; }
.sc-onview.play .sc-subline > :nth-child(6) { animation-delay: 0.9s; }
.sc-onview.play .sc-subline > :nth-child(7) { animation-delay: 0.97s; }
.sc-onview.play .sc-subline > :nth-child(8) { animation-delay: 1.04s; }
.sc-onview.play .sc-subline > :nth-child(9) { animation-delay: 1.11s; }
.sc-onview.play .sc-subline > :nth-child(10) { animation-delay: 1.18s; }
.sc-onview.play .sc-subline > :nth-child(11) { animation-delay: 1.25s; }
.sc-onview.play .sc-subline > :nth-child(12) { animation-delay: 1.32s; }
.sc-onview.play .sc-subline > :nth-child(13) { animation-delay: 1.39s; }
.sc-onview.play .sc-subline > :nth-child(14) { animation-delay: 1.46s; }

.sc-media-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sc-media-pad {
  height: 18px;
}

/* ---------- D. Practice minis ---------- */
.sc-minis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 980px) {
  .sc-minis {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .sc-minis {
    grid-template-columns: 1fr;
  }
}

.sc-mini {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  transition: transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.sc-mini:hover {
  transform: translateY(-3px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-soft);
}

.sc-mini-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sc-mini-head .bento-icon {
  margin-bottom: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.sc-mini-head .bento-icon svg {
  width: 19px;
  height: 19px;
}

.sc-mini-head h4 {
  font-family: var(--font-text);
  font-size: 1rem;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.sc-mini > p {
  font-size: var(--text-xs);
  color: var(--ink-2);
}

.sc-mini-demo {
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--surface-border);
  padding: 15px;
  display: grid;
  gap: 11px;
  min-height: 132px;
  align-content: center;
}

/* fill-in-the-blank */
.sc-blank-sentence {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.9;
}

.sc-blank {
  display: inline-block;
  min-width: 3.4em;
  margin: 0 2px;
  padding: 0 4px;
  border-bottom: 2px solid var(--accent-border);
  text-align: center;
  vertical-align: bottom;
  transition: border-color 0.3s var(--ease-out);
}

.sc-blank-fill {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  width: 0;
  color: var(--accent-strong);
}

.sc-mini.play .sc-blank-fill {
  animation: sc-blank-fill 6.5s steps(3) infinite;
}

@keyframes sc-blank-fill {
  0%, 26% {
    width: 0;
  }
  36%, 88% {
    width: 3em;
  }
  100% {
    width: 3em;
  }
}

.sc-blank-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.sc-blank-chips span {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  font-size: var(--text-xs);
  font-weight: 640;
}

.sc-mini.play .sc-blank-chips .hit {
  animation: sc-chip-hit 6.5s var(--ease-out) infinite;
}

@keyframes sc-chip-hit {
  0%, 14% {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--surface-border);
    transform: scale(1);
  }
  20% {
    transform: scale(0.92);
  }
  26%, 88% {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: transparent;
    transform: scale(1);
  }
  100% {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--surface-border);
  }
}

/* grammar */
.sc-gram-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  font-weight: 640;
  font-size: var(--text-sm);
}

.sc-gram-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-xs);
  color: var(--ink-2);
  font-weight: 640;
}

.sc-gram-progress .bar,
.sc-nat-meter .bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  overflow: hidden;
}

.sc-gram-progress .bar i,
.sc-nat-meter .bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 1.1s var(--ease-out) 0.3s;
}

.sc-mini.play .sc-gram-progress .bar i {
  width: 30%;
}

/* diary */
.sc-diary-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: var(--text-sm);
}

.sc-diary-row em {
  flex: none;
  width: 34px;
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-3);
}

.sc-diary-row span {
  font-weight: 560;
}

.sc-diary-row.today {
  color: var(--ink);
}

.sc-mini.play .sc-diary-row.today .sc-type {
  animation: sc-diary-type 7s steps(var(--n)) infinite;
}

@keyframes sc-diary-type {
  0%, 12% {
    width: 0;
  }
  52%, 100% {
    width: calc(var(--n) * 1em);
  }
}

.sc-diary-streak {
  justify-self: start;
}

.sc-diary-streak svg {
  width: 12px;
  height: 12px;
  color: var(--rate-hard);
}

/* business keigo */
.sc-keigo-stage {
  position: relative;
  height: 44px;
}

.sc-keigo-stage .pair {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-size: 1.0625rem;
  font-weight: 620;
  opacity: 0;
}

.sc-keigo-stage .pair i {
  font-style: normal;
  color: var(--accent-strong);
}

.sc-keigo-stage .pair b {
  color: var(--accent-strong);
  font-weight: 740;
}

.sc-keigo-stage .pair.p1 {
  opacity: 1;
}

.sc-mini.play .sc-keigo-stage .pair {
  animation: sc-cycle-3 9s var(--ease-in-out) infinite;
}

.sc-mini.play .sc-keigo-stage .p1 { animation-delay: 0s; }
.sc-mini.play .sc-keigo-stage .p2 { animation-delay: 3s; }
.sc-mini.play .sc-keigo-stage .p3 { animation-delay: 6s; }

@keyframes sc-cycle-3 {
  0%, 2% {
    opacity: 0;
    translate: 0 8px;
  }
  6%, 30% {
    opacity: 1;
    translate: 0 0;
  }
  34%, 100% {
    opacity: 0;
    translate: 0 -8px;
  }
}

.sc-biz-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

/* AI tools: tone converter + naturalness */
.sc-tone-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.sc-tone-pills span {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  font-size: 0.6875rem;
  font-weight: 700;
}

.sc-tone-pills .t1 {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.sc-mini.play .sc-tone-pills span {
  animation: sc-pill-cycle 12s var(--ease-in-out) infinite;
  background: var(--surface);
  color: var(--ink);
}

.sc-mini.play .sc-tone-pills .t1 { animation-delay: 0s; }
.sc-mini.play .sc-tone-pills .t2 { animation-delay: 3s; }
.sc-mini.play .sc-tone-pills .t3 { animation-delay: 6s; }
.sc-mini.play .sc-tone-pills .t4 { animation-delay: 9s; }

@keyframes sc-pill-cycle {
  0%, 25% {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: transparent;
  }
  25.01%, 100% {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--surface-border);
  }
}

.sc-tone-stage {
  position: relative;
  height: 34px;
}

.sc-tone-stage span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.0625rem;
  font-weight: 640;
  opacity: 0;
}

.sc-tone-stage .s1 {
  opacity: 1;
}

.sc-mini.play .sc-tone-stage span {
  animation: sc-cycle-4 12s var(--ease-in-out) infinite;
  opacity: 0;
}

.sc-mini.play .sc-tone-stage .s1 { animation-delay: 0s; }
.sc-mini.play .sc-tone-stage .s2 { animation-delay: 3s; }
.sc-mini.play .sc-tone-stage .s3 { animation-delay: 6s; }
.sc-mini.play .sc-tone-stage .s4 { animation-delay: 9s; }

@keyframes sc-cycle-4 {
  0%, 1.5% {
    opacity: 0;
    translate: 0 8px;
  }
  5%, 22% {
    opacity: 1;
    translate: 0 0;
  }
  25.5%, 100% {
    opacity: 0;
    translate: 0 -8px;
  }
}

.sc-nat-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-xs);
  font-weight: 640;
  color: var(--ink-2);
}

.sc-nat-meter b {
  color: var(--success);
  font-size: 0.9375rem;
}

.sc-nat-meter .bar i {
  background: var(--success);
}

.sc-mini.play .sc-nat-meter .bar i {
  width: 92%;
}

/* cloud sync */
.sc-sync-demo {
  grid-template-columns: 1fr auto 1fr;
  display: grid;
  align-items: center;
  gap: 8px;
}

.sc-device {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.sc-device .sc-device-word {
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
}

.sc-device.mac .sc-device-word {
  width: 74px;
  height: 50px;
  border-radius: 9px;
}

.sc-device.phone .sc-device-word {
  width: 38px;
  height: 64px;
  border-radius: 11px;
}

.sc-device em {
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
}

.sc-mini.play .sc-device .sc-device-word {
  animation: sc-device-ping 4s var(--ease-in-out) infinite;
}

.sc-mini.play .sc-device.phone .sc-device-word {
  animation-delay: 2s;
}

@keyframes sc-device-ping {
  0%, 8%, 30%, 100% {
    border-color: var(--surface-border);
    box-shadow: var(--shadow-soft);
  }
  16% {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
  }
}

.sc-sync-line {
  position: relative;
  width: clamp(40px, 6vw, 70px);
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--accent-border) 0 6px,
    transparent 6px 12px
  );
}

.sc-sync-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  translate: 0 -50%;
  opacity: 0;
}

.sc-mini.play .sc-sync-dot {
  animation: sc-sync-dot 4s var(--ease-in-out) infinite;
}

@keyframes sc-sync-dot {
  0% {
    left: 0;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  46% {
    left: calc(100% - 9px);
    opacity: 1;
  }
  54% {
    left: calc(100% - 9px);
    opacity: 0;
  }
  60% {
    left: 0;
    opacity: 0;
  }
  66% {
    opacity: 1;
    left: calc(100% - 9px);
  }
  68% {
    left: calc(100% - 9px);
  }
  96% {
    left: 0;
    opacity: 1;
  }
  100% {
    left: 0;
    opacity: 0;
  }
}

/* ---------- E. Spotlight quick bar ---------- */
.sc-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(24px, 3.4vw, 44px);
  margin-top: clamp(56px, 8vh, 96px);
  padding: clamp(24px, 3.4vw, 40px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--surface-border);
}

@media (max-width: 860px) {
  .sc-spotlight {
    grid-template-columns: 1fr;
  }
}

.sc-spotlight h3 {
  font-size: var(--text-lg);
  margin: 10px 0;
}

.sc-spotlight p {
  color: var(--ink-2);
  font-size: var(--text-sm);
  max-width: 56ch;
}

/* night-city backdrop the quick bar floats over */
.sc-spot-stage {
  display: grid;
  place-items: center;
  padding: clamp(28px, 4.5vw, 56px) clamp(16px, 2.5vw, 32px);
  border-radius: var(--radius-md);
  overflow: hidden;
  background:
    radial-gradient(42% 56% at 6% 18%, rgba(72, 224, 220, 0.6) 0%, transparent 100%),
    radial-gradient(34% 46% at 90% 80%, rgba(255, 214, 82, 0.55) 0%, transparent 100%),
    radial-gradient(36% 52% at 20% 92%, rgba(238, 96, 86, 0.55) 0%, transparent 100%),
    radial-gradient(42% 58% at 80% 8%, rgba(150, 166, 255, 0.45) 0%, transparent 100%),
    radial-gradient(24% 34% at 52% 50%, rgba(246, 168, 192, 0.25) 0%, transparent 100%),
    linear-gradient(160deg, #23262e 0%, #15171d 100%);
}

.sc-spot-glass {
  width: min(560px, 100%);
  padding: 16px 20px 14px;
  border-radius: 18px;
  background: rgba(168, 171, 180, 0.42);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}

.sc-spot-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sc-spot-bar svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: rgba(255, 255, 255, 0.7);
}

.sc-spot-caret {
  flex: none;
  width: 2.5px;
  height: 1.45em;
  border-radius: 2px;
  background: #7fb2ff;
  animation: blink 1.06s steps(1) infinite;
}

.sc-spot-placeholder {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 560;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-spot-hint {
  margin-top: 14px;
  font-size: var(--text-xs);
  font-weight: 560;
  color: rgba(255, 255, 255, 0.78);
}

/* ---------- Motto ---------- */
.footer-motto {
  margin-top: 6px;
  font-size: var(--text-sm);
  font-weight: 640;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
}

/* ============================================================
   Nav: scrollspy active state + mobile menu
   ============================================================ */

/* Active section highlight (set by IntersectionObserver) */
.nav-links a.active {
  color: var(--ink);
  background: var(--accent-soft);
}

/* Hamburger — hidden on desktop, shown with the mobile breakpoint */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  place-items: center;
  transition: transform var(--dur-press) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

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

.nav-toggle:active {
  transform: scale(0.92);
}

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 18px;
  height: 12px;
}

.nav-toggle-bars i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--dur-move) var(--ease-out),
    opacity var(--dur-fast) var(--ease-out);
}

.nav-toggle-bars i:nth-child(1) { top: 0; }
.nav-toggle-bars i:nth-child(2) { top: 5px; }
.nav-toggle-bars i:nth-child(3) { top: 10px; }

/* bars morph into an X when open */
.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Mobile dropdown panel — scales down from the top bar (origin-aware) */
.mobile-nav {
  position: fixed;
  top: calc(var(--nav-h) - 2px);
  left: 0;
  right: 0;
  z-index: 99;
  display: grid;
  gap: 4px;
  padding: 14px clamp(20px, 6vw, 28px) 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--surface-border);
  box-shadow: var(--shadow-lift);
  transform-origin: top center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.985);
  transition: opacity var(--dur-move) var(--ease-out),
    transform var(--dur-drawer) var(--ease-out),
    visibility 0s linear var(--dur-drawer);
}

.nav.nav-open .mobile-nav {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity var(--dur-move) var(--ease-out),
    transform var(--dur-drawer) var(--ease-out),
    visibility 0s;
}

.mobile-nav a:not(.btn) {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: var(--text-md);
  font-weight: 560;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.mobile-nav a:not(.btn):hover,
.mobile-nav a:not(.btn).active {
  background: var(--accent-soft);
  text-decoration: none;
}

.mobile-nav-cta {
  margin-top: 8px;
  width: 100%;
}

/* Scrim behind the open panel */
.nav-scrim {
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: 90;
  background: rgba(16, 12, 18, 0.32);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity var(--dur-move) var(--ease-out);
}

.nav-scrim.show {
  opacity: 1;
}

@media (max-width: 760px) {
  .nav-toggle {
    display: grid;
  }
  .nav-download {
    display: none;
  }
}

@media (min-width: 761px) {
  /* never trap the panel open if the viewport grows past the breakpoint */
  .mobile-nav,
  .nav-scrim {
    display: none;
  }
}

/* ============================================================
   FAQ — accessible accordion
   ============================================================ */
.faq-list {
  display: grid;
  gap: 12px;
  max-width: 820px;
}

.faq-item {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.faq-item:hover {
  border-color: var(--accent-border);
}

.faq-item.open {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-soft);
}

.faq-item h3 {
  margin: 0;
  font-family: var(--font-text);
}

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 22px;
  border: none;
  background: none;
  font: inherit;
  font-size: var(--text-md);
  font-weight: 620;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.faq-q:focus-visible {
  outline-offset: -2px;
}

.faq-chevron {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--accent-strong);
  transition: transform var(--dur-move) var(--ease-out);
}

.faq-q[aria-expanded="true"] .faq-chevron {
  transform: rotate(180deg);
}

.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-drawer) var(--ease-out);
}

.faq-a[hidden] {
  display: none;
}

.faq-item.open .faq-a {
  grid-template-rows: 1fr;
}

.faq-a-inner {
  overflow: hidden;
  min-height: 0;
}

.faq-a-inner p {
  padding: 0 22px 20px;
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.faq-a-inner a {
  font-weight: 620;
}

/* ============================================================
   Closing CTA
   ============================================================ */
.cta-final {
  padding-top: clamp(48px, 7vh, 80px);
}

.cta-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
  padding: clamp(40px, 6vw, 76px) clamp(24px, 5vw, 56px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--accent-border);
  background:
    radial-gradient(60% 80% at 50% -10%, var(--accent-soft) 0%, transparent 70%),
    var(--surface);
}

.cta-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -60% -20%;
  height: 80%;
  z-index: -1;
  background: radial-gradient(50% 60% at 50% 100%, var(--accent-soft) 0%, transparent 75%);
}

.cta-kicker {
  font-size: var(--text-sm);
  font-weight: 640;
  letter-spacing: 0.1em;
  color: var(--accent-strong);
  margin-bottom: 14px;
}

.cta-card h2 {
  font-size: var(--text-xl);
  margin-bottom: 14px;
}

.cta-sub {
  max-width: 48ch;
  margin: 0 auto 30px;
  color: var(--ink-2);
  font-size: var(--text-md);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.cta-note {
  margin-top: 20px;
  font-size: var(--text-xs);
  color: var(--ink-3);
}

/* decorative drifting petals — purely ambient, gated behind reduced-motion */
.cta-petals {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.cta-petals span {
  position: absolute;
  top: -8%;
  width: 10px;
  height: 10px;
  border-radius: 60% 40% 60% 40%;
  background: var(--petal-a);
  opacity: 0;
  animation: cta-petal-fall 7s linear infinite;
}

.cta-petals span:nth-child(1) { left: 12%; animation-delay: 0s; }
.cta-petals span:nth-child(2) { left: 32%; animation-delay: 1.6s; background: var(--petal-b); }
.cta-petals span:nth-child(3) { left: 54%; animation-delay: 3.1s; }
.cta-petals span:nth-child(4) { left: 73%; animation-delay: 4.4s; background: var(--petal-b); }
.cta-petals span:nth-child(5) { left: 88%; animation-delay: 5.5s; }

@keyframes cta-petal-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(360px) rotate(300deg);
    opacity: 0;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal,
  .js.no-sda .reveal {
    animation: none;
    opacity: 1;
    translate: 0 0;
  }
  #petals {
    display: none;
  }
  .mockup-card {
    animation: none;
    transform: none;
  }

  /* showcase: freeze every demo in a readable resting state */
  .sc-scene.active .sc-peek,
  .sc-scene.active .sc-space-key,
  .sc-mini.play .sc-blank-fill,
  .sc-mini.play .sc-blank-chips .hit,
  .sc-mini.play .sc-keigo-stage .pair,
  .sc-mini.play .sc-tone-stage span,
  .sc-mini.play .sc-tone-pills span,
  .sc-mini.play .sc-diary-row.today .sc-type,
  .sc-mini.play .sc-device .sc-device-word,
  .sc-mini.play .sc-sync-dot,
  .sc-split-dash.play .sc-toast,
  .sc-split-dash.play .sc-notif,
  .sc-tabs.running .sc-tab.active::after,
  .sc-tree-wrap[data-wave="3"] .sc-fpetal {
    animation: none !important;
  }
  .sc-toast,
  .sc-notif {
    opacity: 1;
    translate: 0 0;
  }
  .sc-blank-fill {
    width: 3em;
  }
  .sc-type,
  .sc-ql-typed {
    width: calc(var(--n) * 1em) !important;
  }
  .sc-caret {
    animation: none;
  }
  .sc-stream .w,
  .sc-bubble.ai .w,
  .sc-field span,
  .sc-onview.play .sc-subline > * {
    opacity: 1;
    animation: none !important;
  }
  .sc-kanji-sheet {
    transform: none;
    animation: none !important;
  }
  .sc-onview.play .sc-media-frame img,
  .sc-onview.play .sc-play-btn,
  .sc-spot-caret {
    animation: none !important;
  }
  .cta-petals {
    display: none;
  }
}
