/* ============================================================
   REEP — Design system
   Palette: mineral chalk light surfaces, navy-green ink & accent
   Type:    Fraunces (display) / Archivo (text) / DM Mono (data)
   ============================================================ */

:root {
  /* Surfaces */
  --chalk:      #EFF1EC;   /* page base — cool mineral off-white */
  --chalk-2:    #E6EAE3;   /* recessed panels */
  --plate:      #F7F8F5;   /* raised panels */
  --pine:       #0C2A23;   /* deep navy-green — dark surface */
  --pine-2:     #123A31;   /* dark surface, one step up */

  /* Ink */
  --ink:        #0B1A16;
  --ink-2:      #33473F;   /* secondary text on light */
  --ink-3:      #66766E;   /* tertiary / captions */
  --on-dark:    #E8EDE8;
  --on-dark-2:  #9DB2A8;

  /* Accent */
  --verd:       #1F6A57;   /* primary interactive navy-green */
  --verd-lift:  #2A8A70;   /* hover */
  --verd-wash:  rgba(31,106,87,.09);
  --brass:      #A8814A;   /* heirloom accent, used sparingly */
  --alert:      #A63D2E;
  --alert-wash: rgba(166,61,46,.09);

  /* Lines */
  --line:       rgba(11,26,22,.13);
  --line-soft:  rgba(11,26,22,.07);
  --line-dark:  rgba(232,237,232,.14);

  /* Radius — restrained */
  --r-xs: 3px;
  --r-sm: 5px;
  --r:    8px;
  --r-lg: 10px;

  /* Type */
  --display: "Fraunces", "Times New Roman", serif;
  --text:    "Archivo", system-ui, -apple-system, sans-serif;
  --mono:    "DM Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Rhythm */
  --gut: clamp(1.25rem, 4vw, 3.5rem);
  --shell: 1240px;
  --nav-h: 66px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

body {
  font-family: var(--text);
  background: var(--chalk);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.62;
  overflow-x: hidden;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--verd); color: #fff; }

:focus-visible {
  outline: 2px solid var(--verd);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--pine); color: var(--on-dark);
  padding: .75rem 1.25rem; border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; }

/* ---------- Type scale ---------- */
h1, h2, h3, .display {
  font-family: var(--display);
  font-variation-settings: "SOFT" 0, "WONK" 1;
  font-weight: 800;
  line-height: .94;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.d1 { font-size: clamp(2.9rem, 7.4vw, 7.2rem); line-height: .9; letter-spacing: -.038em; font-weight: 900; }
.d2 { font-size: clamp(2.4rem, 6.2vw, 4.75rem); }
.d3 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); line-height: 1.0; }
.d4 { font-size: clamp(1.2rem, 2vw, 1.5rem); line-height: 1.12; letter-spacing: -.015em; font-weight: 700; }

.lede {
  font-size: clamp(1.075rem, 1.7vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 46ch;
}

.eyebrow {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
}
.eyebrow.accent { color: var(--verd); }

.mono { font-family: var(--mono); }
.num  { font-family: var(--display); font-weight: 800; font-variation-settings: "SOFT" 0, "WONK" 0; letter-spacing: -.03em; }

p + p { margin-top: 1rem; }
.muted { color: var(--ink-2); }
.dim   { color: var(--ink-3); }
.small { font-size: .875rem; }
.tiny  { font-size: .78rem; }

a { color: var(--verd); text-decoration: none; }
a:hover { color: var(--verd-lift); }

.tlink {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: border-color .18s ease, color .18s ease;
}
.tlink:hover { color: var(--verd); border-color: var(--verd); }

/* ---------- Shell & sections ---------- */
.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gut); }
.shell-wide { max-width: 1520px; }

.band { padding-block: clamp(4.5rem, 9vw, 8.5rem); position: relative; }
.band-tight { padding-block: clamp(2.75rem, 5vw, 4.5rem); }
.band + .band { border-top: 1px solid var(--line-soft); }

