/* Pocket Pro — shared tokens and chrome for every page. Homepage sections live in home.css. */
:root {
  color-scheme: dark;
  /* tokens:start root */
  --bg: #0b0b0b;  /* screen background */
  --surface: #151515;  /* cards */
  --surface-2: #1f1f1f;  /* chips, inputs, pressed */
  --fg: #f5f1ea;  /* primary text */
  --muted: #a39e96;  /* secondary text, inactive tab */
  --line: #2a2a2a;  /* 1px hairlines and card borders */
  --accent: #ff5a1f;  /* actions and events only: CTAs, pots, live dots, one key number per section */
  --accent-ink: #ff6a33;  /* orange text on --bg (AA) */
  --on-accent: #0b0b0b;  /* text on --accent */
  --felt: #4aa3df;  /* cloth only: tables, illustration panels, data fills. Never text. */
  --on-felt: #0b0b0b;  /* text on --felt */
  --rail: #0b0b0b;  /* table rails and pockets */
  --ball: #f5f1ea;  /* ball fill on the schematic tables */
  --shadow: rgb(0 0 0 / .6);  /* drop shadows */
  --line-strong: #3a3a3a;  /* hover borders, outline buttons */
  --faint: #8a857e;  /* tertiary text: notes, meta (AA on --bg) */
  --accent-hover: #ff7a45;  /* --accent on hover */
  --accent-soft: rgb(255 90 31 / .14);  /* orange wash behind live dots and new log rows */
  --diamond: #f5f1ea;  /* rail diamonds */
  --pocket: #000;  /* pocket holes */
  --obj: #f0b429;  /* object balls on the schematic tables */
  --device: #1c1c1c;  /* phone hardware in mockups */

  --font-display: "Geist", system-ui, sans-serif;
  --font-text: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;

  --s1: .25rem;
  --s2: .5rem;
  --s3: 1rem;
  --s4: 1.5rem;  /* screen side padding */
  --s5: 2.5rem;
  --s6: 4rem;
  --s7: 7rem;
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);

  --radius: 14px;
  --radius-lg: 28px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur: .7s;
  /* tokens:end root */
  --elev: 0 1px 0 rgb(255 255 255 / .04) inset, 0 24px 60px -20px var(--shadow), 0 8px 18px -8px var(--shadow);
}

[data-theme="light"] {
  color-scheme: light;
  /* tokens:start light */
  --bg: #f6f1e7;  /* screen background */
  --surface: #ffffff;  /* cards */
  --surface-2: #ece5d8;  /* chips, inputs, pressed */
  --fg: #0b0b0b;  /* primary text */
  --muted: #5a554d;  /* secondary text, inactive tab */
  --line: #d9d1c2;  /* 1px hairlines and card borders */
  --accent: #ff5a1f;  /* actions and events only: CTAs, pots, live dots, one key number per section */
  --accent-ink: #b83a0a;  /* orange text on --bg (AA) */
  --on-accent: #0b0b0b;  /* text on --accent */
  --felt: #4aa3df;  /* cloth only: tables, illustration panels, data fills. Never text. */
  --on-felt: #0b0b0b;  /* text on --felt */
  --rail: #0b0b0b;  /* table rails and pockets */
  --ball: #f6f1e7;  /* ball fill on the schematic tables */
  --shadow: rgb(60 30 0 / .18);  /* drop shadows */
  --line-strong: #c4baa8;  /* hover borders, outline buttons */
  --faint: #6e685f;  /* tertiary text: notes, meta (AA on --bg) */
  --accent-hover: #e84a12;  /* --accent on hover */
  --accent-soft: rgb(255 90 31 / .12);  /* orange wash behind live dots and new log rows */
  --diamond: #f5f1ea;  /* rail diamonds */
  --pocket: #000;  /* pocket holes */
  --obj: #f0b429;  /* object balls on the schematic tables */
  --device: #1c1c1c;  /* phone hardware in mockups */
  /* tokens:end light */
  --elev: 0 1px 0 rgb(255 255 255 / .8) inset, 0 24px 50px -24px var(--shadow), 0 6px 14px -8px var(--shadow);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 17px/1.6 var(--font-text); font-feature-settings: 'ss01';
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: var(--line-strong) var(--bg); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p a, li a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
p a:hover, li a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.035em; line-height: 1.02; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.wrap { width: min(100% - 32px, var(--max)); margin-inline: auto; }
@media (min-width: 720px) { .wrap { width: min(100% - 64px, var(--max)); } }
.display { font-size: clamp(2.4rem, 5.4vw, 4.25rem); }
.lede { color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.2rem); max-width: 56ch; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; font-weight: 550; font-size: 1rem; letter-spacing: -.01em; white-space: nowrap; cursor: pointer;
  transition: background .2s var(--ease-out), border-color .2s var(--ease-out), transform .2s var(--ease-out);
}
.btn:hover { border-color: var(--muted); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn svg { width: 18px; height: 18px; transition: transform .25s var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }
.btn-sm { height: 38px; padding: 0 16px; font-size: .92rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: var(--s4); height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.02em; font-size: 1.05rem; }
.logo-ball { width: 26px; height: 26px; }
.nav-links { display: none; gap: 4px; margin-left: var(--s3); }
.nav-links a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: .94rem; transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--fg); background: var(--surface-2); }
@media (min-width: 900px) { .nav-links { display: flex; } }
.spacer { flex: 1; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: color .2s, border-color .2s;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--line-strong); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding-block: var(--s5); color: var(--muted); font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); }
.footer nav { display: flex; flex-wrap: wrap; gap: var(--s4); }
.footer a:hover { color: var(--fg); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: vt-in .5s var(--ease-out); }
@keyframes vt-in { from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); } to { clip-path: circle(150% at var(--vt-x, 50%) var(--vt-y, 0)); } }
