/* BastionBrief: editorial "intelligence briefing" direction.
   Paper + ink + one signal-orange accent. Newsreader (display serif),
   IBM Plex Sans (text), IBM Plex Mono (threat data and metadata).
   Hairline rules instead of cards; oversized type instead of decoration. */

:root {
  --paper: #F4F1EA;
  --paper-2: #EBE6DB;
  --ink: #141311;
  --ink-2: #3A3732;
  --muted: #5F5A52;
  --rule: #D6CFC1;
  --rule-strong: #141311;
  --signal: #F2622A;          /* fills, large type, rules */
  --signal-text: #B23F0E;     /* small text on paper (5.3:1) */
  --on-signal: #141311;
  --sev-critical: #B42318;
  --sev-high: #B54708;
  --sev-moderate: #8A6A00;
  --ok: #2E6B3A;
  --danger: #B42318;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --container: 1200px;
  --gutter: 24px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12110F;
    --paper-2: #1B1A17;
    --ink: #F1EDE4;
    --ink-2: #D2CCC0;
    --muted: #A49D90;
    --rule: #34312B;
    --rule-strong: #F1EDE4;
    --signal: #FF7438;
    --signal-text: #FF8A55;
    --on-signal: #141311;
    --sev-critical: #F97066;
    --sev-high: #FDB022;
    --sev-moderate: #EAC54F;
    --ok: #6CC77F;
    --danger: #F97066;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
::selection { background: var(--signal); color: var(--on-signal); }

h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
em { font-style: italic; }

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

.mono, .kicker, .meta {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}
.kicker { text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.kicker b { color: var(--signal-text); font-weight: 500; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; font-family: var(--mono); font-size: 0.875rem;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  font-family: var(--sans); font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 1.5px solid var(--ink); cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform 180ms var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--signal { background: var(--signal); color: var(--on-signal); border-color: var(--signal); box-shadow: 4px 4px 0 var(--ink); }
.btn--signal:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn--signal:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn--line { background: transparent; color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--paper); }
.btn--sm { min-height: 44px; padding: 0 16px; font-size: 0.9375rem; box-shadow: none; }
.btn--sm:hover { transform: none; box-shadow: none; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-weight: 600; text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px;
}
.link-arrow:hover { color: var(--signal-text); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.brand span { font-family: var(--serif); font-size: 1.5rem; letter-spacing: -0.01em; line-height: 1; }
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-2); text-decoration: none;
}
.nav-links a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; }
@media (max-width: 900px) { .nav-links { display: none; } }

/* ---------- Masthead / hero ---------- */
.masthead-line {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 0; border-bottom: 1px solid var(--rule-strong);
}
.hero { padding: 0 0 72px; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(3rem, 8.4vw, 7.25rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 56px 0 0;
  max-width: 13ch;
}
.hero h1 em { color: var(--signal); }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; margin-top: 48px; align-items: end; }
.hero-lede { font-size: 1.25rem; line-height: 1.55; color: var(--ink-2); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.hero-actions .note { width: 100%; color: var(--muted); }
@media (max-width: 860px) {
  .hero h1 { margin-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; margin-top: 32px; }
}

/* ---------- Threat ledger (signature element) ---------- */
.ledger { --band-fg: var(--paper); background: var(--ink); color: var(--band-fg); }
.ledger-inner { display: grid; grid-template-columns: 280px 1fr; gap: 40px; padding-block: 40px; }
.ledger-count { border-right: 1px solid color-mix(in srgb, var(--band-fg) 18%, transparent); padding-right: 32px; }
.ledger-count strong { display: block; font-family: var(--serif); font-size: 5.5rem; line-height: 0.9; color: var(--signal); font-weight: 400; letter-spacing: -0.03em; }
.ledger-count p { margin-top: 16px; color: color-mix(in srgb, var(--band-fg) 75%, transparent); font-size: 0.9375rem; }
.ledger table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.8125rem; }
.ledger caption { text-align: left; padding-bottom: 12px; font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in srgb, var(--band-fg) 70%, transparent); }
.ledger th, .ledger td { text-align: left; padding: 12px 12px 12px 0; border-top: 1px solid color-mix(in srgb, var(--band-fg) 16%, transparent); vertical-align: top; }
.ledger thead th { font-weight: 500; color: color-mix(in srgb, var(--band-fg) 60%, transparent); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; border-top: 0; }
.ledger td:first-child { white-space: nowrap; color: var(--band-fg); }
.ledger .tag { display: inline-block; padding: 1px 6px; font-size: 0.75rem; border: 1px solid currentColor; }
.ledger .tag--rw { color: var(--signal); }
.ledger-foot { grid-column: 2; color: color-mix(in srgb, var(--band-fg) 75%, transparent); font-size: 0.9375rem; }
.ledger-foot a { color: var(--band-fg); }
@media (max-width: 860px) {
  .ledger-inner { grid-template-columns: 1fr; gap: 28px; }
  .ledger-count { border-right: 0; padding-right: 0; border-bottom: 1px solid color-mix(in srgb, var(--band-fg) 18%, transparent); padding-bottom: 24px; }
  .ledger-foot { grid-column: 1; }
  .ledger .hide-sm { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: 112px 0; border-bottom: 1px solid var(--rule); }
.section-head { display: grid; grid-template-columns: 220px 1fr; gap: 32px; margin-bottom: 56px; }
.section-head .kicker { padding-top: 14px; border-top: 2px solid var(--signal); align-self: start; }
.section-head h2 { font-family: var(--serif); font-size: clamp(2.25rem, 4.6vw, 3.75rem); line-height: 1.02; letter-spacing: -0.025em; max-width: 18ch; }
.section-head p { margin-top: 20px; font-size: 1.25rem; color: var(--ink-2); max-width: 38em; }
@media (max-width: 860px) {
  .section { padding: 80px 0; }
  .section-head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 40px; }
  .section-head .kicker { justify-self: start; }
}