.on-pine  { background: var(--pine); color: var(--on-dark); }
.on-pine h1, .on-pine h2, .on-pine h3 { color: var(--on-dark); }
.on-pine .muted, .on-pine .lede { color: var(--on-dark-2); }
.on-pine .dim, .on-pine .eyebrow { color: var(--on-dark-2); }
.on-pine .tlink { color: var(--on-dark); border-color: var(--line-dark); }
.on-chalk2 { background: var(--chalk-2); }

/* ---------- Split: the site's structural spine ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 4.4fr) minmax(0, 7.6fr);
  gap: clamp(2rem, 5vw, 5.5rem);
  align-items: start;
}
.split-even { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.split-rail { position: sticky; top: calc(var(--nav-h) + 2.5rem); }
.split-rail .eyebrow { margin-bottom: 1.1rem; }
.split-rail .lede { margin-top: 1.25rem; }

@media (max-width: 900px) {
  .split, .split-even { grid-template-columns: 1fr; gap: 2.25rem; }
  .split-rail { position: static; }
}

/* Continuity thread — signature element in the split gutter */
.thread { position: relative; padding-left: 1.75rem; }
.thread::before {
  content: ""; position: absolute; left: 0; top: .35rem; bottom: .35rem;
  width: 1px; background: var(--line);
}
.thread::after {
  content: ""; position: absolute; left: -2px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--verd);
  top: var(--pulse, 0%);
  transition: top .35s cubic-bezier(.4,0,.2,1);
}
.on-pine .thread::before { background: var(--line-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--text); font-size: .93rem; font-weight: 600; letter-spacing: .005em;
  padding: .78rem 1.35rem; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--pine); color: var(--on-dark); }
