/* =================================================================
   CLAMP FORGE — style.css
   The Lab · dark arcade / retro-terminal. Dark only.
   Pixel type (Press Start 2P) for the masthead, HUD labels and panel
   numbers; mono for working values, code and metrics; sans for reading
   copy. Cyan = structure/inputs, magenta = intercept/preview accent,
   gold = values/copy, green = success/resolved live state.
   ================================================================= */

/* ---------- fonts (self-hosted, shared with the lab root) ---------- */
@font-face { font-family: "Press Start 2P"; font-style: normal; font-weight: 400; font-display: swap; src: url("/press-start-2p.woff2") format("woff2"); }
@font-face { font-family: "Press Start 2P Fallback"; src: local("Courier New"); size-adjust: 166.64%; ascent-override: 60%; descent-override: 0%; line-gap-override: 0%; }

/* ---------- tokens ---------- */
:root {
  --bg: #0a0a12;
  --surface: #12121d;
  --surface-2: #1a1a2a;
  --line: #28283c;
  --line-soft: #1f1f30;
  --control-line: #5e5e80;          /* >=3:1 against surface for inputs */
  --control-line-hover: #8484ad;
  --text: #e9e9f2;
  --dim: #9aa0b5;
  --dimmer: #6b7186;
  --cyan: #45f0ff;
  --magenta: #ff3d8b;
  --gold: #ffc857;
  --green: #41ff8b;
  --red: #ff5560;

  --pixel: "Press Start 2P", "Press Start 2P Fallback", "Courier New", monospace;
  --sans: -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 140ms;
  --dur-norm: 280ms;

  --glow-cyan: 0 0 14px rgba(69, 240, 255, 0.4);
  --glow-magenta: 0 0 14px rgba(255, 61, 139, 0.42);
  --glow-gold: 0 0 14px rgba(255, 200, 87, 0.4);
  --glow-green: 0 0 14px rgba(65, 255, 139, 0.42);

  --shell-max: 80rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  /* slider fill driven by JS (0–100) */
  --slider-progress: 50%;
}

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

html {
  color-scheme: dark;
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(1100px 480px at 50% -8%, rgba(69, 240, 255, 0.07), transparent 70%),
    radial-gradient(820px 520px at 100% 14%, rgba(255, 61, 139, 0.05), transparent 72%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 3rem;
}

::selection { background: rgba(69, 240, 255, 0.3); color: var(--text); }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--cyan);
  background: rgba(69, 240, 255, 0.08);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

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

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(69, 240, 255, 0.16);
  border-radius: 3px;
}

/* ---------- global texture: faint CRT scanlines ---------- */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg, rgba(0, 0, 0, 0.13) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
  opacity: 0.6;
}

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  left: 12px; top: -56px;
  z-index: 200;
  background: var(--cyan);
  color: #05050d;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(68px); }

/* ---------- back to lab ---------- */
.lab-link {
  position: fixed;
  top: clamp(0.75rem, 2.4vw, 1.25rem);
  left: clamp(0.75rem, 2.4vw, 1.25rem);
  z-index: 120;
  display: inline-flex;
  align-items: center;
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--dim);
  text-decoration: none;
  padding: 0.55rem 0.7rem;
  background: rgba(10, 10, 18, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease,
    text-shadow var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}
.lab-link:hover,
.lab-link:focus-visible {
  color: var(--cyan);
  border-color: var(--cyan);
  text-shadow: var(--glow-cyan);
  transform: translateX(-2px);
}

/* ---------- masthead ---------- */
.masthead {
  position: relative;
  z-index: 2;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: clamp(4.5rem, 9vw, 6.5rem) var(--gutter) clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}

.masthead__level {
  margin: 0 0 1.1rem;
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.32em;
  color: var(--gold);
  text-shadow: var(--glow-gold);
}

