/* ─── imiwa? Main Stylesheet ─────────────────────────────────────────────── */

@import url("tokens.css");

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text-primary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--color-dominant); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }

/* ── Layout Utilities ─────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

@media (min-width: 640px) {
  .container { padding-inline: var(--space-6); }
}

@media (min-width: 1024px) {
  .container { padding-inline: var(--space-7); }
}

/* ── Navigation ───────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--color-nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-nav-border);
}

.site-nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-logo {
  font-family: 'Kodchasan', var(--font-sans);
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--color-dominant);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; opacity: 0.85; }
.nav-logo .logo-mark { color: var(--color-accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-left: auto;
}

.nav-links a {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--color-text-primary); }
.nav-links a.nav-current { color: var(--color-dominant); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-dominant);
  color: var(--color-text-on-dominant) !important;
  font-size: var(--font-size-xs) !important;
  font-weight: 700 !important;
  padding: 7px 16px;
  border-radius: 20px;
  transition: background 0.15s !important;
}
.nav-cta:hover { background: var(--color-dominant-hover) !important; text-decoration: none !important; }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ── Language picker ──────────────────────────────────────────────────────── */
.nav-lang {
  position: relative;
  flex-shrink: 0;
}

.nav-lang-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  height: 34px;
  padding: 0 10px;
  background: transparent;
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 600;
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-lang-btn:hover {
  color: var(--color-text-primary);
  border-color: var(--color-text-tertiary);
  background: var(--color-surface);
}
.nav-lang-btn svg { pointer-events: none; transition: transform 0.15s; }
.nav-lang[aria-expanded="true"] .nav-lang-btn svg { transform: rotate(180deg); }

.nav-lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--color-nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  z-index: 200;
}
.nav-lang[aria-expanded="true"] .nav-lang-dropdown { display: block; }

.nav-lang-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-family: var(--font-sans);
  color: var(--color-text-secondary);
  text-align: left;
  transition: background 0.1s, color 0.1s;
}
.nav-lang-option:hover { background: var(--color-surface); color: var(--color-text-primary); }
.nav-lang-option[aria-current="true"] { color: var(--color-dominant); font-weight: 600; }
.nav-lang-option .lang-flag { font-size: 1.1em; line-height: 1; }

/* ── Theme toggle ─────────────────────────────────────────────────────────── */
.nav-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: transparent;
  border: 1.5px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.nav-theme-toggle:hover {
  color: var(--color-text-primary);
  border-color: var(--color-text-tertiary);
  background: var(--color-surface);
}

@media (max-width: 639px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--color-nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--color-nav-border);
    padding: var(--space-5);
  }
  .nav-hamburger { display: flex; }
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  padding-top: var(--space-10);
  padding-bottom: var(--space-9);
  background-color: #f7f2ea;
  overflow: hidden;
  position: relative;
  /* dot grid */
  background-image: radial-gradient(circle, rgba(0,0,0,0.10) 1px, transparent 1px);
  background-size: 24px 24px;
}

[data-theme="dark"] .hero {
  background-color: #141210;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
}

/* Soft colour blobs via pseudo-elements */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

/* Pink blob — bottom-left */
.hero::before {
  width: 520px;
  height: 520px;
  background: rgba(240, 180, 180, 0.55);
  bottom: -120px;
  left: -100px;
}

/* Sage green blob — top-right */
.hero::after {
  width: 480px;
  height: 480px;
  background: rgba(157, 182, 42, 0.30);
  top: -100px;
  right: -80px;
}

[data-theme="dark"] .hero::before {
  background: rgba(180, 60, 60, 0.25);
}
[data-theme="dark"] .hero::after {
  background: rgba(100, 120, 20, 0.20);
}

/* Ensure hero content sits above blobs */
.hero .container { position: relative; z-index: 1; }

