/* ==========================================================================
   AgentBlindfold — landing page styles
   Dark-first, with a light theme via prefers-color-scheme and a manual
   [data-theme] override set by script.js.
   ========================================================================== */

:root {
  --bg:        #0d1117;
  --bg-soft:   #12171f;
  --surface:   #161b22;
  --surface-2: #1b2330;
  --border:    #2a313c;
  --border-soft:#20262f;
  --text:      #e6edf3;
  --muted:     #8b949e;
  --faint:     #6e7681;

  --accent:    #39c5bb;
  --accent-2:  #2f9e93;
  --accent-ink:#052b28;
  --amber:     #e9a83e;
  --red:       #ff6b6b;
  --green:     #3fb950;

  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas,
          "DejaVu Sans Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, "Apple Color Emoji", sans-serif;

  --radius:   14px;
  --radius-sm: 9px;
  --shadow:   0 18px 40px -18px rgba(0, 0, 0, 0.65);
  --maxw:     1120px;
}

:root[data-theme="light"] {
  --bg:        #ffffff;
  --bg-soft:   #f6f8fa;
  --surface:   #ffffff;
  --surface-2: #f6f8fa;
  --border:    #d5dbe2;
  --border-soft:#e4e9ef;
  --text:      #1f2328;
  --muted:     #57606a;
  --faint:     #6e7781;

  --accent:    #12908a;
  --accent-2:  #0f7d78;
  --accent-ink:#e6fbf8;
  --amber:     #b9770f;
  --red:       #cf3838;
  --green:     #1a7f37;
  --shadow:    0 18px 40px -22px rgba(24, 34, 48, 0.35);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        #ffffff;
    --bg-soft:   #f6f8fa;
    --surface:   #ffffff;
    --surface-2: #f6f8fa;
    --border:    #d5dbe2;
    --border-soft:#e4e9ef;
    --text:      #1f2328;
    --muted:     #57606a;
    --faint:     #6e7781;
    --accent:    #12908a;
    --accent-2:  #0f7d78;
    --accent-ink:#e6fbf8;
    --amber:     #b9770f;
    --red:       #cf3838;
    --green:     #1a7f37;
    --shadow:    0 18px 40px -22px rgba(24, 34, 48, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.4em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font: 600 0.78rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.muted { color: var(--muted); }
.center { text-align: center; }

/* ---- background wash ---- */
.bg-orbs {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
}
.bg-orbs::before, .bg-orbs::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.5;
}
.bg-orbs::before {
  width: 520px; height: 520px; top: -160px; left: -120px;
  background: radial-gradient(circle, rgba(57,197,187,0.28), transparent 70%);
}
.bg-orbs::after {
  width: 460px; height: 460px; top: 220px; right: -140px;
  background: radial-gradient(circle, rgba(47,158,147,0.18), transparent 70%);
}

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(150%) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border-soft);
}
.nav { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; display: block; }
.brand b { font-size: 1.05rem; }
.nav-links { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }
.sun { display: none; }
:root[data-theme="light"] .sun { display: block; }
:root[data-theme="light"] .moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .sun { display: block; }
  :root:not([data-theme="dark"]) .moon { display: none; }
}

.nav-toggle { display: none; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 11px;
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
  border: 1px solid transparent; transition: transform .06s ease, box-shadow .2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #04211f; box-shadow: 0 10px 24px -12px rgba(57,197,187,0.7);
}
.btn-primary:hover { box-shadow: 0 12px 28px -10px rgba(57,197,187,0.8); }
.btn-ghost {
  background: var(--surface); color: var(--text); border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: 72px 0 32px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.35rem); font-weight: 800; margin-top: 18px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), #7ee0d8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: 1.12rem; color: var(--muted); max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 22px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 18px; color: var(--faint); font-size: 0.85rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.dot-ok { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }

.hero-media {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow); background: #0d1117;
}
.hero-media img { display: block; width: 100%; height: auto; }

/* install one-liner */
.install {
  display: flex; align-items: center; gap: 10px; margin-top: 4px;
  font: 0.92rem/1.4 var(--mono);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; padding: 12px 12px 12px 16px; max-width: 420px;
}
.install code { color: var(--text); overflow-x: auto; white-space: nowrap; }
.install .prompt { color: var(--accent); user-select: none; }

.copy-btn {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); border-radius: 8px; padding: 5px 9px;
  font: 600 0.72rem var(--mono); cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* ==========================================================================
   Section scaffolding
   ========================================================================== */
section { padding: 64px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; }