.masthead__title {
  position: relative;
  display: inline-block;
  margin: 0;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(1.45rem, 0.7rem + 4.6vw, 3.35rem);
  line-height: 1.18;
  letter-spacing: 0.01em;
  color: var(--text);
  text-shadow: 0 0 18px rgba(69, 240, 255, 0.45), 0 0 54px rgba(69, 240, 255, 0.18);
}
/* chromatic-aberration ghosts */
.masthead__title::before,
.masthead__title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  text-shadow: none;
}
.masthead__title::before { color: var(--magenta); transform: translate(-2px, 0); clip-path: inset(0 0 55% 0); }
.masthead__title::after  { color: var(--cyan);    transform: translate(2px, 0);  clip-path: inset(55% 0 0 0); }

.masthead__tag {
  max-width: 44rem;
  margin: clamp(1.25rem, 3vw, 1.75rem) auto 0;
  color: var(--dim);
  font-size: clamp(0.95rem, 0.9rem + 0.4vw, 1.15rem);
}

.masthead__privacy {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 1.4rem 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--green);
  border: 1px solid rgba(65, 255, 139, 0.32);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  background: rgba(65, 255, 139, 0.06);
}
.masthead__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot { 50% { opacity: 0.35; } }

/* ---------- stage / workspace ---------- */
.stage {
  position: relative;
  z-index: 2;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2.5vw, 1.6rem);
  align-items: start;
}

/* ---------- panels ---------- */
.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 2vw, 1.4rem);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel__title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--cyan);
  text-shadow: 0 0 9px rgba(69, 240, 255, 0.35);
}
.panel__num {
  font-size: 9px;
  color: var(--bg);
  background: var(--cyan);
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
  text-shadow: none;
  box-shadow: 0 0 10px rgba(69, 240, 255, 0.4);
}
.panel--preview .panel__title { color: var(--magenta); text-shadow: 0 0 9px rgba(255, 61, 139, 0.4); }
.panel--preview .panel__num { background: var(--magenta); box-shadow: var(--glow-magenta); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.6rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--control-line);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) ease, color var(--dur-fast) ease,
    background-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.btn:hover { border-color: var(--control-line-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--dim);
}
.btn--ghost:hover { color: var(--text); border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(69,240,255,0.25); }
.btn--ghost:disabled:hover { color: var(--dim); border-color: var(--line); box-shadow: none; }

.btn--copy {
  flex: 0 0 auto;
  border-color: var(--gold);
  background: rgba(255, 200, 87, 0.1);
  color: var(--gold);
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 0.6rem 0.85rem;
}
.btn--copy:hover { background: var(--gold); color: var(--bg); box-shadow: var(--glow-gold); }
.btn--copy:disabled { border-color: var(--line); background: transparent; color: var(--dimmer); }
.btn--copy.is-copied {
  border-color: var(--green);
  background: var(--green);
  color: var(--bg);
  box-shadow: 0 0 16px rgba(65, 255, 139, 0.5);
}
.btn__glyph { font-size: 1.05em; line-height: 1; }

/* ---------- form / fields ---------- */
.calculator-form { display: grid; gap: 1rem; }

.field-group {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 0.95rem 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.012);
}
.field-group__legend {
  margin-left: -0.2rem;
  padding: 0 0.45rem;
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.field { display: grid; gap: 0.4rem; align-content: start; }
.field__label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.field__hint {
  margin-top: -0.25rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--dimmer);
}
.field__control {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  background: #0c0c16;
  color: var(--text);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.field__control--mono { font-family: var(--mono); font-size: 0.95rem; }
.field__control:hover { border-color: var(--control-line-hover); }
.field__control:focus-visible { border-color: var(--cyan); }
select.field__control { cursor: pointer; }

/* ---------- error list ---------- */
.error-list { display: grid; gap: 0.5rem; }
.error-list:empty { display: none; }
.error-list__item {
  position: relative;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--red);
  background: rgba(255, 85, 96, 0.08);
  border: 1px solid rgba(255, 85, 96, 0.32);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem 0.55rem 2.1rem;
}
.error-list__item::before {
  content: "\26A0";          /* ⚠ */
  position: absolute;
  left: 0.7rem; top: 0.5rem;
  font-family: var(--mono);
}