/* 字 watermark — home hero (single character, horizontal) */
.hero-kanji {
  position: absolute;
  font-family: 'Hachi Maru Pop', "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(280px, 42vw, 540px);
  font-weight: 400;
  line-height: 1;
  color: var(--color-dominant);
  opacity: 0.06;
  right: -0.05em;
  top: 50%;
  transform: translateY(-52%);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

[data-theme="dark"] .hero-kanji { opacity: 0.09; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-kanji { opacity: 0.09; }
}

/* Below 768px the hero is single-column and the full-size 字 overlaps
   the title. Top-dock it in the 128px padding zone instead. */
@media (max-width: 767px) {
  .hero-kanji {
    font-size: clamp(68px, 18vw, 100px);
    top: 16px;
    right: 3%;
    transform: none;
  }
}

/* Kanji watermark — interior page heroes (2-character compounds)
   Always top-docked so the kanji never overlaps the h1 title:
   · At small viewports it sits above the text in the 96px padding zone
   · At large viewports it's horizontally clear of the title on the right
   Single clamp() — no breakpoint, no size jump. */
.page-hero-kanji {
  position: absolute;
  font-family: 'Hachi Maru Pop', "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(68px, 13vw, 220px);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  color: var(--color-dominant);
  opacity: 0.07;
  right: 3%;
  top: 14px;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

[data-theme="dark"] .page-hero-kanji { opacity: 0.10; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .page-hero-kanji { opacity: 0.10; }
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: center;
}

.hero-text {
  min-width: 0;
}

@media (min-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-7);
  }
}

.hero-app-icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-5);
  display: block;
}

.hero-eyebrow {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-dominant);
  margin-bottom: var(--space-4);
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, var(--font-size-4xl));
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--space-5);
}

.hero-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  line-height: var(--line-height-base);
  max-width: 480px;
  margin-bottom: var(--space-6);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

@media (max-width: 639px) {
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    width: fit-content;
  }
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: #111;
  color: #fff;
  font-size: var(--font-size-sm);
  font-weight: 700;
  padding: 13px 24px;
  border-radius: 40px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: #000; transform: translateY(-1px); text-decoration: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { background: #f0f0f0; color: #111; }
  :root:not([data-theme="light"]) .btn-primary:hover { background: #fff; }
}

[data-theme="dark"] .btn-primary { background: #f0f0f0; color: #111; }
[data-theme="dark"] .btn-primary:hover { background: #fff; }
[data-theme="light"] .btn-primary { background: #111; color: #fff; }
[data-theme="light"] .btn-primary:hover { background: #000; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: transparent;
  color: var(--color-dominant);
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 40px;
  border: 1.5px solid var(--color-dominant);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.btn-secondary:hover { background: var(--color-dominant); color: #fff; text-decoration: none; }

.hero-compat {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  margin-top: var(--space-3);
}

/* Phone mockup */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  position: relative;
  perspective: 1200px;
}

.phone-mockup {
  position: relative;
  width: 220px;
  filter: drop-shadow(var(--shadow-phone));
}

.phone-mockup img {
  width: 100%;
  border-radius: 36px;
  border: 2px solid var(--color-border);
}

.phone-mockup-placeholder {
  width: 220px;
  height: 440px;
  background: var(--color-surface);
  border-radius: 36px;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
}

@media (min-width: 768px) {
  .phone-mockup {
    width: 260px;
    transform: rotateY(-18deg) rotateX(4deg);
    transition: transform 0.4s ease;
  }
  .phone-mockup:hover {
    transform: rotateY(-8deg) rotateX(2deg);
  }
  .phone-mockup-placeholder { width: 260px; height: 520px; }
}

/* ── Stats Bar ────────────────────────────────────────────────────────────── */
.stats-bar {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-5) 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-cell {
  background: var(--color-surface);
  padding: var(--space-5) var(--space-4);
  text-align: center;
}

.stat-number {
  font-size: var(--font-size-2xl);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--color-dominant);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Section Generic ──────────────────────────────────────────────────────── */
.section {
  padding: var(--space-9) 0;
}

.section-alt {
  background: var(--color-surface);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-7);
}

.section-eyebrow {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-dominant);
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, var(--font-size-3xl));
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.section-desc {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin-inline: auto;
  line-height: var(--line-height-base);
}

/* ── Feature Card Grid ────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 480px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
  .feature-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.feature-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: box-shadow 0.2s, transform 0.2s;
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: var(--space-4);
  background: var(--color-dominant-tint);
  color: var(--color-dominant);
}

.feature-card-icon.accent {
  background: var(--color-accent-tint);
  color: var(--color-accent);
}

.feature-card-icon.neutral {
  background: var(--color-surface);
  color: var(--color-text-secondary);
}

.feature-card-title {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.feature-card-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-base);
}

/* ── Feature Deep-Dives (alternating) ────────────────────────────────────── */
.feature-spotlight {
  padding: var(--space-9) 0;
  overflow: hidden;
}

.feature-spotlight + .feature-spotlight {
  border-top: 1px solid var(--color-border);
}

.feature-spotlight-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
  align-items: center;
}

@media (min-width: 768px) {
  .feature-spotlight-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
  .feature-spotlight-inner.reverse { direction: rtl; }
  .feature-spotlight-inner.reverse > * { direction: ltr; }
}

.spotlight-text {}

.spotlight-eyebrow {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-dominant);
  margin-bottom: var(--space-3);
}

