/* ═══════════════════════════════════════════════════════════════════
   Keyzo — marketing site
   Design tokens extend the product dashboard's palette (teal/indigo)
   and push it darker + more cinematic for the landing experience.
   ═══════════════════════════════════════════════════════════════════ */

/* Self-hosted rather than pulled from Google Fonts. The control plane can
   serve this site at its own root (see internal/controlplaneapp/site.go),
   and there it runs under a Content-Security-Policy of default-src 'self'
   - a font CDN would need an exception carved into that policy, and would
   leak a visit from every reader to a third party. Both faces are variable
   woff2: one file covers every weight used here. */
@font-face {
  font-family: 'Archivo'; font-style: normal; font-weight: 400 700;
  font-display: swap; src: url('fonts/archivo.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700;
  font-display: swap; src: url('fonts/jetbrainsmono.woff2') format('woff2');
}

:root {
  --bg:            #04060b;
  --bg-2:          #070b13;
  --panel:         #0a0f18;
  --panel-2:       #0e141f;
  --panel-3:       #121a27;
  --line:          #182233;
  --line-2:        #233047;
  --text:          #e9eefb;
  --dim:           #8a96ad;
  --dimmer:        #5d6878;

  --accent:        #4fd1c5;
  --accent-2:      #7c8cff;
  --accent-3:      #ff7ac6;
  --ok:            #3fd68b;
  --warn:          #ffb454;
  --bad:           #ff5d7a;

  --accent-soft:   rgba(79, 209, 197, .12);
  --accent2-soft:  rgba(124, 140, 255, .12);
  --ok-soft:       rgba(63, 214, 139, .12);
  --bad-soft:      rgba(255, 93, 122, .12);

  /* Type: the interface language is monospace — this subject's whole world
     (keys, fingerprints, hostnames, digests, logs) is set in it — while the
     voice is a tight industrial grotesque. */
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --maxw: 1180px;
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;

  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; overflow-x: hidden; }

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

::selection { background: rgba(79,209,197,.28); color: #fff; }

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

code, pre, .mono { font-family: var(--mono); }

code {
  font-size: .88em;
  background: rgba(124,140,255,.10);
  border: 1px solid rgba(124,140,255,.18);
  border-radius: 5px;
  padding: .08em .38em;
  color: #cfe6ff;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.03em; line-height: 1.06; }

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

.grad {
  background: linear-gradient(100deg, var(--accent) 0%, #8ee7ff 38%, var(--accent-2) 72%, var(--accent-3) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ── ambient layers ─────────────────────────────────────────────── */

.grain {
  position: fixed; inset: 0; z-index: 999; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-glow {
  position: fixed; width: 520px; height: 520px; border-radius: 50%;
  left: 0; top: 0; margin: -260px 0 0 -260px;
  background: radial-gradient(circle, rgba(79,209,197,.09) 0%, rgba(124,140,255,.05) 38%, transparent 68%);
  pointer-events: none; z-index: 0; opacity: 0;
  transition: opacity .5s ease;
  will-change: transform;
}

.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  z-index: 1000; box-shadow: 0 0 14px rgba(79,209,197,.6);
}

.aurora {
  position: absolute; border-radius: 50%; filter: blur(110px);
  pointer-events: none; z-index: 0; opacity: .5;
}
.aurora-1 { width: 620px; height: 520px; top: -120px; left: -180px; background: radial-gradient(circle, rgba(79,209,197,.20), transparent 68%); }
.aurora-2 { width: 700px; height: 560px; top: 40px; right: -220px; background: radial-gradient(circle, rgba(124,140,255,.20), transparent 68%); }
.aurora-3 { width: 760px; height: 600px; bottom: -180px; left: -160px; background: radial-gradient(circle, rgba(255,122,198,.12), transparent 68%); }
.aurora-4 { width: 820px; height: 620px; top: -140px; left: 50%; transform: translateX(-50%); background: radial-gradient(circle, rgba(79,209,197,.16), transparent 66%); }

/* ── nav ─────────────────────────────────────────────────────────── */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  transition: background .35s var(--ease), border-color .35s var(--ease), backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 8, 14, .72);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.mark { width: 26px; height: 26px; flex: none; }
.brand-name { font-weight: 700; letter-spacing: -.025em; font-size: 1.06rem; }

.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a {
  color: var(--dim); font-size: .92rem; font-weight: 500; position: relative; padding: 4px 0;
  transition: color .22s;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .3s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

/* Sits outside .nav-links so it survives the breakpoint that hides the
   section anchors: on a phone the one link an existing customer needs is
   the way in, and the section links are reachable by scrolling anyway. */
.nav-login {
  color: var(--dim); font-size: .92rem; font-weight: 500;
  padding: 9px 14px; border-radius: 9px; margin-left: 26px;
  border: 1px solid transparent; transition: color .22s, border-color .22s, background .22s;
}
.nav-login:hover { color: var(--text); border-color: var(--line-2); background: rgba(255,255,255,.03); }

/* ── buttons ─────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: inherit; font-weight: 600; font-size: .95rem; letter-spacing: -.01em;
  padding: 12px 22px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; position: relative; overflow: hidden; white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .28s var(--ease),
              border-color .22s, background .22s, color .22s;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn:disabled {
  opacity: .38; cursor: not-allowed; filter: saturate(.35);
  pointer-events: none;
}
.btn-sm { padding: 9px 16px; font-size: .87rem; border-radius: 9px; }
.btn-lg { padding: 15px 28px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #04121a; box-shadow: 0 6px 26px -8px rgba(79,209,197,.5);
}
.btn-primary::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, #6ee7dc, #9aa6ff);
  opacity: 0; transition: opacity .25s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 38px -10px rgba(79,209,197,.62); }
.btn-primary:hover::before { opacity: 1; }
.btn-primary > * { position: relative; z-index: 1; }
.btn-arrow { width: 15px; height: 15px; transition: transform .28s var(--ease); }
.btn-primary:hover .btn-arrow { transform: translateX(3px); }

.btn-ghost {
  background: rgba(255,255,255,.025); color: var(--text); border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.btn-ghost em { font-style: italic; opacity: .75; }

.btn-danger { background: rgba(255,93,122,.1); color: #ff8ea3; border-color: rgba(255,93,122,.35); }
.btn-danger:hover { background: rgba(255,93,122,.18); border-color: var(--bad); transform: translateY(-2px); }

.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [role="radio"]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}

/* ── hero ────────────────────────────────────────────────────────── */

.hero {
  position: relative; padding: 158px 0 88px;
  display: flex; align-items: center;
  overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-vignette {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 50% 32%, transparent 0%, rgba(4,6,11,.55) 62%, var(--bg) 100%),
    linear-gradient(180deg, rgba(4,6,11,.85) 0%, transparent 22%, transparent 62%, var(--bg) 100%);
}
.hero-grid-overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(79,209,197,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,209,197,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 42%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 42%, #000 0%, transparent 78%);
}
.hero-inner { position: relative; z-index: 2; text-align: center; }

.badge {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .78rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: rgba(79,209,197,.07);
  border: 1px solid rgba(79,209,197,.26); border-radius: 999px;
  padding: 7px 16px 7px 12px; margin-bottom: 30px;
  font-family: var(--mono);
}
.badge-pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(79,209,197,.7); animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(79,209,197,.65); }
  70%  { box-shadow: 0 0 0 9px rgba(79,209,197,0); }
  100% { box-shadow: 0 0 0 0 rgba(79,209,197,0); }
}

.hero-title {
  font-size: clamp(2.7rem, 7.4vw, 5.6rem);
  letter-spacing: -.045em; line-height: .98;
  margin: 0 0 26px;
}
.hero-title .scramble { display: inline-block; }

.hero-sub {
  max-width: 680px; margin: 0 auto 38px;
  font-size: clamp(1.02rem, 1.5vw, 1.18rem); color: var(--dim); line-height: 1.72;
}
.hero-sub em { color: var(--text); font-style: normal; font-weight: 600; }

.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 34px; }

.hero-trust {
  display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap;
  font-family: var(--mono); font-size: .76rem; color: var(--dimmer);
  letter-spacing: .04em; margin-bottom: 62px;
}
.hero-trust i { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); }

/* ── console (hero) ──────────────────────────────────────────────── */

.console, .demo-shell, .audit-shell {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: 0 40px 100px -40px rgba(0,0,0,.95),
              0 0 0 1px rgba(255,255,255,.02) inset,
              0 0 90px -50px rgba(79,209,197,.35);
  overflow: hidden; text-align: left;
}
.console { max-width: 960px; margin: 0 auto; }

.console-bar, .demo-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.018);
}
.tl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tl-red { background: #ff5f57; } .tl-amber { background: #febc2e; } .tl-green { background: #28c840; }
.console-title {
  margin-left: 12px; font-family: var(--mono); font-size: .78rem; color: var(--dimmer);
  letter-spacing: .02em;
}
.console-live, .demo-timer {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: .72rem; color: var(--ok);
  text-transform: uppercase; letter-spacing: .1em;
}
.demo-timer { color: var(--dimmer); }
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 8px var(--ok); animation: blink 1.6s infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .28; } }

.console-body { display: grid; grid-template-columns: 1.45fr 1fr; min-height: 262px; }
.console-term { padding: 20px 22px; border-right: 1px solid var(--line); }

.term {
  font-family: var(--mono); font-size: .81rem; line-height: 1.85;
  margin: 0; color: var(--dim); white-space: pre-wrap; word-break: break-word;
}
.term-sm { font-size: .74rem; line-height: 1.75; }
.term .c-prompt { color: var(--accent); }
.term .c-cmd    { color: var(--text); }
.term .c-ok     { color: var(--ok); }
.term .c-bad    { color: var(--bad); }
.term .c-warn   { color: var(--warn); }
.term .c-dim    { color: var(--dimmer); }
.term .c-host   { color: var(--accent-2); }
.term .cursor {
  display: inline-block; width: 7px; height: 1em; background: var(--accent);
  vertical-align: text-bottom; animation: blink 1.05s step-end infinite;
}

.console-fleet { padding: 20px 22px; display: flex; flex-direction: column; }
.cf-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .13em;
  color: var(--dimmer); text-transform: uppercase; margin-bottom: 14px;
}
.cf-count b { color: var(--accent); }
.cf-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; flex: 1;
  align-content: start;
}
.cf-cell {
  aspect-ratio: 1; border-radius: 5px;
  background: rgba(124,140,255,.07); border: 1px solid rgba(124,140,255,.14);
  transition: background .3s, border-color .3s, box-shadow .3s, transform .3s;
}
.cf-cell.working {
  background: rgba(255,180,84,.2); border-color: rgba(255,180,84,.5);
  box-shadow: 0 0 12px rgba(255,180,84,.35); transform: scale(1.14);
}
.cf-cell.done {
  background: rgba(63,214,139,.22); border-color: rgba(63,214,139,.5);
  box-shadow: 0 0 10px rgba(63,214,139,.28);
}
.cf-legend {
  display: flex; gap: 14px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: .64rem; color: var(--dimmer); letter-spacing: .05em;
}
.cf-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.sw-idle { background: rgba(124,140,255,.35); }
.sw-work { background: rgba(255,180,84,.75); }
.sw-done { background: rgba(63,214,139,.75); }

/* ── stats ───────────────────────────────────────────────────────── */

.stats { padding: 10px 0 96px; position: relative; z-index: 2; }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden;
}
.stat { background: var(--bg-2); padding: 30px 26px; transition: background .3s; }
.stat:hover { background: var(--panel-2); }
.stat-val {
  font-size: 2.9rem; font-weight: 700; letter-spacing: -.05em; line-height: 1;
  color: var(--text); margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
.stat-unit { color: var(--accent); }
.stat-label { font-size: .93rem; font-weight: 600; margin-bottom: 4px; }
.stat-note { font-size: .8rem; color: var(--dimmer); font-family: var(--mono); }

/* ── generic section ─────────────────────────────────────────────── */

/* overflow:hidden keeps the decorative aurora blobs — which deliberately
   sit outside their section's box — from widening the document and
   creating a horizontal scrollbar on narrow screens. */
.section { position: relative; padding: 112px 0; overflow: hidden; }
.section > .container { position: relative; z-index: 2; }

.section-head { max-width: 720px; margin-bottom: 60px; }
.eyebrow {
  display: inline-block; font-family: var(--mono); font-size: .73rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 18px;
}
.section-head h2 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); margin-bottom: 20px; }
.section-sub { color: var(--dim); font-size: 1.05rem; margin: 0; line-height: 1.75; }
.section-sub em { color: var(--text); font-style: normal; font-weight: 600; }

/* ── problem ─────────────────────────────────────────────────────── */

.problem-layout { display: grid; grid-template-columns: .85fr 1.15fr; gap: 56px; align-items: start; }

.problem-viz {
  position: relative; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); padding: 18px; height: 430px; overflow: hidden;
}
.pv-label {
  font-family: var(--mono); font-size: .7rem; color: var(--dimmer);
  letter-spacing: .08em; margin-bottom: 14px; text-transform: uppercase;
}
.pv-stack { display: flex; flex-direction: column; gap: 7px; }
.pv-line {
  font-family: var(--mono); font-size: .7rem; color: var(--dim);
  padding: 6px 9px; border-radius: 5px; background: rgba(255,255,255,.022);
  border-left: 2px solid var(--line-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateX(-8px);
  animation: pvIn .5s var(--ease) forwards;
}
.pv-line.stale { border-left-color: var(--bad); color: #ff97aa; background: rgba(255,93,122,.055); }
.pv-line.stale::after { content: ' ← who is this?'; color: var(--bad); opacity: .8; }
@keyframes pvIn { to { opacity: 1; transform: none; } }
.pv-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 130px;
  background: linear-gradient(transparent, var(--panel));
}

.problem-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 30px; }
.problem-list li { display: grid; grid-template-columns: 104px 1fr; gap: 20px; }
.pl-tag {
  font-family: var(--mono); font-size: .66rem; color: var(--accent);
  letter-spacing: .1em; text-transform: uppercase; padding-top: 6px;
  border-top: 1px solid rgba(79,209,197,.3);
}
.problem-list h3 { font-size: 1.2rem; margin-bottom: 7px; letter-spacing: -.02em; }
.problem-list p { margin: 0; color: var(--dim); font-size: .97rem; }

/* ── demo ────────────────────────────────────────────────────────── */

.section-demo { background: linear-gradient(180deg, transparent, rgba(124,140,255,.025), transparent); }

.demo-grid { display: grid; grid-template-columns: 236px 1fr 300px; min-height: 470px; }
.demo-staff { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.demo-keys  { border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.demo-fleet { display: flex; flex-direction: column; }

.panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dimmer);
}
.panel-head b { color: var(--text); }
.panel-path { text-transform: none; letter-spacing: 0; opacity: .75; font-size: .66rem; }
.fleet-status { color: var(--ok); text-transform: none; letter-spacing: .02em; font-size: .68rem; }
.fleet-status.busy { color: var(--warn); }

.staff-list { padding: 12px; display: grid; gap: 7px; }
.staff-row {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1px solid transparent;
  font-family: inherit; color: var(--text); text-align: left;
  transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.staff-row:hover { background: rgba(255,255,255,.03); transform: translateX(2px); }
.staff-row[aria-checked="true"] { background: var(--accent-soft); border-color: rgba(79,209,197,.34); }
.av {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: .84rem; color: #05121a;
}
.av-a { background: linear-gradient(135deg, #4fd1c5, #37b5ab); }
.av-b { background: linear-gradient(135deg, #7c8cff, #5f6fe8); }
.av-c { background: linear-gradient(135deg, #ff7ac6, #e05aa8); }
.staff-meta { min-width: 0; }
.staff-meta b { display: block; font-size: .89rem; font-weight: 600; letter-spacing: -.01em; }
.staff-meta i {
  display: block; font-style: normal; font-family: var(--mono);
  font-size: .68rem; color: var(--dimmer); overflow: hidden; text-overflow: ellipsis;
}
.staff-state { margin-left: auto; font-family: var(--mono); font-size: .64rem; letter-spacing: .06em; }
.staff-state.on  { color: var(--ok); }
.staff-state.off { color: var(--dimmer); }

.demo-actions { padding: 12px; display: grid; gap: 8px; margin-top: auto; }
.demo-hint {
  padding: 0 16px 16px; margin: 0; font-size: .74rem; color: var(--dimmer);
  line-height: 1.6;
}

.fleet-grid {
  padding: 16px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px;
  align-content: start;
}
.host {
  /* min-width:0 overrides a grid item's default min-content floor, which
     otherwise stops the longest hostname from ever letting the column
     shrink — and pushes the whole grid wider than the screen on phones. */
  min-width: 0; overflow: hidden;
  position: relative; aspect-ratio: 1; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.022); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 4px; transition: border-color .25s, background .25s, transform .25s var(--ease), box-shadow .25s;
}
.host:hover { border-color: var(--line-2); transform: translateY(-2px); background: rgba(255,255,255,.045); }
.host.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 18px -4px rgba(79,209,197,.55); }
.host.flash { animation: hostFlash .6s var(--ease); }
@keyframes hostFlash {
  0%   { box-shadow: 0 0 0 0 rgba(79,209,197,.55); border-color: var(--accent); }
  100% { box-shadow: 0 0 0 14px rgba(79,209,197,0); }
}
.host-name {
  font-family: var(--mono); font-size: .53rem; color: var(--dimmer);
  letter-spacing: -.02em; line-height: 1;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.host-keys { display: flex; gap: 3px; height: 6px; align-items: center; }
.kdot {
  width: 6px; height: 6px; border-radius: 50%;
  transform: scale(0); transition: transform .3s var(--ease);
}
.kdot.show { transform: scale(1); }
.kdot.a { background: var(--accent);   box-shadow: 0 0 7px rgba(79,209,197,.8); }
.kdot.b { background: var(--accent-2); box-shadow: 0 0 7px rgba(124,140,255,.8); }
.kdot.c { background: var(--accent-3); box-shadow: 0 0 7px rgba(255,122,198,.8); }

.keys-file {
  flex: 1; margin: 0; padding: 16px 18px; overflow: auto;
  font-family: var(--mono); font-size: .68rem; line-height: 1.85;
  color: var(--dim); white-space: pre-wrap; word-break: break-all;
}
.keys-file .k-marker { color: var(--dimmer); }
.keys-file .k-manual { color: var(--warn); }
.keys-file .k-a { color: var(--accent); }
.keys-file .k-b { color: var(--accent-2); }
.keys-file .k-c { color: var(--accent-3); }
.keys-file .k-new { animation: keyIn .5s var(--ease); }
@keyframes keyIn {
  from { opacity: 0; transform: translateX(-6px); background: rgba(79,209,197,.16); }
  to   { opacity: 1; transform: none; background: transparent; }
}

/* ── steps ───────────────────────────────────────────────────────── */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px 26px 26px;
  position: relative; overflow: hidden;
  transition: border-color .3s, transform .35s var(--ease);
}
.step::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,209,197,.55), transparent);
  opacity: 0; transition: opacity .35s;
}
.step:hover { border-color: var(--line-2); transform: translateY(-4px); }
.step:hover::before { opacity: 1; }
.step-num {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .1em;
  color: var(--accent); margin-bottom: 16px;
}
.step h3 { font-size: 1.28rem; margin-bottom: 10px; }
.step p { color: var(--dim); font-size: .94rem; margin: 0 0 20px; }
.step-visual {
  background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 14px; min-height: 132px;
}

.mock-rows { display: grid; gap: 8px; }
.mock-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 9px; border-radius: 7px; background: rgba(255,255,255,.025);
}
.mock-row.mock-row-dim { opacity: .5; }
.mock-row div { min-width: 0; }
.mock-row b { display: block; font-size: .78rem; font-weight: 600; }
.mock-row i { display: block; font-style: normal; font-family: var(--mono); font-size: .63rem; color: var(--dimmer); }
.chip {
  margin-left: auto; font-family: var(--mono); font-size: .6rem; padding: 3px 7px;
  border-radius: 999px; letter-spacing: .04em; white-space: nowrap;
}
.chip-ok  { background: var(--ok-soft); color: var(--ok); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }

.prop-viz { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.prop-cell {
  aspect-ratio: 1; border-radius: 2px; background: rgba(124,140,255,.14);
  transition: background .35s, box-shadow .35s;
}
.prop-cell.hot { background: var(--ok); box-shadow: 0 0 8px rgba(63,214,139,.7); }
.prop-caption {
  display: flex; align-items: center; gap: 7px; margin-top: 12px;
  font-family: var(--mono); font-size: .66rem; color: var(--dimmer); letter-spacing: .06em;
}

/* ── architecture ────────────────────────────────────────────────── */

.arch-wrap {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 18px;
  box-shadow: 0 40px 90px -50px rgba(0,0,0,.9);
  overflow: hidden;
}
.arch { width: 100%; height: auto; display: block; }

/* stacked equivalent for phones — see .arch media query below */
.arch-mobile { display: none; }
.am-node {
  background: #0b1018; border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 16px 18px; text-align: center;
}
.am-node.am-cp { border-color: rgba(79,209,197,.45); box-shadow: 0 0 34px -16px rgba(79,209,197,.75); }
.am-kicker {
  display: block; font-family: var(--mono); font-size: .62rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dimmer); margin-bottom: 7px;
}
.am-node b { display: block; font-size: 1.02rem; letter-spacing: -.02em; margin-bottom: 4px; }
.am-node i {
  display: block; font-style: normal; font-family: var(--mono);
  font-size: .68rem; color: var(--dim); line-height: 1.7;
}
.am-link { display: grid; place-items: center; padding: 10px 0; position: relative; }
.am-link::before {
  content: ''; position: absolute; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(var(--line-2), rgba(79,209,197,.6));
}
.am-link span {
  position: relative; background: var(--panel); padding: 3px 10px;
  font-family: var(--mono); font-size: .62rem; color: var(--accent);
  letter-spacing: .06em; border-radius: 999px; border: 1px solid var(--line);
}
.am-agents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.am-agents span {
  background: #0b1018; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 4px; text-align: center;
  font-family: var(--mono); font-size: .63rem; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.am-note {
  margin: 16px 0 0; text-align: center; font-family: var(--mono);
  font-size: .64rem; color: var(--dimmer); line-height: 1.7;
}
.arch text { font-family: var(--mono); text-anchor: middle; }
.arch-t1 { fill: var(--text); font-size: 13px; font-weight: 700; letter-spacing: .12em; }
.arch-t2 { fill: var(--dim); font-size: 11px; }
.arch-t3 { fill: var(--dimmer); font-size: 10px; }
.arch-label { fill: var(--dimmer); font-size: 10px; letter-spacing: .18em; }
.arch-mtls { fill: var(--accent); font-size: 11px; letter-spacing: .08em; }
.arch-note { fill: var(--dimmer); font-size: 10px; }
.agent-box { fill: #0b1018; stroke: var(--line-2); stroke-width: 1.2; }
.agent-text { fill: var(--dim); font-size: 10px; }
.agent-dot { fill: var(--ok); }

.arch-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 40px; }
.arch-point h4 { font-size: 1.02rem; margin-bottom: 8px; }
.arch-point p { margin: 0; color: var(--dim); font-size: .92rem; }

/* ── security grid ───────────────────────────────────────────────── */

/* Flatter than the interactive consoles on purpose: these are read, not
   operated, so they get a hairline and a ground rather than elevation. */
.sec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.sec-card {
  background: var(--bg-2);
  border: 0; border-radius: 0; padding: 30px 28px;
  position: relative; overflow: hidden;
  transition: background .3s;
}
.sec-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(79,209,197,.08), transparent 62%);
  transition: opacity .3s;
}
.sec-card:hover { background: var(--panel-2); }
.sec-card:hover::after { opacity: 1; }
.sec-icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(79,209,197,.14), rgba(124,140,255,.14));
  border: 1px solid rgba(79,209,197,.22); color: var(--accent); margin-bottom: 18px;
}
.sec-icon svg { width: 21px; height: 21px; }
.sec-card h3 { font-size: 1.12rem; margin-bottom: 9px; }
.sec-card p { margin: 0; color: var(--dim); font-size: .92rem; }