/* ---------- console (CSS output) ---------- */
.console {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 70%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
}
.console::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta) 60%, transparent);
  opacity: 0.7;
}
.console__bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem 0.7rem;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.console__lights { display: inline-flex; gap: 0.4rem; flex: 0 0 auto; }
.dot { width: 11px; height: 11px; border-radius: 50%; opacity: 0.9; }
.dot--red { background: var(--red); box-shadow: 0 0 7px rgba(255, 85, 96, 0.6); }
.dot--gold { background: var(--gold); box-shadow: 0 0 7px rgba(255, 200, 87, 0.6); }
.dot--green { background: var(--green); box-shadow: 0 0 7px rgba(65, 255, 139, 0.6); }

.console__head {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: clamp(0.82rem, 0.78rem + 0.3vw, 0.95rem);
  display: inline-flex;
  align-items: baseline;
  overflow-wrap: anywhere;
}
.console__key { color: var(--cyan); font-weight: 600; text-shadow: 0 0 8px rgba(69, 240, 255, 0.3); }
.console__colon { color: var(--dim); }

.console__output {
  display: block;
  width: 100%;
  min-height: 5.5rem;
  resize: vertical;
  border: 0;
  border-top: 1px dashed var(--line);
  background:
    repeating-linear-gradient(0deg, rgba(69,240,255,0.025) 0 1px, transparent 1px 28px),
    #0c0c16;
  color: var(--green);
  padding: 1rem 1.1rem;
  font-family: var(--mono);
  font-size: clamp(0.85rem, 0.8rem + 0.3vw, 0.98rem);
  line-height: 1.7;
  letter-spacing: 0.01em;
}
.console__output::selection { background: rgba(65, 255, 139, 0.28); }
.console__output:focus-visible { outline-offset: -2px; }

.console__status {
  margin: 0;
  min-height: 1.4rem;
  padding: 0.6rem 1.1rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--dim);
}
.console__status[data-tone="success"] { color: var(--green); text-shadow: 0 0 8px rgba(65, 255, 139, 0.3); }
.console__status[data-tone="error"] { color: var(--red); }

/* ---------- metrics ---------- */
.metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin: 0;
}
.metric {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 0.85rem;
  background: #0e0e18;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius-sm);
}
.metric dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.metric dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--text);
  overflow-wrap: anywhere;
}
.metric--cyan { border-left-color: var(--cyan); }
.metric--cyan dd { color: var(--cyan); }
.metric--magenta { border-left-color: var(--magenta); }
.metric--magenta dd { color: var(--magenta); }
.metric--gold { border-left-color: var(--gold); }
.metric--gold dd { color: var(--gold); }

/* ---------- viewport badge ---------- */
.viewport-badge {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--magenta);
  background: rgba(255, 61, 139, 0.1);
  border: 1px solid rgba(255, 61, 139, 0.4);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  text-shadow: 0 0 8px rgba(255, 61, 139, 0.3);
}

/* ---------- range slider ---------- */
.range-field { display: grid; gap: 0.6rem; }

.range-field__control {
  --track-fill: linear-gradient(90deg, var(--cyan), var(--magenta) var(--slider-progress), transparent var(--slider-progress));
  width: 100%;
  height: 2.6rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.range-field__control::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--cyan) 0, var(--magenta) var(--slider-progress), transparent var(--slider-progress)),
    repeating-linear-gradient(90deg, var(--line-soft) 0 1px, transparent 1px 12px),
    var(--surface-2);
  border: 1px solid var(--line);
}
.range-field__control::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, var(--line-soft) 0 1px, transparent 1px 12px),
    var(--surface-2);
  border: 1px solid var(--line);
}
.range-field__control::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
}
.range-field__control::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -7px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid #0c0c16;
  box-shadow: 0 0 0 1px var(--gold), var(--glow-gold);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) ease;
}
.range-field__control::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid #0c0c16;
  box-shadow: 0 0 0 1px var(--gold), var(--glow-gold);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) ease;
}
.range-field__control:hover::-webkit-slider-thumb { transform: scale(1.12); }
.range-field__control:hover::-moz-range-thumb { transform: scale(1.12); }
.range-field__control:active::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--gold), 0 0 0 6px rgba(255,200,87,0.22); }
.range-field__control:focus-visible { outline: none; }
.range-field__control:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--gold), 0 0 0 6px rgba(255,200,87,0.3); }
.range-field__control:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 1px var(--gold), 0 0 0 6px rgba(255,200,87,0.3); }