.spotlight-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.spotlight-desc {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  line-height: var(--line-height-loose);
  margin-bottom: var(--space-5);
}

.spotlight-bullets {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.spotlight-bullet {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.spotlight-bullet::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-dominant);
  flex-shrink: 0;
  margin-top: 7px;
}

.spotlight-visual {
  display: flex;
  justify-content: center;
  perspective: 1200px;
}

.screenshot-frame {
  position: relative;
  max-width: 280px;
  width: 100%;
}

.screenshot-frame img {
  width: 100%;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-phone);
  border: 1.5px solid var(--color-border);
}

@media (min-width: 768px) {
  .screenshot-frame {
    transform: rotateY(-18deg) rotateX(4deg);
    transition: transform 0.4s ease;
  }
  .screenshot-frame:hover {
    transform: rotateY(-8deg) rotateX(2deg);
  }
  .feature-spotlight-inner.reverse .screenshot-frame {
    transform: rotateY(18deg) rotateX(4deg);
  }
  .feature-spotlight-inner.reverse .screenshot-frame:hover {
    transform: rotateY(8deg) rotateX(2deg);
  }
}

.dynamic-island {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 1.25%;
  width: 28.6%;
  aspect-ratio: 378 / 111;
  background: #000;
  border-radius: 9999px;
  z-index: 10;
  pointer-events: none;
}

.screenshot-placeholder {
  width: 100%;
  aspect-ratio: 9/19;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-phone);
}

/* ── CTA Section ──────────────────────────────────────────────────────────── */
.cta-section {
  padding: var(--space-10) 0;
  background: linear-gradient(160deg, var(--color-dominant-tint), var(--color-bg));
  text-align: center;
}

.cta-title {
  font-size: clamp(1.75rem, 4vw, var(--font-size-3xl));
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.cta-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-7);
  max-width: 500px;
  margin-inline: auto;
  margin-bottom: var(--space-7);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-7) 0 var(--space-6);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 640px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .footer-inner { grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-8); }
}

.footer-brand {}
.footer-logo {
  font-family: 'Kodchasan', var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--color-dominant);
  margin-bottom: var(--space-3);
  display: block;
}
.footer-logo .logo-mark { color: var(--color-accent); }
.footer-tagline {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  line-height: var(--line-height-base);
}

.footer-col-title {
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-4);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--color-dominant); }

.footer-bottom {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: center;
}

.footer-copyright {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  line-height: var(--line-height-base);
}

.footer-credits {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
}

/* ── Page Hero (inner pages) ──────────────────────────────────────────────── */
.page-hero {
  padding: var(--space-9) 0 var(--space-7);
  background-color: #f7f2ea;
  background-image: radial-gradient(circle, rgba(0,0,0,0.10) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow: hidden;
  position: relative;
}

[data-theme="dark"] .page-hero {
  background-color: #141210;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
}

.page-hero::before,
.page-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.page-hero::before {
  width: 400px;
  height: 400px;
  background: rgba(240, 180, 180, 0.50);
  bottom: -100px;
  left: -80px;
}

.page-hero::after {
  width: 360px;
  height: 360px;
  background: rgba(157, 182, 42, 0.28);
  top: -80px;
  right: -60px;
}

[data-theme="dark"] .page-hero::before {
  background: rgba(180, 60, 60, 0.22);
}
[data-theme="dark"] .page-hero::after {
  background: rgba(100, 120, 20, 0.18);
}

.page-hero .container { position: relative; z-index: 1; }

.page-hero-title {
  font-size: clamp(2rem, 5vw, var(--font-size-3xl));
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.page-hero-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  line-height: var(--line-height-base);
}

/* ── Prose (privacy, support content) ────────────────────────────────────── */
.prose {
  max-width: 720px;
}

.prose h2 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  margin-top: var(--space-7);
  margin-bottom: var(--space-4);
}

