/* ==========================================================================
   lr-core.css — the 2026 design system, foundation layer.

   Loaded by EVERY page (new-style and legacy). Holds only things that are safe on
   any markup: tokens, base typography, focus/selection, the grid background, and the
   few primitives (.wrap, .card, .section-label) every layout is built from.

   Layers (load in this order):
     lr-core.css        tokens + base + background grid       (all pages)
     lr-components.css  nav, buttons, tags, footer, reveal    (new-style markup)
     lr-legacy.css      maps the old Webflow class names      (legacy markup only)

   Everything is a multiple of 16px: the page sits on a 16px grid (see js/lr-layout.js,
   which sets --wrap-w / --wrap-x / --gx so the column and background lines coincide).
   ========================================================================== */

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --u: 16px;

  /* Surfaces */
  --bg: #08090a;
  --card: #0c0d0f;
  --surface-2: rgba(255, 255, 255, 0.05);
  --surface-3: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Text */
  --text: #f7f8f8;
  --text-2: #d0d6e0;
  --text-3: #8a8f98;
  --text-4: #62666d;

  /* Accents */
  --accent: #7c84f0;
  --accent-2: #c7ccff;
  --accent-soft: rgba(124, 132, 240, 0.12);
  --amber: #ffcf70;
  --amber-soft: rgba(255, 207, 112, 0.10);
  --green: #7dffb0;
  --green-soft: rgba(125, 255, 176, 0.08);

  /* Background grid */
  --grid: hsl(220 5% 11%);
  --grid-hot: hsl(220 8% 24%);

  /* Type */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --display-tracking: -0.03em;
  --display-weight: 500;

  --read: 704px;           /* reading column: 44 cells */
  --radius: 8px;

  /* Cursor spotlight position (set by script) */
  --mx: -9999px;
  --my: -9999px;
}

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  position: relative; margin: 0;
  background: var(--bg); color: var(--text-2);
  font-family: var(--font-body); font-size: 16px; line-height: 32px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: rgba(124, 132, 240, 0.35); color: #fff; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display); font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking); color: var(--text); margin: 0;
}
p, blockquote, ul, ol { margin: 0; }
b, strong { color: var(--text); font-weight: 600; }
.bl-probe { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Grid-true borders: the pseudo-border extends 1px right/down so every edge sits on a grid line */
.card, .btn-secondary, .tag, .pill, .switch, .icon, .frame, .kbd, .seg, .dot-btn {
  position: relative;
}
.card::before, .btn-secondary::before, .tag::before, .pill::before, .switch::before,
.icon::before, .frame::before, .kbd::before, .seg::before, .dot-btn::before {
  content: ""; position: absolute; inset: 0 -1px -1px 0;
  border: 1px solid var(--bc, var(--border)); border-style: var(--bs, solid);
  border-radius: inherit; pointer-events: none; z-index: 3; transition: border-color .2s;
}
.sep-top { box-shadow: inset 0 1px 0 var(--border); }

/* ==========================================================================
   Background: scrolling grid, cursor spotlight, light traces
   (markup: .bg > .grid-layer + .grid-spot, .lights-layer > canvas#lights, .vignette)
   ========================================================================== */
.bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.grid-layer, .grid-spot {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: var(--u) var(--u);
  background-position: var(--gx, 0px) 0;
}
.grid-spot {
  background-image:
    linear-gradient(to right, var(--grid-hot) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-hot) 1px, transparent 1px);
  -webkit-mask-image: radial-gradient(440px circle at var(--mx) var(--my), #000, transparent 70%);
          mask-image: radial-gradient(440px circle at var(--mx) var(--my), #000, transparent 70%);
  transition: opacity .3s;
}
.grid-spot.off { opacity: 0; }
.lights-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#lights { position: absolute; inset: 0; width: 100%; height: 100%; }
.vignette {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  --edge: clamp(32px, 4vw, 64px);
  background:
    linear-gradient(90deg,
      var(--bg) 0, var(--bg) 16px, transparent var(--edge),
      transparent calc(100% - var(--edge)), var(--bg) calc(100% - 16px), var(--bg) 100%),
    radial-gradient(ellipse 85% 75% at 50% 40%, transparent 15%, rgba(8, 9, 10, 0.6) 55%, var(--bg) 95%);
}
.page { position: relative; z-index: 1; overflow-x: clip; } /* safety net: nothing may cause sideways scroll */

/* ==========================================================================
   Layout primitives
   ========================================================================== */
.wrap { width: var(--wrap-w); margin-left: var(--wrap-x); }
.read { max-width: var(--read); }
.mono { font-family: var(--font-mono); }
.section-label {
  display: block; font-family: var(--font-mono); font-size: 12px; line-height: 16px;
  letter-spacing: 0.04em; color: var(--accent); text-transform: uppercase; margin-bottom: 32px;
}
.section-label::before { content: ""; display: inline-block; width: 16px; height: 1px; background: var(--accent); vertical-align: middle; margin-right: 16px; }
.section-label.bare::before { display: none; }
.card { background: var(--card); border-radius: var(--radius); }
.card:hover { --bc: var(--border-strong); }
