/* Overglow — site.css
   One stylesheet for every page. No external requests. */

@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-tight-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/inter-tight-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-tight-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  --bg: #0b0c0d;
  --bg-2: #111214;
  --fg: #ecebe6;
  --fg-2: #b4b3ae;
  --dim: #85878b;
  --line: #222428;
  --line-2: #2e3135;
  --accent: #ff6b35;
  --accent-a: rgba(255, 107, 53, 0.55);
  --accent-b: rgba(255, 107, 53, 0.12);

  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --step-4: clamp(2.75rem, 1.2rem + 6.4vw, 8.25rem);

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #0b0c0d; }

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--accent); }

:focus { outline: none; }
:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

.mono {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.01em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--mono);
  font-size: var(--step--1);
}
.skip:focus { top: 12px; }

/* ---------- background field ---------- */

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* ---------- frame ---------- */

.frame {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* crop marks in the four corners of the viewport */
.crop {
  position: fixed;
  width: 14px; height: 14px;
  z-index: 2;
  pointer-events: none;
  border-color: var(--line-2);
  border-style: solid;
  border-width: 0;
}
.crop.tl { top: 10px; left: 10px; border-top-width: 1px; border-left-width: 1px; }
.crop.tr { top: 10px; right: 10px; border-top-width: 1px; border-right-width: 1px; }
.crop.bl { bottom: 10px; left: 10px; border-bottom-width: 1px; border-left-width: 1px; }
.crop.br { bottom: 10px; right: 10px; border-bottom-width: 1px; border-right-width: 1px; }

/* ---------- header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 0;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.mark svg { width: 18px; height: 18px; flex: none; }
.mark:hover { color: var(--fg); }
.mark:hover svg .core { fill: var(--accent); }

.dbg-toggle {
  appearance: none;
  background: none;
  border: 0;
  padding: 6px 0 6px 8px;
  margin: 0;
  color: var(--dim);
  font: inherit;
  font-family: var(--mono);
  font-size: var(--step--1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.dbg-toggle:hover { color: var(--fg); }
.dbg-toggle .kbd {
  border: 1px solid var(--line-2);
  padding: 1px 5px;
  font-size: 0.6875rem;
  color: var(--dim);
}
.dbg-toggle[aria-pressed="true"] { color: var(--accent); }
.dbg-toggle[aria-pressed="true"] .kbd { border-color: var(--accent-a); color: var(--accent); }

/* ---------- home ---------- */

.home main { flex: 1; display: flex; flex-direction: column; }

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(72px, 14vh, 180px) 0 clamp(56px, 10vh, 120px);
}

.eyebrow {
  margin: 0 0 clamp(20px, 3vw, 36px);
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--accent);
  flex: none;
}

.hero h1 {
  margin: 0;
  font-weight: 500;
  font-size: var(--step-4);
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.hero h1 .l2 { color: var(--fg-2); }

.lede {
  margin: clamp(28px, 4vw, 48px) 0 0;
  max-width: 34ch;
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--fg-2);
  letter-spacing: -0.01em;
}

/* outliner: a hairline table of three rows, not cards */
.outliner {
  border-top: 1px solid var(--line);
  margin: 0 0 clamp(40px, 8vh, 96px);
}
.outliner ol { list-style: none; margin: 0; padding: 0; }
.outliner li {
  display: grid;
  grid-template-columns: 4ch minmax(7rem, 1fr) 2.2fr;
  gap: 8px 24px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.outliner .n { font-family: var(--mono); font-size: var(--step--1); color: var(--dim); }
.outliner .k { font-weight: 500; font-size: var(--step-1); letter-spacing: -0.01em; }
.outliner .v { color: var(--fg-2); }
.outliner .v a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--accent-a);
}
.outliner .v a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ---------- footer ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--dim);
}
.home .foot { border-top: 0; padding-top: 0; }
.foot nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot a:hover { color: var(--fg); }
.foot a[aria-current="page"] { color: var(--fg); }
.foot .coords { font-variant-numeric: tabular-nums; }

/* ---------- legal / document pages ---------- */

.doc main { flex: 1; padding: clamp(56px, 10vh, 120px) 0 clamp(56px, 8vh, 96px); }
.doc article { max-width: 68ch; }
.doc .eyebrow { margin-bottom: 20px; }
.doc h1 {
  margin: 0 0 20px;
  font-weight: 500;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.doc .summary {
  margin: 0 0 48px;
  padding: 12px 0 12px 16px;
  border-left: 1px solid var(--accent-a);
  color: var(--fg-2);
  font-size: 0.9375rem;
}
.doc .summary span { font-family: var(--mono); font-size: 0.75rem; color: var(--dim); margin-right: 8px; }
.doc h2 {
  margin: 48px 0 12px;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.doc h2 .n { font-family: var(--mono); font-weight: 400; font-size: var(--step--1); color: var(--dim); }
.doc p, .doc li { color: var(--fg-2); }
.doc p { margin: 0 0 14px; }
.doc ul { margin: 0 0 14px; padding-left: 1.1em; }
.doc li { margin: 0 0 6px; }
.doc li::marker { color: var(--dim); }
.doc strong { color: var(--fg); font-weight: 500; }
.doc article a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--accent-a);
  overflow-wrap: anywhere;
}
.doc article a:hover { color: var(--accent); }
.doc dl {
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: minmax(9rem, max-content) 1fr;
  gap: 8px 24px;
}
.doc dt { font-family: var(--mono); font-size: var(--step--1); color: var(--dim); padding-top: 2px; }
.doc dd { margin: 0; color: var(--fg); }
.doc .updated { margin-top: 56px; font-family: var(--mono); font-size: var(--step--1); color: var(--dim); }

