/* RESPAWN REPAIR CO. — diagnostic terminal theme */
:root {
  --bg: #060806;
  --surface: #0C100C;
  --surface-2: #10160F;
  --text: #D8E6D0;
  --text-dim: rgba(216,230,208,0.55);
  --accent: #33FF66;
  --accent-dim: rgba(51,255,102,0.12);
  --amber: #FFB000;
  --danger: #FF3B30;
  --line: rgba(51,255,102,0.14);
  --radius: 3px;
  --header-h: 64px;
  --font: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
html.no-motion { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  text-shadow: 0 0 6px rgba(51,255,102,0.25);
}

::selection { background: var(--accent); color: #060806; text-shadow: none; }

img { max-width: 100%; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  background: var(--accent); color: #060806; padding: 10px 16px;
  font-weight: 700; text-decoration: none; transition: top 0.2s;
}
.skip:focus { top: 12px; }

.ok { color: var(--accent); }
.amber { color: var(--amber); }

/* ---------- CRT overlay: scanlines + vignette + micro-flicker ---------- */
.crt {
  position: fixed; inset: 0; z-index: 120; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom,
      rgba(0,0,0,0.22) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.5) 100%);
  animation: crt-flicker 4s infinite;
}
@keyframes crt-flicker {
  0%, 100% { opacity: 1; }
  48% { opacity: 1; }
  50% { opacity: 0.96; }
  52% { opacity: 1; }
  78% { opacity: 0.98; }
  80% { opacity: 1; }
}

/* ---------- scroll progress ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 130;
  background: rgba(51,255,102,0.12);
}
.progress span {
  display: block; height: 100%; width: 100%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(51,255,102,0.8);
  transform: scaleX(0); transform-origin: left;
}

/* ---------- custom cursor (fine-pointer + JS only) ---------- */
.cursor-dot, .cursor-ring { display: none; }
html.custom-cursor .cursor-dot, html.custom-cursor .cursor-ring { display: block; }
html.custom-cursor, html.custom-cursor a, html.custom-cursor button,
html.custom-cursor input, html.custom-cursor select, html.custom-cursor textarea,
html.custom-cursor [role="slider"] { cursor: none; }
.cursor-dot {
  position: fixed; z-index: 150; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(51,255,102,0.9);
}
.cursor-ring {
  position: fixed; z-index: 149; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--accent); pointer-events: none;
  transform: translate(-50%, -50%);
  display: none; align-items: center; justify-content: center;
  transition: width 0.25s, height 0.25s, background-color 0.25s;
}
html.custom-cursor .cursor-ring { display: flex; }
.cursor-ring span {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  color: #060806; opacity: 0; transition: opacity 0.2s;
}
.cursor-ring.is-active {
  width: 72px; height: 72px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(51,255,102,0.7);
}
.cursor-ring.is-active span { opacity: 1; }

/* ---------- boot ---------- */
#boot {
  position: fixed; inset: 0; z-index: 180;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.boot-box { width: min(560px, 100%); }
