:root {
  --bg: #0f1115;
  --bg-2: #14171d;
  --card: #1a1d24;
  --card-2: #1f232b;
  --border: #2a2d35;
  --text: #e8e8e8;
  --muted: #9099a8;
  --accent: #4f7cff;
  --accent-hover: #6b90ff;
  --accent-ink: #ffffff;
  --brass: #e2c87e;
  --success: #7ee2a8;
  --success-bg: #1e3a2b;
  --warn: #e2c87e;
  --warn-bg: #3a3620;
  --danger: #ff6b6b;
  --danger-bg: #4a2323;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px -16px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; }
/* Safety net against stray horizontal overflow (long e-mails, subscription links).
   Deliberately on `body` only, never on `html` too — setting it on both turns the root
   into a scroll container and silently breaks the sticky header. */
body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; color: var(--text); }
.muted { color: var(--muted); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* --- Nav --------------------------------------------------------------- */
.site-nav {
  border-bottom: 1px solid var(--border);
  background: rgba(15,17,21,.92);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 50;
}
.site-nav .container { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; color: var(--text); white-space: nowrap; }
.brand:hover { color: var(--text); }
.nav-menu { display: flex; align-items: center; gap: 28px; flex: 1; justify-content: space-between; }
.nav-links { display: flex; align-items: center; gap: 20px; font-size: .92rem; }
.nav-links a { color: var(--muted); white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-right .btn { white-space: nowrap; }
.lang-form { display: flex; align-items: center; }
.lang-select { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .35rem .5rem; font-size: .82rem; }

/* Burger: hidden on desktop, the only nav control below the breakpoint. */
.nav-toggle { position: absolute; opacity: 0; width: 44px; height: 44px; right: 24px; top: 10px; margin: 0; z-index: 2; cursor: pointer; display: none; }
.nav-burger { display: none; width: 44px; height: 44px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer; }
.nav-burger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }
.nav-toggle:focus-visible + .nav-burger { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

@media (max-width: 900px) {
  .site-nav .container { padding: 0 16px; gap: 12px; }
  .nav-toggle, .nav-burger { display: flex; }
  .nav-menu {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 12px 16px 18px;
  }
  .nav-toggle:checked ~ .nav-menu { display: flex; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-links a { padding: .7rem .2rem; border-bottom: 1px solid var(--border); }
  .nav-right { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 12px; }
  .nav-right .btn { width: 100%; }
  .lang-form, .lang-select { width: 100%; }
  .lang-select { padding: .6rem .5rem; font-size: .9rem; }
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: .7rem 1.3rem; border-radius: var(--radius-sm); border: none; cursor: pointer;
  font-weight: 600; font-size: .92rem; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--card-2); color: var(--text); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid transparent; }
.btn-block { width: 100%; }
.btn-sm { padding: .45rem .8rem; font-size: .82rem; }

/* --- Hero ---------------------------------------------------------------- */
.hero { position: relative; padding: 92px 0 76px; overflow: hidden; }
/* Ambient light behind the artwork — gives the flat background depth without resorting
   to a full-bleed gradient wash. */
.hero::before {
  content: ""; position: absolute; pointer-events: none;
  top: -20%; right: -8%; width: min(760px, 90vw); aspect-ratio: 1;
  background: radial-gradient(circle, rgba(79,124,255,.20) 0%, rgba(79,124,255,.07) 42%, transparent 68%);
}
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.06; letter-spacing: -.025em; font-weight: 800;
  text-wrap: balance; margin-bottom: .5em;
}
.hero h1 .accent {
  background: linear-gradient(96deg, var(--accent) 8%, #9ec1ff 92%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero .lede { font-size: 1.1rem; color: var(--muted); max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 2rem 0 0; }
.btn-lg { padding: .9rem 1.7rem; font-size: 1rem; }

.hero-trust {
  list-style: none; margin: 28px 0 0; padding: 22px 0 0;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 10px 26px;
}
.hero-trust li { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.hero-trust li::before {
  content: ""; flex: 0 0 auto; width: 16px; height: 16px; border-radius: 999px;
  background: var(--success-bg);
  /* Checkmark drawn with two borders rotated 45° — no icon font, no extra request. */
  box-shadow: inset 0 0 0 1px rgba(126,226,168,.35);
  background-image: linear-gradient(45deg, transparent 46%, var(--success) 46%, var(--success) 54%, transparent 54%),
                    linear-gradient(-45deg, transparent 46%, var(--success) 46%, var(--success) 54%, transparent 54%);
  background-size: 7px 2px, 4px 2px;
  background-position: 6px 8px, 3.5px 8.5px;
  background-repeat: no-repeat;
}

.hero-art { display: flex; align-items: center; justify-content: center; }
.hero-art img {
  width: 100%; max-width: 540px; height: auto;
  /* screen blend drops the artwork's near-black backing plate against the dark page, so
     only the glowing globe survives — this is what kills the "pasted rectangle" look
     that a mask alone couldn't fully hide. The mask then softens what's left. */
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse 72% 72% at 50% 50%, #000 48%, transparent 88%);
  mask-image: radial-gradient(ellipse 72% 72% at 50% 50%, #000 48%, transparent 88%);
  animation: hero-float 7s ease-in-out infinite;
}
@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-art img { animation: none; }
}
@media (max-width: 860px) {
  .hero { padding: 28px 0 44px; }
  .hero .container { grid-template-columns: 1fr; gap: 24px; }
  .hero-art { order: -1; }
  .hero-art img { max-width: 320px; }
  .hero .lede { max-width: none; }
  .hero-actions { margin-top: 1.6rem; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-trust { gap: 10px 18px; margin-top: 22px; padding-top: 18px; }
  .hero-trust li { font-size: .84rem; }
}
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .section { padding: 40px 0; }
  .card { padding: 24px 20px; }
  .callout { padding: 28px 20px; }
}

/* --- Sections ------------------------------------------------------------- */
.section { padding: 56px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.section-alt { background: var(--bg-2); }

/* --- How it works ---------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { text-align: center; padding: 0 12px; }
.step-icon { width: 104px; height: 104px; margin: 0 auto 18px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.step-icon img { width: 64px; height: 64px; }
.step h3 { font-size: 1.05rem; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: 32px; } }

/* --- Feature grid ---------------------------------------------------------- */
/* Two columns, not three: the icon-beside-text layout needs the extra width to keep
   descriptions off a third line. */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.feature-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  display: flex; align-items: flex-start; gap: 20px;
}
.feature-card .icon { flex: 0 0 auto; width: 76px; height: 76px; }
.feature-card .feature-body { min-width: 0; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: .35em; }
.feature-card p { color: var(--muted); font-size: .9rem; margin: 0; }
@media (max-width: 860px) { .feature-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  .feature-card { padding: 20px; gap: 16px; }
  .feature-card .icon { width: 60px; height: 60px; }
}

/* --- Pricing --------------------------------------------------------------- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.price-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; text-align: center; }
.price-card .name { font-weight: 600; margin-bottom: 6px; }
.price-card .price { font-size: 1.8rem; font-weight: 700; margin: 6px 0 18px; }
.price-card .price small { font-size: .9rem; color: var(--muted); font-weight: 500; }

/* --- Trial callout ------------------------------------------------------------ */
.callout {
  background: linear-gradient(135deg, var(--card), var(--bg-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 40px; text-align: center; margin: 0 auto;
}
.callout h2 { font-size: 1.6rem; }

/* --- Footer ------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; font-size: .85rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.copyright { font-size: .8rem; color: var(--muted); }

/* --- Forms / cards --------------------------------------------------------------- */
.auth-shell { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.card-narrow { width: 100%; max-width: 400px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .84rem; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: .65rem .8rem; font-size: .95rem;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.form-note { font-size: .85rem; color: var(--muted); margin-top: 16px; text-align: center; }
.alert { padding: .7rem 1rem; border-radius: var(--radius-sm); font-size: .87rem; margin-bottom: 16px; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }

/* --- Cabinet layout ------------------------------------------------------------------- */
/* min-width:0 on the content column is load-bearing, not defensive: a grid track sized
   `1fr` still has `min-width: auto`, so one long unbreakable string (the happ:// link)
   would otherwise widen the track and push the whole page past the viewport. */
.cabinet-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.cabinet-side { border-right: 1px solid var(--border); padding: 28px 16px; min-width: 0; }
.cabinet-side nav { display: flex; flex-direction: column; gap: 4px; }
.cabinet-side a { color: var(--muted); padding: .55rem .8rem; border-radius: var(--radius-sm); font-size: .9rem; }
.cabinet-side a:hover { background: var(--card); color: var(--text); }
.cabinet-side a.active { background: var(--card); color: var(--text); font-weight: 600; }
.cabinet-main { padding: 32px 32px 60px; max-width: 760px; min-width: 0; }
.cabinet-main > * { max-width: 100%; }
.cabinet-main h1 { font-size: 1.5rem; }
@media (max-width: 820px) {
  /* minmax(0, …), not a bare 1fr — a bare 1fr track re-inherits min-width:auto and
     undoes the desktop rule's overflow fix on exactly the screens that need it most. */
  .cabinet-shell { grid-template-columns: minmax(0, 1fr); }
  .cabinet-side { border-right: none; border-bottom: 1px solid var(--border); padding: 12px 0 12px 16px; }
  /* Horizontal scroller, not a wrapping row — "My subscriptions" must stay on one line. */
  .cabinet-side nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-right: 16px; scrollbar-width: none; }
  .cabinet-side nav::-webkit-scrollbar { display: none; }
  .cabinet-side a { white-space: nowrap; flex: 0 0 auto; }
  .cabinet-side form { flex: 0 0 auto; margin-top: 0 !important; }
  .cabinet-main { padding: 24px 16px 48px; max-width: 100%; }
  .cabinet-main h1 { font-size: 1.3rem; overflow-wrap: anywhere; }
}

.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; max-width: 100%; overflow-wrap: anywhere; }
.stat-card h2 { font-size: 1.1rem; }
.badge { display: inline-flex; align-items: center; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; background: var(--bg-2); color: var(--muted); }
.badge-success { background: var(--success-bg); color: var(--success); }

.sub-list { padding: 8px 24px; }
.sub-row {
  display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; align-items: baseline;
  padding: .8rem 0; border-bottom: 1px solid var(--border); font-size: .9rem;
}
.sub-list .sub-row:last-child { border-bottom: none; }

.link-box {
  display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .6rem .8rem; font-family: ui-monospace, monospace; font-size: .82rem;
  overflow-x: auto; white-space: nowrap; max-width: 100%;
}
/* Same min-width:0 reasoning as .cabinet-shell — without it this flex item refuses to
   shrink below the link's full width and the scroll never kicks in. */
.link-box code { flex: 1 1 0; min-width: 0; }

.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 8px 0 20px; }
.method-option { display: block; position: relative; }
.method-option input { position: absolute; opacity: 0; inset: 0; pointer-events: none; }
.method-option .box {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 12px; cursor: pointer; font-size: .9rem;
  background: var(--bg-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-align: center; min-height: 64px; overflow-wrap: anywhere;
}
.method-option .box small { color: var(--muted); font-size: .74rem; line-height: 1.3; }
.method-option input:checked + .box { border-color: var(--accent); background: rgba(79,124,255,.12); }
.method-option input:disabled + .box { opacity: .5; cursor: not-allowed; }

.legal-content { max-width: 760px; margin: 0 auto; }
.legal-content h2 { margin-top: 2em; font-size: 1.2rem; }

/* --- Setup guide (/guide) ------------------------------------------------------------ */
.guide-head { padding-bottom: 8px; }
.guide-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.guide-head .lede { font-size: 1.05rem; max-width: 56ch; }

.guide-steps { max-width: 780px; padding-bottom: 56px; }
.guide-step { display: flex; gap: 22px; align-items: flex-start; padding: 28px 0; border-bottom: 1px solid var(--border); }
.guide-step:last-child { border-bottom: none; }
.guide-num {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums;
}
.guide-body { min-width: 0; flex: 1; }
.guide-body h2 { font-size: 1.15rem; margin-bottom: .4em; }
.guide-body p { margin-bottom: 1em; }

.platform-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.platform {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text); text-decoration: none;
}
.platform:hover { border-color: var(--accent); color: var(--text); }
.platform-icon { flex: 0 0 auto; width: 26px; height: 26px; color: var(--accent); display: flex; align-items: center; justify-content: center; }
.platform-icon svg { width: 100%; height: 100%; display: block; }
.platform b { display: block; font-size: .92rem; font-weight: 600; }
.platform small { color: var(--muted); font-size: .78rem; }

/* Full column width, not a thumbnail: the shot is two phone screens side by side, so
   anything smaller makes the in-app labels unreadable. */
.guide-shot { margin: 0; }
.guide-shot img {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--border); display: block;
}
.guide-shot a { display: block; }
.guide-shot a:hover img { border-color: var(--accent); }
.guide-shot figcaption { margin-top: 8px; font-size: .8rem; color: var(--muted); }

.guide-faq { max-width: 780px; }
.guide-faq h2 { font-size: 1.4rem; margin-bottom: 20px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); margin-bottom: 10px; }
.faq-item summary { padding: 14px 18px; cursor: pointer; font-weight: 600; font-size: .95rem; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
.faq-item[open] summary::after { content: "−"; }
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-sm); }
.faq-item p { padding: 0 18px 16px; margin: 0; font-size: .9rem; }
.guide-help { margin-top: 24px; font-size: .9rem; }

@media (max-width: 560px) {
  .guide-step { gap: 14px; padding: 22px 0; }
  .guide-num { width: 36px; height: 36px; font-size: 1rem; }
  .platform-grid { grid-template-columns: 1fr; }
}
