:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, sans-serif;
  --bg: #f5f6f9;
  --card: #ffffff;
  --fg: #1a1b2b;
  --muted: #6c6d7c;
  --faint: #9a9baa;
  --border: rgba(26, 27, 43, 0.09);
  --border-strong: rgba(26, 27, 43, 0.14);
  --hover: rgba(26, 27, 43, 0.045);
  --chip: rgba(26, 27, 43, 0.05);
  --accent: #0a0a45;
  --accent-hover: #14144f;
  --accent-grad: linear-gradient(150deg, #111160 0%, #2c2c8c 100%);
  --accent-soft: rgba(12, 12, 74, 0.05);
  --ring: rgba(43, 43, 134, 0.30);
  --glow: 0 8px 24px rgba(12, 12, 74, 0.18);
  --ok: #159a5a;
  --error: #d3392f;
  --maxw: 1000px;
  --shadow-card: 0 1px 1px rgba(26, 27, 43, 0.04), 0 3px 10px rgba(26, 27, 43, 0.05);
  --shadow-hi: 0 2px 4px rgba(26, 27, 43, 0.06), 0 14px 34px rgba(26, 27, 43, 0.14);
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--fg);
  /* soft ambient wash: near-white base with a few faint navy/indigo glows that
     gently shift as you scroll — differentiation without loud color blocks */
  background:
    radial-gradient(1000px 620px at 12% 3%, rgba(43, 43, 134, 0.06), transparent 58%),
    radial-gradient(1100px 720px at 92% 26%, rgba(17, 17, 96, 0.05), transparent 55%),
    radial-gradient(920px 640px at 6% 62%, rgba(43, 43, 134, 0.055), transparent 55%),
    radial-gradient(1040px 720px at 100% 92%, rgba(17, 17, 96, 0.05), transparent 55%),
    #fbfbfd;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- layout ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* ---- nav ---- */
header.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(245, 246, 249, 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 0.5px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -0.02em; font-size: 17px; }
.brand img { width: 40px; height: 40px; } /* tight logo fills the frame ~= old 45px padded */
.brand span { color: var(--accent); }
.nav .links { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.nav .links a { color: var(--fg); font-weight: 500; font-size: 14px; }
.nav .links a:hover { color: var(--accent); text-decoration: none; }
.nav .links a.btn.primary, .nav .links a.btn.primary:hover { color: #fff; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-weight: 590; letter-spacing: -0.006em; cursor: pointer;
  border: 0.5px solid var(--border-strong); background: var(--card); color: var(--fg);
  border-radius: 12px; padding: 11px 20px; box-shadow: var(--shadow-card);
  transition: transform 0.13s cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 0.18s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-hi); text-decoration: none; }
