/* ---- tokens ---- */
:root {
  color-scheme: light;
  --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px;
  --text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.25rem; --text-xl: 1.5625rem; --text-2xl: 1.953rem; --text-3xl: 2.441rem;
  --text-display-s: clamp(2.25rem, 4vw + 0.5rem, 3.75rem); --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem);
  --text-section: clamp(2rem, 2.5vw + 1rem, 3.5rem); --text-title: clamp(1.25rem, 0.75vw + 0.875rem, 1.625rem); --text-lead: clamp(1.125rem, 0.35vw + 1rem, 1.375rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in: cubic-bezier(0.7, 0, 0.84, 0); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms;
  --color-error: oklch(52% 0.19 27); --color-success: oklch(50% 0.12 150);
  --container: 1440px; --gutter: 64px; --gap-columns: 32px; --section-gap-s: 120px; --section-gap: 144px; --section-gap-l: 176px;
  --z-base: 1; --z-raised: 10; --z-dropdown: 100; --z-sticky: 200; --z-sticky-nav: 300; --z-modal: 400; --z-toast: 500; --z-tooltip: 600;
  --color-paper: oklch(97% 0.006 245); --color-paper-2: oklch(93% 0.012 248); --color-paper-3: oklch(88% 0.02 250);
  --color-ink: oklch(20% 0.015 252); --color-ink-2: oklch(31% 0.018 252); --color-muted: oklch(47% 0.018 252);
  --color-rule: oklch(79% 0.014 252); --color-rule-2: oklch(38% 0.02 252);
  --color-accent: oklch(47% 0.16 255); --color-accent-ink: oklch(98% 0.005 250); --color-focus: oklch(47% 0.16 255);
  --color-overlay: oklch(20% 0.015 252 / 76%);
  --font-display: "Bahnschrift", "Noto Sans SC", sans-serif; --font-body: "Noto Sans SC", sans-serif;
  --font-outlier: Consolas, monospace;
  --radius-card: 0; --radius-pill: 0; --rule-hair: 1px;
  --shadow-card: none;
  --tracking-display: -0.02em; --display-weight: 700;
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-muted) var(--color-paper); scroll-padding-top: var(--space-3xl); }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.55; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent) 20%, transparent); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 700); font-synthesis: none; letter-spacing: var(--tracking-display); line-height: 1.05; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h1 { max-width: 20ch; font-size: var(--text-display); } h2 { max-width: 30ch; font-size: var(--text-section); } h3 { max-width: 40ch; font-size: var(--text-title); line-height: 1.2; }
p { margin: 0; text-wrap: pretty; }
p:not([class]) { max-width: 65ch; }
img { max-width: 100%; height: auto; display: block; }
svg { display: block; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 60rem) { :root { --gutter: 24px; --section-gap-s: 80px; --section-gap: 96px; --section-gap-l: 120px; } }
@media (max-width: 40rem) { :root { --gutter: 16px; --section-gap-s: 56px; --section-gap: 72px; --section-gap-l: 96px; --gap-columns: 16px; } }
@media (prefers-reduced-motion: reduce) { *:not(.keep-motion), *:not(.keep-motion)::before, *:not(.keep-motion)::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }

/* ---- site ---- */
/* Hallmark · shape: Source register · genre: modern-minimal · theme: Blueprint whiteprint adapted to the project blue · redesign: full
 * job: sign up · hero: one clear instruction beside the real D1 fields · nav: anchors, API entry and the icon-only GitHub link · footer: project name and license · imagery: none · signature: the actual schema and separate request paths
 * axes: light/geometric-sans/blue · posture: restrained · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P5 H5 E5 S5 R5 V4 · weakest: V, the short specification has no picture material; its database fields carry the page */
/* Hallmark · dropped “律师团队立即启动”, “合作律所68家” and five count-up metrics · unsupported by Worker code or project records */
/* Hallmark · dropped .audience-card, .stat-number, .stats-grid, #typewriter-text · decorative artwork and unsupported figures removed */
/* Hallmark · dropped baseGrad, camBodyGrad, camGlassGrad, camLensGrad, fishGrad, glow1, glowOther, goldGrad, grad1, grad2, hookGrad, sphereGrad, typewriter-text · decorative SVGs and rotating text were removed */
/* Hallmark · dismissed F1 · straight quotation marks are required in the JSON request example */
@import url("./tokens.css");
@import url("./base.css");

body {
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
}

.site-header,
.page-shell {
  width: min(100%, var(--container));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  border-bottom: 1px solid var(--color-rule);
}

.wordmark,
.footer-wordmark {
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  min-height: 44px;
}

.site-nav a:not(.github-link),
.nav-action {
  color: var(--color-ink-2);
  font-size: var(--text-md);
  text-underline-offset: 0.2em;
}

.site-nav a:not(.github-link) {
  text-decoration: none;
}

.nav-action {
  padding: var(--space-xs) 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.page-shell {
  padding-bottom: var(--space-2xl);
}

.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--color-rule-2);
  border-radius: 0;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

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

.btn-secondary {
  background: var(--color-paper);
}

.btn-danger {
  border-color: var(--color-error);
  background: transparent;
  color: var(--color-error);
}

.btn-text {
  border-color: transparent;
  background: transparent;
  color: var(--color-accent);
}

.btn-glass-primary {
  border-color: var(--color-accent);
  background: transparent;
  color: var(--color-accent);
}

.btn-glass-success {
  border-color: var(--color-success);
  background: transparent;
  color: var(--color-success);
  pointer-events: none;
}

.full-width {
  width: 100%;
  display: flex;
}

button:hover,
.site-nav a:hover {
  color: var(--color-accent);
}

.btn-primary:hover,
.btn-danger:hover {
  background: var(--color-ink);
  color: var(--color-paper);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button:active,
.btn:active,
.copy-btn:active {
  transform: translateY(1px);
}

@media (max-width: 38rem) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-xs);
    padding-block: var(--space-sm);
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: var(--space-xs);
  }

  .site-nav a:not(.github-link),
  .nav-action {
    font-size: var(--text-sm);
  }

  .modal-content {
    padding: var(--space-lg);
  }
}
/* Existing registration and API dialogs */
.modal-overlay {
  position: fixed;
  z-index: var(--z-modal);
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: var(--color-overlay);
}

.modal-content {
  position: relative;
  width: min(100%, 560px);
  max-height: min(88dvh, 52rem);
  overflow-y: auto;
  padding: var(--space-xl);
  border: 1px solid var(--color-rule);
  background: var(--color-paper);
  color: var(--color-ink);
}

.api-modal-content {
  width: min(100%, 760px);
}

.modal-close {
  position: absolute;
  z-index: 1;
  top: var(--space-xs);
  right: var(--space-xs);
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--color-ink);
  font-size: 1.75rem;
  cursor: pointer;
}

.modal-step h3 {
  margin-bottom: var(--space-sm);
  font-size: var(--text-title);
  text-align: center;
}

.modal-step > p {
  margin-bottom: var(--space-lg);
  color: var(--color-muted);
  text-align: center;
}

.auth-tabs,
.api-modal-tabs {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-rule);
}

.auth-tab,
.api-modal-tab {
  min-height: 44px;
  padding: var(--space-sm) var(--space-md);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--color-muted);
  font: inherit;
  cursor: pointer;
}

.auth-tab.active,
.api-modal-tab[aria-selected="true"] {
  border-bottom-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 700;
}

.form-group {
  margin-bottom: var(--space-lg);
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
}

