/* Handwriting to Text — website styles.
   Palette, type and radii mirror the app's "Lumina Script" theme
   (HandToText/Core/Theme/Theme.swift): indigo anchor, violet accent,
   mint for success/processing, Inter everywhere, generous rounding. */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --secondary: #8b5cf6;
  --mint: #2dd4bf;
  --mint-dark: #14b8a6;
  --mint-surface: #e6fbf7;

  --bg: #fafafa;
  --surface: #ffffff;
  --surface-muted: #f3f4f6;
  --text: #111827;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --body-text: #374151;

  --paper: #fdfdff;
  --paper-line: #dfe3fb;
  --ink: #3730a3;

  --glow-1: rgba(99, 102, 241, .16);
  --glow-2: rgba(139, 92, 246, .12);
  --shadow-card: 0 1px 2px rgba(17, 24, 39, .04), 0 4px 10px rgba(17, 24, 39, .04);
  --shadow-float: 0 12px 32px rgba(17, 24, 39, .08), 0 2px 6px rgba(17, 24, 39, .04);
  --shadow-brand: 0 18px 40px rgba(79, 70, 229, .28);

  --r-lg: 12px;
  --r-xl: 16px;
  --r-xxl: 24px;
  --r-pill: 999px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #6366f1;
    --primary-dark: #818cf8;
    --primary-light: #23214d;
    --secondary: #a78bfa;
    --mint-dark: #2dd4bf;
    --mint-surface: #0f2e2a;

    --bg: #0b0d12;
    --surface: #161a22;
    --surface-muted: #1f2430;
    --text: #f3f4f6;
    --text-2: #9ca3af;
    --text-3: #6b7280;
    --border: #2a2f3a;
    --border-strong: #3a4150;
    --body-text: #d1d5db;

    --paper: #f7f7fc;
    --paper-line: #dfe3fb;
    --ink: #3730a3;

    --glow-1: rgba(99, 102, 241, .22);
    --glow-2: rgba(139, 92, 246, .14);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-float: 0 16px 40px rgba(0, 0, 0, .45);
    --shadow-brand: 0 18px 40px rgba(79, 70, 229, .35);

    color-scheme: dark;
  }
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 800px; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--primary); color: #fff; padding: 8px 14px; border-radius: var(--r-lg);
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }

.nav { display: flex; align-items: center; gap: 24px; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand span { white-space: nowrap; }
.brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 0 1px var(--border); }

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  color: var(--text-2); font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: var(--r-pill);
}
.nav-links a:hover { color: var(--text); background: var(--surface-muted); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--primary-dark); background: var(--primary-light); }