.boot-title { color: var(--amber); font-weight: 700; margin-bottom: 18px; }
.boot-lines { list-style: none; margin-bottom: 18px; min-height: 96px; }
.boot-lines li {
  opacity: 0; transform: translateY(6px);
  padding: 4px 0; letter-spacing: 0.04em;
}
.boot-lines li .dots { color: var(--text-dim); }
.boot-final { color: var(--accent); margin-bottom: 18px; opacity: 0; }
.boot-bar { height: 10px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.boot-bar span {
  display: block; height: 100%; width: 0%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(51,255,102,0.8);
}
.boot-meta { margin-top: 10px; color: var(--text-dim); font-size: 13px; letter-spacing: 0.1em; }

/* ---------- header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 110;
  transition: background-color 0.3s, backdrop-filter 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(6,8,6,0.82);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 28px;
  min-height: var(--header-h);
}
.brand {
  color: var(--text); text-decoration: none; font-weight: 700;
  letter-spacing: 0.04em; white-space: nowrap;
}
.brand-dim { color: var(--accent); }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  color: var(--text-dim); text-decoration: none; font-size: 14px;
  letter-spacing: 0.06em; padding: 12px 10px; min-height: 44px;
  display: inline-flex; align-items: center;
  transition: color 0.2s, background-color 0.2s;
}
.site-nav a:hover { color: var(--accent); background: var(--accent-dim); }
.sysclock {
  font-size: 13px; color: var(--text-dim); letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px rgba(51,255,102,0.9);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.35; }
}

/* ---------- demo banner ---------- */
.demo-banner {
  background: rgba(255,176,0,0.08);
  border-bottom: 1px solid rgba(255,176,0,0.35);
  padding: 10px 0; margin-top: var(--header-h);
}
.demo-banner p {
  max-width: 1120px; margin: 0 auto; padding: 0 24px;
  font-size: 13px; color: var(--amber); letter-spacing: 0.02em;
}

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: calc(100vh - var(--header-h));
  display: flex; align-items: center; overflow: hidden;
  padding: 72px 0 96px;
}
#circuit { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; }
.hero-inner { position: relative; z-index: 2; width: 100%; }
.sysline { font-size: 14px; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 20px; }
.hero-title {
  font-size: clamp(2.6rem, 8vw, 6.5rem);
  line-height: 0.98; font-weight: 700; text-transform: uppercase;
  letter-spacing: -0.01em; margin-bottom: 18px;
  min-height: 2.2em;
}
.tagline { font-size: 1.25rem; color: var(--amber); font-style: italic; margin-bottom: 44px; }
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: stretch;
}
.hero-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
  box-shadow: 0 0 24px rgba(51,255,102,0.06);
}
.panel-head { color: var(--accent); font-size: 13px; letter-spacing: 0.12em; margin-bottom: 16px; }
.readout { list-style: none; margin-bottom: 28px; }
.readout li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
  font-size: 15px;
}
.readout li span:first-child { color: var(--text-dim); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 16px; }

/* CRT photo frame */
.crt-frame {
  margin: 0; background: #000; border: 1px solid var(--line);
  border-radius: 18px; padding: 12px; position: relative; overflow: hidden;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.6), 0 0 24px rgba(51,255,102,0.06);
}
.crt-frame img {
  display: block; width: 100%; height: auto; border-radius: 10px;
  filter: saturate(0.85) contrast(1.05);
}
.crt-frame::after {
  content: ""; position: absolute; inset: 12px; border-radius: 10px;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom,
    rgba(0,0,0,0.18) 0 1px, transparent 1px 3px);
}
.crt-frame figcaption {
  padding: 12px 4px 4px; font-size: 12px; letter-spacing: 0.1em;
  color: var(--text-dim);
}

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 2; font-size: 12px; letter-spacing: 0.14em; color: var(--text-dim);
  display: flex; align-items: center; gap: 10px;
}
.scroll-hint span {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 14px 28px;
  font-family: var(--font); font-weight: 700; font-size: 15px;
  letter-spacing: 0.06em; text-decoration: none; text-shadow: none;
  border-radius: var(--radius); border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.2s, background-color 0.2s, color 0.2s;
  will-change: transform;
}
.btn-primary {
  background: var(--accent); color: #060806;
  box-shadow: 0 0 16px rgba(51,255,102,0.35);
}
.btn-primary:hover { box-shadow: 0 0 28px rgba(51,255,102,0.6); }
.btn-ghost {
  background: transparent; color: var(--accent); border-color: var(--accent);
}
.btn-ghost:hover { background: var(--accent-dim); }
.btn-big { font-size: 16px; padding: 16px 34px; }

/* ---------- ticker ---------- */
.ticker {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--surface); overflow: hidden; white-space: nowrap;
  padding: 14px 0;
}
.ticker-track {
  display: inline-flex; width: max-content;
  animation: marquee 26s linear infinite;
}
.ticker-track span {
  color: var(--amber); font-size: 15px; letter-spacing: 0.12em; font-weight: 700;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: 110px 0; scroll-margin-top: var(--header-h); }
.section-title {
  font-size: clamp(1.7rem, 4vw, 2.8rem); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.02em;
  margin-bottom: 16px; color: var(--text);
}
.section-title.glitching { animation: rgb-split 0.45s steps(2) 2; }
@keyframes rgb-split {
  0% { text-shadow: -3px 0 var(--danger), 3px 0 var(--accent); transform: translateX(2px); }
  50% { text-shadow: 3px 0 var(--danger), -3px 0 var(--accent); transform: translateX(-2px); }
  100% { text-shadow: 0 0 6px rgba(51,255,102,0.25); transform: none; }
}
.section-lede { color: var(--text-dim); max-width: 46em; margin-bottom: 48px; font-size: 1.05rem; }
.demo-note {
  color: var(--amber); font-size: 14px; letter-spacing: 0.06em;
  margin-bottom: 28px;
}

