/* ============================================================
   PALMER LEAD MACHINE — v3 design system
   Dark. Amber. Engineered. One accent, one voice.
   Every color is a token. Never hardcode a hex below :root.
   ============================================================ */

:root {
  /* ---- Accent (swap these to re-theme the entire site) ---- */
  --amber: #ffb02e;
  --amber-hi: #ffd36b;
  --amber-lo: #ff9b1e;
  --amber-soft: rgba(255, 176, 46, .10);
  --amber-line: rgba(255, 176, 46, .26);
  --accent-grad: linear-gradient(135deg, #ffd36b 0%, #ff9b1e 100%);
  --glow: rgba(255, 158, 30, .32);
  --on-accent: #14100a;

  /* ---- Surfaces ---- */
  --bg: #050506;
  --bg-2: #08080a;
  --bg-3: #0c0c10;
  --card: rgba(255, 255, 255, .022);
  --card-2: rgba(255, 255, 255, .042);
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);

  /* ---- Text ---- */
  --text: #f6f6f8;
  --muted: #9d9daa;
  --faint: #63636f;

  /* ---- Signal colors (used sparingly — one hue, one meaning) ---- */
  --ok: #4ade80;
  --hot: #fb7185;
  --info: #60a5fa;

  /* ---- Geometry ---- */
  --r: 16px;
  --r-lg: 24px;
  --r-sm: 10px;
  --maxw: 1200px;
  --gut: 24px;

  /* ---- Motion ---- */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --spring: cubic-bezier(.34, 1.4, .48, 1);
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

img, svg, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }

::selection { background: var(--amber); color: var(--on-accent); }

/* ============================================================
   AMBIENT — grain + the light that makes the dark feel deep
   ============================================================ */
body::before {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 0;
  pointer-events: none;
  opacity: .3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* A slow accent bloom that trails the cursor on desktop. */
.aura {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  width: 900px; height: 900px;
  left: 0; top: 0;
  margin: -450px 0 0 -450px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 62%);
  opacity: 0;
  filter: blur(40px);
  transition: opacity 1.2s var(--ease);
  will-change: transform;
}
.aura.on { opacity: .28; }

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
  position: relative;
  z-index: 1;
}

/* Grid and flex children default to min-width:auto, so one unbreakable
   string — a mono metric, a nowrap table row — can push a track wider than
   its container. `overflow-x: hidden` on body then CLIPS that silently
   rather than showing a scrollbar, so it reads as "text cut off mid-word"
   with nothing obviously wrong. Opt every layout child out of it. */
.hero-grid > *, .leak > *, .about-grid > *, .fit > *,
.grid-2 > *, .stages > *, .arsenal > *, .pkgs > *, .readouts > * { min-width: 0; }

.section { position: relative; z-index: 1; padding: 132px 0; }
.section.tight { padding: 92px 0; }
.section.flush-top { padding-top: 0; }

.rule {
  height: 1px; border: 0; margin: 0;
  background: linear-gradient(90deg, transparent, var(--line-2) 22%, var(--line-2) 78%, transparent);
}

/* ============================================================
   TYPE
   ============================================================ */
.h1, .h2, .h3, .display {
  font-family: Sora, Inter, sans-serif;
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.038em;
  text-wrap: balance;
}

/* The display sits in a half-width hero column, so it scales off a
   fraction of the viewport that accounts for that — not the full width. */
.display { font-size: clamp(2.4rem, 3.9vw, 3.5rem); letter-spacing: -.042em; }
.h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); }
.h2 { font-size: clamp(1.85rem, 3.4vw, 2.65rem); }
.h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); letter-spacing: -.028em; line-height: 1.22; }

.lede {
  font-size: clamp(1.06rem, 1.55vw, 1.24rem);
  line-height: 1.62;
  color: var(--muted);
  max-width: 60ch;
  text-wrap: pretty;
}

.accent { color: var(--amber); }

.grad {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Mono is reserved for DATA — numbers, metrics, labels, system text.
   It is the strongest "engineered, not brochure" signal on the page. */
.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .715rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}
.eyebrow .pip {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft), 0 0 14px var(--glow);
  flex: none;
}

.section-head { max-width: 64ch; margin-bottom: 62px; }
.section-head .lede { margin-top: 20px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  --btn-y: 13px;
  --btn-x: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: var(--btn-y) var(--btn-x);
  border-radius: 999px;
  font-size: .945rem;
  font-weight: 600;
  letter-spacing: -.015em;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  transition: transform .32s var(--spring), box-shadow .32s var(--ease),
              background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.btn svg { width: 17px; height: 17px; flex: none; transition: transform .32s var(--spring); }
.btn:active { transform: scale(.975); }

.btn-primary {
  background: var(--accent-grad);
  color: var(--on-accent);
  box-shadow: 0 1px 0 rgba(255,255,255,.30) inset, 0 8px 30px -8px var(--glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255,255,255,.34) inset, 0 16px 44px -10px var(--glow);
}
.btn-primary:hover svg { transform: translateX(4px); }

.btn-ghost {
  border: 1px solid var(--line-2);
  color: var(--text);
  background: var(--card);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  border-color: var(--amber-line);
  background: var(--amber-soft);
  transform: translateY(-2px);
}

.btn-lg { --btn-y: 16px; --btn-x: 30px; font-size: 1.005rem; }

:where(a, button, input, textarea, select):focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  border-bottom: 1px solid transparent;
  transition: background-color .45s var(--ease), border-color .45s var(--ease);
}
.nav.scrolled {
  background: rgba(5, 5, 6, .72);
  backdrop-filter: blur(18px) saturate(1.5);
  border-bottom-color: var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  height: 74px;
}

