/* sitereliability.sh — hand-written, dependency-free, CSP-safe (no inline).
   Terminal-native identity: mono display voice, amber watchdog accent,
   pass/warn/fail color reserved for report-card semantics.
   Dark-first; light theme is a real theme, not an inversion. */

:root {
  /* ground */
  --bg: #0b0e14;
  --surface: #11151f;
  --surface-2: #161b28;
  --line: #212837;
  --text: #d7dee8;
  --muted: #7d8899;
  /* brand */
  --accent: #e8a33d;
  --accent-strong: #f5b950;
  --accent-ink: #0b0e14;
  /* report-card semantics (terminal only) */
  --ok: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  /* terminal window (fixed dark in both themes) */
  --term-bg: #0a0d13;
  --term-line: #1b2230;
  --term-text: #cdd6e0;
  --term-dim: #66707e;

  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --radius: 10px;
  --measure: 62ch;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf9f6;
    --surface: #ffffff;
    --surface-2: #f3f1ec;
    --line: #e2ded4;
    --text: #1f2630;
    --muted: #5c6470;
    --accent: #9a6a14;
    --accent-strong: #7d5610;
    --accent-ink: #ffffff;
  }
}
/* explicit theme override (future toggle / preview harness) */
:root[data-theme="light"] {
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --line: #e2ded4;
  --text: #1f2630;
  --muted: #5c6470;
  --accent: #9a6a14;
  --accent-strong: #7d5610;
  --accent-ink: #ffffff;
}
:root[data-theme="dark"] {
  --bg: #0b0e14;
  --surface: #11151f;
  --surface-2: #161b28;
  --line: #212837;
  --text: #d7dee8;
  --muted: #7d8899;
  --accent: #e8a33d;
  --accent-strong: #f5b950;
  --accent-ink: #0b0e14;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
@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(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:is(a, button, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

code, pre, .mono { font-family: var(--mono); }

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* ---------- header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.8rem;
}
.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand .tld { color: var(--accent); }
.top nav { display: flex; gap: clamp(0.75rem, 2.5vw, 1.5rem); flex-wrap: wrap; }
.top nav a {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}
.top nav a:hover { color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(2rem, 5vw, 4rem);
}
.kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}
h1 {
  font-family: var(--mono);
  font-size: clamp(1.7rem, 4.4vw, 2.9rem);
  line-height: 1.14;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.lede {
  max-width: var(--measure);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  color: var(--muted);
  margin: 0 0 1.75rem;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.hero-note {
  margin: 1.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: var(--measure);
}

/* ---------- terminal window ---------- */
.terminal {
  background: var(--term-bg);
  border: 1px solid var(--term-line);
  border-radius: var(--radius);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 18px 50px -18px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  min-width: 0;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--term-line);
}
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot-r { background: #f2555a; }
.dot-y { background: #f7bd3e; }
.dot-g { background: #3ec96f; }
.term-title {
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--term-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.term-body {
  padding: 1rem 1.1rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--term-text);
  overflow-x: auto;
}
.tl { white-space: pre; min-height: 1.36em; }
.tl .prompt { color: var(--accent); }
.t-ok { color: var(--ok); }
.t-warn { color: var(--warn); }
.t-bad { color: var(--bad); }
.t-dim { color: var(--term-dim); }
.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.term-hidden .tl-out { visibility: hidden; }
.term-replay {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--term-dim);
  background: none;
  border: 1px solid var(--term-line);
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  margin-left: auto;
  cursor: pointer;
}
.term-replay:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- section scaffolding ---------- */
section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-line { border-top: 1px solid var(--line); }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
}
h2 {
  font-family: var(--mono);
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.9rem;
  text-wrap: balance;
}
.section-lede { max-width: var(--measure); color: var(--muted); margin: 0 0 2rem; }

/* ---------- countdown strip ---------- */
.countdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  counter-reset: step;
}
.count-step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem 1.2rem;
}
.count-step strong {
  display: block;
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.count-step .when {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.count-step p { margin: 0.4rem 0 0; font-size: 0.9rem; color: var(--muted); }
.count-note { margin: 1.5rem 0 0; max-width: var(--measure); color: var(--text); }

/* ---------- tools ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1.1rem;
}
.tool {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem 1.2rem;
  transition: border-color 140ms ease, transform 140ms ease;
  min-width: 0;
}
.tool:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-2px); }
.tool h3 {
  font-family: var(--mono);
  font-size: 1rem;
  margin: 0;
  color: var(--accent);
}
.tool p { margin: 0; font-size: 0.92rem; color: var(--muted); flex-grow: 1; }
.cmd {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  min-width: 0;
}
.cmd pre {
  flex: 1;
  margin: 0;
  background: var(--term-bg);
  border: 1px solid var(--term-line);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  overflow-x: auto;
  min-width: 0;
}
.cmd code { font-size: 0.74rem; color: var(--term-text); white-space: pre; }
.copy {
  flex: none;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 0.7rem;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy.done { color: var(--ok); border-color: var(--ok); }
.tool-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.tool-meta .dim { color: var(--muted); }

/* ---------- products ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.1rem;
}
.product {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.4rem;
}
.product h3 {
  font-family: var(--mono);
  font-size: 1.1rem;
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.badge {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  white-space: nowrap;
}
.product p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.product .price {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text);
}
.price em { color: var(--accent); font-style: normal; }

/* ---------- trust ---------- */
.trust {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  max-width: 46rem;
}
.trust h2 { font-size: 1.15rem; }
.trust p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem 2.5rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}
.foot-inner { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .countdown { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .term-body { font-size: 0.72rem; }
  .cmd { flex-direction: column; }
  .copy { padding: 0.45rem 0.7rem; }
}
