:root {
  --blue: #3b82f6;
  --cyan: #0ea5e9;
  --orange: #ea580c;
  --teal: #0d9488;
  --danger: #f87171;
  --radius: 12px;
  --radius-lg: 20px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --max: 1120px;
  --header-h: 56px;
  --section-y: clamp(1.75rem, 4vw, 2.75rem);
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #030213;
  --ink-soft: #0c0c18;
  --surface: #111118;
  --surface-2: #1a1a24;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f6;
  --text-secondary: #d8d8e0;
  --muted: #717182;
  --success: #4ade80;
  --chart-green: #4ade80;
  --chart-blue: #3b82f6;
  --header-bg: rgba(3, 2, 19, 0.75);
  --grid-line: rgba(255, 255, 255, 0.03);
  --control-active-bg: #030213;
  --accent-soft-bg: rgba(14, 165, 233, 0.12);
  --accent-soft-border: rgba(14, 165, 233, 0.45);
  --accent-soft-bg-hover: rgba(14, 165, 233, 0.22);
  --feature-shot-bg: rgba(59, 130, 246, 0.08);
  --feature-hover-border: rgba(59, 130, 246, 0.35);
  --store-hover-border: rgba(14, 165, 233, 0.45);
  --ghost-hover-border: rgba(255, 255, 255, 0.18);
  --chart-green-shadow: rgba(74, 222, 128, 0.25);
  --chart-blue-shadow: rgba(59, 130, 246, 0.3);
  --chart-fill-green: 0.22;
  --chart-fill-blue: 0.28;
  --glow-blue-opacity: 0.45;
  --glow-cyan-opacity: 0.3;
  --phone-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  color-scheme: light;
  --ink: #f4f7f9;
  --ink-soft: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --cyan: #4f46e5;
  --success: #16a34a;
  --chart-green: #22c55e;
  --chart-blue: #6366f1;
  --header-bg: rgba(255, 255, 255, 0.92);
  --grid-line: rgba(15, 23, 42, 0.04);
  --control-active-bg: #ffffff;
  --accent-soft-bg: rgba(79, 70, 229, 0.08);
  --accent-soft-border: rgba(79, 70, 229, 0.22);
  --accent-soft-bg-hover: rgba(79, 70, 229, 0.14);
  --feature-shot-bg: rgba(99, 102, 241, 0.06);
  --feature-hover-border: rgba(79, 70, 229, 0.28);
  --store-hover-border: rgba(59, 130, 246, 0.35);
  --ghost-hover-border: rgba(15, 23, 42, 0.12);
  --chart-green-shadow: rgba(34, 197, 94, 0.2);
  --chart-blue-shadow: rgba(99, 102, 241, 0.25);
  --chart-fill-green: 0.18;
  --chart-fill-blue: 0.22;
  --glow-blue-opacity: 0.12;
  --glow-cyan-opacity: 0.1;
  --phone-shadow: 0 20px 56px rgba(15, 23, 42, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

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

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* Background grid */
.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 75%);
}

/* Animated chart lines (background) */
.chart-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 85%, black 15%, transparent 72%);
}

.chart-lines svg {
  position: absolute;
  left: -8%;
  bottom: -8%;
  width: 116%;
  height: min(52vh, 420px);
  animation: chartDrift 18s ease-in-out infinite alternate;
}

.chart-area {
  opacity: 0.85;
}

.chart-area--green {
  fill: url(#fillGreen);
  animation: areaPulseGreen 7s ease-in-out infinite alternate;
}

.chart-area--blue {
  fill: url(#fillBlue);
  animation: areaPulseBlue 9s ease-in-out infinite alternate-reverse;
}

.chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line--green {
  stroke: var(--chart-green);
  stroke-dasharray: 2200;
  stroke-dashoffset: 2200;
  opacity: 0.75;
  filter: drop-shadow(0 0 8px var(--chart-green-shadow));
  animation:
    chartDrawGreen 3.5s ease forwards,
    linePulseGreen 6s ease-in-out 3.5s infinite;
}

.chart-line--blue {
  stroke: var(--chart-blue);
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  opacity: 0.8;
  filter: drop-shadow(0 0 10px var(--chart-blue-shadow));
  animation:
    chartDrawBlue 4s ease 0.4s forwards,
    linePulseBlue 8s ease-in-out 4.4s infinite;
}

@keyframes chartDrawGreen {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes chartDrawBlue {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes chartDrift {
  from {
    transform: translateY(0) scale(1);
  }
  to {
    transform: translateY(-14px) scale(1.015);
  }
}

@keyframes linePulseGreen {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.9;
  }
}

@keyframes linePulseBlue {
  0%,
  100% {
    opacity: 0.65;
  }
  50% {
    opacity: 0.95;
  }
}

@keyframes areaPulseGreen {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 0.95;
  }
}

@keyframes areaPulseBlue {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 1;
  }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 clamp(1rem, 4vw, 2rem);
  max-width: var(--max);
  margin: 0 auto;
  backdrop-filter: blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
}

.logo img {
  border-radius: 8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-beta {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--accent-soft-border);
  background: var(--accent-soft-bg);
  color: var(--cyan);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-beta:hover {
  text-decoration: none;
  background: var(--accent-soft-bg-hover);
  border-color: var(--cyan);
  color: var(--text);
}

.theme-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 1.85rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.theme-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.theme-btn:hover {
  color: var(--text);
}

.theme-btn.is-active {
  background: var(--control-active-bg);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--border);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.15rem;
}

.store-row--hero {
  justify-content: flex-start;
  gap: 0.5rem;
}

.store-row--hero .store-btn {
  min-width: 0;
  padding: 0.55rem 0.85rem;
}

.store-row--hero .store-btn svg {
  width: 22px;
  height: 22px;
}

.store-row--hero .store-btn strong {
  font-size: 0.95rem;
}

.btn-beta--hero {
  font-size: 0.85rem;
  padding: 0.55rem 1rem;
}

.lang-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.lang-btn {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.65rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.is-active {
  background: var(--control-active-bg);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--border);
}

/* Layout */
main {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem) 2.5rem;
}

section {
  padding: var(--section-y) 0;
}

.section-title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  padding-top: 0.5rem;
  padding-bottom: 0.25rem;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 0.65rem;
}

.hero h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(2rem, 5vw, 2.85rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.hero-lead {
  margin: 0 0 1.1rem;
  font-size: 1rem;
  color: var(--muted);
  max-width: 34rem;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.hero-pills li {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Phone mock */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 0.25rem 0;
}

.phone {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(252px, 78vw);
  aspect-ratio: 9 / 19;
  border-radius: 32px;
  padding: 10px;
  background: linear-gradient(145deg, #2a2a36 0%, #14141c 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    var(--phone-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 22px;
  background: #0a0a10;
  border-radius: 0 0 14px 14px;
  z-index: 3;
}

.phone-screen {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 24px;
  overflow: hidden;
  background: #0a0a10;
}

.phone--photo .phone-screen {
  padding: 0;
}

.phone--photo .phone-screen img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.phone--compact {
  width: min(180px, 38vw);
}

.phone--compact .phone-notch {
  display: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.glow--blue {
  width: 280px;
  height: 280px;
  background: var(--blue);
  top: 10%;
  right: 5%;
  opacity: var(--glow-blue-opacity);
}

.glow--cyan {
  width: 200px;
  height: 200px;
  background: var(--cyan);
  bottom: 5%;
  left: 10%;
  opacity: var(--glow-cyan-opacity);
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.feature-card {
  padding: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--feature-hover-border);
  transform: translateY(-2px);
}

.feature-card--shot {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.feature-shot {
  display: flex;
  justify-content: center;
  padding: 0.85rem 0.75rem 0.35rem;
  background: linear-gradient(180deg, var(--feature-shot-bg) 0%, transparent 100%);
}

.feature-card--shot h3,
.feature-card--shot p {
  padding: 0 1.25rem;
}

.feature-card--shot h3 {
  margin: 0.5rem 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.feature-card--shot p {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Privacy */
.privacy-lead {
  color: var(--muted);
  margin: 0 0 1rem;
  max-width: 36rem;
}

.privacy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.privacy-list li {
  display: grid;
  gap: 0.15rem;
  padding-left: 1rem;
  border-left: 2px solid var(--blue);
}

.privacy-term {
  font-weight: 600;
  font-size: 0.95rem;
}

.privacy-list li > span:last-child {
  font-size: 0.88rem;
  color: var(--muted);
}

/* Flow */
.flow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

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

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

.flow-steps li {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.flow-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
}

.flow-steps h3 {
  margin: 0.35rem 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.flow-steps p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.store-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.store-btn--active:hover {
  border-color: var(--store-hover-border);
  background: var(--surface-2);
}

.store-btn svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  opacity: 0.85;
}

.store-btn span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.store-btn small {
  font-size: 0.65rem;
  color: var(--muted);
}

.store-btn strong {
  font-size: 1.05rem;
  font-weight: 600;
}

.store-btn em {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-style: normal;
  color: var(--cyan);
  margin-top: 0.15rem;
}

.store-btn--active em {
  color: var(--success);
}

.store-btn--disabled {
  opacity: 0.7;
  cursor: default;
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 4vw, 2rem) 1.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
}

.footer-brand img {
  border-radius: 6px;
}

.footer-domain a {
  color: var(--muted);
}

.footer-domain a:hover {
  color: var(--cyan);
}

.btn-beta--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-beta--ghost:hover {
  border-color: var(--ghost-hover-border);
  text-decoration: none;
}

.legal-page {
  position: relative;
  z-index: 1;
  padding: calc(var(--header-h) + 1.5rem) clamp(1rem, 4vw, 2rem) var(--section-y);
}

.legal-inner {
  max-width: 720px;
  margin: 0 auto;
}

.legal-updated {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.legal-page h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.15;
}

.legal-lead {
  margin: 0 0 2rem;
  font-size: 1.05rem;
  color: var(--muted);
}

.legal-page section {
  margin-bottom: 1.75rem;
}

.legal-page h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.legal-page p,
.legal-page li {
  color: var(--text-secondary);
}

.legal-page ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.legal-page li + li {
  margin-top: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .chart-lines svg {
    animation: none;
  }

  .chart-line--green,
  .chart-line--blue {
    stroke-dashoffset: 0;
    animation: none;
    opacity: 0.65;
  }

  .chart-area--green,
  .chart-area--blue {
    animation: none;
    opacity: 0.7;
  }
}