/* ---------- 404 ---------- */

.e404 main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 80px 0; }
.e404 .missing {
  width: 72px; height: 72px;
  margin-bottom: 36px;
  background-color: #0b0c0d;
  background-image:
    linear-gradient(45deg, var(--accent) 25%, transparent 25%, transparent 75%, var(--accent) 75%),
    linear-gradient(45deg, var(--accent) 25%, transparent 25%, transparent 75%, var(--accent) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  outline: 1px solid var(--accent-a);
  outline-offset: 6px;
}
.e404 h1 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(2.5rem, 1.3rem + 5vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.045em;
}
.e404 .err { margin: 28px 0 0; color: var(--dim); }
.e404 .err b { color: var(--accent); font-weight: 400; }
.e404 .back { margin-top: 36px; }
.e404 .back a { text-decoration: underline; text-decoration-color: var(--accent-a); }

/* ---------- debug view ---------- */

html.is-debug, html.is-debug body { cursor: crosshair; }
html.is-debug a, html.is-debug button { cursor: pointer; }
html.is-debug .crop { border-color: var(--accent-a); }

#dbg[hidden] { display: none; }
#dbg {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  color: var(--accent);
}

.dbg-boxes { position: absolute; inset: 0; overflow: hidden; }
.dbg-box {
  position: absolute;
  border: 1px dashed var(--accent-a);
}
.dbg-box.is-pick {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-b);
}
.dbg-box > span {
  position: absolute;
  left: -1px;
  bottom: 100%;
  padding: 1px 5px;
  background: var(--accent);
  color: #0b0c0d;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.5;
}
.dbg-box > span.r { left: auto; right: -1px; }

.dbg-hair-x, .dbg-hair-y {
  position: absolute;
  background: rgba(255, 107, 53, 0.35);
}
.dbg-hair-x { left: 0; right: 0; height: 1px; top: 0; }
.dbg-hair-y { top: 0; bottom: 0; width: 1px; left: 0; }
.dbg-cursor {
  position: absolute;
  top: 0; left: 0;
  padding: 1px 5px;
  white-space: nowrap;
  color: var(--accent);
  background: rgba(11, 12, 13, 0.85);
  font-variant-numeric: tabular-nums;
}

.dbg-hud {
  position: absolute;
  top: 72px;
  right: var(--gutter);
  min-width: 220px;
  padding: 10px 12px;
  background: rgba(11, 12, 13, 0.9);
  border: 1px solid var(--line-2);
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.dbg-hud .t { color: var(--accent); margin-bottom: 6px; display: flex; justify-content: space-between; gap: 16px; }
.dbg-hud dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 1px 14px; }
.dbg-hud dt { color: var(--dim); }
.dbg-hud dd { margin: 0; color: var(--fg); white-space: nowrap; }
.dbg-hud .graph { display: block; margin-top: 8px; width: 100%; height: 24px; }

.dbg-console {
  position: absolute;
  left: var(--gutter);
  bottom: 24px;
  width: min(440px, calc(100% - 2 * var(--gutter)));
  background: rgba(11, 12, 13, 0.94);
  border: 1px solid var(--line-2);
  pointer-events: auto;
  color: var(--fg-2);
  font-size: 12px;
}
.dbg-console .log {
  margin: 0;
  padding: 10px 12px 4px;
  max-height: 168px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
}
.dbg-console .log .in { color: var(--dim); }
.dbg-console .log .ok { color: var(--fg); }
.dbg-console .log .err { color: var(--accent); }
.dbg-console .log a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent-a); }
.dbg-console form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 10px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 8px;
}
.dbg-console label { color: var(--accent); }
.dbg-console input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  color: var(--fg);
  font: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
  line-height: 1.2;
  padding: 2px 0;
  caret-color: var(--accent);
}
@media (min-width: 640px) { .dbg-console input { font-size: 12px; } }
.dbg-console input:focus-visible { outline: none; }
.dbg-console form:focus-within { border-top-color: var(--accent-a); }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .outliner li { grid-template-columns: 3ch 1fr; }
  .outliner .v { grid-column: 2; }
  .doc dl { grid-template-columns: 1fr; gap: 2px; }
  .doc dd { margin-bottom: 10px; }
  .dbg-hud { top: 64px; right: var(--gutter); min-width: 0; padding: 6px 8px; font-size: 10px; }
  .dbg-hud .t { margin-bottom: 2px; }
  .dbg-hud .opt, .dbg-hud .graph { display: none; }
  .dbg-console { bottom: 16px; font-size: 11px; }
  .dbg-console .log { max-height: 84px; padding-top: 6px; }
}

@media (max-width: 420px) {
  .dbg-toggle .kbd { display: none; }
  .foot { font-size: 0.75rem; }
}

@media (hover: none) {
  .dbg-hair-x, .dbg-hair-y, .dbg-cursor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  #field, #dbg, .crop, .dbg-toggle { display: none !important; }
  body, html { background: #fff; color: #000; }
  .doc p, .doc li, .doc dd, .doc .summary { color: #000; }
}

/* leave room so the console never permanently hides the last lines */
html.is-debug .frame { padding-bottom: 140px; }
@media (max-width: 720px) { html.is-debug .frame { padding-bottom: 150px; } }