/* ── audit chain ─────────────────────────────────────────────────── */

.section-audit { background: linear-gradient(180deg, transparent, rgba(79,209,197,.02), transparent); }
.audit-shell { padding: 24px; }
.audit-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }

.chain { display: grid; gap: 10px; }
.centry {
  display: grid; grid-template-columns: 42px 1fr auto; gap: 16px; align-items: center;
  padding: 14px 16px; border-radius: var(--r);
  background: rgba(255,255,255,.02); border: 1px solid var(--line);
  transition: border-color .3s, background .3s, box-shadow .3s;
  position: relative;
}
.centry::after {
  content: ''; position: absolute; left: 37px; bottom: -11px; width: 1px; height: 10px;
  background: var(--line-2);
}
.centry:last-child::after { display: none; }
.centry.tampered { border-color: rgba(255,93,122,.5); background: rgba(255,93,122,.05); }
.centry.broken   { border-color: rgba(255,93,122,.32); background: rgba(255,93,122,.03); }
.centry.verified { border-color: rgba(63,214,139,.3); }
.centry.checking { border-color: var(--accent); box-shadow: 0 0 22px -8px rgba(79,209,197,.7); }

.cseq {
  font-family: var(--mono); font-size: .78rem; color: var(--dimmer);
  text-align: center; padding: 5px 0; border-radius: 7px; background: rgba(255,255,255,.03);
}
.centry.tampered .cseq, .centry.broken .cseq { color: var(--bad); background: rgba(255,93,122,.1); }
.cbody { min-width: 0; }
.caction {
  font-family: var(--mono); font-size: .85rem; color: var(--text); margin-bottom: 4px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.caction .ctag {
  font-size: .62rem; padding: 2px 7px; border-radius: 999px;
  background: var(--accent2-soft); color: #a9b4ff; letter-spacing: .05em;
}
.centry.tampered .caction { color: var(--bad); }
.chash { font-family: var(--mono); font-size: .68rem; color: var(--dimmer); }
.chash b { color: var(--accent); font-weight: 400; }
.centry.tampered .chash b, .centry.broken .chash b { color: var(--bad); }
.cstatus {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .06em;
  color: var(--dimmer); white-space: nowrap;
}
.cstatus.ok  { color: var(--ok); }
.cstatus.bad { color: var(--bad); }

.audit-verdict {
  display: flex; align-items: center; gap: 12px; margin-top: 22px;
  padding: 15px 18px; border-radius: var(--r);
  background: var(--ok-soft); border: 1px solid rgba(63,214,139,.28);
  font-family: var(--mono); font-size: .84rem; color: var(--ok);
  transition: background .3s, border-color .3s, color .3s;
}
.audit-verdict.bad { background: var(--bad-soft); border-color: rgba(255,93,122,.32); color: var(--bad); }
.verdict-icon { font-size: 1.05rem; }

/* ── CTA ─────────────────────────────────────────────────────────── */

.section-cta { padding: 100px 0 120px; }
.cta-card {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px;
  background: linear-gradient(140deg, var(--panel-2), var(--panel) 60%);
  border: 1px solid var(--line-2); border-radius: 28px; padding: 54px;
  box-shadow: 0 50px 120px -50px rgba(0,0,0,.95), 0 0 120px -60px rgba(79,209,197,.4);
  overflow: hidden;
}
.cta-card::before {
  content: ''; position: absolute; top: 0; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,209,197,.7), rgba(124,140,255,.7), transparent);
}
.cta-copy h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); margin-bottom: 18px; }
.cta-copy p { color: var(--dim); margin: 0 0 22px; font-size: 1rem; }
.cta-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.cta-list li {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: .93rem; color: var(--dim);
}
.cta-list li::before {
  content: '✓'; color: var(--accent); font-weight: 700; flex: none;
  font-size: .9rem; line-height: 1.6;
}