@media (max-width: 860px) { .nav-links { display: none; } .nav .btn { margin-left: auto; } }
@media (max-width: 380px) { .brand { font-size: 15px; } .nav { gap: 12px; } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--r-pill);
  font: 600 15px/1 var(--font); white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, .28); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.small { height: 38px; padding: 0 14px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* App Store badge-style button (drawn, not Apple's artwork). */
.store-btn {
  display: inline-flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 22px 0 18px; border-radius: var(--r-xl);
  background: #111827; color: #fff; border: 1px solid #111827;
  box-shadow: var(--shadow-float);
  transition: transform .15s ease, box-shadow .15s ease;
}
.store-btn:hover { text-decoration: none; transform: translateY(-2px); }
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-btn span { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.store-btn small { font-size: 11px; font-weight: 500; opacity: .8; letter-spacing: .01em; }
.store-btn strong { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
@media (prefers-color-scheme: dark) { .store-btn { background: #fff; color: #111827; border-color: #fff; } }

/* ---------- Hero ---------- */

.hero { position: relative; padding: 56px 0 72px; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -120px 0 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(520px 380px at 78% 30%, var(--glow-1), transparent 70%),
    radial-gradient(420px 320px at 12% 8%, var(--glow-2), transparent 70%);
}

.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; gap: 48px; } .hero { padding-top: 32px; } }

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(38px, 6vw, 60px); line-height: 1.05; letter-spacing: -.035em; font-weight: 700;
}
.hero h1 .hand {
  font-family: var(--font-hand); font-weight: 600; font-size: 1.18em; letter-spacing: 0;
  color: var(--primary); position: relative; white-space: nowrap; padding-right: .12em;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { font-size: 19px; color: var(--text-2); max-width: 520px; margin: 0 0 28px; }
@media (max-width: 480px) { .hero .lead { font-size: 17px; } }

.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.hero-note { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 22px 0 0; padding: 0; list-style: none; color: var(--text-2); font-size: 14px; }
.hero-note li { display: inline-flex; align-items: center; gap: 6px; }
.hero-note svg { width: 16px; height: 16px; color: var(--mint-dark); flex: none; }

/* ---------- Phone mock-up ---------- */

.showcase { position: relative; display: flex; justify-content: center; }

.phone {
  position: relative; width: 300px; max-width: 100%;
  aspect-ratio: 300 / 610;
  padding: 12px; border-radius: 48px;
  background: linear-gradient(160deg, #1f2333, #0b0d12);
  box-shadow: var(--shadow-brand), inset 0 0 0 1.5px rgba(255, 255, 255, .08);
}
.phone::before { /* dynamic island */
  content: ""; position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  width: 86px; height: 24px; border-radius: 14px; background: #000; z-index: 3;
}
.screen {
  position: relative; height: 100%; overflow: hidden; border-radius: 37px;
  background: #fafafa; color: #111827;
  display: flex; flex-direction: column; gap: 10px; padding: 52px 14px 14px;
  font-size: 12px;
}
.screen-top { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.screen-top b { font-size: 15px; letter-spacing: -.01em; }

.paper {
  position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden;
  border-radius: 16px; background: var(--paper);
  background-image: repeating-linear-gradient(180deg, transparent 0 25px, var(--paper-line) 25px 26px);
  background-position: 0 14px;
  border: 1px solid #e8eaf6;
  padding: 16px 16px 0 30px;
  box-shadow: 0 4px 10px rgba(17, 24, 39, .05);
}
.paper::before { /* margin line */
  content: ""; position: absolute; top: 0; bottom: 0; left: 20px; width: 1.5px; background: #f3b8c4;
}
.paper p {
  margin: 0; font-family: var(--font-hand); color: var(--ink);
  font-size: 21px; line-height: 26px; transform: rotate(-1.2deg); transform-origin: left;
}
.scanline {
  position: absolute; left: 0; right: 0; top: 0; height: 46px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(45, 212, 191, .28));
  border-bottom: 2px solid var(--mint);
  animation: scan 3.6s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes scan { 0% { top: -50px; } 60%, 100% { top: 100%; } }
.corner { position: absolute; width: 18px; height: 18px; border: 3px solid var(--mint); }
.corner.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.corner.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.corner.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.corner.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }

.result {
  flex: 0 0 auto; border-radius: 16px; background: #fff; border: 1px solid #e5e7eb;
  padding: 12px 14px; box-shadow: 0 4px 10px rgba(17, 24, 39, .05);
}
.result-head { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; color: #14b8a6; margin-bottom: 6px; }
.result-head i { width: 14px; height: 14px; border-radius: 50%; background: #e6fbf7; display: grid; place-items: center; font-style: normal; font-size: 9px; }
.result p { margin: 0; font-size: 12.5px; line-height: 1.5; color: #374151; }
.result p + p { margin-top: 4px; }

.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.actions span {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 0; border-radius: 12px; background: #fff; border: 1px solid #e5e7eb;
  font-size: 10px; font-weight: 600; color: #374151;
}
.actions svg { width: 16px; height: 16px; color: #4f46e5; }

@media (prefers-reduced-motion: reduce) {
  .scanline { animation: none; }
  .scanline { display: none; }
}

/* ---------- Sections ---------- */

section.block { padding: 88px 0; }
section.block.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (max-width: 640px) { section.block { padding: 64px 0; } }

.section-head { max-width: 760px; margin: 0 auto 48px; text-align: center; }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin: 0 0 10px; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -.025em; margin: 0 0 12px; }
.section-head p { color: var(--text-2); font-size: 17px; margin: 0; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; list-style: none; margin: 0; padding: 0; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step {
  position: relative; padding: 28px 24px 24px; border-radius: var(--r-xxl);
  background: var(--bg); border: 1px solid var(--border);
}
.step-num {
  counter-increment: step;
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 14px; margin-bottom: 18px;
}
.step-num::before { content: counter(step); }
.step h3 { font-size: 19px; margin: 0 0 8px; letter-spacing: -.01em; }
.step p { margin: 0; color: var(--text-2); font-size: 15.5px; }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 920px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }
.feature {
  padding: 24px; border-radius: var(--r-xxl);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.feature .ic {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px;
  background: var(--primary-light); color: var(--primary);
}
.feature .ic.mint { background: var(--mint-surface); color: var(--mint-dark); }
.feature .ic.violet { background: color-mix(in srgb, var(--secondary) 14%, transparent); color: var(--secondary); }
.feature .ic svg { width: 22px; height: 22px; }
.feature h3 { font-size: 17px; margin: 0 0 6px; letter-spacing: -.01em; }
.feature p { margin: 0; color: var(--text-2); font-size: 15px; }

/* Privacy band */
.privacy-band {
  display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center;
  padding: 32px; border-radius: var(--r-xxl);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; box-shadow: var(--shadow-brand);
}
.privacy-band .ic { width: 56px; height: 56px; border-radius: 18px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; }
.privacy-band .ic svg { width: 28px; height: 28px; }
.privacy-band h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.015em; }
.privacy-band p { margin: 0; opacity: .88; font-size: 15.5px; }
.privacy-band .btn { background: #fff; border-color: #fff; color: #4338ca; }
@media (max-width: 760px) { .privacy-band { grid-template-columns: 1fr; text-align: left; padding: 26px; } }

/* Pricing */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 820px; margin: 0 auto; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }
.plan {
  position: relative; display: flex; flex-direction: column;
  padding: 30px 28px 28px; border-radius: var(--r-xxl);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.plan.pro { border: 2px solid var(--primary); box-shadow: var(--shadow-float); }
.plan h3 { margin: 0; font-size: 20px; }
.plan .price { margin: 10px 0 4px; font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.plan .price small { font-size: 15px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.plan .sub { margin: 0 0 20px; color: var(--text-2); font-size: 14.5px; }
.plan ul { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; flex: 1; }
.plan li { display: flex; gap: 10px; font-size: 15px; color: var(--body-text); }
.plan li svg { width: 20px; height: 20px; flex: none; color: var(--mint-dark); margin-top: 1px; }
.plan .btn { width: 100%; }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq details {
  border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border);
  padding: 0 20px; transition: border-color .15s ease;
}
.faq details[open] { border-color: var(--border-strong); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 0;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-weight: 600; font-size: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 10px; height: 10px; flex: none; margin-right: 4px;
  border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq details p { margin: 0 0 18px; color: var(--text-2); font-size: 15.5px; }

/* Final CTA */
.cta {
  text-align: center; padding: 56px 24px; border-radius: 32px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card);
  position: relative; overflow: hidden; isolation: isolate;
}
.cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(480px 240px at 50% 0%, var(--glow-1), transparent 70%);
}
.cta img { width: 88px; height: 88px; margin: 0 auto 20px; border-radius: 22px; box-shadow: var(--shadow-float); }
.cta h2 { font-size: clamp(26px, 4vw, 36px); letter-spacing: -.025em; line-height: 1.15; margin: 0 0 10px; }
.cta p { color: var(--text-2); margin: 0 auto 26px; max-width: 460px; }

/* ---------- Footer ---------- */

.site-footer { padding: 40px 0 48px; color: var(--text-2); font-size: 14px; }
.footer-row { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 28px; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }

/* ---------- Legal pages ---------- */

.legal-hero { padding: 48px 0 28px; position: relative; isolation: isolate; }
.legal-hero::before {
  content: ""; position: absolute; inset: -100px 0 0; z-index: -1; pointer-events: none;
  background: radial-gradient(460px 260px at 50% 0%, var(--glow-1), transparent 70%);
}
.legal-hero h1 { font-size: clamp(32px, 5vw, 44px); letter-spacing: -.03em; line-height: 1.1; margin: 0 0 8px; }
.updated { color: var(--text-2); font-size: 14px; margin: 0; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xxl);
  padding: 36px 40px 20px; box-shadow: var(--shadow-card); margin-bottom: 8px;
}
@media (max-width: 560px) { .card { padding: 24px 20px 10px; border-radius: 20px; } }
.card h2 { font-size: 19px; letter-spacing: -.01em; margin: 32px 0 10px; }
.card h2:first-child { margin-top: 0; }
.card p, .card li { color: var(--body-text); font-size: 15.5px; }
.card p { margin: 0 0 14px; }
.card ul { margin: 0 0 14px; padding-left: 22px; }
.card li { margin-bottom: 6px; }
.card .lead { color: var(--text-2); font-size: 16.5px; }
.card strong { color: var(--text); }

.table-wrap { overflow-x: auto; margin: 4px 0 18px; border: 1px solid var(--border); border-radius: var(--r-xl); }
table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--body-text); }
tr:last-child td { border-bottom: 0; }
th { color: var(--text-2); font-weight: 600; font-size: 13px; background: var(--surface-muted); }