.btn-primary:hover { background: var(--verd); color: #fff; }
.btn-accent { background: var(--verd); color: #fff; }
.btn-accent:hover { background: var(--verd-lift); color: #fff; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-line:hover { border-color: var(--ink); color: var(--ink); background: rgba(11,26,22,.03); }
.on-pine .btn-line { color: var(--on-dark); border-color: var(--line-dark); }
.on-pine .btn-line:hover { background: rgba(255,255,255,.06); color: var(--on-dark); }
.on-pine .btn-primary { background: var(--on-dark); color: var(--pine); }
.on-pine .btn-primary:hover { background: #fff; color: var(--pine); }
.btn-sm { padding: .5rem .85rem; font-size: .82rem; }
.btn-lg { padding: .95rem 1.7rem; font-size: 1rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Panels ---------- */
.panel {
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(1.25rem, 2.5vw, 1.9rem);
}
.panel-flush { padding: 0; overflow: hidden; }
.on-pine .panel { background: rgba(255,255,255,.04); border-color: var(--line-dark); }

.rows { border-top: 1px solid var(--line); }
.row {
  display: flex; gap: 1rem; align-items: baseline;
  padding: 1.15rem 0; border-bottom: 1px solid var(--line);
}
.row-k { flex: 0 0 clamp(6.5rem, 16%, 11rem); }
.row-v { flex: 1; min-width: 0; }
.on-pine .rows, .on-pine .row { border-color: var(--line-dark); }

.stat-k { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.stat-v { font-family: var(--display); font-weight: 800; font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1; letter-spacing: -.03em; margin-top: .35rem; }
.on-pine .stat-k { color: var(--on-dark-2); }

/* ---------- Tags & status ---------- */
.tag {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .28rem .55rem; border-radius: var(--r-xs);
  border: 1px solid var(--line); color: var(--ink-2); background: transparent;
}
.tag-live   { color: var(--verd); border-color: rgba(31,106,87,.35); background: var(--verd-wash); }
.tag-wait   { color: var(--brass); border-color: rgba(168,129,74,.4); background: rgba(168,129,74,.08); }
.tag-stop   { color: var(--alert); border-color: rgba(166,61,46,.35); background: var(--alert-wash); }
.tag-demo   { color: var(--ink-2); border-color: var(--line); background: var(--chalk-2); }
.on-pine .tag { color: var(--on-dark-2); border-color: var(--line-dark); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.dot-beat { animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .35; transform: scale(.8);} }

.meter { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--verd); border-radius: 2px; transition: width .5s cubic-bezier(.4,0,.2,1); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 90; height: var(--nav-h);
  background: rgba(239,241,236,.94);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background-color .25s ease;
}
.nav.is-stuck { border-bottom-color: var(--line); background: var(--chalk); }
.nav-inner { height: 100%; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; }
.brand:hover { color: var(--verd); }
.brand svg { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 1.65rem; margin-left: auto; }
.nav-links a { color: var(--ink-2); font-size: .92rem; font-weight: 500; position: relative; padding-block: .35rem; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--verd);
}
.nav-cta { margin-left: 1.5rem; }
.burger {
  display: none; margin-left: auto; background: transparent; border: 1px solid var(--line);
  border-radius: var(--r-sm); width: 40px; height: 40px; cursor: pointer; padding: 0;
  align-items: center; justify-content: center;
}
.burger span { display: block; width: 16px; height: 1.5px; background: var(--ink); position: relative; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; width: 16px; height: 1.5px; background: var(--ink); }
.burger span::before { top: -5px; } .burger span::after { top: 5px; }

@media (max-width: 980px) {
  .nav-links, .nav-cta { display: none; }
  .burger { display: flex; }
}

/* Mobile drawer */
.scrim { position: fixed; inset: 0; background: rgba(11,26,22,.4); opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 95; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 88vw); z-index: 96;
  background: var(--pine); color: var(--on-dark);
  transform: translateX(101%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; padding: 1.25rem;
  overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.drawer-head .brand { color: var(--on-dark); }
.drawer nav { display: flex; flex-direction: column; }
.drawer nav a {
  color: var(--on-dark); font-family: var(--display); font-weight: 700; font-size: 1.55rem;
  letter-spacing: -.02em; padding: .7rem 0; border-bottom: 1px solid var(--line-dark);
}
.drawer nav a:hover { color: #fff; padding-left: .35rem; transition: padding .18s ease; }
.drawer-foot { margin-top: auto; padding-top: 1.5rem; font-size: .85rem; color: var(--on-dark-2); }
.x-btn { background: transparent; border: 1px solid var(--line-dark); color: var(--on-dark); width: 38px; height: 38px; border-radius: var(--r-sm); cursor: pointer; }

body.locked { overflow: hidden; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden; padding-top: var(--nav-h); }
#stage {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; touch-action: pan-y;
  /* Static poster of the same lattice. Shown until the WebGL scene takes over,
     and left in place if three.js or WebGL is unavailable, so the hero is never blank. */
  background: url("/assets/hero-lattice.svg") no-repeat;
  background-size: min(118vh, 96vw) auto;
  background-position: right -14vw center;
}
#stage.is-live { background-image: none; }
@media (max-width: 820px) {
  #stage { background-size: 158vw auto; background-position: center top 1vh; }
}
.hero::after { content:""; position:absolute; inset:0; z-index:1; pointer-events:none; background: linear-gradient(180deg, rgba(239,241,236,0) 4%, rgba(239,241,236,.55) 26%, rgba(239,241,236,.93) 42%, var(--chalk) 56%); }
@media (min-width: 821px) { .hero::after { background: linear-gradient(96deg, var(--chalk) 26%, rgba(239,241,236,.72) 52%, rgba(239,241,236,0) 78%); } }
.hero-grid { position: relative; z-index: 2; width: 100%; padding-bottom: clamp(2rem, 5vw, 4rem); pointer-events: none; }
.hero-grid a, .hero-grid button { pointer-events: auto; }
.hero h1 { color: var(--ink); mix-blend-mode: normal; }
.hero-sub { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); max-width: 960px; gap: clamp(1.5rem,4vw,4rem); align-items: end; margin-top: clamp(1.5rem, 3vw, 2.5rem); }
@media (max-width: 820px) { .hero-sub { grid-template-columns: 1fr; gap: 1.5rem; } }
.hero-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; margin-bottom: 1.4rem; }
.hero-legend { display: flex; flex-wrap: wrap; gap: 1.25rem; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.hero-legend span { display: inline-flex; align-items: center; gap: .45rem; }
.hero-hint { display: none; position: absolute; bottom: 1rem; right: var(--gut); z-index: 2; font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
#stage.is-live ~ .hero-hint { display: block; }
@media (max-width: 820px) { #stage.is-live ~ .hero-hint { display: none; } }

/* ---------- Reveal ---------- */
.rise { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.16,1,.3,1); }
.rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; transition: none; }
  .dot-beat { animation: none; }
}

/* ---------- Interactive: LEVS simulator ---------- */
.sim { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--plate); }
@media (max-width: 900px) { .sim { grid-template-columns: 1fr; } }
.sim-controls { padding: clamp(1.25rem,2.5vw,2rem); border-right: 1px solid var(--line); }
@media (max-width: 900px) { .sim-controls { border-right: none; border-bottom: 1px solid var(--line); } }
.sim-stage { padding: clamp(1.25rem,2.5vw,2rem); background: var(--chalk-2); }

.field { margin-bottom: 1.5rem; }
.field > label, .field-label { display: block; font-family: var(--mono); font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .6rem; }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--chalk); }
.seg button { flex: 1; background: transparent; border: none; padding: .6rem .5rem; font-size: .85rem; font-weight: 500; cursor: pointer; color: var(--ink-2); border-right: 1px solid var(--line); transition: background-color .18s ease, color .18s ease; }
.seg button:last-child { border-right: none; }
.seg button[aria-pressed="true"] { background: var(--pine); color: var(--on-dark); }
.seg button:hover:not([aria-pressed="true"]) { background: var(--verd-wash); color: var(--ink); }

