/* =========================================================
   珍妮白話翻譯器 Jennie Clear Translate — landing.css
   Neutral modern SaaS. Light/dark via [data-theme] on <html>.
   ========================================================= */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.10);
  --accent-2: #10b981;
  --accent-2-soft: rgba(16, 185, 129, 0.10);
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.10);
  --nav-h: 64px;
}

:root[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #334155;
  --accent: #818cf8;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --accent-2: #10b981;
  --accent-2-soft: rgba(16, 185, 129, 0.14);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* No-JS fallback: follow OS preference when no explicit choice */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --border: #334155;
    --accent: #818cf8;
    --accent-soft: rgba(129, 140, 248, 0.14);
    --accent-2-soft: rgba(16, 185, 129, 0.14);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
  }
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Noto Sans TC", system-ui, -apple-system, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
img, svg { max-width: 100%; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 16px; font-size: 0.9rem; }
.btn-lg { padding: 13px 28px; font-size: 1.05rem; }
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: var(--shadow-lg); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-invert {
  background: #ffffff;
  color: #4f46e5;
}
.btn-invert:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nav.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.02rem;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 26px;
  margin-left: 8px;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); }
.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* Show moon in light mode (tap = go dark), sun in dark mode */
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .icon-moon { display: none; }
  :root:not([data-theme]) .icon-sun { display: block; }
}

/* ===== Hero ===== */
.hero { padding: 72px 20px 84px; }
.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero-pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 900;
  letter-spacing: 0.01em;
}
.hero-title-en {
  color: var(--accent);
  font-weight: 700;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  margin-bottom: 18px;
}
.hero-sub {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 34em;
  margin-bottom: 28px;
}
.hero-sub strong { color: var(--text); }
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.hero-trust {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}
.mobile-br { display: none; }

/* ===== Hero visual: demo window ===== */
.demo-window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.demo-titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-r { background: #f87171; }
.dot-y { background: #fbbf24; }
.dot-g { background: #34d399; }
.demo-title {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.demo-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg);
}
.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.demo-card-short { border-left: 4px solid var(--accent); }
.demo-card-key { border-left: 4px solid var(--accent-2); }
.demo-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.speaker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}
.speaker-a { background: var(--accent); }
.speaker-b { background: var(--accent-2); }
.demo-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: 999px;
}
.demo-tag-key { color: var(--accent-2); background: var(--accent-2-soft); }
.demo-src {
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 6px;
}
.demo-src-long { font-size: 0.8rem; line-height: 1.6; }
.demo-dst {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0;
}
.demo-points {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.92rem;
}
.demo-points li::marker { color: var(--accent-2); }
.demo-points strong { font-weight: 700; }

/* ===== Sections ===== */
.section { padding: 84px 20px; }
.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-inner { max-width: 1120px; margin: 0 auto; }
.section-narrow { max-width: 760px; }
.section-eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.section-title {
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 36px;
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.feature-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  font-size: 1.35rem;
  margin-bottom: 14px;
}
.feature-card h3 { font-size: 1.08rem; font-weight: 700; }
.feature-card p { color: var(--muted); font-size: 0.93rem; margin: 0; }

/* section-alt cards sit on surface bg — flip their bg */
.section-alt .step { background: var(--bg); }

/* How it works */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
}
.step {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 14px;
}
.step h3 { font-size: 1.08rem; font-weight: 700; }
.step p { color: var(--muted); font-size: 0.93rem; margin: 0; }

/* ===== FAQ ===== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
}
.faq-q:hover { color: var(--accent); }
.faq-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.25s ease;
}
.faq-item.open .faq-chevron { transform: rotate(180deg); color: var(--accent); }
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}
.faq-a > p {
  overflow: hidden;
  min-height: 0;
  margin: 0;
  padding: 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
  transition: padding 0.28s ease;
}
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-item.open .faq-a > p { padding: 0 20px 18px; }

/* ===== CTA band ===== */
.cta-band {
  padding: 84px 20px;
  background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 100%);
  color: #ffffff;
  text-align: center;
}
.cta-inner { max-width: 720px; margin: 0 auto; }
.cta-band h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); font-weight: 800; }
.cta-band p { color: rgba(255, 255, 255, 0.85); font-size: 1.05rem; margin-bottom: 28px; }

/* ===== Footer ===== */
.footer {
  padding: 32px 20px;
  text-align: center;
  border-top: 1px solid var(--border);
}
.footer p { color: var(--muted); font-size: 0.85rem; margin: 0; }

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

@media (max-width: 880px) {
  .hero { padding: 48px 20px 64px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-copy { text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-ctas { justify-content: center; }
  .steps { grid-template-columns: 1fr; }
}

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

@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 16px; }
  .hero { padding-left: 16px; padding-right: 16px; }
  .brand-name { font-size: 0.95rem; }
  .mobile-br { display: inline; }
  .btn-lg { padding: 12px 22px; font-size: 1rem; }
}
