/* AeroPine — site styles for the content pages and the home shell.
   The radar widget itself is styled inline inside App.jsx; nothing here
   touches it apart from the hero frame it sits in. */

:root {
  --bg: #05080a;
  --bg-2: #080d10;
  --surface: #0c1215;
  --surface-2: #111a1e;
  --line: rgba(0, 255, 204, 0.14);
  --line-soft: rgba(255, 255, 255, 0.07);
  --ink: #dbe5e5;
  --ink-strong: #ffffff;
  --muted: #8fa0a0;
  --accent: #00ffcc;
  --accent-dim: #0b8f77;
  --sans: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --wrap: 1120px;
  --col: 44rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 50% -220px, rgba(0, 255, 204, 0.075), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: rgba(0, 255, 204, 0.28); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: #001a15; padding: 10px 16px; font-weight: 700;
}
.skip:focus { left: 12px; top: 12px; }

/* ── Header ─────────────────────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 8, 10, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.head-inner { display: flex; align-items: center; gap: 26px; min-height: 62px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink-strong); font-weight: 800; letter-spacing: 0.5px;
  font-size: 1.05rem; text-decoration: none; flex-shrink: 0;
}
.brand img { object-fit: contain; }
.brand b { color: var(--accent); font-weight: 800; }
.site-nav { display: flex; flex-wrap: wrap; gap: 20px; margin-left: auto; }
.site-nav a {
  color: var(--muted); font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.3px; text-decoration: none; padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--ink-strong); border-bottom-color: var(--accent-dim); text-decoration: none; }
.site-nav a[aria-current='page'] { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Hero (home) ────────────────────────────────────────── */
.hero { padding-top: 42px; padding-bottom: 10px; }
.hero-copy { max-width: 40rem; }
.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.3rem);
  line-height: 1.05; letter-spacing: -1.4px; margin: 0 0 16px;
  color: var(--ink-strong); font-weight: 900;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lede { font-size: 1.12rem; color: var(--muted); margin: 0 0 26px; }

/* Start control: the radar box stays hidden until this is tapped (see App.jsx). */
.radar-start { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0 0 6px; }
.btn.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 30px;
  background: var(--accent); border-color: var(--accent); color: #00201a;
  font-size: 0.88rem; letter-spacing: 1.2px;
  box-shadow: 0 12px 32px -14px rgba(0, 255, 204, 0.6);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s;
}
.btn.btn-primary:hover { background: #6cffe4; color: #00201a; transform: translateY(-1px); box-shadow: 0 16px 36px -14px rgba(0, 255, 204, 0.75); }
.btn.btn-primary:active { transform: translateY(0); box-shadow: 0 8px 22px -14px rgba(0, 255, 204, 0.6); }
.btn-primary svg { flex-shrink: 0; }
/* min-height holds two lines so the web-font swap cannot reflow the page below. */
.radar-note { margin: 0; max-width: 27rem; min-height: 3em; font-size: 0.88rem; line-height: 1.5; color: var(--muted); }

.radar-frame {
  margin-top: 30px;
  scroll-margin-top: 24px;
  position: relative;
  height: min(90vh, 860px);
  min-height: 600px;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.radar-frame #root { position: absolute; inset: 0; }
.radar-frame:focus { outline: none; }
/* The live card can be taller than the box: scroll inside it, centred only when it fits. */
.radar-frame .state-wrap { overflow-y: auto; align-items: safe center !important; padding: 20px 0; box-sizing: border-box; }
.radar-frame.is-opening { animation: radarOpen 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes radarOpen {
  from { opacity: 0; transform: translateY(10px); clip-path: inset(0 0 22% 0 round 24px); }
  to { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 24px); }
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 4px 26px; align-items: center;
  margin: 22px 0 0; font-size: 0.9rem;
}
.hero-actions a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }
.hero-actions a:hover { color: var(--accent); }
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent);
  font-weight: 700; font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase;
}
.btn:hover { background: var(--accent); color: #00201a; text-decoration: none; }
.btn-quiet { border-color: var(--line-soft); color: var(--muted); }
.btn-quiet:hover { background: transparent; border-color: var(--muted); color: var(--ink-strong); }

/* ── Sections & prose ───────────────────────────────────── */
section.band { padding: 62px 0; border-top: 1px solid var(--line-soft); }
section.band:first-of-type { border-top: none; }
section.band h1 {
  font-size: clamp(2rem, 4.6vw, 2.7rem); line-height: 1.12; letter-spacing: -1.2px;
  color: var(--ink-strong); margin: 0 0 14px; font-weight: 900;
}

.kicker {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 2.4px;
  text-transform: uppercase; color: var(--accent-dim); margin: 0 0 12px;
}
h2 {
  font-size: clamp(1.5rem, 3vw, 1.95rem); line-height: 1.2; letter-spacing: -0.6px;
  color: var(--ink-strong); margin: 0 0 14px; font-weight: 800;
}
h3 {
  font-size: 1.16rem; color: var(--ink-strong); margin: 34px 0 10px;
  font-weight: 700; letter-spacing: -0.2px;
}

.prose { max-width: var(--col); padding-top: 46px; padding-bottom: 40px; }
.prose h1 {
  font-size: clamp(2rem, 4.6vw, 2.7rem); line-height: 1.12; letter-spacing: -1.2px;
  color: var(--ink-strong); margin: 0 0 14px; font-weight: 900;
}
.prose p.kicker { font-family: var(--mono); font-size: 0.68rem; line-height: 1.4; letter-spacing: 2.4px; margin: 0 0 12px; }
.prose .standfirst {
  font-family: var(--serif); font-size: 1.2rem; line-height: 1.6;
  color: #b9c6c6; margin: 0 0 18px;
}
.prose .byline {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--muted);
  padding-bottom: 22px; border-bottom: 1px solid var(--line-soft); margin: 0 0 30px;
}
.prose p, .prose li { font-family: var(--serif); font-size: 1.07rem; line-height: 1.78; }
.prose p { margin: 0 0 20px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 22px; }
.prose li { margin-bottom: 10px; }
.prose li::marker { color: var(--accent-dim); }
.prose strong { color: var(--ink-strong); font-weight: 700; }
.prose h2 { margin-top: 44px; }

