:root {
  --ink: #14162B;
  --paper: #F6F6FB;
  --surface: #FFFFFF;
  --surface-2: #EEEEF7;
  --line: #E1E1EC;
  --muted: #5B5C74;
  --accent: #3D4FE0;
  --accent-deep: #6C3FD6;
  --accent-ink: #FFFFFF;
  --accent-tint: #EAEBFC;
  --success: #1F8A5F;
  --before-ink: #8A6A2E;
  --before-bg: #FBF3E3;
  --before-line: #E8D6A8;
  --shadow: 0 1px 2px rgba(20,22,43,0.04), 0 12px 28px -12px rgba(20,22,43,0.18);
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 22px;
  --font-display: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ECEDF7;
    --paper: #0E0F1F;
    --surface: #171933;
    --surface-2: #1D1F3E;
    --line: #2B2D4D;
    --muted: #9496B8;
    --accent: #8B98FF;
    --accent-deep: #B79CFF;
    --accent-ink: #0E0F1F;
    --accent-tint: #232653;
    --success: #5FD79E;
    --before-ink: #E7C77A;
    --before-bg: #2A2213;
    --before-line: #4A3A19;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 20px 40px -16px rgba(0,0,0,0.55);
  }
}

:root[data-theme="dark"] {
  --ink: #ECEDF7;
  --paper: #0E0F1F;
  --surface: #171933;
  --surface-2: #1D1F3E;
  --line: #2B2D4D;
  --muted: #9496B8;
  --accent: #8B98FF;
  --accent-deep: #B79CFF;
  --accent-ink: #0E0F1F;
  --accent-tint: #232653;
  --success: #5FD79E;
  --before-ink: #E7C77A;
  --before-bg: #2A2213;
  --before-line: #4A3A19;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 20px 40px -16px rgba(0,0,0,0.55);
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('../fonts/nunito-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-600.woff2') format('woff2');
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; }

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

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

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; max-width: 1080px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 14px; font-weight: 500; letter-spacing: 0.01em; }
.brand img { width: 26px; height: 26px; border-radius: 7px; display: block; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; color: var(--muted); }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  background: var(--ink); color: var(--paper);
  padding: 8px 16px; border-radius: 999px; text-decoration: none;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 720px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 48px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent-deep); background: var(--accent-tint);
  padding: 5px 11px; border-radius: 999px; margin-bottom: 22px;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.hero h1 {
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.01em;
}
.hero h1 em { font-style: italic; color: var(--accent-deep); }

.hero-sub {
  margin-top: 22px; font-size: 18px; color: var(--muted); max-width: 46ch; line-height: 1.6;
}

.hero-ctas { display: flex; align-items: center; gap: 18px; margin-top: 34px; flex-wrap: wrap; }

.store-badge {
  display: inline-flex; align-items: center;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.store-badge:hover { transform: translateY(-1px); opacity: 0.85; }
.store-badge-img { display: block; height: 44px; width: auto; }

.link-secondary {
  font-family: var(--font-mono); font-size: 14px; color: var(--muted);
  text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px;
}
.link-secondary:hover { color: var(--accent-deep); border-color: var(--accent-deep); }


/* ---------- Hero demo (before/after) ---------- */
.hero-demo {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  position: relative;
}
.hero-demo-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.transform-arrow--down { width: 34px; height: 34px; }
.json-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: var(--shadow); overflow: hidden; width: min(100%, 320px);
}
.json-card-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.json-snippet {
  margin: 0; padding: 12px 14px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.6;
  color: var(--ink); overflow-x: auto;
}
.file-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: var(--shadow);
  padding: 18px; width: 190px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
}
.file-card--before {
  transform: rotate(-3.5deg);
  border-color: var(--before-line);
}
.file-card--after {
  transform: rotate(2deg);
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 0 3px var(--accent-tint);
}
.file-glyph { width: 56px; height: 68px; position: relative; flex-shrink: 0; }
.file-glyph svg { width: 100%; height: 100%; display: block; }
.file-name {
  font-family: var(--font-mono); font-size: 11px; line-height: 1.4;
  color: var(--muted); word-break: break-word; hyphens: auto;
}
.file-card--before .file-name { color: var(--before-ink); }
.file-card--after .file-name { color: var(--ink); font-weight: 500; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.tag-pill {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  padding: 3px 9px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
}
.tag-pill--muted { background: var(--surface-2); color: var(--muted); }

.transform-arrow {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-2); color: var(--accent-deep);
  flex-shrink: 0;
  animation: pulse-arrow 2.4s ease-in-out infinite;
}
.transform-arrow svg { width: 18px; height: 18px; }
@keyframes pulse-arrow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* ---------- Sections shared ---------- */
section { padding: 76px 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-tab {
  display: inline-block; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-bottom: none;
  padding: 6px 14px 8px; border-radius: 8px 8px 0 0; margin-bottom: -1px;
}
.section-rule { border-top: 1px solid var(--line); }
.section-head h2 { font-size: clamp(26px, 3vw, 34px); }
.section-head p { margin-top: 14px; color: var(--muted); font-size: 16.5px; }

/* ---------- How it works ---------- */
.workflow-track {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 6px 4px 22px; margin: 0 -4px;
  scrollbar-width: thin;
}
.workflow-track::-webkit-scrollbar { height: 6px; }
.workflow-track::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

.workflow-card {
  scroll-snap-align: start;
  flex: 0 0 260px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 26px 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.workflow-num {
  font-family: var(--font-mono); font-size: 13px; color: var(--accent-deep);
  display: flex; align-items: center; gap: 8px;
}
.workflow-num::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.workflow-card h3 { font-family: var(--font-body); font-weight: 600; font-size: 17px; }
.workflow-card p { color: var(--muted); font-size: 14.5px; }

.workflow-dots { display: flex; gap: 7px; justify-content: center; margin-top: 4px; }
.workflow-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.workflow-dots span.active { background: var(--accent); }

/* ---------- Privacy ---------- */
.privacy-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.audience-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
@media (max-width: 800px) { .audience-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .privacy-grid { grid-template-columns: 1fr; } }
.privacy-card {
  border: 1px solid var(--line); border-radius: var(--radius-m); padding: 24px;
  background: var(--surface);
}
.privacy-card .badge {
  display: inline-block; font-family: var(--font-mono); font-size: 11px;
  color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent);
  padding: 3px 9px; border-radius: 999px; margin-bottom: 14px;
}
.privacy-card h3 { font-family: var(--font-body); font-size: 16.5px; font-weight: 600; margin-bottom: 8px; }
.apple-logo { width: 15px; height: 15px; vertical-align: -2px; }
.privacy-card p { color: var(--muted); font-size: 14.5px; }

/* ---------- Product mockup window ---------- */
.mock-window {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow); overflow: hidden; max-width: 640px; margin: 0 auto;
}
.mock-titlebar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mock-dot { width: 11px; height: 11px; border-radius: 50%; }
.mock-dot:nth-child(1) { background: #EF6A5F; }
.mock-dot:nth-child(2) { background: #F5BD4F; }
.mock-dot:nth-child(3) { background: #61C454; }
.mock-titlebar span { flex: 1; text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-right: 27px; }
.mock-body { padding: 30px; }
.mock-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.mock-header img { width: 34px; height: 34px; border-radius: 8px; }
.mock-header-text strong { display: block; font-size: 15px; }
.mock-header-text small { color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.mock-dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--radius-m);
  padding: 44px 20px; text-align: center; color: var(--muted);
}
.mock-dropzone svg { width: 30px; height: 30px; margin-bottom: 12px; color: var(--muted); }
.mock-dropzone strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 6px; }
.mock-dropzone span { font-size: 12.5px; font-family: var(--font-mono); }

/* ---------- Screenshot gallery ---------- */
.shots-track {
  display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 6px 4px 22px; margin: 0 -4px;
}
.shots-track::-webkit-scrollbar { height: 6px; }
.shots-track::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.shot-card { scroll-snap-align: start; flex: 0 0 min(560px, 82vw); }
.shot-frame {
  border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden;
  box-shadow: var(--shadow); background: var(--surface);
}
.shot-frame img { width: 100%; display: block; }
.shot-caption {
  margin-top: 12px; display: flex; align-items: baseline; gap: 8px;
  font-family: var(--font-mono); font-size: 13px; color: var(--muted);
}
.shot-caption strong { font-family: var(--font-body); color: var(--ink); font-size: 14.5px; font-weight: 600; }
.shots-dots { display: flex; gap: 7px; justify-content: center; margin-top: 4px; }
.shots-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.shots-dots span.active { background: var(--accent); }

/* ---------- API ---------- */
.api-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .api-panels { grid-template-columns: 1fr; } }
.code-panel {
  background: var(--ink); border-radius: var(--radius-m); overflow: hidden;
  box-shadow: var(--shadow);
}
.code-panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid color-mix(in srgb, var(--paper) 14%, transparent);
  font-family: var(--font-mono); font-size: 12.5px;
  color: color-mix(in srgb, var(--paper) 65%, transparent);
}
.code-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.code-dot--fm { background: #F5BD4F; }
.code-block {
  margin: 0; padding: 18px 16px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7;
  color: color-mix(in srgb, var(--paper) 88%, transparent);
}
.code-block code { white-space: pre; }
.tok-kw { color: var(--accent); font-weight: 500; }
.tok-str { color: #7CD9A8; }
.tok-cm { color: color-mix(in srgb, var(--paper) 45%, transparent); font-style: italic; }

.api-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
@media (max-width: 800px) { .api-notes { grid-template-columns: 1fr; } }
.api-note h3 { font-family: var(--font-body); font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.api-note p { color: var(--muted); font-size: 14px; }

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 800px) { .pricing-grid { grid-template-columns: 1fr; } }
.price-card {
  border: 1px solid var(--line); border-radius: var(--radius-m); padding: 28px 24px;
  background: var(--surface); display: flex; flex-direction: column;
}
.price-card--highlight {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint), var(--shadow);
}
.price-card .badge {
  align-self: flex-start;
  display: inline-block; font-family: var(--font-mono); font-size: 11px;
  color: var(--muted); background: var(--surface-2);
  padding: 3px 9px; border-radius: 999px; margin-bottom: 16px;
}
.price-card .badge--accent { color: var(--accent-deep); background: var(--accent-tint); }
.price-card h3 { font-family: var(--font-body); font-size: 17px; font-weight: 600; }
.price-amount { font-family: var(--font-display); font-size: 34px; font-weight: 600; margin-top: 8px; }
.price-period { font-family: var(--font-body); font-size: 15px; font-weight: 400; color: var(--muted); }
.price-detail { color: var(--muted); font-size: 14px; margin-top: 8px; }
.price-list { list-style: none; margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.price-list li { font-size: 13.5px; color: var(--ink); padding-left: 20px; position: relative; }
.price-list li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 10px; height: 6px;
  border-left: 1.6px solid var(--accent); border-bottom: 1.6px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px 4px; font-family: var(--font-body); font-weight: 500; font-size: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .plus {
  flex-shrink: 0; width: 22px; height: 22px; position: relative;
}
.faq-item summary .plus::before, .faq-item summary .plus::after {
  content: ""; position: absolute; background: var(--muted); border-radius: 2px;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.faq-item summary .plus::before { width: 14px; height: 2px; }
.faq-item summary .plus::after { width: 2px; height: 14px; transition: transform 0.2s ease, opacity 0.2s ease; }
.faq-item[open] summary .plus::after { opacity: 0; transform: translate(-50%, -50%) rotate(90deg); }
.faq-item[open] summary { color: var(--accent-deep); }
.faq-answer { padding: 0 4px 22px; color: var(--muted); font-size: 15px; max-width: 68ch; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--ink); color: var(--paper); border-radius: var(--radius-l);
  padding: 56px 48px; display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.cta-band h2 { color: var(--paper); font-size: clamp(24px, 3vw, 30px); }
.cta-band p { color: color-mix(in srgb, var(--paper) 65%, transparent); margin-top: 10px; font-size: 15.5px; }

@media (max-width: 720px) { .cta-band { flex-direction: column; align-items: flex-start; padding: 40px 28px; } }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 48px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 14px; margin-bottom: 10px; }
.footer-brand img { width: 22px; height: 22px; border-radius: 6px; }
.footer-col h4 {
  font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 12px; font-weight: 500;
}
.footer-col p, .footer-col a { display: block; color: var(--muted); font-size: 14px; text-decoration: none; line-height: 1.7; }
.footer-col a:hover { color: var(--accent-deep); }
.footer-legal { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }