/* Redactabit — landing page styles.
   Color/space tokens are lifted verbatim from the app (ui/styles/tokens.css) so the
   site matches Redactabit: dark, teal accent, system fonts. Font SIZES are web-scaled
   (the app's px scale tops out at 28px — too small for a hero).
   Self-hosted only: system fonts, no CDN, no web fonts, no third-party anything. */

:root {
  /* surfaces */
  --bg: #0e1014;
  --surface: #161922;
  --surface-2: #1d212c;
  --surface-3: #252b38;
  --border: #2b313d;
  --border-strong: #3a4250;
  /* text */
  --text: #e7e9ee;
  --text-2: #a3acbd;
  --text-muted: #6b7383;
  /* accent (teal = "secured") */
  --primary: #2dd4bf;
  --primary-hover: #45e3cf;
  --primary-press: #14b8a6;
  --on-primary: #04201c;
  /* redaction motif */
  --redacted: rgba(45, 212, 191, 0.16);
  --redacted-ring: rgba(45, 212, 191, 0.45);
  --redacted-bar: #0a0d12;
  /* type — system stack, offline, native feel */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  /* space (4px base) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;
  /* radius / shadow / motion */
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-full: 9999px;
  --shadow-2: 0 10px 30px rgba(0,0,0,.40);
  --dur: 160ms; --ease: cubic-bezier(.2,.6,.2,1);
  /* landing display scale */
  --fs-hero: clamp(2.3rem, 6vw, 4rem);
  --fs-sub: clamp(1.05rem, 2.2vw, 1.35rem);
  --fs-h2: clamp(1.6rem, 3.4vw, 2.1rem);
  --container: 1040px;
  --gap-section: clamp(32px, 4vw, 56px);
  /* fixed across themes: the brand stripe always sits on a dark bar; the header tint flips */
  --brand-stripe: #2dd4bf;
  --header-bg: rgba(14,16,20,.82);
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img, svg { display: block; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(45,212,191,.45); border-radius: var(--r-sm); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-5); }
.section { padding-block: var(--gap-section); }
.section > .container > h2 {
  font-size: var(--fs-h2); font-weight: 600; letter-spacing: -.01em;
  text-align: center; margin-bottom: var(--s-2);
}
.section .lede { color: var(--text-2); text-align: center; max-width: 52ch; margin: 0 auto var(--s-5); }
/* offset anchor targets for the sticky header */
:where(#how, #download) { scroll-margin-top: 68px; }

/* ===== Brand mark (identical construction to the app) ===== */
.brand { display: inline-flex; align-items: center; gap: var(--s-3); color: var(--text); }
.brand-mark { display: block; flex-shrink: 0; }
.brand .name { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }

/* ===== Buttons (from the app) ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-5); border-radius: var(--r-md); border: 1px solid transparent;
  font-size: 1rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn--secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-3); color: var(--text); }
.btn--sm { padding: var(--s-2) var(--s-3); font-size: .875rem; }

/* ===== Header / nav ===== */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); height: 56px; }
.nav__links { display: flex; align-items: center; gap: var(--s-2); }
.nav__links a {
  color: var(--text-2); padding: var(--s-2) var(--s-3); border-radius: var(--r-md); font-size: .9375rem;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav__links a:hover { color: var(--text); background: var(--surface-2); }
.nav__right { display: flex; align-items: center; gap: var(--s-3); }
.theme-toggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.theme-toggle:hover { background: var(--surface-3); color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ===== Hero ===== */
.hero { padding-top: clamp(28px, 4vw, 52px); padding-bottom: var(--gap-section); text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-4);
  padding: var(--s-1) var(--s-3); border-radius: var(--r-full);
  background: var(--redacted); border: 1px solid var(--redacted-ring);
  color: var(--primary); font-size: .8125rem; font-weight: 500; letter-spacing: .01em;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.hero h1 {
  font-size: var(--fs-hero); font-weight: 600; letter-spacing: -.025em; line-height: 1.06;
  max-width: 18ch; margin: 0 auto;
}
.hero .sub {
  font-size: var(--fs-sub); color: var(--text-2); line-height: 1.5;
  max-width: 46ch; margin: var(--s-4) auto 0;
}
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: center; margin-top: var(--s-5); }
.reassure { margin-top: var(--s-3); font-size: .875rem; color: var(--text-muted); }

/* ===== Demo (before → after — the proof) ===== */
.demo { padding-top: 0; }
.demo__card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); overflow: hidden;
}
.demo__bar {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: .8125rem;
}
.demo__bar .dots { display: inline-flex; gap: 6px; }
.demo__bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.demo__bar .file { margin-left: var(--s-2); font-family: var(--font-mono); }
.demo__grid { display: grid; grid-template-columns: 1fr 1fr; }
.pane { padding: var(--s-5); }
.pane + .pane { border-left: 1px solid var(--border); }
.pane__label {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted);
  margin-bottom: var(--s-3);
}
.doc { font-family: var(--font-mono); font-size: .875rem; line-height: 1.9; color: var(--text-2); margin: 0; white-space: pre-wrap; }
.doc .k { color: var(--text-muted); }
mark.repl { background: var(--redacted); color: var(--primary); border: 1px solid var(--redacted-ring); border-radius: 4px; padding: 0 4px; }
mark.bar { background: var(--redacted-bar); color: transparent; border-radius: 3px; padding: 0 4px; box-shadow: inset 0 0 0 1px var(--border); }
.kept { color: var(--text); }
.demo__settings { padding: var(--s-4); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--s-2); font-size: .8125rem; color: var(--text-muted); }
.demo__settings p { margin: 0; line-height: 1.5; }
.demo__settings b { color: var(--text-2); font-weight: 600; }
.demo__note { text-align: center; color: var(--text-muted); font-size: .875rem; margin-top: var(--s-4); }