.prose h3 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
}

.prose p {
  color: var(--color-text-secondary);
  line-height: var(--line-height-loose);
  margin-bottom: var(--space-4);
}

.prose a { color: var(--color-dominant); }

.prose ul {
  list-style: disc;
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.prose ul li {
  color: var(--color-text-secondary);
  line-height: var(--line-height-loose);
  margin-bottom: var(--space-2);
}

/* ── Donate Card ──────────────────────────────────────────────────────────── */
.donate-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-7);
  max-width: 560px;
}

.donate-card-title {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.donate-card-desc {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  line-height: var(--line-height-loose);
  margin-bottom: var(--space-6);
}

/* ── Support FAQ ──────────────────────────────────────────────────────────── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-width: 720px;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: var(--space-5) var(--space-6);
  background: var(--color-bg);
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  transition: background 0.15s;
}

.faq-question:hover { background: var(--color-surface); }

.faq-question::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--color-dominant);
  flex-shrink: 0;
  margin-left: var(--space-4);
  transition: transform 0.2s;
}

.faq-item.open .faq-question::after { transform: rotate(45deg); }

.faq-answer {
  display: none;
  padding: 0 var(--space-6) var(--space-5);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-loose);
  background: var(--color-bg);
}

.faq-item.open .faq-answer { display: block; }

/* ── Features Page ────────────────────────────────────────────────────────── */
.feature-category {
  margin-bottom: var(--space-8);
}

.feature-category-title {
  font-size: var(--font-size-xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-dominant);
  display: inline-block;
}

.feature-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.feature-row:last-child { border-bottom: none; }

.feature-row-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: var(--color-dominant-tint);
  color: var(--color-dominant);
}

.feature-row-icon.accent {
  background: var(--color-accent-tint);
  color: var(--color-accent);
}

.feature-row-body {}

.feature-row-name {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.feature-row-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-base);
}

/* ── Data Credits ─────────────────────────────────────────────────────────── */
.credits-table {
  width: 100%;
  max-width: 720px;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.credits-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-weight: 700;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-tertiary);
  border-bottom: 2px solid var(--color-border);
}

.credits-table td {
  padding: var(--space-4);
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  line-height: var(--line-height-base);
}

.credits-table td:first-child { font-weight: 600; color: var(--color-text-primary); }

/* ── Crossfade: 2-image (fc-a / fc-b) ────────────────────────────────────── */
/*  Cycle: 3s hold A → 1s fade → 3s hold B → 1s fade back = 8s total
    A: visible 0–37.5%, fade out 37.5–50%, hidden 50–87.5%, fade in 87.5–100%
    B: hidden 0–37.5%, fade in 37.5–50%, visible 50–87.5%, fade out 87.5–100% */
/* Container holds its size via aspect-ratio; all four images sit absolutely
   on top of each other so theme switching / display:none never collapses the frame.
   Ratio matches actual screenshot pixel dimensions: 1320 × 2868. */
.fc-crossfade {
  position: relative;
  width: 100%;
  aspect-ratio: 1320 / 2868;
}
.fc-crossfade img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.fc-crossfade .fc-a {
  animation: fc-show-a 8s ease-in-out infinite;
}
.fc-crossfade .fc-b {
  opacity: 0;
  animation: fc-show-b 8s ease-in-out infinite;
}