.stage-line { display: flex; flex-direction: column; gap: 0; }
.step { display: grid; grid-template-columns: 22px 1fr; gap: .9rem; padding-bottom: 1.35rem; position: relative; }
.step:last-child { padding-bottom: 0; }
.step-mark { width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--line); background: var(--chalk); margin-top: .3rem; position: relative; z-index: 1; transition: background-color .3s ease, border-color .3s ease; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 1.15rem; bottom: -.2rem; width: 1px; background: var(--line); }
.step[data-state="done"] .step-mark { background: var(--verd); border-color: var(--verd); }
.step[data-state="active"] .step-mark { background: var(--brass); border-color: var(--brass); }
.step[data-state="blocked"] .step-mark { background: var(--alert); border-color: var(--alert); }
.step h4 { font-family: var(--text); font-size: .95rem; font-weight: 600; letter-spacing: 0; }
.step p { font-size: .875rem; color: var(--ink-2); margin-top: .15rem; }
.step[data-state="idle"] h4, .step[data-state="idle"] p { color: var(--ink-3); }

.guard-list { display: flex; flex-direction: column; gap: .5rem; }
.guard {
  display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left;
  padding: .7rem .85rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--chalk); cursor: pointer; transition: border-color .18s ease, background-color .18s ease;
}
.guard:hover:not([disabled]) { border-color: var(--verd); }
.guard[data-approved="true"] { border-color: var(--verd); background: var(--verd-wash); }
.guard[disabled] { cursor: not-allowed; opacity: .55; }
.guard-name { font-weight: 500; font-size: .9rem; }
.guard-rel { font-size: .78rem; color: var(--ink-3); }
.guard-state { margin-left: auto; font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.guard[data-approved="true"] .guard-state { color: var(--verd); }

.notice { border: 1px solid var(--line); border-left: 2px solid var(--ink-3); border-radius: var(--r-xs); padding: .8rem 1rem; font-size: .875rem; background: var(--chalk); }
.notice-ok   { border-left-color: var(--verd); color: var(--ink); }
.notice-warn { border-left-color: var(--brass); }
.notice-stop { border-left-color: var(--alert); color: var(--alert); background: var(--alert-wash); }

/* ---------- Vault explorer ---------- */
.vault-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.vault-tab {
  border: 1px solid var(--line); background: transparent; border-radius: var(--r-sm);
  padding: .55rem .9rem; cursor: pointer; font-size: .88rem; font-weight: 500; color: var(--ink-2);
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}
.vault-tab:hover { border-color: var(--ink-3); color: var(--ink); }
.vault-tab[aria-selected="true"] { background: var(--pine); border-color: var(--pine); color: var(--on-dark); }
.item {
  display: flex; gap: 1rem; align-items: baseline; padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: none; }
.item-t { font-weight: 500; }
.item-d { font-size: .85rem; color: var(--ink-2); margin-top: .1rem; }
.item-m { margin-left: auto; font-family: var(--mono); font-size: .72rem; color: var(--ink-3); white-space: nowrap; }

/* ---------- Plan configurator ---------- */
.plan-out { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 1.5rem; align-items: center; }
@media (max-width: 620px) { .plan-out { grid-template-columns: 1fr; } }
.price { font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem,6vw,4rem); line-height: 1; letter-spacing: -.035em; }
.price small { font-family: var(--text); font-size: .95rem; font-weight: 400; letter-spacing: 0; color: var(--ink-3); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r); }
table.grid { min-width: 620px; font-size: .92rem; }
table.grid th, table.grid td { text-align: left; padding: .95rem 1.15rem; border-bottom: 1px solid var(--line); }
table.grid thead th { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; background: var(--chalk-2); }
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid td.yes { color: var(--verd); font-weight: 500; }
table.grid td.no { color: var(--ink-3); }