/* Specimen: the example issue with annotations */
.specimen { display: grid; grid-template-columns: 1fr minmax(0, 640px); gap: 56px; align-items: start; }
.notes { list-style: none; margin: 0; padding: 0; counter-reset: note; position: sticky; top: 100px; }
.notes li { counter-increment: note; display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 20px 0; border-top: 1px solid var(--rule); }
.notes li:last-child { border-bottom: 1px solid var(--rule); }
.notes li::before { content: counter(note, decimal-leading-zero); font-family: var(--mono); font-size: 0.875rem; color: var(--signal-text); padding-top: 3px; }
.notes h3 { font-family: var(--sans); font-weight: 600; font-size: 1.0625rem; }
.notes p { color: var(--muted); font-size: 0.9375rem; margin-top: 4px; }
.sheet { background: #F4F5F7; border: 1px solid var(--rule-strong); box-shadow: 10px 10px 0 var(--paper-2), 10px 10px 0 1px var(--rule-strong); }
.sheet-bar { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; }
.sheet iframe { width: 100%; height: 720px; border: 0; background: #F4F5F7; }
.specimen-foot { margin-top: 28px; }
@media (max-width: 960px) {
  .specimen { grid-template-columns: 1fr; gap: 40px; }
  .notes { position: static; order: 2; }
  .sheet iframe { height: 560px; }
}

/* Three reasons: ruled columns, no cards */
.columns { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule-strong); }
.columns article { padding: 28px 32px 8px 0; }
.columns article + article { padding-left: 32px; border-left: 1px solid var(--rule); }
.columns .num { font-family: var(--mono); font-size: 0.8125rem; color: var(--signal-text); }
.columns h3 { font-family: var(--serif); font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.015em; margin-top: 16px; }
.columns p { margin-top: 12px; color: var(--ink-2); }
@media (max-width: 860px) {
  .columns { grid-template-columns: 1fr; }
  .columns article, .columns article + article { padding: 24px 0; border-left: 0; }
  .columns article + article { border-top: 1px solid var(--rule); }
}

/* Process timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.timeline li { position: relative; padding: 40px 24px 0 0; border-top: 2px solid var(--ink); }
.timeline li::before { content: ""; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; background: var(--signal); border: 2px solid var(--ink); }
.timeline .when { font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.timeline h3 { font-family: var(--sans); font-weight: 600; font-size: 1.25rem; margin-top: 8px; }
.timeline p { margin-top: 8px; color: var(--ink-2); font-size: 1rem; }
@media (max-width: 860px) {
  .timeline { grid-template-columns: 1fr; border-left: 2px solid var(--ink); margin-left: 6px; }
  .timeline li { border-top: 0; padding: 0 0 40px 28px; }
  .timeline li::before { top: 4px; left: -8px; }
}

/* Pricing ledger */
.plans { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--ink); }
.plan { padding: 40px; display: flex; flex-direction: column; }
.plan + .plan { border-left: 1.5px solid var(--ink); }
.plan--pro { --band-fg: var(--paper); background: var(--ink); color: var(--band-fg); }
.plan-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.plan h3 { font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; }
.plan .flag { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--signal); }
.price { margin-top: 24px; display: flex; align-items: baseline; gap: 8px; }
.price strong { font-family: var(--serif); font-weight: 400; font-size: 4.5rem; line-height: 1; letter-spacing: -0.03em; }
.price span { font-family: var(--mono); font-size: 0.8125rem; opacity: 0.75; }
.plan > p { margin-top: 12px; opacity: 0.85; }
.plan ul { list-style: none; margin: 32px 0 40px; padding: 0; flex: 1; }
.plan li { padding: 12px 0 12px 28px; border-top: 1px solid var(--rule); position: relative; }
.plan--pro li { border-top-color: color-mix(in srgb, var(--band-fg) 18%, transparent); }
.plan li::before { content: "+"; position: absolute; left: 4px; top: 12px; font-family: var(--mono); color: var(--signal-text); font-weight: 600; }
.plan--pro li::before { color: var(--signal); }
.plan .btn { width: 100%; }
.closing-alt { margin-top: 20px; font-size: 0.9375rem; opacity: 0.85; }
.closing-alt a { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; }
.plan-sub { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 8px; font-size: 0.9375rem; opacity: 0.85; }
.plan-sub .link-arrow { opacity: 1; }
.plan--pro .plan-sub .link-arrow:hover { color: var(--signal); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.plan--pro .btn--signal { box-shadow: 4px 4px 0 var(--paper); }
.plan--pro .btn--signal:hover { box-shadow: 6px 6px 0 var(--paper); }
.plans-foot { margin-top: 20px; color: var(--muted); }
@media (max-width: 820px) {
  .plans { grid-template-columns: 1fr; }
  .plan { padding: 28px 24px; }
  .plan + .plan { border-left: 0; border-top: 1.5px solid var(--ink); }
}

/* Free edition */
.free { background: var(--signal); color: var(--on-signal); border-bottom: 0; }
.free .section-head .kicker { border-top-color: var(--on-signal); color: var(--on-signal); }
.free .section-head p { color: var(--on-signal); }
.free-grid { display: grid; grid-template-columns: 220px 1fr 1fr; gap: 32px; align-items: end; }
.free-grid .section-head { display: contents; }
.free-grid .section-head > div { grid-column: 2; }
.signup { grid-column: 3; }
.signup label { display: block; font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }
.signup-row { display: flex; border: 1.5px solid var(--on-signal); background: #FFFFFF; }
.signup input {
  flex: 1; min-width: 0; min-height: 56px; padding: 0 16px; border: 0;
  font: inherit; font-size: 1.0625rem; color: #141311; background: transparent;
}
.signup input:focus-visible { outline: 3px solid #141311; outline-offset: 2px; }
.signup input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px #B42318; }
.signup button {
  min-height: 56px; padding: 0 22px; border: 0; border-left: 1.5px solid #141311; cursor: pointer;
  font: inherit; font-weight: 600; background: #141311; color: #F4F1EA;
  transition: background-color 180ms var(--ease);
}
.signup button:hover { background: #3A3732; }
.signup button:focus-visible { outline: 3px solid #141311; outline-offset: 2px; }
.signup button[disabled] { cursor: progress; opacity: 0.8; }
.signup-help { margin-top: 16px; font-size: 0.9375rem; }
.signup-msg { margin-top: 8px; min-height: 1.6em; font-weight: 600; }
.signup-msg[data-state="error"] { color: #141311; }
.signup-msg[data-state="error"]::before { content: "Error: "; }
.signup-msg[data-state="success"] { color: #141311; }
.free :focus-visible { outline-color: #141311; }
@media (max-width: 960px) {
  .free-grid { grid-template-columns: 1fr; }
  .free-grid .section-head > div, .signup { grid-column: 1; }
}
@media (max-width: 480px) {
  .signup-row { flex-direction: column; }
  .signup button { border-left: 0; border-top: 1.5px solid #141311; }
}

/* FAQ */
.faq { border-top: 1px solid var(--rule-strong); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: grid; grid-template-columns: 1fr 28px; gap: 16px; align-items: center;
  min-height: 72px; padding: 20px 0; cursor: pointer; list-style: none;
  font-family: var(--serif); font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--mono); font-size: 1.5rem; text-align: center; color: var(--signal-text);
  transition: transform 180ms var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--ink-2); }
.faq details p { padding: 0 48px 24px 0; color: var(--ink-2); max-width: 70ch; }

/* Closing CTA */
.closing { padding: 128px 0; text-align: left; }
.closing h2 { font-family: var(--serif); font-size: clamp(2.75rem, 7vw, 6rem); line-height: 1; letter-spacing: -0.035em; max-width: 14ch; }
.closing h2 em { color: var(--signal); }
.closing p { margin: 24px 0 36px; font-size: 1.25rem; color: var(--ink-2); max-width: 34em; }
@media (max-width: 860px) { .closing { padding: 88px 0; } }

/* Footer */
.site-footer { border-top: 1px solid var(--rule-strong); padding: 32px 0 40px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; color: var(--muted); }
.footer-row a { color: var(--ink); }

@media (max-width: 600px) {
  :root { --gutter: 20px; }
  .hero-actions .btn { width: 100%; }
  .closing .btn { width: 100%; }
  .masthead-line .hide-sm { display: none; }
}

/* Dark mode: keep the ledger and Pro plan as dark bands instead of inverting to light */
@media (prefers-color-scheme: dark) {
  .ledger, .plan--pro { --band-fg: var(--ink); background: var(--paper-2); color: var(--band-fg); }
  .ledger { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
  .plan--pro .btn--signal { box-shadow: 4px 4px 0 var(--ink); }
  .plan--pro .btn--signal:hover { box-shadow: 6px 6px 0 var(--ink); }
}

/* ---------- Motion (cinematic-gsap-lenis-motion-system, restrained) ---------- */
html { scroll-padding-top: 84px; }
.section-head .kicker { border-top: 0; position: relative; padding-top: 16px; }
.section-head .kicker::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
  background: var(--signal); transform-origin: left center; transform: scaleX(var(--rule-scale, 1));
}
.free .section-head .kicker::before { background: var(--on-signal); }

html.has-motion [data-motion-text],
html.has-motion [data-reveal],
html.has-motion [data-reveal-item],
html.has-motion [data-hero-line],
html.has-motion [data-hero-after] { visibility: hidden; }
html.has-motion [data-rule] { --rule-scale: 0; }

.motion-word-mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.motion-word { display: inline-block; will-change: transform, opacity; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
/* GSAP drives transform on magnetic buttons; keep CSS from fighting it. */
html.has-motion .btn[data-magnetic] { transition-property: background-color, color, box-shadow; }
html.has-motion .btn--signal[data-magnetic]:hover, html.has-motion .btn--signal[data-magnetic]:active { transform: none; }
