/* Design tokens */
:root {
  --text: #0B0B0C;
  --muted: #6B7280;
  --bg: #FFFFFF;
  --card: #F8FAFC;
  --primary: #0A84FF;
  --success: #34C759;
  --ring: rgba(10,132,255,0.35);
  --warn: #F59E0B;

  --radius-card: 16px;
  --radius-btn: 12px;
  --shadow-soft: 0 6px 24px rgba(2, 6, 23, 0.06), 0 1px 2px rgba(2, 6, 23, 0.04);
  --shadow-elev: 0 10px 30px rgba(2, 6, 23, 0.10);
  color-scheme: light;
}

/* Reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

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

/* Typography */
h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: clamp(2rem, 3.2vw + 1rem, 3rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.25rem, 1.2vw + 1rem, 1.75rem); }
h3 { font-size: 1.0625rem; }
p { margin: 0 0 12px; color: var(--text); }
.subhead { color: var(--muted); font-size: 1.0625rem; }
.muted { color: var(--muted); }
.micro-note { color: var(--muted); font-size: 0.9rem; margin-top: 8px; }

/* Layout */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.section { padding: clamp(40px, 6vw, 80px) 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Skip link */
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 1000; }
.skip-link:focus { left: 8px; outline: none; box-shadow: 0 0 0 3px var(--ring); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.8); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid #e5e7eb; }
.site-header.scrolled { box-shadow: 0 6px 18px rgba(2,6,23,0.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 600; color: var(--text); text-decoration: none; letter-spacing: 0.01em; }
.brand:hover { opacity: 0.9; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: var(--radius-btn); text-decoration: none; font-weight: 600; border: 1px solid transparent; transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease; font-size: 1rem; line-height: 1; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-soft); }
.btn-primary:hover { opacity: 0.96; box-shadow: var(--shadow-elev); transform: translateY(-1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

/* Hero */
.hero { position: relative; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr 1fr; gap: 40px; } }
.badge { display: inline-block; padding: 8px 12px; border-radius: 999px; font-size: 1.2rem; font-weight: 700; color: var(--primary); background: rgba(10,132,255,0.08); border: 1px solid rgba(10,132,255,0.18); margin-bottom: 12px; letter-spacing: 0.01em; }
.badge-assist { color: #111827; }
.cta-row { margin-top: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.cta-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cta-secondary { color: var(--muted); text-decoration: none; font-weight: 600; }
.cta-secondary:hover { text-decoration: underline; opacity: 0.95; }
.cta-secondary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); border-radius: 8px; }
.trust-line { font-size: 0.95rem; }

.hero-visual { position: relative; min-height: 340px; display: grid; place-items: center; }
.hero-visual .glow { position: absolute; inset: 0; background: radial-gradient(1200px 600px at 70% 30%, rgba(10,132,255,0.15), transparent 60%), radial-gradient(900px 400px at 30% 80%, rgba(134,84,255,0.12), transparent 60%); filter: blur(10px); pointer-events: none; }

.ui-card { position: relative; width: min(600px, 100%); background: var(--bg); border: 1px solid #e5e7eb; border-radius: var(--radius-card); box-shadow: var(--shadow-soft); padding: 16px; }
.ui-card-header { height: 28px; display: flex; align-items: center; gap: 6px; padding-left: 4px; margin-bottom: 8px; }
.ui-card-header .dot { width: 10px; height: 10px; border-radius: 50%; background: #e5e7eb; display: inline-block; }
.locale-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
@media (min-width: 520px) { .locale-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.locale-tile { background: var(--card); border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px 12px; display: grid; gap: 10px; box-shadow: 0 1px 2px rgba(2,6,23,0.04); }
.locale-header { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.locale-code { font-weight: 700; letter-spacing: 0.01em; }
.flags { display: none; }
.lang-badge { display: inline-block; min-width: 28px; padding: 4px 8px; border-radius: 999px; line-height: 1; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--primary); background: rgba(10,132,255,0.08); border: 1px solid rgba(10,132,255,0.18); text-align: center; }

/* Flow layout v2: source on top, targets in bottom row */
.flow-canvas { position: relative; height: 260px; }
.source-wrap { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); }
.targets-row { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; }
.beam { position: absolute; left: 0; top: 0; height: 2px; width: 0; background: #e5e7eb; border-radius: 2px; transform-origin: 0 50%; }
.beam::after { content: ""; position: absolute; top: 50%; left: 0; width: 14px; height: 14px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 6px rgba(10,132,255,0.10); }
.beam.left {}
.beam.mid {}
.beam.right {}
.beam.progress::after { animation: knobTravel 2.35s linear infinite; }
@keyframes knobTravel { 0% { left: 0%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .beam.progress::after { animation: none; } }
.locale-tile.source { border-color: rgba(10,132,255,0.3); background: #fff; }
.locale-tile { transition: opacity 220ms ease, transform 220ms ease; }
.locale-tile.swap { transform: translateY(-1px); opacity: 0.96; }

/* Small screens: keep connectors, just tighten spacing */
@media (max-width: 679px) {
  .flow-canvas { height: 220px; padding-bottom: 0; }
  .targets-row { gap: 8px; }
}

/* Extra small screens: stack flag below label to save width */
@media (max-width: 380px) {
  .targets-row { gap: 6px; }
  .locale-tile { padding: 8px 10px; }
  .locale-header { flex-direction: column; align-items: center; gap: 0; }
  .locale-header .flag { order: 2; font-size: 16px; margin-top: 0; }
  /* Keep English (source) inline; do not stack its flag */
  .locale-tile.source .locale-header { flex-direction: row; gap: 8px; }
  .locale-code { font-size: 0.95rem; }
}

/* Header CTA visibility toggle when hero present */
.header-cta { transition: opacity 200ms ease, transform 200ms ease, visibility 200ms; }
.header-cta.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-4px); }

/* Features */
.feature-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .feature-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; } }
.feature-card { background: var(--bg); border: 1px solid #e5e7eb; border-radius: var(--radius-card); padding: 18px; box-shadow: var(--shadow-soft); transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease; }
.feature-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-elev); opacity: 0.98; }
.feature-card .icon { width: 40px; height: 40px; border-radius: 12px; margin-bottom: 10px; position: relative; background: linear-gradient(180deg, #eef6ff, #eaf1ff); border: 1px solid #e5e7eb; }
.icon-publish::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%,-50%) rotate(45deg); border-right: 3px solid var(--primary); border-bottom: 3px solid var(--primary); border-radius: 2px; }
.icon-translate::before { content: ""; position: absolute; inset: 8px; border: 2px solid var(--primary); border-radius: 8px; }
.icon-translate::after { content: ""; position: absolute; width: 18px; height: 18px; right: -4px; bottom: -4px; background: #ffffff; border: 2px solid var(--primary); border-radius: 6px; }
.icon-templates::before { content: ""; position: absolute; left: 8px; right: 8px; top: 11px; height: 4px; background: var(--primary); border-radius: 2px; box-shadow: 0 10px 0 var(--primary), 0 20px 0 rgba(10,132,255,0.7); }

/* How it works */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 44px 1fr; align-items: start; gap: 14px; background: var(--bg); border: 1px solid #e5e7eb; border-radius: var(--radius-card); padding: 14px; box-shadow: var(--shadow-soft); }
.step-num { width: 44px; height: 44px; border-radius: 50%; background: rgba(10,132,255,0.08); border: 1px solid rgba(10,132,255,0.18); color: var(--primary); display: grid; place-items: center; font-weight: 700; }
.step-body h3 { margin: 2px 0 6px; font-size: 1.05rem; }
.step-body p { color: var(--muted); }

/* Benefits */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { position: relative; padding-left: 28px; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--success); color: #fff; font-size: 14px; line-height: 20px; text-align: center; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.05); }

/* FAQ */
.faq-list { display: grid; gap: 12px; }
details.faq-item { border: 1px solid #e5e7eb; border-radius: var(--radius-card); background: var(--bg); box-shadow: var(--shadow-soft); }
details.faq-item[open] { box-shadow: var(--shadow-elev); }
details.faq-item > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 600; outline: none; }
details.faq-item > summary::-webkit-details-marker { display: none; }
details.faq-item > summary:focus-visible { box-shadow: 0 0 0 3px var(--ring); border-radius: var(--radius-card); }
details.faq-item > summary::after { content: "+"; float: right; color: var(--muted); transition: transform 160ms ease; }
details.faq-item[open] > summary::after { content: "–"; }
.answer { padding: 0 16px 14px; color: var(--muted); }

/* Waitlist */
.waitlist-card { background: var(--bg); border: 1px solid #e5e7eb; border-radius: var(--radius-card); padding: 20px; box-shadow: var(--shadow-soft); max-width: 720px; margin: 0 auto; text-align: left; }
.waitlist-card h2 { margin-bottom: 6px; }
/* Form */
.waitlist-form { margin-top: 10px; }
.form-row { display: grid; gap: 10px; align-items: center; padding: 6px 0; }
@media (min-width: 560px) { .form-row { grid-template-columns: 180px 1fr; } }
.form-label { font-weight: 600; }
.form-controls { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.form-controls.single { grid-template-columns: 1fr; }
.input { width: 100%; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; color: var(--text); font: inherit; height: 44px; }
.input:focus { outline: none; box-shadow: 0 0 0 3px var(--ring); border-color: rgba(10,132,255,0.4); }
.input::placeholder { color: #9ca3af; }
.form-msg { margin-top: 10px; color: var(--success); font-weight: 600; min-height: 1.25em; }
.form-msg:empty { display: none; }

/* Submit button height alignment */
.btn { min-height: 44px; }

/* Actions row */
.form-actions { display: flex; justify-content: flex-start; padding: 6px 0 0; }
@media (min-width: 560px) { .form-actions { justify-content: flex-end; } }

/* Success message */
.form-success { margin-top: 14px; }
.form-success h3 { margin: 0 0 6px; font-size: 1.125rem; }

/* Footer */
.site-footer { border-top: 1px solid #e5e7eb; padding: 22px 0; color: var(--muted); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: inherit; }
.back-to-top { text-decoration: none; font-weight: 600; }
.back-to-top:hover { opacity: 0.9; }
.back-to-top:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); border-radius: 8px; }

/* Honeypot (off-screen) */
.hp { position: absolute; left: -5000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(8px); will-change: opacity, transform; }
.is-visible { opacity: 1; transform: none; transition: opacity 420ms ease, transform 420ms ease; }

/* Focus states */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); border-radius: 8px; }

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