/* ---------- fault list ---------- */
.faults-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: start; }
.fault-list { list-style: none; }
.fault-row {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 20px; align-items: center;
  padding: 20px 16px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--text);
  min-height: 44px;
  transition: background-color 0.2s, padding-left 0.2s;
}
.fault-row:first-child { border-top: 1px solid var(--line); }
.fault-row:hover, .fault-row:focus-visible {
  background: var(--accent-dim); padding-left: 24px;
}
.fault-code { color: var(--danger); font-weight: 700; font-size: 14px; letter-spacing: 0.06em; }
.fault-main strong { display: block; font-size: 1.05rem; letter-spacing: 0.03em; }
.fault-main em { font-style: normal; color: var(--text-dim); font-size: 14px; }
.fault-price { color: var(--amber); font-weight: 700; font-size: 1.15rem; }

/* ---------- before / after ---------- */
.ba {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; user-select: none; touch-action: pan-y;
  background: #000;
}
.ba-photo { display: block; width: 100%; height: auto; pointer-events: none; }
.ba-top {
  position: absolute; inset: 0; width: 50%; overflow: hidden;
  border-right: 2px solid var(--accent);
  box-shadow: 4px 0 12px rgba(51,255,102,0.35);
}
.ba-inner { position: relative; height: 100%; }
.ba-inner .ba-photo {
  width: auto; height: 100%; max-width: none;
  position: absolute; top: 0; left: 0;
}
.ba-faulty {
  filter: hue-rotate(140deg) saturate(2.2) contrast(1.25) brightness(0.9);
}
.ba-top::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background:
    repeating-linear-gradient(0deg, rgba(255,59,48,0.12) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(90deg, rgba(51,255,102,0.08) 0 3px, transparent 3px 7px);
  animation: noise-shift 0.35s steps(3) infinite;
}
@keyframes noise-shift {
  0% { transform: translate(0,0); } 50% { transform: translate(-4px,2px); } 100% { transform: translate(3px,-3px); }
}
.ba-tag {
  position: absolute; top: 16px; font-size: 13px; font-weight: 700;
  letter-spacing: 0.12em; padding: 8px 14px; border-radius: var(--radius);
  text-shadow: none; z-index: 3;
}
.ba-tag-faulty { left: 16px; background: var(--danger); color: #060806; }
.ba-tag-fixed { right: 16px; background: var(--accent); color: #060806; }
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 48px;
  margin-left: -24px; z-index: 4; display: flex; align-items: center; justify-content: center;
}
.ba-grip {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); border: 3px solid #060806;
  box-shadow: 0 0 16px rgba(51,255,102,0.7);
  position: relative;
}
.ba-grip::before, .ba-grip::after {
  content: ""; position: absolute; top: 50%; width: 0; height: 0;
  border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}