@keyframes fc-show-a {
  0%     { opacity: 1; }
  37.5%  { opacity: 1; }
  50%    { opacity: 0; }
  87.5%  { opacity: 0; }
  100%   { opacity: 1; }
}
@keyframes fc-show-b {
  0%     { opacity: 0; }
  37.5%  { opacity: 0; }
  50%    { opacity: 1; }
  87.5%  { opacity: 1; }
  100%   { opacity: 0; }
}

/* ── Crossfade: 3-image (fc3-a / fc3-b / fc3-c) ──────────────────────────── */
/*  Cycle: 3s hold each → 1s fade between = 12s total per loop
    Each image is visible for 3s (25%) and fades over 1s (8.33%)
    A: in  0–25%, out 25–33.33%, hidden 33.33–91.67%, in 91.67–100%
    B: hidden 0–25%, in 25–33.33%, visible 33.33–58.33%, out 58.33–66.67%, hidden 66.67–100%
    C: hidden 0–58.33%, in 58.33–66.67%, visible 66.67–91.67%, out 91.67–100%             */
.fc3-crossfade {
  position: relative;
  width: 100%;
  aspect-ratio: 1320 / 2868;
}
.fc3-crossfade img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: fill;
}
.fc3-crossfade .fc3-a { animation: fc3-show-a 12s ease-in-out infinite; }
.fc3-crossfade .fc3-b { opacity: 0; animation: fc3-show-b 12s ease-in-out infinite; }
.fc3-crossfade .fc3-c { opacity: 0; animation: fc3-show-c 12s ease-in-out infinite; }

@keyframes fc3-show-a {
  0%       { opacity: 1; }
  25%      { opacity: 1; }
  33.33%   { opacity: 0; }
  91.67%   { opacity: 0; }
  100%     { opacity: 1; }
}
@keyframes fc3-show-b {
  0%       { opacity: 0; }
  25%      { opacity: 0; }
  33.33%   { opacity: 1; }
  58.33%   { opacity: 1; }
  66.67%   { opacity: 0; }
  100%     { opacity: 0; }
}
@keyframes fc3-show-c {
  0%       { opacity: 0; }
  58.33%   { opacity: 0; }
  66.67%   { opacity: 1; }
  91.67%   { opacity: 1; }
  100%     { opacity: 0; }
}

/* ── Themed screenshots ───────────────────────────────────────────────────── */
/* Default: show light, hide dark. */
.img-dark { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .img-dark  { display: block; }
  :root:not([data-theme="light"]) .img-light { display: none; }
}
[data-theme="dark"]  .img-dark  { display: block; }
[data-theme="dark"]  .img-light { display: none; }
[data-theme="light"] .img-dark  { display: none; }
[data-theme="light"] .img-light { display: block; }

/* Inside the crossfade container, use visibility instead of display so that
   absolutely-positioned images still participate in layout/animation. */
.fc-crossfade .img-dark  { display: block; visibility: hidden; }
.fc-crossfade .img-light { display: block; visibility: visible; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fc-crossfade .img-dark  { visibility: visible; }
  :root:not([data-theme="light"]) .fc-crossfade .img-light { visibility: hidden; }
}
[data-theme="dark"]  .fc-crossfade .img-dark  { visibility: visible; }
[data-theme="dark"]  .fc-crossfade .img-light { visibility: hidden; }
[data-theme="light"] .fc-crossfade .img-dark  { visibility: hidden; }
[data-theme="light"] .fc-crossfade .img-light { visibility: visible; }

/* Same visibility rules for the 3-image crossfade variant */
.fc3-crossfade .img-dark  { display: block; visibility: hidden; }
.fc3-crossfade .img-light { display: block; visibility: visible; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fc3-crossfade .img-dark  { visibility: visible; }
  :root:not([data-theme="light"]) .fc3-crossfade .img-light { visibility: hidden; }
}
[data-theme="dark"]  .fc3-crossfade .img-dark  { visibility: visible; }
[data-theme="dark"]  .fc3-crossfade .img-light { visibility: hidden; }
[data-theme="light"] .fc3-crossfade .img-dark  { visibility: hidden; }
[data-theme="light"] .fc3-crossfade .img-light { visibility: visible; }

