/* beg1nner shared design tokens & components */

/* ============================================================
   Self-hosted IBM Plex Mono (latin subset, 4 weights).
   Replaces the Google Fonts <link>: removes 2 third-party DNS
   lookups, ~50-150ms on cold connections, and the third-party
   pixel. Files in /fonts are ~10KB each = ~40KB total.
   ============================================================ */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/IBMPlexMono-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/IBMPlexMono-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/IBMPlexMono-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/IBMPlexMono-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg:        #0A0A0A;
  --surface:   #141414;
  --surface-2: #1B1B1B;
  --border:    #2A2A2A;
  --border-2:  #3A3A3A;
  --text:      #F5F5F0;
  --muted:     #888888;
  --muted-2:   #5A5A5A;
  --accent:    #D4FF00;
  --accent-h:  #BFED00;
  --accent-dim: rgba(212, 255, 0, 0.12);
  --danger:    #FF4D4D;

  --font-display: 'IBM Plex Mono', ui-monospace, monospace;
  --font-body:    'IBM Plex Mono', ui-monospace, monospace;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --grid-size: 28px;
  --grid-color: rgba(255, 255, 255, 0.045);

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;

  --container: 1240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ============================================================
   Theme + accent SWITCH ANIMATIONS
   The .palette-shift class is added briefly when the user
   changes theme or accent. While present, almost every visual
   property tweens — so the page bleeds from one palette to the
   next. Removed after the transition completes so normal
   hover/state transitions aren't affected.
   ============================================================ */
body.palette-shift,
body.palette-shift *,
body.palette-shift *::before,
body.palette-shift *::after {
  transition:
    background-color 700ms cubic-bezier(0.4, 0, 0.2, 1),
    background-image 700ms cubic-bezier(0.4, 0, 0.2, 1),
    color 700ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 700ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 700ms cubic-bezier(0.4, 0, 0.2, 1),
    fill 700ms cubic-bezier(0.4, 0, 0.2, 1),
    stroke 700ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 700ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Color wave overlay — slow 4-color sweep animated via shared.js */
.color-wave {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.32;
  background: linear-gradient(
    to right,
    var(--wave-from, transparent) 0%,
    var(--wave-from, transparent) var(--wave-edge-l, 0%),
    var(--wave-to,   transparent) var(--wave-edge-r, 0%),
    var(--wave-to,   transparent) 100%
  );
  /* Soft blur on the edge for extra creaminess */
  filter: blur(2px);
}
body[data-theme="light"] .color-wave { opacity: 0.28; }

/* Animated dot-grid background — global */
.bg-grid {
  position: fixed;
  inset: -50px;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, var(--grid-color) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  animation: gridPan 60s linear infinite;
  opacity: 1;
  transition: opacity .3s;
}
.bg-grid.style-lines {
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
}
.bg-grid.style-nonogram {
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px),
    linear-gradient(rgba(212,255,0,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,255,0,.04) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size), var(--grid-size) var(--grid-size), calc(var(--grid-size)*5) calc(var(--grid-size)*5), calc(var(--grid-size)*5) calc(var(--grid-size)*5);
}
.bg-grid.style-off { opacity: 0; }

@keyframes gridPan {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(var(--grid-size), var(--grid-size)); }
}

/* Vignette + scanline texture overlay */
.bg-vignette {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at center, transparent 0%, transparent 50%, rgba(0,0,0,.7) 100%);
}

main, header, footer { position: relative; z-index: 1; }

/* Custom cursor — desktop only */
@media (hover: hover) and (pointer: fine) {
  body.cursor-on { cursor: none; }
  body.cursor-on a, body.cursor-on button, body.cursor-on [role="button"], body.cursor-on input, body.cursor-on textarea, body.cursor-on select { cursor: none; }
  .cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: width .15s, height .15s, background .15s;
  }
  .cursor-dot.hover {
    width: 18px; height: 18px;
    background: var(--accent);
  }
  body:not(.cursor-on) .cursor-dot { display: none; }
}
@media not all and (hover: hover) {
  .cursor-dot { display: none; }
}

/* Typography */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}