/* ---------- Accordion ---------- */
.acc { border-top: 1px solid var(--line); }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary {
  cursor: pointer; list-style: none; padding: 1.15rem 0; display: flex; gap: 1rem; align-items: baseline;
  font-weight: 500; font-size: 1.02rem;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; margin-left: auto; font-family: var(--mono); color: var(--ink-3); font-size: 1.1rem; }
.acc details[open] summary::after { content: "–"; }
.acc details > div { padding-bottom: 1.2rem; color: var(--ink-2); max-width: 62ch; }

/* ---------- Forms ---------- */
.inp {
  width: 100%; background: var(--chalk); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: .7rem .85rem; font-size: .95rem; transition: border-color .18s ease;
}
.inp:focus { border-color: var(--verd); outline: none; box-shadow: 0 0 0 3px var(--verd-wash); }
.inp[aria-invalid="true"] { border-color: var(--alert); }
.err { color: var(--alert); font-size: .8rem; margin-top: .35rem; display: none; }
.err.show { display: block; }
.on-pine .inp { background: rgba(255,255,255,.06); border-color: var(--line-dark); color: var(--on-dark); }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: .5rem; width: min(440px, calc(100vw - 2rem)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: .75rem; align-items: flex-start;
  background: var(--pine); color: var(--on-dark); border: 1px solid var(--line-dark);
  border-radius: var(--r-sm); padding: .8rem 1rem; font-size: .9rem;
  animation: toast-in .28s cubic-bezier(.16,1,.3,1);
}
.toast.err-toast { background: var(--alert); border-color: transparent; color: #fff; }
.toast b { font-weight: 600; }
.toast .toast-x { margin-left: auto; background: none; border: none; color: inherit; cursor: pointer; opacity: .7; padding: 0 0 0 .5rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Skeleton ---------- */
.skel { background: linear-gradient(90deg, var(--chalk-2) 25%, var(--plate) 50%, var(--chalk-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-xs); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.skel-line { height: 12px; margin-bottom: .6rem; }

/* ---------- Footer ---------- */
.foot { background: var(--pine); color: var(--on-dark-2); padding-block: clamp(3rem,6vw,5rem) 2rem; }
.foot-top { display: grid; grid-template-columns: minmax(0,1.6fr) repeat(3, minmax(0,1fr)); gap: 2.5rem; }
@media (max-width: 860px) { .foot-top { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media (max-width: 520px) { .foot-top { grid-template-columns: 1fr; } }
.foot h3 { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark-2); font-weight: 400; margin-bottom: 1rem; }
.foot ul { display: flex; flex-direction: column; gap: .6rem; }
.foot ul a { color: var(--on-dark); font-size: .92rem; }
.foot ul a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.foot-bar { margin-top: clamp(2.5rem,5vw,4rem); padding-top: 1.5rem; border-top: 1px solid var(--line-dark); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: .82rem; }
.foot .brand { color: var(--on-dark); }

/* ---------- Article ---------- */
.article { max-width: 68ch; margin-inline: auto; }
.article h2 { font-size: clamp(1.5rem,3vw,2rem); margin-top: 2.75rem; margin-bottom: .85rem; }
.article p { margin-top: 1.15rem; color: var(--ink-2); font-size: 1.06rem; }
.article ul.bullets { margin-top: 1.15rem; display: flex; flex-direction: column; gap: .6rem; }
.article ul.bullets li { padding-left: 1.4rem; position: relative; color: var(--ink-2); }
.article ul.bullets li::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 1px; background: var(--verd); }
.article blockquote { margin: 2rem 0; padding-left: 1.5rem; border-left: 2px solid var(--verd); font-family: var(--display); font-size: 1.3rem; line-height: 1.35; font-weight: 700; letter-spacing: -.015em; }

/* ---------- App dashboard ---------- */
.app-body { background: var(--chalk-2); }
.app-shell { display: grid; grid-template-columns: 244px minmax(0,1fr); min-height: 100vh; }
.app-side { background: var(--pine); color: var(--on-dark); padding: 1.25rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.app-side .brand { color: var(--on-dark); margin-bottom: 2rem; }
.app-side nav { display: flex; flex-direction: column; gap: .15rem; }
.app-side nav button {
  display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left;
  background: transparent; border: none; border-radius: var(--r-sm); cursor: pointer;
  color: var(--on-dark-2); padding: .6rem .7rem; font-size: .92rem; transition: background-color .18s ease, color .18s ease;
}
.app-side nav button:hover { background: rgba(255,255,255,.06); color: var(--on-dark); }
.app-side nav button[aria-current="true"] { background: rgba(255,255,255,.1); color: #fff; font-weight: 500; }
.app-side nav svg { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; }
.app-side-foot { margin-top: auto; font-size: .76rem; color: var(--on-dark-2); line-height: 1.6; padding-top: 1.5rem; }
.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-top { position: sticky; top: 0; z-index: 40; background: rgba(239,241,236,.95); border-bottom: 1px solid var(--line); padding: .9rem clamp(1rem,3vw,2.25rem); display: flex; align-items: center; gap: 1rem; }
.app-content { padding: clamp(1.25rem,3vw,2.25rem); flex: 1; }
.app-foot { padding: 1.25rem clamp(1rem,3vw,2.25rem); border-top: 1px solid var(--line); font-size: .8rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
.app-burger { display: none; }
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-side { position: fixed; top: 0; bottom: 0; left: 0; width: min(268px, 82vw); height: 100dvh; z-index: 96; transform: translateX(-101%); transition: transform .3s cubic-bezier(.4,0,.2,1); }
  .app-side.open { transform: none; }
  .app-burger { display: inline-flex; }
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cards > div { background: var(--plate); padding: 1.15rem 1.25rem; }
.app-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 1.25rem; }
@media (max-width: 1040px) { .app-grid { grid-template-columns: 1fr; } }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 110; display: none; align-items: center; justify-content: center; padding: 1rem; }
.modal.open { display: flex; }
.modal-scrim { position: absolute; inset: 0; background: rgba(11,26,22,.45); }
.modal-panel { position: relative; background: var(--plate); border: 1px solid var(--line); border-radius: var(--r); width: min(440px, 100%); padding: 1.6rem; max-height: 90vh; overflow-y: auto; }

/* ---------- Utility ---------- */
.stack-sm > * + * { margin-top: .75rem; }
.stack   > * + * { margin-top: 1.35rem; }
.stack-lg > * + * { margin-top: 2.5rem; }
.flex { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.between { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .75rem; } .mt-2 { margin-top: 1.5rem; } .mt-3 { margin-top: 2.5rem; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