.btn:active { transform: translateY(0) scale(0.99); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 1px 2px rgba(12,12,74,.28), 0 8px 20px rgba(12,12,74,.22); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--error); border-color: rgba(211,57,47,.28); background: var(--card); }
.btn.danger:hover { background: rgba(211,57,47,.06); }
.btn.block { display: flex; width: 100%; text-align: center; }
/* Even vertical spacing between stacked action buttons on the account page. */
.account .btn.block { margin-bottom: 10px; }
.btn:disabled { opacity: .5; cursor: default; box-shadow: var(--shadow-card); }
/* Loading state: spinner after the label, non-interactive (matches the app). */
.btn.loading { pointer-events: none; opacity: .85; }
.btn.loading::after {
  content: ''; display: inline-block; width: 12px; height: 12px; margin-left: 2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -2px; opacity: .7; animation: btnspin .6s linear infinite;
}
@keyframes btnspin { to { transform: rotate(360deg); } }
/* "coming soon" download button — full white text, not dimmed */
.btn.soon { color: #fff; }
.btn.soon .soon-tag { color: #fff; opacity: .85; font-weight: 500; margin-left: 4px; }

/* ---- hero ---- */
.hero { text-align: center; padding: 84px 0 60px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -160px 0 auto 0; height: 440px;
  background: radial-gradient(820px 360px at 50% 0, rgba(43,43,134,.12), transparent 70%);
  pointer-events: none;
}
.hero .badge {
  display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 0.5px solid var(--border); border-radius: 999px; padding: 5px 14px; margin-bottom: 22px;
}
.hero h1 { font-size: 52px; line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 10px; font-weight: 720; }
.hero .tagline { font-size: 32px; font-weight: 650; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 20px; }
.hero .tagline .grad, .hero h1 .grad { color: var(--accent); }
.hero p.sub { font-size: 19px; color: var(--muted); max-width: 620px; margin: 0 auto 30px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .note { color: var(--muted); font-size: 13px; margin-top: 16px; }

/* ---- sections ---- */
section.block { padding: 60px 0; }
section.block h2 { font-size: 30px; letter-spacing: -0.02em; text-align: center; margin-bottom: 10px; font-weight: 700; }
section.block p.lead { color: var(--muted); text-align: center; max-width: 620px; margin: 0 auto 40px; }

/* ---- soft, edge-fading section tints (gentle bands, no hard lines) ---- */
#how,
#pricing {
  background: linear-gradient(180deg,
    rgba(43, 43, 134, 0) 0%,
    rgba(43, 43, 134, 0.05) 22%,
    rgba(43, 43, 134, 0.05) 78%,
    rgba(43, 43, 134, 0) 100%);
}

/* ---- zoom scale strip (clickable) ---- */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 640px; margin: 0 auto; }
.scale .lvl {
  font: inherit; background: var(--card); border: 0.5px solid var(--border); border-radius: 13px;
  padding: 13px 8px; text-align: center; cursor: pointer; display: block; box-shadow: var(--shadow-card);
  transition: transform .12s cubic-bezier(.2,.8,.3,1), box-shadow .16s, border-color .12s;
}
.scale .lvl:hover { transform: translateY(-2px); box-shadow: var(--shadow-hi); }
.scale .lvl:active { transform: translateY(0); }
.scale .lvl .n { display: block; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--accent); }
.scale .lvl.zero .n { opacity: .5; }
.scale .lvl .t { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.scale .lvl.active { border-color: transparent; background: var(--accent); box-shadow: 0 2px 6px rgba(12,12,74,.24), 0 10px 24px rgba(12,12,74,.22); }
.scale .lvl.active .n, .scale .lvl.active .t { color: #fff; opacity: 1; }
.scale-ends { display: flex; justify-content: space-between; max-width: 640px; margin: 12px auto 0; color: var(--muted); font-size: 12px; }

/* ---- example topic chips (interactive demo) ---- */
.ex-nav { display: flex; align-items: center; justify-content: center; gap: 10px 12px; flex-wrap: wrap; max-width: 640px; margin: 0 auto 16px; }
.ex-label { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.ex-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ex-chip { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 13px; font-weight: 590; color: var(--fg); background: var(--card); border: 0.5px solid var(--border-strong); border-radius: 999px; padding: 7px 15px; cursor: pointer; box-shadow: var(--shadow-card); transition: transform .12s cubic-bezier(.2,.8,.3,1), box-shadow .16s, background .15s, border-color .15s; }
.ex-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-hi); }
.ex-chip .ec-base { position: relative; z-index: 1; }
/* navy fill overlay that doubles as the countdown; JS clips it left-to-right.
   text on top of the fill is white; text on the un-filled part keeps the base color */
.ex-chip .ec-fill { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; clip-path: inset(0 100% 0 0); }
/* the active pill sits on a faint tint so it reads as selected before the fill grows */
.ex-chip.active { background: var(--accent-soft); border-color: rgba(12,12,74,.18); box-shadow: 0 1px 2px rgba(12,12,74,.10), 0 6px 16px rgba(12,12,74,.10); }

/* ---- app-like popup preview ---- */
.demo-popup {
  max-width: 560px; margin: 26px auto 0; background: var(--card);
  border: 0.5px solid var(--border); border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 4px rgba(26,27,43,.06), 0 18px 44px rgba(26,27,43,.12);
}
.dp-head { display: flex; align-items: center; gap: 9px; padding: 11px 14px; background: #f6f7fa; border-bottom: 0.5px solid var(--border); }
.dp-mark { width: 18px; height: 18px; }
.dp-level { font-size: 12px; font-weight: 640; color: #fff; background: var(--accent); padding: 3px 12px; border-radius: 999px; }
.dp-hint { margin-left: auto; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.dp-body { padding: 18px 18px 20px; font-size: 16px; line-height: 1.6; color: var(--fg); min-height: 96px; }
.dp-body.fade { animation: dp-fade .22s ease; }
@keyframes dp-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- feature cards ---- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--card); border: 0.5px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--shadow-card); }
.feature .ico { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 11px; background: var(--accent-soft); border: 0.5px solid var(--border); font-size: 19px; margin-bottom: 13px; }
.feature h3 { font-size: 16px; margin-bottom: 6px; font-weight: 650; }
.feature p { color: var(--muted); font-size: 14px; }

/* ---- pricing ---- */
.plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 640px; margin: 0 auto; }
.plan-card { background: var(--card); border: 0.5px solid var(--border); border-radius: 18px; padding: 26px; text-align: center; position: relative; box-shadow: var(--shadow-card); }
.plan-card.featured { border-color: transparent; box-shadow: inset 0 0 0 1.5px var(--accent), 0 12px 30px rgba(12,12,74,.13); }
.plan-card .tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #fff; background: var(--accent-grad); border-radius: 999px; padding: 3px 12px; }
.plan-card .price { font-size: 40px; font-weight: 730; letter-spacing: -0.03em; }
.plan-card .price small { font-size: 15px; font-weight: 500; color: var(--muted); }
.plan-card .per { color: var(--muted); margin-bottom: 18px; }