/* ── Crossfade: 6-image (fc6-a … fc6-f) ──────────────────────────────────── */
/*  Cycle: 3s hold each → 1s fade between = 24s total
    Each slot = 4s = 16.67% of 24s; fade = 1s = 4.17%
    A: 0–16.67% visible, 16.67–20.83% out, 20.83–95.83% hidden, 95.83–100% in
    B: offset +16.67% · C: +33.33% · D: +50% · E: +66.67% · F: +83.33%     */
.fc6-crossfade {
  position: relative;
  width: 100%;
  aspect-ratio: 1320 / 2868;
}
.fc6-crossfade img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: fill;
}
.fc6-crossfade .fc6-a { animation: fc6-show-a 24s ease-in-out infinite; }
.fc6-crossfade .fc6-b { opacity: 0; animation: fc6-show-b 24s ease-in-out infinite; }
.fc6-crossfade .fc6-c { opacity: 0; animation: fc6-show-c 24s ease-in-out infinite; }
.fc6-crossfade .fc6-d { opacity: 0; animation: fc6-show-d 24s ease-in-out infinite; }
.fc6-crossfade .fc6-e { opacity: 0; animation: fc6-show-e 24s ease-in-out infinite; }
.fc6-crossfade .fc6-f { opacity: 0; animation: fc6-show-f 24s ease-in-out infinite; }

@keyframes fc6-show-a {
  0%      { opacity: 1; }
  16.67%  { opacity: 1; }
  20.83%  { opacity: 0; }
  95.83%  { opacity: 0; }
  100%    { opacity: 1; }
}
@keyframes fc6-show-b {
  0%      { opacity: 0; }
  16.67%  { opacity: 0; }
  20.83%  { opacity: 1; }
  33.33%  { opacity: 1; }
  37.5%   { opacity: 0; }
  100%    { opacity: 0; }
}
@keyframes fc6-show-c {
  0%      { opacity: 0; }
  33.33%  { opacity: 0; }
  37.5%   { opacity: 1; }
  50%     { opacity: 1; }
  54.17%  { opacity: 0; }
  100%    { opacity: 0; }
}
@keyframes fc6-show-d {
  0%      { opacity: 0; }
  50%     { opacity: 0; }
  54.17%  { opacity: 1; }
  66.67%  { opacity: 1; }
  70.83%  { opacity: 0; }
  100%    { opacity: 0; }
}
@keyframes fc6-show-e {
  0%      { opacity: 0; }
  66.67%  { opacity: 0; }
  70.83%  { opacity: 1; }
  83.33%  { opacity: 1; }
  87.5%   { opacity: 0; }
  100%    { opacity: 0; }
}
@keyframes fc6-show-f {
  0%      { opacity: 0; }
  83.33%  { opacity: 0; }
  87.5%   { opacity: 1; }
  95.83%  { opacity: 1; }  /* hold ends just before A fades back in */
  100%    { opacity: 0; }
}

.fc6-crossfade .img-dark  { display: block; visibility: hidden; }
.fc6-crossfade .img-light { display: block; visibility: visible; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fc6-crossfade .img-dark  { visibility: visible; }
  :root:not([data-theme="light"]) .fc6-crossfade .img-light { visibility: hidden; }
}
[data-theme="dark"]  .fc6-crossfade .img-dark  { visibility: visible; }
[data-theme="dark"]  .fc6-crossfade .img-light { visibility: hidden; }
[data-theme="light"] .fc6-crossfade .img-dark  { visibility: hidden; }
[data-theme="light"] .fc6-crossfade .img-light { visibility: visible; }