.ba-grip::before { left: 9px; border-right: 9px solid #060806; transform: translateY(-50%); }
.ba-grip::after { right: 9px; border-left: 9px solid #060806; transform: translateY(-50%); }
.ba-caption { margin-top: 18px; color: var(--text-dim); font-size: 14px; font-style: italic; }

/* ---------- repair log ---------- */
.log-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.term-lines {
  list-style: none; background: #020402; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px 28px; min-height: 300px;
}
.term-lines li {
  padding: 12px 0; font-size: 1.02rem; min-height: 3.2em; color: var(--accent);
}
.term-lines li .caret {
  display: inline-block; width: 10px; height: 1.15em; background: var(--accent);
  vertical-align: text-bottom; margin-left: 2px;
  animation: blink 0.9s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.log-photos { display: grid; gap: 32px; }

/* ---------- rate table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.rate-table { width: 100%; border-collapse: collapse; background: var(--surface); min-width: 560px; }
.rate-table th, .rate-table td {
  padding: 16px 20px; text-align: left; font-size: 15px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.rate-table thead th {
  color: var(--accent); font-size: 13px; letter-spacing: 0.12em;
  border-bottom: 2px solid var(--line); background: var(--surface-2);
}
.rate-table tbody tr { transition: background-color 0.2s; }
.rate-table tbody tr:hover { background: var(--accent-dim); }
.rate-table tbody tr:last-child td { border-bottom: none; }
.rate-table td.amber { font-weight: 700; }

/* ---------- manifesto + counters ---------- */
.manifesto {
  font-size: clamp(1.8rem, 5vw, 3.4rem); font-weight: 700; line-height: 1.25;
  text-transform: uppercase; max-width: 20em; margin-bottom: 72px;
}
.manifesto .w { color: rgba(216,230,208,0.18); transition: color 0.2s; }
.manifesto .w.lit { color: var(--accent); text-shadow: 0 0 12px rgba(51,255,102,0.5); }
.counters {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  margin-bottom: 28px;
}
.counter {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 20px; background: var(--surface); text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.counter:hover { border-color: var(--accent); box-shadow: 0 0 18px rgba(51,255,102,0.15); }
.counter-num {
  font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 700; color: var(--accent);
  margin-bottom: 8px; font-variant-numeric: tabular-nums;
}
.counter-label { font-size: 12px; letter-spacing: 0.14em; color: var(--text-dim); }

/* ---------- booking form ---------- */
.book-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 36px; max-width: 860px;
}
.field { display: grid; gap: 10px; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: 13px; letter-spacing: 0.12em; color: var(--accent); font-weight: 700; }
.field input, .field select, .field textarea {
  font-family: var(--font); font-size: 16px; color: var(--text);
  background: #020402; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; min-height: 52px; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 12px rgba(51,255,102,0.25);
  outline: none;
}
.field input.invalid, .field select.invalid { border-color: var(--danger); }
.form-error { grid-column: 1 / -1; color: var(--danger); font-size: 14px; }
.book-form .btn { grid-column: 1 / -1; justify-self: start; }
.form-success {
  background: var(--surface); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 36px; max-width: 860px;
  box-shadow: 0 0 24px rgba(51,255,102,0.12);
}
.success-head { color: var(--accent); font-weight: 700; font-size: 1.2rem; margin-bottom: 12px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 64px 0 40px; margin-top: 40px;
}
.footer-grid {
  display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  margin-bottom: 40px;
}
.footer-tag { color: var(--amber); font-style: italic; margin-top: 8px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.footer-nav a {
  color: var(--text-dim); text-decoration: none; font-size: 14px;
  letter-spacing: 0.06em; padding: 12px 10px; min-height: 44px;
  display: inline-flex; align-items: center;
}
.footer-nav a:hover { color: var(--accent); }
.disclaimer {
  font-size: 13px; color: var(--text-dim); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 24px; line-height: 1.7;
}
.disclaimer strong { color: var(--amber); }
.copy { font-size: 13px; color: var(--text-dim); }

/* ---------- back to top ---------- */
#to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 110;
  font-family: var(--font); font-weight: 700; font-size: 13px; letter-spacing: 0.1em;
  background: var(--surface); color: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 14px 18px; min-width: 44px; min-height: 44px;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s, box-shadow 0.2s;
  text-shadow: none;
}
#to-top.show { opacity: 1; visibility: visible; transform: none; }
#to-top:hover { box-shadow: 0 0 16px rgba(51,255,102,0.4); }

/* ---------- legal pages ---------- */
.legal-body { padding: calc(var(--header-h) + 48px) 0 80px; }
.legal-body h1 { font-size: 2rem; margin-bottom: 8px; text-transform: uppercase; }
.legal-body .updated { color: var(--text-dim); font-size: 14px; margin-bottom: 32px; }
.legal-body h2 { color: var(--accent); font-size: 1.15rem; margin: 32px 0 12px; text-transform: uppercase; }
.legal-body p, .legal-body li { color: var(--text-dim); margin-bottom: 12px; max-width: 60em; }
.legal-body ul { padding-left: 24px; }
.legal-back { display: inline-block; margin-top: 40px; }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .hero-grid, .faults-grid, .log-grid { grid-template-columns: 1fr; }
  .counters { grid-template-columns: repeat(2, 1fr); }
  .sysclock { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 72px 0; }
  .site-nav a { padding: 12px 7px; font-size: 12px; }
  .book-form { grid-template-columns: 1fr; padding: 24px 20px; }
  .fault-row { grid-template-columns: 76px 1fr auto; gap: 12px; padding: 16px 10px; }
  .hero { padding: 48px 0 80px; }
  .manifesto { margin-bottom: 48px; }
  .counters { gap: 16px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .crt { animation: none; }
  .ticker-track { animation: none; }
  .pulse, .scroll-hint span, .term-lines li .caret, .ba-top::after { animation: none !important; }
  .section-title.glitching { animation: none; }
}
html.no-motion .ticker-track { animation: none; }
html.no-motion .crt { animation: none; }
html.no-motion .pulse,
html.no-motion .scroll-hint span,
html.no-motion .ba-top::after { animation: none !important; }