/* ---------- resolved readout cards ---------- */
.resolved-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin: 0;
}
.resolved-card {
  display: grid;
  gap: 0.3rem;
  padding: 0.85rem 0.95rem;
  background: #0e0e18;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.resolved-card__label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.resolved-card__value {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(1.05rem, 0.95rem + 0.6vw, 1.45rem);
  line-height: 1.15;
  color: var(--green);
  text-shadow: 0 0 10px rgba(65, 255, 139, 0.25);
  overflow-wrap: anywhere;
}

/* ---------- preview frame (the "screen") ---------- */
.preview-frame {
  display: grid;
  gap: 0.6rem;
  padding: clamp(0.85rem, 2.5vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 61, 139, 0.05), transparent 60%),
    repeating-linear-gradient(90deg, rgba(69, 240, 255, 0.05) 0 1px, transparent 1px 2.5rem),
    #0b0b15;
  overflow-x: auto;
}
.preview-frame__rule {
  display: flex;
  justify-content: space-between;
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 0.08em;
  color: var(--dimmer);
}

.preview-canvas {
  position: relative;
  width: min(var(--simulated-width, 900px), 100%);
  min-width: min(100%, 240px);
  margin-top: 0.3rem;
  padding: clamp(1.1rem, 4vw, 2.25rem) clamp(1.1rem, 4vw, 2rem) clamp(1.1rem, 4vw, 1.75rem);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, #14141f, #0e0e18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 0 24px rgba(69, 240, 255, 0.06);
  transition: width var(--dur-norm) var(--ease-out);
}
.preview-canvas__tab {
  position: absolute;
  top: -0.6rem;
  left: 1rem;
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 0.16em;
  color: var(--cyan);
  background: #0e0e18;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.25rem 0.45rem;
}

.sample-heading {
  margin: 0 0 0.6em;
  font-family: var(--sans);
  font-weight: 800;
  font-size: var(--preview-heading-size, 2rem);
  line-height: 1.08;
  color: var(--text);
  text-shadow: 0 0 18px rgba(69, 240, 255, 0.18);
}
.sample-paragraph {
  max-width: 60ch;
  margin: 0;
  color: var(--dim);
  font-size: var(--preview-paragraph-size, 1rem);
  line-height: 1.5;
}

/* ---------- colophon ---------- */
.colophon {
  position: relative;
  z-index: 2;
  max-width: var(--shell-max);
  margin: clamp(2.5rem, 6vw, 4rem) auto 0;
  padding: 1.75rem var(--gutter) 0;
  text-align: center;
  border-top: 1px solid var(--line-soft);
}
.colophon__line {
  margin: 1.5rem 0 0.6rem;
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--dim);
}
.colophon__sub { margin: 0; font-size: 0.82rem; color: var(--dimmer); }

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (min-width: 560px) {
  .control-grid {
    grid-template-columns: 1fr 1fr;
  }
  .control-grid .field:nth-child(3) { grid-column: span 2; }
  .control-grid--settings { grid-template-columns: 1fr 1fr; }
  .control-grid--settings .field { grid-column: auto; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .resolved-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 980px) {
  .workspace {
    grid-template-columns: minmax(20rem, 0.9fr) minmax(0, 1.1fr);
  }
  .panel--preview { grid-column: 1 / -1; }
  .control-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .control-grid .field:nth-child(3) { grid-column: auto; }
}

/* tighten for very small screens */
@media (max-width: 380px) {
  .console__bar { gap: 0.6rem; }
  .lab-link { font-size: 8px; padding: 0.45rem 0.55rem; }
  .masthead__privacy { font-size: 0.72rem; }
}

/* ===================================================================
   REDUCED MOTION
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .masthead__dot { animation: none; }
  .lab-link:hover,
  .btn:hover,
  .range-field__control:hover::-webkit-slider-thumb,
  .range-field__control:hover::-moz-range-thumb { transform: none; }
  .preview-canvas { transition: none; }
}