/* ── SF Symbol icons (mask-image lets currentColor drive the fill) ────────── */
.sf-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  flex-shrink: 0;
}
.sf-icon.magnifyingglass       { -webkit-mask-image: url('../images/icons/magnifyingglass.svg');              mask-image: url('../images/icons/magnifyingglass.svg'); }
.sf-icon.wand-and-rays         { -webkit-mask-image: url('../images/icons/wand.and.rays.svg');                mask-image: url('../images/icons/wand.and.rays.svg'); }
.sf-icon.camera                { -webkit-mask-image: url('../images/icons/camera.svg');                       mask-image: url('../images/icons/camera.svg'); }
.sf-icon.rectangle-on-rect     { -webkit-mask-image: url('../images/icons/rectangle.on.rectangle.angled.svg'); mask-image: url('../images/icons/rectangle.on.rectangle.angled.svg'); }
.sf-icon.waveform              { -webkit-mask-image: url('../images/icons/waveform.path.svg');                mask-image: url('../images/icons/waveform.path.svg'); }
.sf-icon.sparkles {
  -webkit-mask-image: url('../images/icons/sparkles.svg');
  mask-image: url('../images/icons/sparkles.svg');
  background-color: transparent;
  background-image: linear-gradient(135deg, #3b82f6, #a855f7, #ec4899);
  background-size: 200% 200%;
  animation: sparkles-shift 4s ease-in-out infinite alternate;
}
@keyframes sparkles-shift {
  0%   { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}
.sf-icon.rectangle-stack       { -webkit-mask-image: url('../images/icons/rectangle.stack.svg');              mask-image: url('../images/icons/rectangle.stack.svg'); }
.sf-icon.wifi-slash            { -webkit-mask-image: url('../images/icons/wifi.slash.svg');                   mask-image: url('../images/icons/wifi.slash.svg'); }
.sf-icon.tablecells            { -webkit-mask-image: url('../images/icons/tablecells.svg');                    mask-image: url('../images/icons/tablecells.svg'); }
.sf-icon.graduationcap         { -webkit-mask-image: url('../images/icons/graduationcap.svg');                mask-image: url('../images/icons/graduationcap.svg'); }
.sf-icon.square-grid           { -webkit-mask-image: url('../images/icons/square.grid.3x3.svg');              mask-image: url('../images/icons/square.grid.3x3.svg'); }
.sf-icon.list-star             { -webkit-mask-image: url('../images/icons/list.star.svg');                    mask-image: url('../images/icons/list.star.svg'); }
.sf-icon.book                  { -webkit-mask-image: url('../images/icons/book.svg');                          mask-image: url('../images/icons/book.svg'); }
.sf-icon.square-split          { -webkit-mask-image: url('../images/icons/square.split.2x1.svg');              mask-image: url('../images/icons/square.split.2x1.svg'); }
.sf-icon.pencil-scribble       { -webkit-mask-image: url('../images/icons/pencil.and.scribble.svg');           mask-image: url('../images/icons/pencil.and.scribble.svg'); }
.sf-icon.richtext-page         { -webkit-mask-image: url('../images/icons/richtext.page.svg');                 mask-image: url('../images/icons/richtext.page.svg'); }
.sf-icon.hand-draw             { -webkit-mask-image: url('../images/icons/hand.draw.svg');                     mask-image: url('../images/icons/hand.draw.svg'); }
.sf-icon.pencil-list           { -webkit-mask-image: url('../images/icons/pencil.and.list.clipboard.svg');     mask-image: url('../images/icons/pencil.and.list.clipboard.svg'); }
.sf-icon.macbook-ipad          { -webkit-mask-image: url('../images/icons/macbook.and.ipad.svg');              mask-image: url('../images/icons/macbook.and.ipad.svg'); }
.sf-icon.checkmark-icloud      { -webkit-mask-image: url('../images/icons/checkmark.icloud.svg');              mask-image: url('../images/icons/checkmark.icloud.svg'); }
.sf-icon.siri                 { -webkit-mask-image: url('../images/icons/siri.svg'); mask-image: url('../images/icons/siri.svg'); }
.sf-icon.bubbles               { -webkit-mask-image: url('../images/icons/bubble.left.and.bubble.right.svg'); mask-image: url('../images/icons/bubble.left.and.bubble.right.svg'); }
.sf-icon.accessibility         { -webkit-mask-image: url('../images/icons/accessibility.svg');                 mask-image: url('../images/icons/accessibility.svg'); }

/* Sizing inside card/row containers */
.feature-card-icon .sf-icon,
.feature-row-icon .sf-icon {
  width: 22px;
  height: 22px;
}

/* Wide-aspect icons need explicit upsize to match perceived weight of square icons */
.feature-row-icon .sf-icon.macbook-ipad {
  width: 30px;
  height: 30px;
}

/* ── Utilities ────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-dominant { color: var(--color-dominant); }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