/* ===== Value cards ===== */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card .ico {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--r-md);
  background: var(--redacted); color: var(--primary);
}
.card .ico svg { width: 20px; height: 20px; }
.card h3 { font-size: 1.0625rem; font-weight: 600; }
.card p { color: var(--text-2); font-size: .9375rem; line-height: 1.55; }

/* ===== How it works ===== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); counter-reset: step; }
.step { position: relative; padding-left: var(--s-7); }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-full);
  background: var(--surface-2); border: 1px solid var(--redacted-ring); color: var(--primary);
  font-weight: 600; font-size: 1rem;
}
.step h3 { font-size: 1.0625rem; font-weight: 600; margin-bottom: var(--s-1); }
.step p { color: var(--text-2); font-size: .9375rem; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); padding-block: var(--s-6); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); color: var(--text-muted); font-size: .9375rem; }
.footer-links a { color: var(--text-2); }
.footer-links a:hover { color: var(--text); }
.footer-links .sep { color: var(--border-strong); }
.footer-creed { color: var(--text-muted); font-size: .875rem; }
.footer-creed b { color: var(--text-2); font-weight: 500; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; gap: var(--s-5); }
}
@media (max-width: 620px) {
  .nav__links { display: none; }
  .cards { grid-template-columns: 1fr; }
  .demo__grid { grid-template-columns: 1fr; }
  .pane + .pane { border-left: 0; border-top: 1px solid var(--border); }
  .footer-row { flex-direction: column; align-items: flex-start; }
}

/* ===== Respect reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ===== Light theme =====
   Token-only palette. It applies in two cases: (a) the visitor made no manual choice and
   their OS is light, or (b) they explicitly picked Light from the nav toggle. Manual Dark
   keeps the base (dark) :root. --brand-stripe and --redacted-bar stay dark-friendly in every
   theme (a redaction bar should read as a solid block). The two blocks below carry identical
   tokens — keep them in sync. */
:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --surface-2: #eef1f5;
  --surface-3: #e4e9ee;
  --border: #e2e7ec;
  --border-strong: #cbd3db;
  --text: #0e1014;
  --text-2: #475059;
  --text-muted: #6b7480;
  --primary: #0f766e;
  --primary-hover: #0c5f58;
  --on-primary: #ffffff;
  --redacted: rgba(15,118,110,.10);
  --redacted-ring: rgba(15,118,110,.34);
  --shadow-2: 0 10px 30px rgba(2,6,23,.12);
  --header-bg: rgba(255,255,255,.82);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #ffffff;
    --surface: #f6f8fa;
    --surface-2: #eef1f5;
    --surface-3: #e4e9ee;
    --border: #e2e7ec;
    --border-strong: #cbd3db;
    --text: #0e1014;
    --text-2: #475059;
    --text-muted: #6b7480;
    --primary: #0f766e;
    --primary-hover: #0c5f58;
    --on-primary: #ffffff;
    --redacted: rgba(15,118,110,.10);
    --redacted-ring: rgba(15,118,110,.34);
    --shadow-2: 0 10px 30px rgba(2,6,23,.12);
    --header-bg: rgba(255,255,255,.82);
  }
}