blockquote {
  margin: 26px 0; padding: 4px 0 4px 20px;
  border-left: 2px solid var(--accent-dim);
  font-family: var(--serif); font-style: italic; color: #b9c6c6;
}

.callout {
  border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, rgba(0, 255, 204, 0.05), rgba(0, 255, 204, 0.015));
  padding: 18px 20px; margin: 28px 0;
}
.callout h3 { margin: 0 0 8px; font-size: 0.78rem; letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent); font-family: var(--sans); }
.callout p:last-child { margin-bottom: 0; }

code, .code {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: 5px; padding: 1px 6px; color: var(--accent);
}

/* ── Cards ──────────────────────────────────────────────── */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  display: block; border: 1px solid var(--line-soft); border-radius: 16px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  padding: 22px; color: var(--ink); text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
a.card:hover { border-color: var(--line); transform: translateY(-2px); text-decoration: none; }
.card h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--ink-strong); }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.6; }
.card .tag {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 1.8px;
  text-transform: uppercase; color: var(--accent-dim); display: block; margin-bottom: 10px;
}

/* ── Reference tables ───────────────────────────────────── */
.table-scroll {
  overflow-x: auto; margin: 0 0 28px;
  background:
    linear-gradient(90deg, var(--bg) 30%, rgba(5, 8, 10, 0)) left center / 36px 100% no-repeat local,
    linear-gradient(270deg, var(--bg) 30%, rgba(5, 8, 10, 0)) right center / 36px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 255, 204, 0.22), rgba(0, 255, 204, 0)) left center / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 255, 204, 0.22), rgba(0, 255, 204, 0)) right center / 14px 100% no-repeat scroll;
}
table.ref {
  width: 100%; border-collapse: collapse; font-size: 0.92rem;
  border: 1px solid var(--line-soft); border-radius: 12px;
}
table.ref caption {
  text-align: left; color: var(--muted); font-size: 0.82rem; padding: 0 0 10px;
}
table.ref th, table.ref td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }
table.ref thead th {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--accent-dim); background: rgba(0, 255, 204, 0.04); font-weight: 600;
}
table.ref tbody tr:last-child td { border-bottom: none; }
table.ref tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
table.ref td.code-cell { font-family: var(--mono); color: var(--accent); white-space: nowrap; }
table.ref td.note-cell { color: var(--muted); font-size: 0.86rem; }

.group-block { margin: 0 0 44px; scroll-margin-top: 84px; }
.group-block > p { color: var(--muted); max-width: var(--col); }
.jump {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 34px; padding: 0; list-style: none;
}
.jump a {
  display: inline-block; font-size: 0.76rem; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-soft); color: var(--muted);
}
.jump a:hover { border-color: var(--accent-dim); color: var(--accent); text-decoration: none; }

/* ── Glossary ───────────────────────────────────────────── */
dl.glossary { margin: 0; max-width: var(--col); }
dl.glossary dt {
  font-weight: 700; color: var(--ink-strong); font-size: 1.02rem;
  margin: 30px 0 6px; scroll-margin-top: 84px;
}
dl.glossary dt span { font-family: var(--mono); font-size: 0.72rem; color: var(--accent-dim); margin-left: 8px; letter-spacing: 1px; }
dl.glossary dd { margin: 0; font-family: var(--serif); font-size: 1.04rem; line-height: 1.72; color: var(--ink); }