h1 { font-size: clamp(40px, 7vw, 96px); line-height: 1.02; letter-spacing: -0.03em; }
h2 { font-size: clamp(28px, 4vw, 48px); line-height: 1.1; letter-spacing: -0.02em; }
h3 { font-size: clamp(20px, 2.4vw, 28px); line-height: 1.2; }
h4 { font-size: 18px; line-height: 1.3; }

p { margin: 0; }
a { color: var(--text); text-decoration: none; }

.one { color: var(--accent); font-style: normal; }

.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* Marker-pen highlight chip — usable on arbitrary text spans.
   Page-scoped overrides (e.g. .slogan-block .q .hl) still win where defined. */
.hl {
  background: var(--accent);
  color: var(--bg);
  padding: 0.04em 0.28em;
  border-radius: 3px;
  font-style: normal;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
body[data-theme="light"] .hl {
  color: #1A1814;
  box-shadow: 0 1px 0 rgba(20, 16, 8, 0.12);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.bracket {
  font-family: var(--font-mono);
  color: var(--accent);
}

/* Layout */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) {
  .container { padding: 0 20px; }
}

section { padding: 96px 0; position: relative; }
@media (max-width: 720px) {
  section { padding: 64px 0; }
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.section-head .num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 0.1em;
}
.section-head h2 { flex: 1; min-width: 280px; }
.section-head p.lede {
  color: var(--muted);
  max-width: 360px;
  font-size: 15px;
}

/* Navbar */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}
.logo .one {
  text-shadow: 0 0 18px rgba(212, 255, 0, 0.6);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 14px;
  color: var(--muted);
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .15s, background .15s;
}
.nav-links a .num { color: var(--muted-2); font-size: 11px; }
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a:hover .num { color: var(--accent); }
.nav-links a.active { color: var(--text); }
.nav-links a.active .num { color: var(--accent); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: var(--r-sm);
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: rgba(10,10,10,0.96);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 8px;
  }
  .nav-links.open a { padding: 14px 16px; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all .15s ease;
  text-align: left;
  white-space: nowrap;
}
.btn::before { content: '[ '; color: var(--muted); }
.btn::after  { content: ' ]'; color: var(--muted); }
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.btn:hover::before, .btn:hover::after { color: var(--accent); }
.btn.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn.primary::before, .btn.primary::after { color: var(--bg); opacity: .5; }
.btn.primary:hover {
  background: var(--accent-h);
  color: var(--bg);
  transform: translateY(-1px);
  box-shadow: 0 8px 32px -8px rgba(212,255,0,.5);
}
.btn.primary:hover::before, .btn.primary:hover::after { color: var(--bg); }
.btn.bare {
  background: transparent;
  border-color: transparent;
  padding: 8px 12px;
}
.btn.bare:hover { background: var(--surface); }

/* Cards */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 28px;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .2s ease;
}
.card:hover { border-color: var(--border-2); }
.card:hover::before { transform: scaleY(1); }
.card.bleed:hover {
  background: linear-gradient(90deg, rgba(212,255,0,.06) 0%, var(--surface) 40%);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--muted);
  background: var(--bg);
}
.badge.live    { color: var(--accent); border-color: rgba(212,255,0,.3); }
.badge.live::before { content: ''; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 8px var(--accent); }
.badge.beta    { color: #FFC857; border-color: rgba(255,200,87,.25); }
.badge.soon    { color: var(--muted); }
.badge.platform{ color: var(--muted); }

/* Terminal block */
.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  overflow: hidden;
}
.terminal-bar {
  background: var(--surface-2);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.terminal-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); }
.terminal-body { padding: 18px 20px; min-height: 140px; }
.terminal-body .line { color: var(--muted); line-height: 1.7; }
.terminal-body .line .prompt { color: var(--accent); margin-right: 10px; }
.terminal-body .line .out { color: var(--text); }
.terminal-body .caret {
  display: inline-block;
  width: 8px; height: 16px;
  background: var(--accent);
  vertical-align: -3px;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Footer */
footer.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  position: relative;
  z-index: 1;
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.footer-inner > div:nth-child(2) {
  text-align: center;
  font-family: var(--font-display);
  color: var(--muted);
  font-size: 14px;
}
.footer-inner > div:nth-child(3) {
  text-align: right;
}
.footer-links {
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }
.footer-tag {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; text-align: left !important; }
  .footer-inner > div:nth-child(2), .footer-inner > div:nth-child(3) { text-align: left !important; }
  .footer-links { justify-content: flex-start; }
}