.modal-input {
  width: 100%;
  min-height: 48px;
  margin-bottom: var(--space-sm);
  padding: var(--space-sm);
  border: 1px solid var(--color-muted);
  border-radius: var(--radius-card);
  outline: 2px solid transparent;
  outline-offset: -3px;
  background: var(--color-paper);
  color: var(--color-ink);
  font: inherit;
}

.modal-input:focus-visible {
  outline-color: var(--color-focus);
}

textarea.modal-input {
  min-height: 6rem;
  resize: vertical;
}

.captcha-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

#login-captcha-canvas,
#register-captcha-canvas {
  max-width: 100%;
  border: 1px solid var(--color-rule);
  background: var(--color-paper-2);
}

.icon-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
}

.icon-btn svg,
.btn svg {
  width: 20px;
  height: 20px;
}

.key-display-box,
.dashboard-card {
  margin-block: var(--space-md);
  padding: var(--space-md);
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
}

.key-display-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.key-display-box code {
  overflow-wrap: anywhere;
  font-size: var(--text-md);
  font-weight: 700;
}

.copy-btn {
  min-height: 44px;
  padding-inline: var(--space-md);
  border: 1px solid var(--color-rule-2);
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
}

.warning-text,
.privacy-form-note {
  color: var(--color-error) !important;
  font-size: var(--text-sm) !important;
}

.privacy-form-note {
  padding: var(--space-md);
  border-top: 1px solid var(--color-accent);
  background: var(--color-paper-2);
  color: var(--color-ink-2) !important;
  text-align: left !important;
}

.radio-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}

.radio-card {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border: 1px solid var(--color-rule);
  cursor: pointer;
}

.radio-card:has(input:checked) {
  border-color: var(--color-accent);
}

.dashboard-header,
.dashboard-actions,
.dashboard-header > div,
.dashboard-card > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.dashboard-header h3 {
  margin-block: var(--space-lg);
}

.dashboard-period {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

#period-select {
  margin-top: var(--space-sm);
  text-align: center;
}

#download-key-btn {
  margin-bottom: var(--space-md);
  gap: var(--space-xs);
}

.btn-danger {
  margin-top: var(--space-sm);
}

.dashboard-label,
.dashboard-value {
  text-align: center;
}

.dashboard-label {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.dashboard-value {
  color: var(--color-ink);
  font-size: var(--text-title);
  font-variant-numeric: tabular-nums;
}

.dashboard-value.highlight {
  color: var(--color-accent);
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-success);
}

.dashboard-actions {
  flex-wrap: wrap;
  margin-top: var(--space-lg);
}