/* trust boundary strip */
.boundary { border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); background: var(--bg-soft); }
.boundary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.bcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.bcard .tag { font: 600 0.72rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.tag.leak { color: var(--red); }
.tag.mask { color: var(--amber); }
.tag.safe { color: var(--green); }
.bcard h3 { margin-top: 8px; }
.bcard p { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* ==========================================================================
   How it works
   ========================================================================== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
.step {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 24px;
}
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 14px;
  border-radius: 10px; font: 700 1rem var(--mono);
  color: var(--accent); background: var(--accent-ink);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.step h3 { margin: 0 0 6px; }
.step p { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* ==========================================================================
   Feature grid
   ========================================================================== */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: transform .15s ease, border-color .15s ease;
}
.feature:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.feature .ic {
  width: 40px; height: 40px; border-radius: 10px; margin-bottom: 14px;
  display: grid; place-items: center; color: var(--accent);
  background: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.feature .ic svg { width: 21px; height: 21px; }
.feature h3 { margin: 0 0 7px; }
.feature p { color: var(--muted); margin: 0; font-size: 0.94rem; }

/* ==========================================================================
   Quickstart
   ========================================================================== */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.code-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.code-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.code-head .dots { display: flex; gap: 6px; }
.code-head .dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.code-head .dots i:nth-child(1) { background: #ff5f56; }
.code-head .dots i:nth-child(2) { background: #ffbd2e; }
.code-head .dots i:nth-child(3) { background: #27c93f; }
.code-head .name { font: 600 0.78rem var(--mono); color: var(--muted); }
.code-head .copy-btn { margin-left: auto; }
.code-card pre {
  margin: 0; padding: 18px 18px; overflow-x: auto;
  font: 0.86rem/1.7 var(--mono); color: var(--text);
}
.code-card .cmt { color: var(--faint); }
.code-card .pr { color: var(--accent); }
.code-card .fn { color: var(--amber); }
.code-card .st { color: #7ee0d8; }

/* ==========================================================================
   Policy modes table
   ========================================================================== */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.94rem; }
thead th { text-align: left; background: var(--surface-2); color: var(--muted); font-weight: 600; }
th, td { padding: 13px 18px; border-bottom: 1px solid var(--border-soft); }
tbody tr:last-child td { border-bottom: none; }
td code, .mode-pill {
  font: 600 0.82rem var(--mono);
}
.mode-pill { padding: 2px 9px; border-radius: 999px; background: var(--accent-ink); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }

/* ==========================================================================
   Audit log & viewer
   ========================================================================== */
.audit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: center; }
.audit-list { list-style: none; margin: 0 0 22px; padding: 0; }
.audit-list li {
  position: relative; padding: 9px 0 9px 26px; color: var(--muted);
  font-size: 0.95rem; border-bottom: 1px solid var(--border-soft);
}
.audit-list li:last-child { border-bottom: none; }
.audit-list li::before {
  content: ""; position: absolute; left: 2px; top: 16px;
  width: 9px; height: 9px; border-radius: 2px; background: var(--accent);
}
.audit-list b { color: var(--text); font-weight: 600; }
.audit-media figcaption {
  margin-top: 10px; text-align: center; font: 0.8rem var(--mono); color: var(--faint);
}

/* ==========================================================================
   Security / honesty callout
   ========================================================================== */
.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
}
.panel h3 { display: flex; align-items: center; gap: 9px; }
.panel ul { margin: 0; padding: 0; list-style: none; }
.panel li { position: relative; padding: 7px 0 7px 28px; color: var(--muted); font-size: 0.95rem; border-bottom: 1px solid var(--border-soft); }
.panel li:last-child { border-bottom: none; }
.panel li::before {
  position: absolute; left: 0; top: 7px; font: 700 0.95rem var(--mono);
}
.panel.does li::before { content: "✓"; color: var(--green); }
.panel.doesnt li::before { content: "✕"; color: var(--red); }

/* ==========================================================================
   CTA + footer
   ========================================================================== */
.cta-band { text-align: center; }
.cta-card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: 20px;
  padding: 48px 28px; box-shadow: var(--shadow);
}
.cta-card h2 { margin-bottom: 10px; }
.cta-card .hero-cta { justify-content: center; }

.site-footer { border-top: 1px solid var(--border-soft); padding: 34px 0; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; }
.footer-inner .brand b { font-size: 0.98rem; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }
.footer-note { width: 100%; font-size: 0.82rem; color: var(--faint); }

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-media { order: 2; }
  .boundary-grid, .steps, .features, .quick-grid, .security-grid, .audit-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px 24px 18px; margin: 0;
    transform: translateY(-140%); transition: transform .22s ease; pointer-events: none;
  }
  .nav-links.open { transform: none; pointer-events: auto; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
  .nav-links .btn { margin-top: 12px; justify-content: center; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .theme-toggle { margin-left: 0; }
  .features { grid-template-columns: 1fr; }
  section { padding: 52px 0; }
  .hero { padding: 44px 0 20px; }
}