.brand { display: inline-flex; align-items: baseline; gap: 12px; flex: none; }
.brand-p {
  font-family: Sora, sans-serif;
  font-weight: 300;
  font-size: .9rem;
  letter-spacing: .3em;
  color: var(--text);
}
.brand-lm {
  font-family: Sora, sans-serif;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -.015em;
  color: var(--text);
  white-space: nowrap;
}
.brand-grad {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .89rem;
  font-weight: 500;
  color: var(--muted);
  transition: color .25s var(--ease), background-color .25s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--card-2); }

.nav-right { display: flex; align-items: center; gap: 14px; flex: none; }

.nav-micro {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "JetBrains Mono", monospace;
  font-size: .685rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.nav-micro .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 9px rgba(74, 222, 128, .8);
  animation: breathe 2.6s var(--ease) infinite;
}
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.hamburger {
  display: none;
  width: 42px; height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  position: relative;
  background: var(--card);
}
.hamburger span, .hamburger::before, .hamburger::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 17px; height: 1.6px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .34s var(--spring), opacity .2s var(--ease);
}
.hamburger span { transform: translate(-50%, -50%); }
.hamburger::before { transform: translate(-50%, calc(-50% - 6px)); }
.hamburger::after  { transform: translate(-50%, calc(-50% + 6px)); }
.nav.open .hamburger span { opacity: 0; }
.nav.open .hamburger::before { transform: translate(-50%, -50%) rotate(45deg); }
.nav.open .hamburger::after  { transform: translate(-50%, -50%) rotate(-45deg); }

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 10px var(--gut) 26px;
  background: rgba(5, 5, 6, .96);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.mobile-menu a {
  padding: 15px 4px;
  font-size: 1.06rem;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
/* The CTA at the bottom of the mobile sheet reads as a button, not a row. */
.mobile-menu a.btn {
  border-bottom: 0;
  margin-top: 16px;
  justify-content: center;
  padding: 15px 22px;
}
.nav.open .mobile-menu { display: flex; }

/* ============================================================
   REVEAL — motion should feel like the page settling into place,
   not like elements flying in.
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: .07s; }
.d2 { transition-delay: .14s; }
.d3 { transition-delay: .21s; }
.d4 { transition-delay: .28s; }
.d5 { transition-delay: .35s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .aura { display: none; }
}

/* ============================================================
   CARD — the one surface primitive everything builds on
   ============================================================ */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px;
  transition: border-color .4s var(--ease), background-color .4s var(--ease), transform .4s var(--ease);
}
.card:hover { border-color: var(--line-2); background: var(--card-2); }

/* A light that tracks the cursor across the card face. */
.card.lit::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity .45s var(--ease);
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--amber-soft), transparent 62%);
  pointer-events: none;
}
.card.lit:hover::before { opacity: 1; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; padding: 168px 0 108px; overflow: hidden; }
.hero::after {
  content: "";
  position: absolute;
  left: 50%; top: -180px;
  width: 1300px; height: 780px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--amber-soft) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  gap: 68px;
  align-items: center;
}

.hero .display { margin-bottom: 26px; }
.hero .lede { margin-bottom: 38px; font-size: clamp(1.1rem, 1.6vw, 1.28rem); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 13px; margin-bottom: 42px; }

/* ============================================================
   INSTRUMENT PANEL — real numbers presented as machine readouts
   rather than brochure "stats".
   ============================================================ */
.readouts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.readout { background: var(--bg-2); padding: 20px 22px; transition: background-color .4s var(--ease); }
.readout:hover { background: var(--bg-3); }
.readout .n {
  font-family: "JetBrains Mono", monospace;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1.1;
}
.readout .n .unit { font-size: .58em; color: var(--muted); font-weight: 500; }
.readout .k {
  font-family: "JetBrains Mono", monospace;
  font-size: .66rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 7px;
}

/* Provenance line. If a number appears on this page, the reader
   can see exactly where it came from. */
.source {
  font-family: "JetBrains Mono", monospace;
  font-size: .69rem;
  line-height: 1.6;
  color: var(--faint);
  letter-spacing: -.005em;
}
.source b { color: var(--muted); font-weight: 500; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 68px 0 42px;
  background: var(--bg-2);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 44px;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--line);
}
.footer h4 {
  font-family: "JetBrains Mono", monospace;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
  margin-bottom: 16px;
}
.footer-col a, .footer-col p {
  display: block;
  font-size: .92rem;
  color: var(--muted);
  padding: 5px 0;
  transition: color .25s var(--ease);
}
.footer-col a:hover { color: var(--amber); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding-top: 26px;
  font-size: .82rem;
  color: var(--faint);
}
.footer-note { max-width: 46ch; font-size: .84rem; color: var(--muted); margin-top: 14px; line-height: 1.6; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 54px; }
  .hero { padding-top: 142px; }
}

@media (max-width: 900px) {
  :root { --gut: 20px; }
  /* Brand + CTA + burger cannot all fit at 390px — the CTA loses, because
     it already lives at the top of the mobile sheet and in the hero. */
  .nav-links, .nav-micro, .nav-right > .btn { display: none; }
  .hamburger { display: block; }
  .section { padding: 92px 0; }
  .section.tight { padding: 68px 0; }
  .section-head { margin-bottom: 44px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .hero { padding: 124px 0 76px; }
  .hero-cta .btn { width: 100%; }
  .readouts { grid-template-columns: 1fr; }
  .card { padding: 24px; }
  .footer-top { grid-template-columns: 1fr; }
}