.success-icon {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.success-icon svg {
  width: 48px;
  height: 48px;
  color: var(--color-success);
}

.api-modal-panel[hidden] {
  display: none;
}

.api-section-title {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
  color: var(--color-ink-2);
  font-weight: 700;
}

.api-code-block {
  overflow-x: auto;
  margin-block: var(--space-sm);
  padding: var(--space-md);
  border: 1px solid var(--color-rule);
  background: var(--color-paper-2);
  color: var(--color-ink);
  font-family: ui-monospace, Consolas, monospace;
  font-size: var(--text-sm);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.api-method-badge {
  display: inline-block;
  margin-right: var(--space-xs);
  padding: var(--space-2xs) var(--space-xs);
  border: 1px solid var(--color-rule);
  color: var(--color-ink-2);
  font-size: var(--text-xs);
}

.ai-guide-label {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.ai-guide-badge,
.ai-guide-tip {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.ai-dev-prompt {
  width: 100%;
  min-height: 16rem;
  padding: var(--space-md);
  border: 1px solid var(--color-rule);
  background: var(--color-paper-2);
  color: var(--color-ink);
  font: inherit;
}

.ai-guide-tip {
  margin-block: var(--space-md);
  font-size: var(--text-md);
}

button:hover,
.btn:hover,
.site-nav a:hover {
  color: var(--color-accent);
}

.btn-primary:hover,
.btn-danger:hover,
.btn-glass-primary:hover {
  background: var(--color-ink);
  color: var(--color-paper);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button:active,
.btn:active,
.copy-btn:active {
  transform: translateY(1px);
}

/* ===== Clarity pass: consistent section rhythm & legibility ===== */
html { scroll-behavior: smooth; }
section[id], #faq { scroll-margin-top: 96px; }

/* Unified heading sizes so hierarchy reads at a glance */
#process-title, #scenarios-title, #privacy-title,
#requests-title, #legacy-faq-title {
  font-size: clamp(1.875rem, 2vw + 1rem, 2.75rem) !important;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* Body copy: larger & higher contrast */

/* Audience: one even row instead of a ragged 3+2 grid */

/* Stats: bigger numbers, quieter labels */

/* Hover feedback on cards */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.form-group > .form-label { display: block; margin-bottom: var(--space-xs); font-size: var(--text-sm); color: #dbe4f2; }
.modal-close:focus-visible, .icon-btn:focus-visible { outline: 2px solid #77d1bf; outline-offset: 2px; }

/* Toasts (replace blocking alert dialogs) */
.toast-region {
  position: fixed; z-index: var(--z-toast); left: 50%; bottom: 24px; transform: translateX(-50%);
  display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none;
}
.toast {
  padding: 12px 16px; border-radius: 12px; font-size: 0.9375rem; line-height: 1.5;
  color: #eaeff7; background: rgba(23, 31, 42, 0.96); border: 1px solid rgba(119, 209, 191, 0.45);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  opacity: 0; transform: translateY(8px); transition: opacity 220ms ease, transform 220ms ease;
}
.toast.toast-error { border-color: rgba(226, 112, 96, 0.7); }
.toast.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ===== Always-visible floating navigation ===== */
.site-header {
  position: sticky !important;
  top: 12px;
  z-index: var(--z-sticky-nav, 300) !important;
  transition: box-shadow var(--dur-short) var(--ease-out), background var(--dur-short) var(--ease-out);
}
.site-header.is-scrolled {
  background: linear-gradient(110deg, rgba(20, 30, 46, 0.92), rgba(15, 23, 36, 0.88)) !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}
.site-nav a.is-active { color: #7fe0c8 !important; }
section[id], #faq { scroll-margin-top: 112px; }

/* Hero visual: tint warm cloud into calm night-blue */

/* =====================================================================
   v2 layout — calm, trustworthy, scannable
   ===================================================================== */
:root {
  --z-bg: #0b1320;
  --z-surface: rgba(148, 178, 214, 0.06);
  --z-surface-2: rgba(148, 178, 214, 0.1);
  --z-line: rgba(148, 178, 214, 0.16);
  --z-text: #e9eff7;
  --z-muted: #9db0c7;
  --z-accent: #5fd4b6;
  --z-accent-strong: #3bb898;
  --z-candle: #f2b45c;
  --z-radius: 20px;
}
body { background: radial-gradient(ellipse 60rem 40rem at 85% -10%, rgba(95, 212, 182, 0.08), transparent 70%), radial-gradient(ellipse 50rem 40rem at -10% 30%, rgba(90, 130, 200, 0.08), transparent 70%), var(--z-bg) !important; color: var(--z-text); }
.z-ic { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -3px; }
.z-ic-lg { width: 26px; height: 26px; flex: 0 0 auto; color: var(--z-accent); }
.z-ic-xl { width: 44px; height: 44px; color: var(--z-accent); }

/* Header */
.z-header { max-width: 1200px; margin-inline: auto !important; width: calc(100% - 32px) !important; }
.z-nav { gap: 6px !important; align-items: center; }
.z-nav > a:not(.z-nav-cta), .z-nav .nav-action { padding: 8px 12px; border-radius: 999px; color: var(--z-muted) !important; font-size: 0.9375rem; }
.z-nav > a:not(.z-nav-cta):hover, .z-nav .nav-action:hover { color: var(--z-text) !important; background: var(--z-surface); }
.z-nav-cta { margin-left: 6px; padding: 9px 18px; border-radius: 999px; background: var(--z-accent); color: #062a21 !important; font-weight: 700; font-size: 0.9375rem; }
.z-nav-cta:hover { background: #7fe0c8; }

/* Main container */
.z-main { width: min(1200px, calc(100% - 32px)) !important; margin-inline: auto; padding-top: 24px !important; }

/* Hero */
.z-hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; padding: 72px 0 56px; }
.z-badge { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; padding: 7px 14px; border: 1px solid rgba(95, 212, 182, 0.35); border-radius: 999px; background: rgba(95, 212, 182, 0.08); color: var(--z-accent); font-size: 0.875rem; font-weight: 600; }
.z-hero h1 { margin: 0; font-size: clamp(2.6rem, 5.2vw, 4.4rem); line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; color: var(--z-text); }
.z-hero h1 span { color: var(--z-accent); }
.z-lead { max-width: 34em; margin: 22px 0 30px; color: #c3d0df; font-size: clamp(1.05rem, 0.4vw + 1rem, 1.2rem); line-height: 1.75; }
.z-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.z-btn-primary { display: inline-flex !important; align-items: center; justify-content: center; min-height: 50px; padding: 0 28px !important; border-radius: 999px !important; background: linear-gradient(135deg, #7fe6cb, var(--z-accent-strong)) !important; color: #052a20 !important; font-weight: 700 !important; font-size: 1rem !important; box-shadow: 0 10px 30px rgba(59, 184, 152, 0.3) !important; border: 0 !important; }
.z-btn-primary:hover { transform: translateY(-1px); }
.z-btn-ghost { display: inline-flex; align-items: center; min-height: 50px; padding: 0 24px; border: 1px solid var(--z-line); border-radius: 999px; color: var(--z-text); font-weight: 600; }
.z-btn-ghost:hover { background: var(--z-surface); }

.z-hero-visual { position: relative; display: grid; place-items: center; min-height: 440px; }
.z-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--z-accent); box-shadow: 0 0 0 4px rgba(95, 212, 182, 0.2); animation: z-pulse 2.4s ease-in-out infinite; }
@keyframes z-pulse { 50% { box-shadow: 0 0 0 8px rgba(95, 212, 182, 0); } }

/* Trust strip */
.z-trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--z-line); border-radius: var(--z-radius); background: var(--z-line); }
.z-trust article { display: flex; gap: 14px; padding: 24px 22px; background: #0f1928; }
.z-trust h3 { margin: 0 0 4px; font-size: 1rem; color: var(--z-text); }
.z-trust p { margin: 0; font-size: 0.875rem; line-height: 1.6; color: var(--z-muted); }

/* Sections */
.z-section { padding: 112px 0 0; }
.z-head { max-width: 720px; margin-bottom: 40px; }
.z-eyebrow { margin: 0 0 12px; color: var(--z-accent); font-size: 0.875rem; font-weight: 700; letter-spacing: 0.08em; }
.z-head h2 { margin: 0; font-size: clamp(1.8rem, 2vw + 1rem, 2.6rem); line-height: 1.2; letter-spacing: -0.01em; color: var(--z-text); }
.z-sub { margin: 14px 0 0; color: var(--z-muted); font-size: 1.0625rem; line-height: 1.7; }

/* Timeline */
.z-timeline { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; }
.z-timeline::before { content: ""; position: absolute; top: 28px; left: 28px; right: 28px; height: 2px; background: linear-gradient(90deg, var(--z-accent) 0 72%, var(--z-candle)); opacity: 0.35; }
.z-timeline li { position: relative; }
.z-step-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 18px; border: 1px solid rgba(95, 212, 182, 0.35); border-radius: 16px; background: #0f1d2b; }
.z-step-no { color: var(--z-muted); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; }
.z-timeline h3 { margin: 6px 0 8px; font-size: 1.1875rem; color: var(--z-text); }
.z-timeline p { margin: 0; color: var(--z-muted); font-size: 0.9375rem; line-height: 1.7; }
.z-step-alert .z-step-icon { border-color: rgba(242, 180, 92, 0.5); }
.z-step-alert .z-ic-lg, .z-step-alert .z-step-no { color: var(--z-candle); }
.z-note { display: flex; gap: 10px; align-items: flex-start; margin: 40px 0 0; padding: 16px 20px; border: 1px solid rgba(95, 212, 182, 0.25); border-radius: 14px; background: rgba(95, 212, 182, 0.06); color: #c3d0df; font-size: 0.9375rem; line-height: 1.6; }
.z-note .z-ic { color: var(--z-accent); margin-top: 2px; }

/* Manifesto */
.z-memorial { display: inline-flex; align-items: center; gap: 8px; margin: 28px 0 0; padding: 8px 16px; border: 1px solid rgba(242, 180, 92, 0.3); border-radius: 999px; color: var(--z-candle); font-size: 0.875rem; }

/* Cards */
.z-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
.z-grid-5 li, .z-api article { padding: 24px; border: 1px solid var(--z-line); border-radius: var(--z-radius); background: var(--z-surface); transition: border-color 200ms ease, transform 200ms ease; }
.z-grid-5 li:hover, .z-api article:hover { border-color: rgba(95, 212, 182, 0.4); transform: translateY(-2px); }
.z-grid-5 h3 { margin: 16px 0 6px; font-size: 1.0625rem; color: var(--z-text); }
.z-grid-5 p { margin: 0; color: var(--z-muted); font-size: 0.875rem; }

.z-api { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.z-api-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.z-api h3 { margin: 0; font-size: 1.1875rem; color: var(--z-text); }
.z-api code { padding: 4px 10px; border: 1px solid var(--z-line); border-radius: 8px; background: rgba(0, 0, 0, 0.25); color: var(--z-accent); font-size: 0.8125rem; }
.z-api p { margin: 14px 0 0; color: var(--z-muted); line-height: 1.7; }
.z-api-sos { border-color: rgba(242, 180, 92, 0.3) !important; }
.z-link { margin-top: 16px; padding: 0; border: 0; background: none; color: var(--z-accent); font: inherit; font-weight: 700; cursor: pointer; }
.z-link:hover { text-decoration: underline; }

/* Stats */
.z-stats { margin-top: 112px; padding: 40px; border: 1px solid var(--z-line); border-radius: var(--z-radius); background: var(--z-surface); }
.z-stats-intro { margin: 0 0 24px; color: var(--z-muted); text-align: center; }
.z-stats dl { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; }
.z-stats dl > div { display: flex; flex-direction: column-reverse; align-items: center; gap: 6px; padding: 8px; border-left: 1px solid var(--z-line); }
.z-stats dl > div:first-child { border-left: 0; }
.z-stats dd { margin: 0; font-size: clamp(1.8rem, 2vw + 1rem, 2.5rem); font-weight: 700; color: var(--z-text); font-variant-numeric: tabular-nums; }
.z-stats dt { color: var(--z-muted); font-size: 0.875rem; }

/* FAQ */
.z-faq { display: grid; gap: 12px; max-width: 880px; }

/* CTA */
.z-cta { margin: 112px 0 40px; padding: 64px 32px; border-radius: 28px; text-align: center; background: radial-gradient(ellipse at 50% 120%, rgba(95, 212, 182, 0.22), transparent 60%), #0f1b2a; border: 1px solid rgba(95, 212, 182, 0.25); }
.z-cta h2 { margin: 18px 0 10px; font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem); color: var(--z-text); }
.z-cta p { margin: 0 0 28px; color: var(--z-muted); }

/* Footer */
.z-footer { display: grid; grid-template-columns: 1fr auto; gap: 24px 40px; align-items: center; width: min(1200px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 48px; border-top: 1px solid var(--z-line); color: var(--z-muted); }
.z-footer-brand p { margin: 8px 0 0; font-size: 0.9rem; }
.z-footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.z-footer-links a { color: var(--z-muted); font-size: 0.9375rem; }
.z-footer-links a:hover { color: var(--z-text); }
.z-footer-note { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.8125rem; }
.z-footer-note .z-ic { color: var(--z-candle); }

/* Responsive */
@media (max-width: 1024px) {
  .z-hero { grid-template-columns: 1fr; padding-top: 48px; }
  .z-hero-visual { min-height: 380px; }
  .z-trust { grid-template-columns: repeat(2, 1fr); }
  .z-timeline { grid-template-columns: repeat(2, 1fr); gap: 32px 20px; }
  .z-timeline::before { display: none; }
  .z-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .z-stats dl { grid-template-columns: repeat(3, 1fr); row-gap: 20px; }
  .z-stats dl > div:nth-child(4) { border-left: 0; }
}
@media (max-width: 720px) {
  .z-nav > a:not(.z-nav-cta) { display: none; }
  .z-header { flex-direction: row !important; flex-wrap: nowrap !important; }
  .z-hero { padding: 32px 0 40px; gap: 32px; }
  .z-hero-visual { min-height: 340px; }
  .z-trust, .z-api { grid-template-columns: 1fr; }
  .z-timeline { grid-template-columns: 1fr; }
  .z-grid-5 { grid-template-columns: 1fr 1fr; }
  .z-section { padding-top: 80px; }
  .z-stats { padding: 28px 16px; }
  .z-stats dl { grid-template-columns: 1fr 1fr; }
  .z-stats dl > div { border-left: 0; }
  .z-footer { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {  .z-dot { animation: none; } }
.z-cta > svg { display: block; margin: 0 auto; }
.z-footer a, .z-nav a, .z-btn-ghost, .z-nav-cta { text-decoration: none !important; }
@media (max-width: 720px) {
  .site-header.z-header { padding: 10px 12px 10px 16px !important; min-height: 60px !important; display: flex !important; justify-content: space-between !important; align-items: center !important; }
  .site-header.z-header .z-nav { display: flex !important; flex-wrap: nowrap !important; width: auto !important; margin: 0 !important; overflow: visible !important; }
  .site-header.z-header .z-nav > a:not(.z-nav-cta) { display: none !important; }
  .z-nav-cta { padding: 8px 14px; }
}
@media (max-width: 720px) {
  .z-timeline { gap: 22px; }
  .z-timeline li { display: grid; grid-template-columns: 48px 1fr; column-gap: 14px; }
  .z-step-icon { grid-row: span 3; width: 48px; height: 48px; margin: 0; border-radius: 14px; }
  .z-timeline h3 { margin: 2px 0 4px; }
}

/* Top slogan ticker */
.z-ticker { position: relative; overflow: hidden; border-bottom: 1px solid rgba(242, 180, 92, 0.18); background: linear-gradient(90deg, #120f0a, #17130d 50%, #120f0a); color: #f2c98a; font-size: 0.875rem; }
.z-ticker::before, .z-ticker::after { content: ""; position: absolute; top: 0; bottom: 0; z-index: 1; width: 64px; pointer-events: none; }
.z-ticker::before { left: 0; background: linear-gradient(90deg, #120f0a, transparent); }
.z-ticker::after { right: 0; background: linear-gradient(270deg, #120f0a, transparent); }
.z-ticker-track { display: flex; width: max-content; animation: z-ticker 70s linear infinite; }
.z-ticker:hover .z-ticker-track, .z-ticker:focus-within .z-ticker-track { animation-play-state: paused; }
.z-ticker-list { display: flex; flex-shrink: 0; margin: 0; padding: 0; list-style: none; }
.z-ticker-list li { display: inline-flex; align-items: center; gap: 8px; padding: 10px 28px; white-space: nowrap; border-right: 1px solid rgba(242, 180, 92, 0.16); }
.z-ticker-list .z-ic { width: 15px; height: 15px; color: var(--z-candle); }
@keyframes z-ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .z-ticker-track { animation: none; width: auto; }
  .z-ticker-list { flex-wrap: wrap; justify-content: center; }
  .z-ticker-list[aria-hidden] { display: none; }
}
.z-header { margin-top: 12px !important; }

/* Manifesto heading */

/* Modal secondary text button: transparent link style */
#online-modal .btn-text { background: transparent !important; box-shadow: none !important; border: 0 !important; color: var(--z-accent) !important; min-height: 40px; margin-top: 6px; }
#online-modal .btn-text:hover { text-decoration: underline; }
.z-hero-visual { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; gap: 0; }

/* Hero rotating headline */
.z-rotator { position: relative; }
.z-rotator .z-l1, .z-rotator .z-l2 { white-space: nowrap; transition: opacity 300ms ease; }
.z-rotator .z-l2 { color: var(--z-accent); }
.z-rotator.is-morphing .z-l1, .z-rotator.is-morphing .z-l2, .z-rotator.is-fading .z-l1, .z-rotator.is-fading .z-l2 { opacity: 0; transition: none; }
.z-rotator.is-fading .z-l1, .z-rotator.is-fading .z-l2 { transition: opacity 300ms ease; }
.z-particles { position: absolute; left: -80px; top: -80px; pointer-events: none; }
@media (max-width: 420px) { .z-hero h1 { font-size: clamp(2.2rem, 11vw, 2.8rem); } }

/* Manifesto carousel */

/* FAQ: all expanded, one row, swipe on small screens */
.z-faq { display: grid !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 16px !important; max-width: none !important; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.z-faq article { scroll-snap-align: start; padding: 24px; border: 1px solid var(--z-line); border-radius: var(--z-radius); background: var(--z-surface); }
.z-faq h3 { margin: 0 0 12px; font-size: 1.0625rem; color: var(--z-text); }
.z-faq p { margin: 0; color: #c3d0df; font-size: 0.9375rem; line-height: 1.8; }
@media (max-width: 1024px) {
  .z-faq { grid-auto-columns: 78%; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
}
.z-hero h1.z-rotator .z-l1 { color: var(--z-text); }

/* Manifesto background: A4 / white paper movement illustration */
.z-art-credit { position: absolute; right: 16px; bottom: 12px; margin: 0; color: rgba(233, 239, 247, 0.55); font-size: 0.75rem; }
/* Active dot doubles as countdown */

/* ===== Polish pass ===== */
/* Headings: one font, balanced wrapping */
.z-head h2, .z-cta h2, .z-hero h1 { font-family: var(--font-body); text-wrap: balance; }
.z-head h2 { font-weight: 700; }
/* Closing CTA: centered */
.z-cta h2, .z-cta p { text-align: center; margin-inline: auto !important; max-width: none !important; }
/* Orphan items on 2-column mobile grids */
@media (max-width: 720px) {
  .z-grid-5 > li:last-child { grid-column: 1 / -1; }
  .z-stats dl > div:last-child { grid-column: 1 / -1; }
  .z-hero-visual { min-height: 0 !important; }
}
/* Mobile menu */
.z-menu-btn { display: none; }
.z-mobile-menu { display: none; }
@media (max-width: 720px) {
  .z-menu-btn { display: inline-grid; place-content: center; gap: 5px; width: 40px; height: 40px; padding: 0; border: 1px solid var(--z-line); border-radius: 12px; background: var(--z-surface); cursor: pointer; }
  .z-menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--z-text); transition: transform 200ms ease; }
  .z-menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .z-menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .z-mobile-menu:not([hidden]) { position: sticky; top: 84px; z-index: 299; display: grid; width: calc(100% - 32px); margin: 8px auto 0; padding: 8px; border: 1px solid var(--z-line); border-radius: 18px; background: rgba(15, 25, 40, 0.97); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); }
  .z-mobile-menu a { padding: 14px 16px; border-radius: 12px; color: var(--z-text); text-decoration: none; font-size: 1rem; }
  .z-mobile-menu a:active, .z-mobile-menu a:hover { background: var(--z-surface-2); }
  .z-nav .nav-action { display: none !important; }
}
/* Scroll reveal */
.z-reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms ease, transform 600ms var(--ease-out, ease); }
.z-reveal.is-in { opacity: 1; transform: none; }
.z-main .z-reveal { transition: opacity 600ms ease, transform 600ms ease, border-color 200ms ease; }

/* ---- liquid-glass ---- */
/* Liquid Glass inspired web treatment. This is a CSS/WebGL approximation, not Apple's native platform material. */
:root {
  --color-paper: #eef6fb;
  --color-paper-2: #f7fbfe;
  --color-paper-3: #dcecf6;
  --color-ink: #14344d;
  --color-ink-2: #2b4a62;
  --color-muted: #566f82;
  --color-rule: rgba(42, 87, 119, 0.18);
  --color-rule-2: rgba(42, 87, 119, 0.36);
  --color-accent: #1268a8;
  --color-accent-ink: #fff;
  --color-focus: #075ea6;
  --color-error: #a93242;
  --color-success: #206845;
  --color-overlay: rgba(8, 30, 48, 0.48);
  --font-display: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", sans-serif;
  --radius-card: 28px;
  --radius-pill: 999px;
  --shadow-card: 0 22px 64px rgba(36, 83, 116, 0.14);
  --tracking-display: -0.045em;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--color-ink);
  background:
    radial-gradient(ellipse 48rem 36rem at 9% 0%, rgba(191, 227, 248, 0.72), transparent 72%),
    radial-gradient(ellipse 42rem 34rem at 96% 10%, rgba(218, 240, 253, 0.84), transparent 70%),
    linear-gradient(180deg, #edf7fc 0%, #f5f9fc 58%, #ebf5fb 100%);
  font-family: var(--font-body);
}

.site-header,
.page-shell {
  width: min(calc(100% - 40px), var(--container));
  padding-inline: 0;
}

.site-header {
  position: relative;
  z-index: var(--z-sticky-nav);
  min-height: 72px;
  margin: 16px auto 0;
  padding: 8px 14px 8px 26px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-pill);
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.76), rgba(242, 250, 255, 0.45));
  box-shadow: 0 10px 32px rgba(52, 101, 135, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 -1px 0 rgba(104, 160, 192, 0.12);
  -webkit-backdrop-filter: blur(26px) saturate(175%);
  backdrop-filter: blur(26px) saturate(175%);
}

.wordmark,
.footer-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 720;
  letter-spacing: -0.055em;
  text-decoration: none;
}

.wordmark::before {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 27%, #fff 0 9%, #b9efff 22%, #49a4db 61%, #1d669d 100%);
  box-shadow: 0 1px 8px rgba(35, 131, 187, 0.35);
  content: "";
}

.site-nav {
  gap: 4px;
}

.site-nav a:not(.github-link),
.nav-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: #34556e;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.site-nav a:not(.github-link):hover,
.nav-action:hover {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.58);
  color: #124e7b;
}

.nav-action {
  background: transparent;
  cursor: pointer;
}

.page-shell {
  padding-top: 22px;
  padding-bottom: 76px;
}

.btn {
  min-height: 52px;
  padding: 0 23px;
  border: 1px solid rgba(57, 105, 138, 0.2);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  color: #234860;
  font-weight: 650;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.btn-primary {
  position: relative;
  border-color: rgba(22, 91, 143, 0.9);
  background: linear-gradient(180deg, #2581bc, #1268a8 80%);
  box-shadow: 0 9px 20px rgba(18, 104, 168, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #2279b3, #0b5e9e 80%);
  box-shadow: 0 13px 24px rgba(18, 104, 168, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.36);
  color: #fff;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.92);
}

/* Auth and API surfaces use the same translucent material system. */
.modal-overlay {
  background: rgba(11, 33, 51, 0.5);
  -webkit-backdrop-filter: blur(13px) saturate(125%);
  backdrop-filter: blur(13px) saturate(125%);
}

.modal-content {
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(250, 253, 255, 0.96), rgba(235, 246, 252, 0.93));
  box-shadow: 0 28px 90px rgba(4, 24, 41, 0.27), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(28px) saturate(165%);
  backdrop-filter: blur(28px) saturate(165%);
}

.modal-close {
  top: 13px;
  right: 13px;
  border: 1px solid rgba(76, 126, 155, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  color: #416279;
  font-size: 1.45rem;
  line-height: 1;
}

.modal-step h3 {
  color: #183b55;
  text-align: left;
  letter-spacing: -0.04em;
}

.modal-step > p {
  color: #526b7d;
  text-align: left;
  line-height: 1.65;
}

.auth-tabs,
.api-modal-tabs {
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-pill);
  background: rgba(222, 239, 248, 0.58);
}

.auth-tab,
.api-modal-tab {
  min-height: 42px;
  flex: 1 1 0;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: #4f6b80;
}

.auth-tab.active,
.api-modal-tab[aria-selected="true"] {
  border-color: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 3px 10px rgba(38, 87, 117, 0.08), inset 0 1px #fff;
  color: #175e8d;
}

.form-group label {
  color: #36566c;
  font-weight: 580;
}

.modal-input,
.ai-dev-prompt {
  border: 1px solid rgba(55, 105, 139, 0.25);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 3px rgba(39, 83, 111, 0.04);
  color: #173b54;
}

.modal-input::placeholder,
.ai-dev-prompt::placeholder {
  color: #667e8f;
  opacity: 1;
}

.modal-input:focus-visible,
.ai-dev-prompt:focus-visible {
  border-color: #1b77b4;
  outline-color: #1b77b4;
  box-shadow: 0 0 0 4px rgba(27, 119, 180, 0.14);
}

.radio-card {
  border: 1px solid rgba(55, 105, 139, 0.2);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.58);
}

.radio-card:has(input:checked) {
  border-color: #4a9bc1;
  background: rgba(220, 243, 251, 0.84);
  box-shadow: inset 0 0 0 1px rgba(74, 155, 193, 0.14);
}

.copy-btn,
.icon-btn {
  border: 1px solid rgba(56, 111, 147, 0.2);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.72);
  color: #1b628f;
}

.key-display-box,
.dashboard-card {
  border: 1px solid rgba(61, 113, 146, 0.15);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.57);
}

.privacy-form-note {
  border: 1px solid rgba(73, 145, 177, 0.22);
  border-radius: 16px;
  background: rgba(222, 244, 250, 0.84);
  color: #315b72 !important;
}

.api-code-block {
  border: 1px solid rgba(51, 104, 138, 0.17);
  border-radius: 15px;
  background: rgba(226, 241, 249, 0.72);
  color: #1b4059;
}

.api-method-badge {
  border: 1px solid rgba(73, 128, 160, 0.22);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.6);
  color: #245f82;
}

.ai-guide-badge,
.ai-guide-tip {
  color: #516c80;
}

.warning-text {
  color: #9c2838 !important;
}

.btn-danger {
  border-color: rgba(169, 50, 66, 0.54);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.42);
  color: #9b2f3d;
}

.btn-danger:hover {
  background: #9f3342;
  color: #fff;
}

@media (max-width: 600px) {
  .site-header,
  .page-shell {
    width: min(calc(100% - 24px), var(--container));
  }

  .site-header {
    min-height: 0;
    flex-flow: row wrap;
    gap: 4px;
    margin-top: 10px;
    padding: 9px 12px;
    border-radius: 23px;
  }

  .wordmark {
    min-height: 42px;
    padding-inline: 7px;
    font-size: 1.16rem;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 1px;
  }

  .site-nav a:not(.github-link),
  .nav-action {
    min-height: 40px;
    padding-inline: 8px;
    font-size: 0.79rem;
    white-space: nowrap;
  }

  .page-shell {
    padding-top: 14px;
    padding-bottom: 48px;
  }

  .modal-content {
    max-height: min(90dvh, 52rem);
    padding: 24px 18px;
    border-radius: 23px;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header,
  .modal-content {
    background-color: #f5fbff;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header,
  .modal-content {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background-color: rgba(246, 251, 254, 0.97);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav a,
  .nav-action,
  .btn {
    transition: none;
  }
}

/* Obsidian and champagne material palette */
:root {
  --color-paper: #171613;
  --color-paper-2: #211f1b;
  --color-paper-3: #302c25;
  --color-ink: #f3eee4;
  --color-ink-2: #ded6c8;
  --color-muted: #b0a99b;
  --color-rule: rgba(239, 225, 200, 0.16);
  --color-rule-2: rgba(239, 225, 200, 0.3);
  --color-accent: #c99d58;
  --color-accent-ink: #211b12;
  --color-focus: #edca86;
  --color-error: #f0a0a4;
  --color-success: #a8d0ad;
  --color-overlay: rgba(4, 4, 3, 0.72);
  --shadow-card: 0 24px 70px rgba(0, 0, 0, 0.28);
}

html {
  color-scheme: dark;
}

body {
  color: #e4eaf3;
  background:
    radial-gradient(ellipse 46rem 38rem at 82% 4%, rgba(54, 125, 111, 0.18), transparent 72%),
    radial-gradient(ellipse 40rem 33rem at 4% 38%, rgba(79, 91, 110, 0.11), transparent 72%),
    linear-gradient(180deg, #0f141b 0%, #131922 52%, #0e1219 100%);
}

.site-header {
  border-color: rgba(234, 239, 247, 0.18);
  background: linear-gradient(110deg, rgba(31, 41, 56, 0.78), rgba(22, 28, 38, 0.66));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(203, 236, 229, 0.07);
}

.wordmark,
.footer-wordmark {
  color: #e7edf6;
}

.wordmark::before {
  display: none;
}

.brand-mark {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(100, 199, 179, 0.28));
}

.site-nav a:not(.github-link),
.nav-action {
  color: #c2cbd8;
}

.site-nav a:not(.github-link):hover,
.nav-action:hover {
  border-color: rgba(232, 238, 246, 0.18);
  background: rgba(238, 242, 248, 0.09);
  color: #eef2f9;
}


.modal-content .btn-primary,
.btn.btn-primary {
  border: 1px solid rgba(235, 240, 248, 0.55);
  background: linear-gradient(135deg, #aceade, #5bbba8 76%, #46ae99);
  box-shadow: 0 9px 26px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.68);
  color: #111720;
}


.modal-content .btn-primary:hover,
.btn.btn-primary:hover {
  filter: brightness(1.07);
}

.modal-overlay {
  background: rgba(2, 2, 3, 0.73);
}

.modal-content {
  border-color: rgba(230, 236, 245, 0.2);
  background: linear-gradient(145deg, rgba(28, 36, 49, 0.98), rgba(17, 23, 31, 0.98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.56), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  color: #e1e8f2;
}

.modal-close,
.auth-tab,
.api-modal-tab {
  border-color: rgba(211, 222, 238, 0.17);
  background: rgba(241, 245, 250, 0.07);
  color: #b9c5d8;
}

.modal-step h3,
.form-group label {
  color: #dbe4f2;
}

.modal-step > p,
.ai-guide-badge,
.ai-guide-tip {
  color: #a7b1bf;
}

.modal-input,
.ai-dev-prompt,
.key-display-box,
.dashboard-card,
.api-code-block {
  border-color: rgba(212, 223, 239, 0.2);
  background: rgba(10, 14, 19, 0.5);
  color: #dfe7f3;
}

.modal-input::placeholder,
.ai-dev-prompt::placeholder {
  color: #89919e;
}

.modal-input:focus-visible,
.ai-dev-prompt:focus-visible {
  border-color: #77cfbe;
  outline-color: #77cfbe;
  box-shadow: 0 0 0 4px rgba(119, 207, 190, 0.15);
}

.auth-tabs,
.api-modal-tabs {
  border-color: rgba(212, 223, 239, 0.16);
  background: rgba(241, 245, 250, 0.06);
}

.auth-tab.active,
.api-modal-tab[aria-selected="true"] {
  border-color: rgba(236, 241, 248, 0.25);
  border-bottom-color: rgba(236, 241, 248, 0.25);
  background: rgba(241, 245, 250, 0.15);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18), inset 0 1px rgba(255, 255, 255, 0.16);
  color: #a4eadc;
}

.radio-card {
  border-color: rgba(212, 223, 239, 0.19);
  background: rgba(241, 245, 250, 0.06);
  color: #cbd5e3;
}

.radio-card:has(input:checked) {
  border-color: rgba(117, 212, 193, 0.66);
  background: rgba(75, 174, 154, 0.16);
  box-shadow: inset 0 0 0 1px rgba(117, 212, 193, 0.16);
}

.copy-btn,
.icon-btn,
.btn.btn-secondary {
  border-color: rgba(212, 223, 239, 0.22);
  background: rgba(241, 245, 250, 0.09);
  color: #aee7dc;
}

.privacy-form-note {
  border-color: rgba(133, 217, 200, 0.22);
  background: rgba(84, 182, 163, 0.13);
  color: #b4dfd7 !important;
}

.api-method-badge {
  border-color: rgba(189, 236, 227, 0.2);
  background: rgba(241, 245, 250, 0.07);
  color: #b0e3d9;
}

.btn-danger {
  border-color: rgba(219, 129, 128, 0.5);
  background: rgba(241, 245, 250, 0.05);
  color: #f0aaaa;
}

.btn-danger:hover {
  background: #8f3a36;
  color: #fff;
}

.btn.btn-glass-primary {
  border-color: rgba(235, 240, 248, 0.4);
  background: linear-gradient(135deg, rgba(140, 217, 202, 0.88), rgba(69, 165, 146, 0.92));
  color: #121821;
}

.btn.btn-text {
  color: #95ded0;
}

.dashboard-label {
  color: #a5afbd;
}

.dashboard-value {
  color: #dfe7f3;
}

.dashboard-value.highlight {
  color: #99e6d7;
}

.status-indicator.active {
  background: #8cbd92;
  box-shadow: 0 0 12px rgba(140, 189, 146, 0.4);
}

.warning-text {
  color: #f0a0a4 !important;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header,
  .modal-content {
    background-color: #19212c;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header,
  .modal-content {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background-color: #19212d;
  }
}

@media (max-width: 600px) {
  .brand-mark {
    width: 29px;
    height: 29px;
  }

}

.z-nb { display: inline-block; }

/* ===== Clarity pass 2 ===== */
.z-tagline { position: relative; margin: 18px 0 0; font-size: clamp(1.25rem, 1vw + 1rem, 1.6rem); font-weight: 600; line-height: 1.4; color: var(--z-text); }
.z-tagline .z-l2 { color: var(--z-accent); }
.z-lead strong { color: var(--z-text); font-weight: 700; }

/* Hero demo timeline */
.z-demo { width: min(420px, 100%); padding: 22px 22px 10px; border: 1px solid var(--z-line); border-radius: 22px; background: linear-gradient(180deg, rgba(20, 33, 52, 0.92), rgba(12, 21, 34, 0.92)); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.z-demo-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--z-line); font-size: 0.95rem; }
.z-demo-tag { margin-left: auto; padding: 2px 8px; border: 1px solid var(--z-line); border-radius: 999px; color: var(--z-muted); font-size: 0.75rem; }
.z-demo-list { position: relative; margin: 0; padding: 8px 0 0; list-style: none; }
.z-demo-list li { position: relative; display: grid; grid-template-columns: 76px 34px 1fr; align-items: center; gap: 10px; padding: 12px 0; opacity: 0.18; transform: translateX(8px); transition: opacity 500ms ease, transform 500ms ease; }
.z-demo-list li.is-on { opacity: 1; transform: none; }
.z-demo-list li + li::before { content: ""; position: absolute; left: 102px; top: -10px; height: 20px; border-left: 1px dashed var(--z-line); }
.z-demo-time { color: var(--z-muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.z-demo-ic { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(95, 212, 182, 0.35); border-radius: 50%; color: var(--z-accent); background: rgba(95, 212, 182, 0.08); }
.z-demo-list strong { display: block; color: var(--z-text); font-size: 0.95rem; }
.z-demo-list small { display: block; margin-top: 2px; color: var(--z-muted); font-size: 0.8125rem; }
.z-demo-list li.is-warn .z-demo-ic { border-color: rgba(242, 180, 92, 0.5); color: var(--z-candle); background: rgba(242, 180, 92, 0.1); }
.z-demo-list li.is-warn strong { color: var(--z-candle); }

/* Trigger cards */
.z-triggers { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; }
.z-triggers article { position: relative; padding: 26px; border: 1px solid var(--z-line); border-radius: var(--z-radius); background: var(--z-surface); }
.z-triggers h3 { margin: 16px 0 8px; font-size: 1.1875rem; color: var(--z-text); }
.z-triggers p { margin: 0; color: var(--z-muted); line-height: 1.7; }
.z-trg-main { border-color: rgba(242, 180, 92, 0.45) !important; background: radial-gradient(ellipse at 0% 0%, rgba(242, 180, 92, 0.12), transparent 60%), var(--z-surface) !important; }
.z-trg-main .z-ic-lg { color: var(--z-candle); }
.z-trg-badge { position: absolute; top: 22px; right: 22px; padding: 3px 10px; border-radius: 999px; background: rgba(242, 180, 92, 0.16); color: var(--z-candle); font-size: 0.75rem; font-weight: 700; }

/* Privacy flow diagram */
.z-flow { display: grid; grid-template-columns: 1fr 90px 1fr 90px 1fr; align-items: stretch; margin: 0; padding: 0; list-style: none; }
.z-flow > li:not(.z-flow-arrow) { padding: 24px; border: 1px solid var(--z-line); border-radius: var(--z-radius); background: var(--z-surface); }
.z-flow h3 { margin: 14px 0 6px; font-size: 1.125rem; color: var(--z-text); }
.z-flow p { margin: 0; color: var(--z-muted); font-size: 0.9375rem; line-height: 1.7; }
.z-flow-ic { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--z-surface-2); }
.z-flow-lock { border-color: rgba(95, 212, 182, 0.45) !important; background: rgba(95, 212, 182, 0.07) !important; }
.z-flow-warn .z-ic-lg { color: var(--z-candle); }
.z-flow-arrow { position: relative; display: grid; place-items: center; }
.z-flow-arrow::before { content: ""; position: absolute; left: 10px; right: 14px; top: 50%; border-top: 2px dashed rgba(95, 212, 182, 0.5); }
.z-flow-arrow::after { content: ""; position: absolute; right: 10px; top: calc(50% - 5px); border: 5px solid transparent; border-left: 7px solid rgba(95, 212, 182, 0.8); border-right: 0; }
.z-flow-arrow span { position: relative; z-index: 1; padding: 2px 6px; background: var(--z-bg); color: var(--z-accent); font-size: 0.75rem; white-space: nowrap; transform: translateY(-16px); }
.z-flow-arrow-warn::before { border-color: rgba(242, 180, 92, 0.55); }
.z-flow-arrow-warn::after { border-left-color: rgba(242, 180, 92, 0.85); }
.z-flow-arrow-warn span { color: var(--z-candle); }

@media (max-width: 1024px) {
  .z-triggers { grid-template-columns: 1fr; }
  .z-flow { grid-template-columns: 1fr; }
  .z-flow-arrow { height: 54px; }
  .z-flow-arrow::before { left: 50%; right: auto; top: 6px; bottom: 12px; border-top: 0; border-left: 2px dashed rgba(95, 212, 182, 0.5); }
  .z-flow-arrow-warn::before { border-left-color: rgba(242, 180, 92, 0.55); }
  .z-flow-arrow::after { left: calc(50% - 4px); right: auto; top: auto; bottom: 4px; border: 5px solid transparent; border-top: 7px solid rgba(95, 212, 182, 0.8); border-bottom: 0; }
  .z-flow-arrow-warn::after { border-top-color: rgba(242, 180, 92, 0.85); }
  .z-flow-arrow span { transform: translateX(70px); background: none; }
}
@media (max-width: 720px) {
  .z-demo-list li { grid-template-columns: 64px 30px 1fr; gap: 8px; }
  .z-demo-list li + li::before { left: 87px; }
  .z-demo-ic { width: 30px; height: 30px; }
  .z-trg-badge { position: static; display: inline-block; margin-bottom: 12px; }
}

/* ===== Hero with A4 movement illustration ===== */

/* ===== Top cinematic banner ===== */
.z-banner { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 340px; margin-top: 8px; padding: 44px 24px 40px; border: 1px solid var(--z-line); border-radius: 28px; text-align: center; background: #0c1522; }
.z-banner::before { content: ""; position: absolute; inset: 0; z-index: -2; background: url("assets/a4-movement.webp") center 35% / cover no-repeat; opacity: 0.6; filter: saturate(0.9); }
.z-banner::after { content: ""; position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(ellipse 50% 75% at 50% 50%, rgba(10, 18, 30, 0.9), rgba(10, 18, 30, 0.5) 70%, rgba(10, 18, 30, 0.3)),
  linear-gradient(180deg, rgba(10, 18, 30, 0.35), rgba(10, 18, 30, 0.15) 40%, rgba(10, 18, 30, 0.8)); }
.z-banner-icons { display: flex; gap: 16px; margin-bottom: 14px; }
.z-banner-icons .z-ic-xl { width: 34px; height: 34px; }
.z-candle { color: var(--z-candle) !important; filter: drop-shadow(0 0 14px rgba(242, 180, 92, 0.55)); }
.z-slides { display: grid; width: 100%; }
.z-slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(10px); filter: blur(6px); transition: opacity 600ms ease, transform 600ms ease, filter 600ms ease, visibility 0s 600ms; }
.z-slide.is-active { opacity: 1; visibility: visible; transform: none; filter: none; transition: opacity 600ms ease, transform 600ms ease, filter 600ms ease; }
.z-slide h2 { margin: 0; font-family: var(--font-body); font-size: clamp(2.2rem, 4vw + 1rem, 3.6rem); font-weight: 800; line-height: 1.15; color: #f3f6fb; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5); }
.z-slide p { margin: 14px auto 0; max-width: 32em; color: #d3dce8; font-size: clamp(1rem, 0.4vw + 0.95rem, 1.15rem); line-height: 1.7; }
.z-banner .z-dots { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.z-dots button { position: relative; overflow: hidden; width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: rgba(233, 239, 247, 0.3); cursor: pointer; transition: width 300ms ease; }
.z-dots button[aria-selected="true"] { width: 40px; background: rgba(242, 180, 92, 0.25); }
.z-dots button[aria-selected="true"]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--z-candle); transform-origin: left; animation: z-fill var(--z-slide-dur, 7s) linear forwards; }
@keyframes z-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.z-banner .z-memorial { margin-top: 20px; background: rgba(10, 18, 30, 0.55); }
.z-banner .z-art-credit { position: absolute; right: 18px; bottom: 12px; margin: 0; color: rgba(233, 239, 247, 0.5); font-size: 0.75rem; }
.z-banner + .z-hero { padding-top: 56px; }
@media (max-width: 720px) {
  .z-banner { min-height: 300px; padding: 36px 18px 44px; border-radius: 22px; }
  .z-banner::before { background-position: 62% center; opacity: 0.5; }
  .z-banner .z-memorial { font-size: 0.8125rem; }
  .z-banner .z-art-credit { left: 0; right: 0; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .z-slide, .z-slide.is-active { transition: none; filter: none; transform: none; } .z-dots button[aria-selected="true"]::after { animation: none; transform: none; } }

/* Full-bleed banner */
html, body { overflow-x: clip; }
.z-banner { width: auto; margin-inline: calc(50% - 50vw); border-radius: 0; border-left: 0; border-right: 0; min-height: 380px; }
.z-banner .z-art-credit { right: max(18px, calc(50vw - 600px)); }
@media (max-width: 720px) { .z-banner { min-height: 320px; border-radius: 0; } }

/* FAQ: swipe without visible scrollbars */
.z-faq { overflow-y: hidden !important; scrollbar-width: none !important; -ms-overflow-style: none; overscroll-behavior-x: contain; }
.z-faq::-webkit-scrollbar { display: none; }

/* Banner extends behind the floating nav */
.z-banner { margin-top: -116px; padding-top: 156px; min-height: 500px; border-top: 0; }
@media (max-width: 720px) { .z-banner { margin-top: -110px; padding-top: 140px; min-height: 440px; } }
.z-slide h2, .z-slide p { text-align: center; margin-inline: auto !important; max-width: none !important; }
.z-slide p { max-width: 32em !important; }

/* Nav: light glass over the banner, solid once scrolled */
.site-header.z-header { transition: background 250ms ease, border-color 250ms ease, box-shadow 250ms ease; }
.site-header.z-header:not(.is-scrolled) {
  background: rgba(10, 18, 30, 0.38) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.site-header.z-header:not(.is-scrolled) .z-nav > a:not(.z-nav-cta),
.site-header.z-header:not(.is-scrolled) .z-nav .nav-action { color: rgba(240, 245, 251, 0.88) !important; }
.site-header.z-header:not(.is-scrolled) .wordmark { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
/* Fast 1s slogan rotation */
.z-banner .z-slide { transition: opacity 250ms ease, transform 250ms ease, filter 250ms ease, visibility 0s 250ms; }
.z-banner .z-slide.is-active { transition: opacity 250ms ease, transform 250ms ease, filter 250ms ease; }

/* ===== Header v3: standalone logo, link pill, separate CTA ===== */
.site-header.z-header, .site-header.z-header:not(.is-scrolled), .site-header.z-header.is-scrolled {
  display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 16px;
  min-height: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important;
  background: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
.site-header.z-header::before { content: ""; position: absolute; z-index: -1; left: 50%; width: 100vw; top: -12px; bottom: -20px; transform: translateX(-50%); background: linear-gradient(180deg, rgba(10, 18, 30, 0.96), rgba(10, 18, 30, 0.75) 70%, transparent); opacity: 0; transition: opacity 250ms ease; pointer-events: none; }
.site-header.z-header.is-scrolled::before { opacity: 1; }
.z-header .wordmark { text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.z-header .wordmark span { font-size: 1.25rem; font-weight: 800; }
.z-header .brand-mark { width: 36px !important; height: 36px !important; }
.z-nav { margin-left: auto; padding: 5px !important; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px; background: rgba(10, 18, 30, 0.45); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25); }
.z-header.is-scrolled .z-nav { background: rgba(15, 25, 40, 0.92); }
.z-nav > a, .z-nav .nav-action { color: rgba(240, 245, 251, 0.88) !important; }
.z-header > .z-nav-cta { flex: 0 0 auto; margin: 0; padding: 11px 20px; box-shadow: 0 8px 24px rgba(59, 184, 152, 0.3); }

@media (max-width: 720px) {
  .site-header.z-header, .site-header.z-header:not(.is-scrolled), .site-header.z-header.is-scrolled { flex-wrap: wrap !important; row-gap: 10px; }
  .z-header .wordmark { order: 1; }
  .z-header > .z-nav-cta { order: 2; padding: 9px 16px; font-size: 0.875rem; }
  .site-header.z-header .z-nav { order: 3; display: flex !important; flex: 1 1 100%; justify-content: space-between; gap: 0 !important; margin: 0 !important; width: 100% !important; overflow-x: auto; scrollbar-width: none; }
  .z-nav::-webkit-scrollbar { display: none; }
  .site-header.z-header .z-nav > a:not(.z-nav-cta), .site-header.z-header .z-nav .nav-action { display: inline-flex !important; flex: 0 0 auto; padding: 7px 9px; font-size: 0.8125rem; white-space: nowrap; }
}
.z-banner { margin-top: -90px; padding-top: 112px; min-height: 470px; }
@media (max-width: 720px) { .z-banner { margin-top: -140px; padding-top: 150px; min-height: 470px; } }
@media (max-width: 370px) { .site-header.z-header .z-nav > a:not(.z-nav-cta), .site-header.z-header .z-nav .nav-action { padding: 7px 6px; } }
@media (max-width: 720px) {
  .site-header.z-header::before { bottom: -28px; background: linear-gradient(180deg, rgba(10, 18, 30, 0.98), rgba(10, 18, 30, 0.95) 75%, transparent); }
  section[id], #faq { scroll-margin-top: 150px; }
}
@media (max-width: 720px) { section[id], #faq { scroll-margin-top: 64px; } }
