/* PixelSpec brand tokens and shared components. Spacing on a 4px base, layout on an 8px grid. */

:root {
  /* Surfaces, dark (default) */
  --void: #08090A;       /* page */
  --night: #0F1011;      /* surface: cards, panels */
  --deep: #16171A;       /* raised: hover, inputs, nested cards */
  --line: #1F2023;       /* hairlines */
  --line-2: #2B2D31;     /* borders on controls */
  --fog: #A1A6AE;        /* secondary text */
  --mute: #7D828B;       /* tertiary text and labels, AA on void and night */
  --snow: #F7F8F8;       /* primary text */

  /* Surfaces, light */
  --paper: #F7F6F3;      /* warm light page and cards */
  --paper-2: #EEEDE9;
  --rule: #E3E1DC;       /* hairlines on light */
  --ink: #0A0A0A;        /* text on light */
  --ink-2: #5E6168;      /* secondary text on light, AA */

  /* Brand + spec palette. Signal is the brand blue; the rest only appear in product visuals. */
  --signal: #0D99FF;
  --signal-2: #6CC2FF;
  --redline: #FF3B30;    /* distances */
  --pad: #86EFAC;        /* padding */
  --margin: #F6B26B;     /* margin */
  --gap: #E83E8C;        /* gap */
  --marker: #FFE14D;     /* highlight */

  /* Type: Geist for everything, Geist Pixel as an accent, Geist Mono for numbers and labels */
  --f-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-pixel: 'Geist Pixel', 'Geist Mono', ui-monospace, monospace;
  --f-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Shape */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* Layout */
  --gutter: clamp(20px, 4vw, 40px);
  --max: 1200px;
  --ease: cubic-bezier(.2, 0, 0, 1);

  color-scheme: dark;
}

*, *::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 { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body {
  margin: 0;
  background: var(--void);
  color: var(--snow);
  font: 400 16px/1.6 var(--f-sans);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--signal); color: var(--ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
.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; }

/* ---------- logo (site/assets/brand.js fills [data-logo]) */
[data-logo] { display: inline-block; line-height: 0; color: inherit; --ps-mark: var(--signal); }
[data-logo] svg { height: 100%; width: auto; overflow: visible; }

/* ---------- icons: <svg class="i"><use href="assets/icons.svg#name"/></svg> (Hugeicons, stroke) */
.i { width: 20px; height: 20px; flex: none; color: inherit; }
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 24px; height: 24px; }

/* ---------- type */
.t-pixel { font-family: var(--f-pixel); font-weight: 400; letter-spacing: 0; font-variation-settings: 'ELSH' 0; }
.t-mono { font-family: var(--f-mono); }
.h-display { margin: 0; font: 500 clamp(44px, 7vw, 80px)/1.02 var(--f-sans); letter-spacing: -0.045em; text-wrap: balance; }
.h-1 { margin: 0; font: 500 clamp(32px, 4.4vw, 52px)/1.06 var(--f-sans); letter-spacing: -0.035em; text-wrap: balance; }
.h-2 { margin: 0; font: 500 clamp(24px, 2.6vw, 32px)/1.15 var(--f-sans); letter-spacing: -0.025em; text-wrap: balance; }
.h-3 { margin: 0; font: 500 17px/1.35 var(--f-sans); letter-spacing: -0.015em; }
.lede { margin: 0; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; color: var(--fog); text-wrap: pretty; }
.muted { color: var(--fog); }

/* Small mono label, Linear-style: "FIG 0.1", section numbers, metadata */
.label {
  font: 500 12px/1 var(--f-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
}

/* ---------- buttons: pills */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border: 0; border-radius: var(--r-pill);
  font: 500 14px/1 var(--f-sans); letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.btn.lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn.sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-primary { background: var(--snow); color: var(--ink); }
.btn-primary:hover { background: #fff; }
.btn-secondary { background: var(--deep); color: var(--snow); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-secondary:hover { background: #1D1E21; }
.btn-ghost { background: transparent; color: var(--fog); }
.btn-ghost:hover { color: var(--snow); }
.btn-signal { background: var(--signal); color: var(--ink); }
.btn-signal:hover { background: #2AA6FF; }
.on-paper .btn-primary { background: var(--ink); color: #fff; }
.on-paper .btn-primary:hover { background: #222; }
.on-paper .btn-secondary { background: var(--paper-2); color: var(--ink); box-shadow: none; }
.on-paper .btn-secondary:hover { background: #E6E4DF; }

/* Text link with arrow */
.more-link { display: inline-flex; align-items: center; gap: 6px; color: var(--fog); text-decoration: none; font-size: 15px; transition: color .15s; }
.more-link:hover { color: var(--snow); }
.more-link .i { width: 16px; height: 16px; transition: transform .15s var(--ease); }
.more-link:hover .i { transform: translateX(2px); }

/* Copyable command */
.cmd {
  display: inline-flex; align-items: center; gap: 12px;
  height: 48px; padding: 0 6px 0 18px;
  background: var(--night); border: 1px solid var(--line-2); border-radius: var(--r-pill);
  font: 500 14px/1 var(--f-mono); color: var(--snow);
  cursor: pointer; text-align: left;
}
.cmd .prompt { color: var(--mute); }
.cmd .copy-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--mute); transition: color .15s, background-color .15s; }
.cmd:hover .copy-ic { color: var(--snow); background: var(--deep); }
.cmd[data-copied] .copy-ic { color: var(--pad); }

/* ---------- cards */
.card { background: var(--night); border: 1px solid var(--line); border-radius: var(--r-lg); }
.on-paper .card, .card.paper { background: var(--paper); border-color: transparent; color: var(--ink); }

/* Spec tag: the blue size label from the product */
.spec-tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px;
  background: var(--signal); color: var(--ink);
  font: 500 11px/1 var(--f-mono); white-space: nowrap;
}

/* ---------- layout */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- rulers (PX.rulers in pixel.js, enabled with <body data-px-rulers>) */
.px-rulers-on body { padding-left: 20px; }
.px-ruler { background: var(--void); }
.px-ruler canvas { display: block; }
.px-ruler-x {
  position: sticky; z-index: 49; height: 20px; margin-left: -20px;
  display: flex; box-shadow: inset 0 -1px 0 var(--line);
}
.px-ruler-x canvas { flex: 1; min-width: 0; height: 20px; }
.px-ruler-corner {
  flex: none; width: 20px; height: 20px; display: grid; place-items: center;
  font: 500 7px/1 var(--f-mono); letter-spacing: .04em; color: var(--mute);
  box-shadow: inset -1px -1px 0 var(--line);
}
.px-ruler-y {
  position: fixed; z-index: 48; left: 0; top: 84px; bottom: 0; width: 20px;
  box-shadow: inset -1px 0 0 var(--line);
}
.px-ruler-y canvas { width: 20px; height: 100%; }
.px-ruler[hidden] { display: none; }