/* "1" glow utility */
.glow1 { color: var(--accent); text-shadow: 0 0 24px rgba(212, 255, 0, 0.4); }

/* Entry animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal { animation: fadeUp .5s ease both; }
.reveal.d1 { animation-delay: .08s; }
.reveal.d2 { animation-delay: .16s; }
.reveal.d3 { animation-delay: .24s; }
.reveal.d4 { animation-delay: .32s; }
.reveal.d5 { animation-delay: .40s; }

/* Konami: rain of 1s */
.konami-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9000;
}
.konami-rain span {
  position: absolute;
  top: -40px;
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(212,255,0,.6);
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh); opacity: 0; }
}

.konami-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  z-index: 9001;
  animation: toastIn .3s ease both, toastOut .3s ease 2.5s forwards;
  box-shadow: 0 12px 40px -10px rgba(212,255,0,.5);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, 20px); } }

/* Form elements */
input[type="text"], input[type="email"], textarea, select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  border-radius: var(--r-sm);
  width: 100%;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
label.field {
  display: block;
  margin-bottom: 16px;
}
label.field span {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ASCII separator */
.ascii-sep {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: 0.4em;
  margin: 64px 0;
  user-select: none;
}

/* Selection */
::selection { background: var(--accent); color: var(--bg); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* ============================================================
   LIGHT THEME — "indie zine on warm paper"
   Not a dark-mode inversion. It has its own posture:
     · warm cream paper background (not corporate white)
     · soft real shadows on cards (paper depth)
     · subtle paper-grain noise via SVG filter
     · graph-paper grid (a hair more visible than dark)
     · acid yellow accent used as HIGHLIGHTS and CHIPS, never text-on-white
     · the "1" is a yellow marker-pen chip — punkier than dark's glow
     · terminal blocks + iPhone mocks STAY DARK (they depict dark surfaces)
   ============================================================ */
body[data-theme="light"] {
  --bg:        #F6F2E6;   /* warm eggshell paper */
  --surface:   #FFFFFF;   /* paper card */
  --surface-2: #EEE8D4;   /* deeper cream */
  --border:    #D8CFB4;   /* warm tan hairline */
  --border-2:  #B8AC8C;   /* deeper tan */
  --text:      #1A1814;   /* warm ink */
  --muted:     #6B6356;   /* warm mid-gray */
  --muted-2:   #ADA48F;   /* warm light-gray */
  --accent:    #D4FF00;
  --accent-h:  #BFED00;
  --accent-dim: rgba(212, 255, 0, 0.22);
  --danger:    #C13030;

  --grid-color: rgba(20, 16, 8, 0.06);

  /* Paper shadows — only in light theme */
  --shadow-sm: 0 1px 0 rgba(20, 16, 8, 0.04), 0 2px 8px -2px rgba(20, 16, 8, 0.06);
  --shadow-md: 0 1px 0 rgba(20, 16, 8, 0.04), 0 4px 16px -4px rgba(20, 16, 8, 0.08), 0 16px 40px -12px rgba(20, 16, 8, 0.06);
  --shadow-lg: 0 1px 0 rgba(20, 16, 8, 0.04), 0 8px 24px -6px rgba(20, 16, 8, 0.10), 0 24px 60px -18px rgba(20, 16, 8, 0.08);
}

/* Subtle paper-grain noise layered over the whole page */
body[data-theme="light"]::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.09  0 0 0 0 0.06  0 0 0 0.12 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

body[data-theme="light"] .bg-vignette {
  background:
    radial-gradient(ellipse at top left, rgba(212, 255, 0, 0.05) 0%, transparent 35%),
    radial-gradient(ellipse at center, transparent 0%, transparent 60%, rgba(20, 16, 8, 0.08) 100%);
}

/* Grid pattern reads as graph paper, not dot grid */
body[data-theme="light"] .bg-grid { opacity: 0.85; }
body[data-theme="light"] .bg-grid.style-lines {
  background-image:
    linear-gradient(rgba(20, 16, 8, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 16, 8, 0.04) 1px, transparent 1px);
}

/* "1" highlight as a marker-pen chip — yellow bg, ink digit.
   Rendered as a pseudo-element so the chip hugs the digit's cap-height
   instead of spanning the full line-box (which on tight line-heights
   bleeds into the line above). */
/* ════════════════════════════════════════════════════════════════════════════
 * "1" HIGHLIGHT CHIP — LIGHT THEME
 *
 * To adjust the chip yourself, change the values in --chip-* below.
 * All values are in `em` so they scale with font-size automatically.
 *
 * Visual model — the chip is drawn by the ::before pseudo BEHIND the digit:
 *
 *     ┌──────────────────────────┐  ← inline-block top  (y = 0em)
 *     │       chip-pad-top       │
 *     │   ┌──────────────────┐   │  ← chip top
 *     │   │    chip-inset-x  │   │
 *     │   │  ┌────────────┐  │   │  ← chip inner area (where the "1" sits)
 *     │   │  │      1     │  │   │
 *     │   │  │      1     │  │   │
 *     │   │  │      1     │  │   │
 *     │   │  └────────────┘  │   │
 *     │   │                  │   │
 *     │   └──────────────────┘   │  ← chip bottom
 *     │      chip-pad-bottom     │
 *     └──────────────────────────┘  ← inline-block bottom (y = 1em with line-height: 1)
 *
 *      ↑                        ↑
 *      chip-margin from "g"     chip-margin from "n"
 *
 * ── Tunable parameters ──────────────────────────────────────────────────────
 *   --chip-pad-top       space ABOVE the chip (from inline-block top edge)
 *                        ↑ INCREASE this to move the chip DOWN
 *                        ↓ DECREASE this to move the chip UP
 *
 *   --chip-pad-bottom    space BELOW the chip (from inline-block bottom edge)
 *                        ↑ INCREASE this to move the chip UP / make it shorter
 *                        ↓ DECREASE this to move the chip DOWN / make it taller
 *
 *   --chip-inset-x       inset on LEFT and RIGHT of the chip
 *                        ↑ INCREASE to make the chip NARROWER
 *                        ↓ DECREASE (can go negative) to make it WIDER
 *
 *   --chip-margin-x      breathing room from neighbor letters ("g", "n")
 *                        ↑ INCREASE to move the chip AWAY from neighbors
 *
 *   --chip-radius        corner roundness
 *
 *   --chip-shadow-color  drop shadow color (the marker-pen "ink baseline")
 *
 * Hard refresh (⌘+Shift+R) after each change to bust the browser cache.
 * ════════════════════════════════════════════════════════════════════════════ */
body[data-theme="light"] .one,
body[data-theme="light"] .glow1 {
  /* ─── EDIT THESE TO TUNE THE CHIP ─── */
  --chip-pad-top:    -0.08em;
  --chip-pad-bottom: -0.1em;
  --chip-inset-x:    -0.02em;
  --chip-margin-x:   0.05em;
  --chip-radius:     2px;
  --chip-shadow:     0 1px 0 rgba(20, 16, 8, 0.12);
  /* ─── (don't touch below) ─────────── */

  display: inline-block;
  width: 1ch;
  text-align: center;
  color: #1A1814;
  background: transparent;
  text-shadow: none;
  font-style: normal;
  padding: 0;
  margin: 0 var(--chip-margin-x);
  position: relative;
  isolation: isolate;
  vertical-align: baseline;
}
body[data-theme="light"] .one::before,
body[data-theme="light"] .glow1::before {
  content: '';
  position: absolute;
  inset: var(--chip-pad-top) var(--chip-inset-x) var(--chip-pad-bottom) var(--chip-inset-x);
  background: var(--accent);
  border-radius: var(--chip-radius);
  z-index: -1;
  box-shadow: var(--chip-shadow);
}

/* Logo "1" override — uses the same variables but with slightly tighter spacing
   because the logo is rendered at a smaller font-size. */
body[data-theme="light"] .logo .one {
  --chip-pad-top:    0.22em;
  --chip-pad-bottom: 0.05em;
  --chip-margin-x:   0.06em;
  --chip-shadow:     0 1px 0 rgba(20, 16, 8, 0.15);
}

/* Accent text — a deeper olive on white for legibility, NOT the bright yellow */
body[data-theme="light"] .accent { color: #4A6A00; }
body[data-theme="light"] .btn.primary .accent,
body[data-theme="light"] .badge .accent { color: inherit; }

/* Selection */
body[data-theme="light"] ::selection { background: var(--accent); color: #1A1814; }

/* Eyebrow + small mono labels — keep them warm gray */
body[data-theme="light"] .eyebrow { color: var(--muted); }

/* Cursor — drop the difference blend; small ink dot reads on paper */
body[data-theme="light"] .cursor-dot {
  background: #1A1814;
  mix-blend-mode: normal;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}
body[data-theme="light"] .cursor-dot.hover {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6), 0 0 0 4px rgba(20, 16, 8, 0.1);
}

/* Nav — translucent paper bar with subtle bottom rule */
body[data-theme="light"] .nav {
  background: rgba(246, 242, 230, 0.82);
  border-bottom-color: var(--border);
}
body[data-theme="light"] .nav-links a:hover { background: var(--surface); }
body[data-theme="light"] .nav-links a .num,
body[data-theme="light"] .nav-links a:hover .num,
body[data-theme="light"] .nav-links a.active .num { color: #4A6A00; }
body[data-theme="light"] .nav-toggle { background: var(--surface); }

/* Buttons — paper depth on ghost, kept yellow on primary */
body[data-theme="light"] .btn {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
body[data-theme="light"] .btn:hover {
  border-color: #1A1814;
  color: #1A1814;
  background: #FDFBF4;
  box-shadow: 0 1px 0 rgba(20,16,8,0.05), 0 6px 14px -4px rgba(20, 16, 8, 0.12);
}
body[data-theme="light"] .btn:hover::before,
body[data-theme="light"] .btn:hover::after { color: #4A6A00; }
body[data-theme="light"] .btn.primary {
  background: var(--accent);
  color: #1A1814;
  border-color: #BFED00;
  box-shadow: 0 1px 0 rgba(20,16,8,.05), 0 4px 12px -2px rgba(212, 255, 0, 0.45);
}
body[data-theme="light"] .btn.primary:hover {
  background: var(--accent-h);
  color: #1A1814;
  border-color: #A8D000;
  box-shadow: 0 1px 0 rgba(20,16,8,.06), 0 10px 24px -6px rgba(212, 255, 0, 0.55);
}
body[data-theme="light"] .btn.bare { background: transparent; box-shadow: none; }
body[data-theme="light"] .btn.bare:hover { background: var(--surface); }

/* Cards — white paper with soft shadow + retained accent left-bar on hover */
body[data-theme="light"] .card,
body[data-theme="light"] .value,
body[data-theme="light"] .stack-cat,
body[data-theme="light"] .tier,
body[data-theme="light"] .col,
body[data-theme="light"] .proj,
body[data-theme="light"] .puz-card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
body[data-theme="light"] .card:hover,
body[data-theme="light"] .proj:hover,
body[data-theme="light"] .puz-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Badges */
body[data-theme="light"] .badge {
  background: var(--surface);
  border-color: var(--border);
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}
body[data-theme="light"] .badge.live { color: #4A6A00; border-color: #B5D000; background: rgba(212, 255, 0, 0.18); }
body[data-theme="light"] .badge.beta { color: #8A5500; border-color: #E0B86A; background: rgba(255, 200, 87, 0.22); }

/* Form inputs */
body[data-theme="light"] input[type="text"],
body[data-theme="light"] input[type="email"],
body[data-theme="light"] textarea,
body[data-theme="light"] select {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
body[data-theme="light"] input:focus,
body[data-theme="light"] textarea:focus,
body[data-theme="light"] select:focus {
  border-color: #4A6A00;
  box-shadow: 0 0 0 3px rgba(212, 255, 0, 0.25);
}
body[data-theme="light"] input::placeholder,
body[data-theme="light"] textarea::placeholder { color: var(--muted-2); }

/* Manifesto block — cream paper with bigger highlight */
body[data-theme="light"] .manifesto {
  background:
    radial-gradient(ellipse at top right, rgba(212, 255, 0, 0.10) 0%, transparent 50%),
    var(--surface-2);
  border-top-color: var(--border);
  border-bottom-color: var(--border);
}
body[data-theme="light"] .manifesto::before {
  color: #1A1814;
  opacity: 0.05;
}
body[data-theme="light"] .manifesto .quote .hl {
  background: var(--accent);
  color: #1A1814;
  box-shadow: 0 2px 0 rgba(20, 16, 8, 0.15);
}

/* Terminal & code surfaces STAY DARK in light theme — they represent code */
body[data-theme="light"] .terminal {
  background: #0F0F0E;
  border-color: #2A2A2A;
  box-shadow: var(--shadow-md);
}
body[data-theme="light"] .terminal-bar { background: #1A1A18; color: #888; border-color: #2A2A2A; }
body[data-theme="light"] .terminal-body .line { color: #888; }
body[data-theme="light"] .terminal-body .line .out { color: #F5F5F0; }
body[data-theme="light"] .terminal-body .line .prompt { color: var(--accent); }
body[data-theme="light"] .terminal-body .caret { background: var(--accent); }

/* Pulse dot — keep as solid (no animation jitter on light, calmer) */
@media (prefers-reduced-motion: no-preference) {
  body[data-theme="light"] .hero-meta .pulse { animation-duration: 2.4s; }
}

/* Builder log — flip to paper card */
body[data-theme="light"] .builder-log {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}
body[data-theme="light"] .log-head {
  background: var(--surface-2);
  border-bottom-color: var(--border);
  color: var(--muted);
}
body[data-theme="light"] .log-list li { color: var(--muted); border-top-color: var(--border); }
body[data-theme="light"] .log-list li .what { color: var(--text); }

/* Newsletter — paper card with warm gradient corner + accent shadow */
body[data-theme="light"] .newsletter {
  background:
    radial-gradient(circle at 0% 0%, rgba(212, 255, 0, 0.14) 0%, transparent 45%),
    var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

/* Footer */
body[data-theme="light"] footer.site-footer { border-top-color: var(--border); }
body[data-theme="light"] .footer-tag { color: var(--muted); border-top-color: var(--border); }

/* Konami rain — darker yellow-green so 1's read on paper */
body[data-theme="light"] .konami-rain span {
  color: #4A6A00;
  text-shadow: 0 0 6px rgba(212, 255, 0, 0.6), 0 0 14px rgba(212, 255, 0, 0.35);
}

/* Quality-promise / pricing-tier accents that draw on rgba accent backgrounds */
body[data-theme="light"] .quality-promise {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}
body[data-theme="light"] .quality-promise .checklist li.no .label { color: var(--muted-2); }

/* Section header eyebrow numbers stay olive on light */
body[data-theme="light"] .section-head .num { color: #4A6A00; }
body[data-theme="light"] .ascii-sep { color: var(--muted-2); }

/* Scrollbars */
body[data-theme="light"] ::-webkit-scrollbar-track { background: var(--bg); }
body[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--border); }
body[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* Page-header on subpages */
body[data-theme="light"] .page-header { border-bottom-color: var(--border); }
body[data-theme="light"] .page-header .kicker { color: #4A6A00; }

/* Stats strip (apps page) */
body[data-theme="light"] .stats-strip {
  background: var(--surface);
  border-top-color: var(--border);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
body[data-theme="light"] .stat { border-right-color: var(--border); }

/* App-list rows (apps page) */
body[data-theme="light"] .app-row { border-bottom-color: var(--border); }
body[data-theme="light"] .app-row:hover {
  background: linear-gradient(90deg, rgba(212, 255, 0, 0.10) 0%, transparent 60%);
}
body[data-theme="light"] .app-row .icon { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-sm); }

/* Photo frame (about page) */
body[data-theme="light"] .photo-frame {
  background:
    repeating-linear-gradient(135deg, transparent 0 16px, rgba(212, 255, 0, 0.06) 16px 17px),
    var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}
body[data-theme="light"] .photo-frame::before { color: var(--muted-2); }
body[data-theme="light"] .photo-frame .corner { border-color: #4A6A00; }
body[data-theme="light"] .pixel-avatar .on { background: #4A6A00; }

/* Roadmap lanes + project cards */
body[data-theme="light"] .lane { border-right-color: var(--border); }
body[data-theme="light"] .roadmap-cta { border-color: var(--border-2); background: var(--surface); box-shadow: var(--shadow-sm); }
body[data-theme="light"] .last-update {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

/* Partnerships selective + past work */
body[data-theme="light"] .selective {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}
body[data-theme="light"] .selective .stats > div { border-color: var(--border); background: var(--bg); }
body[data-theme="light"] .pw-list { border-top-color: var(--border); }
body[data-theme="light"] .pw-list li { border-bottom-color: var(--border); }
body[data-theme="light"] .pw-list li .tag { background: var(--surface); border-color: var(--border); color: var(--muted); }
body[data-theme="light"] .pw-list li .out { color: #4A6A00; }

/* Contact page */
body[data-theme="light"] .contact-meta,
body[data-theme="light"] .form-shell {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}
body[data-theme="light"] .form-head { background: var(--surface-2); border-bottom-color: var(--border); color: var(--muted); }
body[data-theme="light"] .sent-flash { background: rgba(212, 255, 0, 0.18); border-color: #B5D000; color: #4A6A00; }

/* Legal docs */
body[data-theme="light"] .doc section.doc-sec { border-bottom-color: var(--border); }
body[data-theme="light"] .doc section.doc-sec .num { color: #4A6A00; }
body[data-theme="light"] .doc .toc { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-sm); }
body[data-theme="light"] .doc section.doc-sec .callout {
  background: var(--surface);
  border-left-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
body[data-theme="light"] .doc .updated { border-bottom-color: var(--border); }
body[data-theme="light"] .legal-list li a { border-bottom-color: var(--border); }
body[data-theme="light"] .legal-list li a:hover { background: linear-gradient(90deg, rgba(212, 255, 0, 0.10) 0%, transparent 60%); }
body[data-theme="light"] .plain-promise { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-md); }
body[data-theme="light"] .ex { background: var(--bg); border-color: var(--border); }
body[data-theme="light"] .ex .to { color: #4A6A00; }

/* ReceiptVault page bits that aren't part of the phone mock */
body[data-theme="light"] .feat-grid { border-top-color: var(--border); border-bottom-color: var(--border); }
body[data-theme="light"] .feat { border-right-color: var(--border); border-bottom-color: var(--border); }
body[data-theme="light"] .priv-callout { background: var(--surface); box-shadow: var(--shadow-md); }
body[data-theme="light"] .priv-callout .lock { color: #4A6A00; border-color: #4A6A00; background: rgba(212, 255, 0, 0.12); }

/* Minesweeper page chrome (board stays dark via .ms-board pin) */
body[data-theme="light"] .daily-seed { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-sm); }
body[data-theme="light"] .feat-row { border-top-color: var(--border); border-bottom-color: var(--border); }
body[data-theme="light"] .feat-row .feat { border-right-color: var(--border); }

/* Nonogram page chrome */
body[data-theme="light"] .ng-shell { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-md); }
body[data-theme="light"] .ng-toolbar .modes button { background: var(--bg); border-color: var(--border); color: var(--muted); }
body[data-theme="light"] .ng-grid .cell { background: #FDFBF4; border-color: var(--border); }

/* Tweaks panel itself */
body[data-theme="light"] .tweaks-panel {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-lg);
}
body[data-theme="light"] .tweaks-head { background: var(--surface-2); border-bottom-color: var(--border); }
body[data-theme="light"] .tweak-seg { background: var(--bg); border-color: var(--border); }
body[data-theme="light"] .tweak-seg button { color: var(--muted); }
body[data-theme="light"] .tweak-swatches button { border-color: var(--border); }
body[data-theme="light"] .tweak-swatches button.active { box-shadow: 0 0 0 2px var(--text); }
body[data-theme="light"] .tweak-toggle .sw { background: var(--bg); border-color: var(--border); }
body[data-theme="light"] .tweak-toggle .sw::after { background: var(--muted-2); }