/* ── FAQ ────────────────────────────────────────────────── */
.faq { max-width: var(--col); }
.faq details {
  border-bottom: 1px solid var(--line-soft); padding: 16px 0;
}
.faq summary {
  cursor: pointer; font-weight: 600; color: var(--ink-strong); font-size: 1.02rem;
  list-style: none; display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details p { font-family: var(--serif); color: var(--ink); margin: 12px 0 2px; line-height: 1.72; }

/* ── Steps / how-to list ────────────────────────────────── */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; max-width: var(--col); }
ol.steps li {
  counter-increment: step; position: relative; padding: 0 0 22px 46px; margin: 0;
  font-family: var(--serif); font-size: 1.06rem; line-height: 1.72;
}
ol.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(0, 255, 204, 0.07);
  color: var(--accent); font-family: var(--sans); font-size: 0.78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
ol.steps li b { color: var(--ink-strong); }

/* ── Ads ────────────────────────────────────────────────── */
.ad-wrap {
  margin: 42px 0; padding: 14px 0;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  text-align: center; min-height: 90px;
}
.ad-label {
  display: block; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 2px;
  text-transform: uppercase; color: #55625f; margin-bottom: 10px;
}

/* ── Related ────────────────────────────────────────────── */
.related { margin-top: 48px; border-top: 1px solid var(--line-soft); padding-top: 26px; }
.related h2 { font-size: 0.78rem; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-dim); font-family: var(--mono); }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { margin: 0 0 14px; font-family: var(--sans); }
.related li a { font-weight: 600; }
.related li span { display: block; color: var(--muted); font-size: 0.88rem; }

/* ── Breadcrumbs ────────────────────────────────────────── */
.crumbs { padding-top: 26px; }
.crumbs.narrow { max-width: var(--col); }
.crumbs ol {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0;
  font-size: 0.8rem; color: var(--muted);
}
.crumbs li + li::before { content: '›'; margin: 0 8px; color: var(--accent-dim); }
.crumbs a { color: var(--muted); display: inline-block; padding: 12px 0; margin: -12px 0; }
.crumbs a:hover { color: var(--accent); }
.crumbs + .prose { padding-top: 18px; }
.crumbs + section.band { padding-top: 22px; }

/* ── Figures & CTA ──────────────────────────────────────── */
.prose figure { margin: 30px 0; }
.prose figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface); }
.prose figcaption { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); margin-top: 10px; line-height: 1.55; }
.cta-line { margin: 34px 0 6px; }
.sources { font-family: var(--sans); font-size: 0.88rem; color: var(--muted); }
.sources li { font-family: var(--sans); font-size: 0.88rem; line-height: 1.6; margin-bottom: 6px; }

/* ── Footer ─────────────────────────────────────────────── */
.site-foot { border-top: 1px solid var(--line-soft); margin-top: 70px; padding: 52px 0 40px; background: #04070895; }
.foot-grid { display: grid; gap: 30px; grid-template-columns: 1.4fr repeat(4, 1fr); }
.foot-grid h2 {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent-dim); margin: 0 0 14px;
}
.foot-grid a { display: block; color: var(--muted); font-size: 0.88rem; padding: 6px 0; margin-bottom: 3px; }
.foot-grid a:hover { color: var(--accent); }
.foot-brand { font-weight: 800; font-size: 1.1rem; color: var(--ink-strong); margin-bottom: 10px; }
.foot-brand b { color: var(--accent); }
.foot-note { color: var(--muted); font-size: 0.88rem; margin: 0; max-width: 30rem; }
.foot-legal { margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.foot-legal p { color: #6f7d7c; font-size: 0.78rem; line-height: 1.7; margin: 0 0 10px; max-width: 62rem; }
.foot-legal a { color: #8fa0a0; }
.foot-legal .copy { color: #55625f; }

/* ── Responsive ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .radar-frame.is-opening { animation: none; }
  .btn.btn-primary { transition: none; }
}
@media (max-width: 900px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .site-head { position: static; }
  .head-inner { flex-wrap: wrap; padding-top: 8px; padding-bottom: 0; gap: 0 18px; min-height: 0; }
  .brand { min-height: 44px; }
  .site-nav {
    margin: 0 -22px; padding: 0 22px; width: calc(100% + 44px);
    flex-wrap: nowrap; gap: 20px; overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; padding: 0; }
  .hero { padding-top: 30px; }
  .radar-start { flex-direction: column; align-items: stretch; gap: 12px; }
  .btn.btn-primary { width: 100%; }
  .radar-note { max-width: none; text-align: center; }
  .radar-frame { height: min(80vh, 640px); min-height: 520px; border-radius: 18px; margin-top: 24px; }
  .hero-actions { gap: 0 22px; }
  section.band { padding: 46px 0; }
  .foot-grid { grid-template-columns: 1fr; }
}