/* ---- account page ---- */
.account { max-width: 460px; margin: 60px auto; }
.panel-card { background: var(--card); border: 0.5px solid var(--border); border-radius: 18px; padding: 28px; box-shadow: 0 2px 4px rgba(26,27,43,.05), 0 16px 40px rgba(26,27,43,.10); }
.account h1 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 4px; font-weight: 700; }
.account .sub { color: var(--muted); margin-bottom: 22px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); margin: 16px 0; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
input {
  width: 100%; font: inherit; color: var(--fg); background: var(--card);
  padding: 12px 14px; border: 0.5px solid var(--border-strong); border-radius: 11px; outline: none;
  box-shadow: inset 0 1px 2px rgba(26,27,43,.04);
  transition: border-color .14s, box-shadow .14s; margin-bottom: 10px;
}
input::placeholder { color: var(--faint); }
input:focus { border-color: transparent; box-shadow: 0 0 0 3.5px var(--ring), inset 0 1px 2px rgba(26,27,43,.03); }
.plan-status { background: var(--card); border: 0.5px solid var(--border); box-shadow: var(--shadow-card); border-radius: 14px; padding: 15px 16px; margin-bottom: 16px; }
.plan-status .row1 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.plan-status .name { font-weight: 680; font-size: 14.5px; }
.plan-status .detail { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.pill { font-size: 11px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--muted); white-space: nowrap; }
.pill.live { background: rgba(21,154,90,.14); color: var(--ok); }
.pill.warn { background: rgba(211,57,47,.12); color: var(--error); }
.stats-row { display: flex; gap: 12px; margin-bottom: 18px; }
.stat { flex: 1; background: var(--card); border: 0.5px solid var(--border); box-shadow: var(--shadow-card); border-radius: 13px; padding: 14px 15px; }
.stat .num { font-size: 22px; font-weight: 720; letter-spacing: -0.02em; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.msg { min-height: 18px; font-size: 13px; color: var(--muted); margin-top: 12px; text-align: center; }
.msg.error { color: var(--error); }
.msg.ok { color: var(--ok); }
.spinner { width: 22px; height: 22px; border: 2px solid var(--chip); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- legal pages ---- */
.legal { padding: 50px 0 80px; }
.legal h1 { font-size: 34px; letter-spacing: -0.02em; margin-bottom: 6px; font-weight: 720; }
.legal .updated { color: var(--muted); margin-bottom: 30px; }
.legal h2 { font-size: 20px; margin: 30px 0 8px; font-weight: 650; }
.legal p, .legal li { color: #33344a; }
.legal ul { padding-left: 22px; margin: 8px 0; }
.legal .callout { background: var(--accent-soft); border: 0.5px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: 14px; color: var(--muted); margin: 20px 0; }

/* ---- footer ---- */
footer.foot { border-top: 0.5px solid var(--border); padding: 40px 0; margin-top: 0; background: linear-gradient(180deg, rgba(43, 43, 134, 0) 0%, rgba(43, 43, 134, 0.05) 60%); }
footer.foot .wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
footer.foot .brand { font-size: 15px; }
footer.foot .brand img { width: 40px; height: 40px; }
footer.foot .links { margin-left: auto; display: flex; gap: 20px; flex-wrap: wrap; }
footer.foot .links a { color: var(--muted); font-size: 14px; }
footer.foot .copy { color: var(--muted); font-size: 13px; width: 100%; }

/* ---- install modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(12, 12, 74, 0.40); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; animation: modal-fade .16s ease; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 480px; background: var(--card); border-radius: 20px;
  box-shadow: 0 30px 70px rgba(20,22,45,.34); overflow: hidden;
  animation: modal-pop .18s cubic-bezier(.2,.9,.3,1.15);
}
@keyframes modal-pop { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; gap: 11px; padding: 20px 22px 0; }
.modal-head img { width: 40px; height: 40px; }
.modal-head h3 { font-size: 18px; letter-spacing: -.02em; flex: 1; font-weight: 680; }
.modal-close { border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 8px; line-height: 1; }
.modal-close:hover { background: var(--hover); color: var(--fg); }
.modal-body { padding: 14px 22px 4px; }
.steps { list-style: none; counter-reset: step; padding: 0; }
.steps li { position: relative; padding: 0 0 16px 40px; counter-increment: step; color: #33344a; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -1px;
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent-grad); color: #fff;
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.steps li:last-child { padding-bottom: 4px; }
.steps b { color: var(--fg); }
.steps .tip { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-foot { padding: 8px 22px 22px; }
.modal-foot .btn { width: 100%; text-align: center; }
.modal-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 10px; }

.hidden { display: none !important; }

@media (max-width: 720px) {
  .hero h1 { font-size: 40px; }
  .hero .tagline { font-size: 25px; }
  .grid { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .scale { grid-template-columns: repeat(5, 1fr); }
  .nav .links a:not(.btn) { display: none; }
  /* footer: stack brand, links, and copyright with even spacing on mobile */
  footer.foot .wrap { flex-direction: column; align-items: flex-start; gap: 16px; }
  footer.foot .links { margin-left: 0; gap: 12px 18px; }
  footer.foot .copy { width: auto; }
}