.cta-form { display: grid; gap: 15px; align-content: start; }
.field { display: grid; gap: 7px; }
.field label {
  font-size: .8rem; font-weight: 600; color: var(--dim); letter-spacing: .01em;
}
.field .opt { color: var(--dimmer); font-weight: 400; font-size: .74rem; }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: .94rem; color: var(--text);
  background: rgba(0,0,0,.35); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 12px 14px; width: 100%; resize: vertical;
  transition: border-color .22s, box-shadow .22s, background .22s;
}
.field textarea { font-size: .9rem; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: var(--dimmer); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,209,197,.14);
  background: rgba(0,0,0,.5);
}
.field input.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(255,93,122,.12); }
.field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5 6 8.5l4-4' fill='none' stroke='%238a96ad' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 12px;
  padding-right: 36px;
}
.form-note { margin: 2px 0 0; font-size: .78rem; color: var(--dimmer); text-align: center; }
.form-note.error { color: var(--bad); }

.btn.is-loading { pointer-events: none; opacity: .82; }
.btn.is-loading .btn-label::after {
  content: ''; display: inline-block; width: 13px; height: 13px; margin-left: 9px;
  vertical-align: -2px; border: 2px solid rgba(4,18,26,.3); border-top-color: #04121a;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cta-success { grid-column: 1 / -1; text-align: center; padding: 30px 0 10px; }
.success-mark { width: 76px; height: 76px; margin: 0 auto 22px; }
.success-mark svg { width: 100%; height: 100%; }
.sm-circle {
  stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 152; stroke-dashoffset: 152;
  animation: drawCircle .7s var(--ease) forwards;
}
.sm-check {
  stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 48; stroke-dashoffset: 48;
  animation: drawCheck .4s var(--ease) .5s forwards;
}
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck  { to { stroke-dashoffset: 0; } }
.cta-success h3 { font-size: 1.7rem; margin-bottom: 10px; }
.cta-success p { color: var(--dim); margin: 0; }

/* ── footer ──────────────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--line); padding: 52px 0 32px; background: var(--bg-2); }
.footer-inner { display: flex; justify-content: space-between; gap: 34px; flex-wrap: wrap; }
.footer-brand { display: flex; gap: 13px; align-items: flex-start; }
.footer-brand b { display: block; letter-spacing: -.025em; font-size: 1.02rem; margin-bottom: 3px; }
.footer-brand span { color: var(--dimmer); font-size: .86rem; }
.footer-links { display: flex; gap: 26px; flex-wrap: wrap; }
.footer-links a { color: var(--dim); font-size: .88rem; transition: color .2s; }
.footer-links a:hover { color: var(--accent); }
.footer-base {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: .74rem; color: var(--dimmer); flex-wrap: wrap;
}
.footer-status { display: inline-flex; align-items: center; gap: 7px; color: var(--ok); }

/* ── reveal ──────────────────────────────────────────────────────── */

/* Scoped to .js so the page's resting state — with scripting blocked or
   still loading — is fully readable rather than a stack of invisible
   sections waiting on an observer that may never run. */
.js [data-reveal] { opacity: 0; transform: translateY(22px); }
.js [data-reveal].in {
  opacity: 1; transform: none;
  transition: opacity .75s var(--ease), transform .75s var(--ease);
}

/* ── responsive ──────────────────────────────────────────────────── */

@media (max-width: 1000px) {
  .console-body { grid-template-columns: 1fr; }
  .console-term { border-right: none; border-bottom: 1px solid var(--line); }
  .cf-grid { grid-template-columns: repeat(12, 1fr); }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-staff { border-right: none; border-bottom: 1px solid var(--line); }
  .demo-keys  { border-left: none;  border-top: 1px solid var(--line); }
  .demo-actions { grid-template-columns: 1fr 1fr; margin-top: 0; }
  /* Once the panels stack, the staff-panel footnote would sit between the
     Grant/Revoke buttons and the fleet they act on. Drop it so the control
     and the thing it changes stay adjacent. */
  .demo-staff .demo-hint { display: none; }
  .problem-layout { grid-template-columns: 1fr; gap: 36px; }
  .arch-points { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-card { grid-template-columns: 1fr; gap: 38px; padding: 38px 30px; }
  .nav-links { display: none; }
  .nav-login { margin-left: auto; }
}

/* Tablets keep two columns — one full-width column of feature cards wastes
   the width and makes the section needlessly long. */
@media (max-width: 1000px) and (min-width: 700px) {
  .steps, .sec-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 699px) {
  .steps, .sec-grid { grid-template-columns: 1fr; }
}

/* The wide architecture diagram is unreadable below this; swap in the
   stacked version instead of shrinking text to 3px. */
@media (max-width: 760px) {
  .arch { display: none; }
  .arch-mobile { display: block; }
  .arch-wrap { padding: 22px 18px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .hero { padding: 124px 0 64px; }
  .hero-title { font-size: clamp(2.05rem, 9.4vw, 3rem); }
  .hero-sub { line-height: 1.62; }
  .badge { font-size: .68rem; padding: 6px 13px 6px 10px; letter-spacing: .04em; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .hero-trust { font-size: .66rem; gap: 8px; margin-bottom: 44px; }
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 40px; }

  .nav-inner { padding: 12px 16px; gap: 12px; }
  .nav .btn { margin-left: auto; padding: 9px 13px; font-size: .8rem; }
  .brand-name { display: none; }

  .container { padding: 0 18px; }
  .fleet-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 12px; }
  .host-name { font-size: .48rem; }
  .demo-actions { grid-template-columns: 1fr; }
  .staff-list { padding: 10px; }

  .stats-grid { grid-template-columns: 1fr; }
  .stat { padding: 22px 20px; }
  .stat-val { font-size: 2.3rem; }

  .problem-list li { grid-template-columns: 1fr; gap: 8px; }
  .pl-tag { padding-top: 0; border-top: 0; }
  .problem-viz { height: 320px; }

  .audit-shell { padding: 16px; }
  .audit-controls { gap: 7px; }
  .audit-controls .btn { flex: 1 1 140px; padding: 9px 10px; font-size: .78rem; }
  .centry { grid-template-columns: 38px 1fr; gap: 12px; padding: 12px 13px; align-items: start; }
  .cstatus { grid-column: 2; }
  .centry::after { left: 32px; }
  .chash { word-break: break-all; }
  .caction { font-size: .78rem; }

  .cta-card { padding: 28px 20px; border-radius: var(--r-lg); }
  .console, .demo-shell, .audit-shell { border-radius: var(--r); }
  .am-agents { grid-template-columns: repeat(2, 1fr); }
  .footer-links { gap: 16px 20px; }
}

/* Very narrow / older small phones */
@media (max-width: 380px) {
  .fleet-grid { grid-template-columns: repeat(4, 1fr); }
  .cf-grid { grid-template-columns: repeat(8, 1fr); }
  .hero-trust i { display: none; }
}

/* No hover pointer: the cursor glow can never be shown, so keep it out of
   layout entirely rather than as an invisible 520px box. */
@media (hover: none) {
  .cursor-glow { display: none; }
}

/* ── reduced motion ──────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .hero-canvas, .cursor-glow { display: none; }
}
