/* ==========================================================================
   RUG PATROL — base.css
   Design tokens, reset, typography, primitives.
   Palette is pulled from the night-town reference art: near-black navy
   ground, snow-white text, lamp amber, Robinhood green, rug red.
   ========================================================================== */

:root {
  /* --- surface ramp (dark, cold, night-town) --- */
  --bg:        #070B10;
  --bg-1:      #0B1119;
  --bg-2:      #111A25;
  --bg-3:      #18242F;
  --line:      #1E2C3A;
  --line-soft: #16212C;

  /* --- ink --- */
  --txt:       #E8EEF5;
  --txt-dim:   #8496A9;
  --txt-faint: #55677A;

  /* --- accents --- */
  --green:     #00E05A;   /* Robinhood green, lifted for dark ground */
  --green-dim: #0B8F42;
  --green-glow: rgba(0, 224, 90, 0.18);
  --amber:     #FFB454;   /* street-lamp light */
  --amber-dim: #8A5F22;
  --red:       #FF4D5E;   /* rug alert */
  --red-dim:   #8C2130;
  --ice:       #6FD3FF;   /* cold accent / links */

  /* --- type --- */
  --f-pixel: "Silkscreen", "Courier New", monospace;
  --f-head:  "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --f-mono:  "IBM Plex Mono", "Consolas", monospace;

  /* --- metrics --- */
  --wrap: 1180px;
  --gut: clamp(20px, 5vw, 56px);
  --r: 4px;          /* corners stay tight — this is a pixel project */
  --r-lg: 8px;

  /* --- motion --- */
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ========================= reset ========================= */

*, *::before, *::after { box-sizing: border-box; }

/* The UA rule for [hidden] is display:none, but ANY author `display` beats it
   regardless of specificity — so `.dlg { display: grid }` silently defeats
   `el.hidden = true`. Everything in this project toggles visibility with the
   hidden attribute, so it has to win. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--f-head);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, canvas, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

::selection { background: var(--green); color: #04140A; }

/* firefox + webkit scrollbar, kept dark so it doesn't flash white */
* { scrollbar-color: var(--line) transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--bg-1); }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: var(--bg-3); }

/* ========================= layout primitives ========================= */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.section {
  position: relative;
  padding-block: clamp(72px, 11vw, 140px);
  border-top: 1px solid var(--line-soft);
}

.section--flush { border-top: 0; }

/* numbered section header, in the spirit of the stockhunt / undead-fish
   numbered-block layout the brief pointed at */
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: clamp(28px, 4vw, 52px);
  flex-wrap: wrap;
}

.sec-num {
  font-family: var(--f-pixel);
  font-size: 13px;
  color: var(--green);
  letter-spacing: 0.06em;
  flex: none;
  padding-top: 6px;
}

.sec-title {
  font-size: clamp(30px, 5.2vw, 56px);
  text-transform: uppercase;
}

.sec-lede {
  color: var(--txt-dim);
  font-size: clamp(15px, 1.6vw, 18px);
  max-width: 62ch;
  margin-top: 14px;
  flex-basis: 100%;
}

/* ========================= type helpers ========================= */

.eyebrow {
  font-family: var(--f-pixel);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-faint);
}

.mono { font-family: var(--f-mono); }

.pixel { font-family: var(--f-pixel); letter-spacing: 0.04em; }

.hl-green { color: var(--green); }
.hl-amber { color: var(--amber); }
.hl-red   { color: var(--red); }
.dim      { color: var(--txt-dim); }

/* ========================= buttons ========================= */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--txt);
  --btn-bd: var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r);
  font-family: var(--f-pixel);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease),
              color 0.18s var(--ease), transform 0.08s var(--ease);
  white-space: nowrap;
}

.btn:hover { border-color: var(--txt-faint); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.btn--primary {
  --btn-bg: var(--green);
  --btn-fg: #04140A;
  --btn-bd: var(--green);
  font-weight: 700;
}
.btn--primary:hover {
  --btn-bg: #2BFF7E;
  --btn-bd: #2BFF7E;
  box-shadow: 0 0 0 4px var(--green-glow);
}

.btn--ghost { --btn-bd: var(--line); }
.btn--ghost:hover { --btn-bg: var(--bg-2); }

.btn--danger { --btn-bd: var(--red-dim); --btn-fg: var(--red); }
.btn--danger:hover { --btn-bg: rgba(255,77,94,0.09); --btn-bd: var(--red); }

.btn--sm { padding: 9px 14px; font-size: 10px; }

/* ========================= cards / panels ========================= */

.panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.panel--inset { background: var(--bg); }

/* thin top hairline used to "light" a panel like a lamp */
.panel--lit { position: relative; overflow: hidden; }
.panel--lit::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: 0.55;
}

/* ========================= tags ========================= */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--txt-dim);
  text-transform: uppercase;
}

.tag--live { border-color: var(--green-dim); color: var(--green); }
.tag--soon { border-color: var(--amber-dim); color: var(--amber); }
.tag--idea { border-color: var(--line); color: var(--txt-faint); }

.dot {
  width: 6px; height: 6px;
  border-radius: 99px;
  background: currentColor;
  flex: none;
}
.dot--pulse { animation: pulse 1.9s var(--ease) infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

/* ========================= reveal on scroll ========================= */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ========================= a11y ========================= */

.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;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 999;
  padding: 10px 16px;
  background: var(--green);
  color: #04140A;
  border-radius: var(--r);
  font-family: var(--f-pixel);
  font-size: 12px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }
