/* WatchTower standalone site: control-room / night-watch aesthetic.
   Zero build step, no framework. Green = draining, red = stuck:
   the product's own status language, used as the visual system. */

:root {
  --bg: #0a0d13;
  --bg-2: #0e121b;
  --surface: #141926;
  --surface-2: #1a2030;
  --border: #232a3d;
  --border-soft: #1c2233;
  --text: #ccd4e4;
  --text-strong: #f2f5fb;
  --muted: #7c879b;
  --muted-2: #5b6478;
  --amber: #f6b545;      /* the watch light: brand accent */
  --amber-soft: #f6b54522;
  --green: #46c06a;      /* draining / live */
  --green-soft: #46c06a1f;
  --red: #f0576d;        /* stuck */
  --red-soft: #f0576d1f;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle beacon glow behind the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 80% -8%, #f6b5450d, transparent 60%),
    radial-gradient(700px 500px at 0% 0%, #46c06a0a, transparent 55%);
  pointer-events: none;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- top nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 13, 19, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--text-strong);
  font-size: 16px;
  letter-spacing: 0.2px;
}
.brand:hover { text-decoration: none; }
.beacon {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 var(--amber);
  animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 #f6b54566; }
  70%  { box-shadow: 0 0 0 9px #f6b54500; }
  100% { box-shadow: 0 0 0 0 #f6b54500; }
}
.nav-links { display: flex; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-size: 14.5px; font-weight: 500; }
.nav-links a:hover { color: var(--text-strong); text-decoration: none; }

/* ---------- generic sections ---------- */
section { padding: 68px 0; border-bottom: 1px solid var(--border-soft); }
section:last-of-type { border-bottom: none; }
.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 14px;
}
h1, h2, h3 { color: var(--text-strong); line-height: 1.2; }
h2 { font-size: clamp(26px, 4vw, 34px); margin: 0 0 10px; letter-spacing: -0.4px; }
h3 { font-size: 19px; margin: 0 0 8px; }
.lede { color: var(--muted); font-size: 18px; max-width: 62ch; }

/* ---------- hero ---------- */
.hero { padding: 76px 0 60px; border-bottom: 1px solid var(--border-soft); }
.hero h1 {
  font-size: clamp(34px, 6.2vw, 62px);
  letter-spacing: -1.4px;
  margin: 0 0 18px;
  font-weight: 800;
}
.hero h1 .hl { color: var(--amber); }
.hero .lede { font-size: clamp(18px, 2.4vw, 22px); max-width: 60ch; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 13px; margin-bottom: 22px;
}
.hero-tag b { color: var(--green); font-weight: 600; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px;
  font-weight: 650; font-size: 15px;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--amber); color: #1a1206; }
.btn-primary:hover { background: #ffc45f; text-decoration: none; }
.btn-ghost { border-color: var(--border); color: var(--text-strong); background: var(--surface); }
.btn-ghost:hover { border-color: var(--muted); text-decoration: none; }

/* ---------- terminal block ---------- */
.term {
  background: #070a10;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px -30px #000, 0 0 0 1px #0000;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
}
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}
.term-bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.term-bar .r { background: #ff5f57; } .term-bar .y { background: #febc2e; } .term-bar .g { background: #28c840; }
.term-bar span { margin-left: 8px; color: var(--muted); font-size: 12px; }
.term-body { padding: 18px 20px; overflow-x: auto; }
.term-body pre { margin: 0; white-space: pre; }
.term .cmd { color: var(--text-strong); }
.term .cmd::before { content: "$ "; color: var(--amber); }
.term .out { color: var(--muted); }
.term .ok { color: var(--green); }
.term .bad { color: var(--red); }
.term .cm { color: #566079; }  /* comment */
.term .em { color: var(--amber); }

/* ---------- status strip demo ---------- */
.strip {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 34px;
}
.pill {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 13px;
  padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
}
.pill .dot { width: 9px; height: 9px; border-radius: 50%; }
.pill.live { border-color: #46c06a55; background: var(--green-soft); }
.pill.live .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.pill.live b { color: var(--green); }
.pill.stuck { border-color: #f0576d55; background: var(--red-soft); }
.pill.stuck .dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.pill.stuck b { color: var(--red); }
.pill .q { color: var(--text-strong); font-weight: 600; }
.pill .meta { color: var(--muted); }

/* ---------- cards / grid ---------- */
.grid { display: grid; gap: 18px; margin-top: 34px; }
.grid.g2 { grid-template-columns: repeat(2, 1fr); }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 22px;
}
.card h3 { display: flex; align-items: center; gap: 9px; }
.card p { color: var(--muted); margin: 6px 0 0; font-size: 15.5px; }
.card .ic { color: var(--amber); font-family: var(--mono); font-weight: 700; }

/* ---------- steps ---------- */
.steps { counter-reset: step; margin-top: 30px; display: grid; gap: 16px; }
.step {
  display: grid; grid-template-columns: 40px 1fr; gap: 16px; align-items: start;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 18px 20px;
}
.step::before {
  counter-increment: step; content: counter(step);
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--amber-soft); color: var(--amber);
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  border: 1px solid #f6b54540;
}
.step h3 { margin: 3px 0 4px; }
.step p { color: var(--muted); margin: 0 0 10px; font-size: 15px; }
.step code, .inline-code {
  font-family: var(--mono); font-size: 13.5px;
  background: #070a10; border: 1px solid var(--border-soft);
  padding: 2px 7px; border-radius: 6px; color: var(--text-strong);
}

/* ---------- CLI reference ---------- */
.cli-cmd { margin-top: 30px; scroll-margin-top: 80px; }
.cli-cmd h3 {
  font-family: var(--mono); font-size: 18px; color: var(--text-strong);
  display: flex; align-items: baseline; gap: 10px;
}
.cli-cmd h3 .verb { color: var(--amber); }
.cli-cmd .sig {
  font-family: var(--mono); font-size: 13.5px; color: var(--text);
  background: #070a10; border: 1px solid var(--border-soft);
  padding: 12px 14px; border-radius: 8px; margin: 10px 0 12px;
  overflow-x: auto; white-space: pre;
}
.cli-cmd p { color: var(--muted); margin: 0 0 8px; }
table.flags { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 14.5px; }
table.flags td { padding: 7px 10px; border-top: 1px solid var(--border-soft); vertical-align: top; }
table.flags td:first-child {
  font-family: var(--mono); color: var(--amber); white-space: nowrap; width: 1%;
  padding-right: 20px;
}
table.flags td:last-child { color: var(--muted); }

.toc {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px;
}
.toc a {
  font-family: var(--mono); font-size: 13px;
  padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text);
  background: var(--surface);
}
.toc a:hover { border-color: var(--amber); color: var(--amber); text-decoration: none; }

/* ---------- callouts ---------- */
.note {
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  padding: 14px 18px; border-radius: 0 10px 10px 0;
  margin-top: 22px; font-size: 15px; color: var(--text);
}
.note b { color: var(--amber); }
.note.green { border-left-color: var(--green); background: var(--green-soft); }
.note.green b { color: var(--green); }

/* ---------- scope / honest table ---------- */
table.matrix { width: 100%; border-collapse: collapse; margin-top: 26px; font-size: 15px; }
table.matrix th, table.matrix td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); }
table.matrix th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; }
table.matrix td:first-child { color: var(--text-strong); font-weight: 600; }
.tag { font-family: var(--mono); font-size: 12px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.tag.yes { background: var(--green-soft); color: var(--green); }
.tag.no  { background: var(--red-soft); color: var(--red); }
.tag.mid { background: var(--amber-soft); color: var(--amber); }

/* ---------- footer ---------- */
footer {
  padding: 44px 0 60px;
  color: var(--muted);
  font-size: 14.5px;
}
.foot-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--text-strong); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  section { padding: 48px 0; }
  .nav-inner { padding: 11px 18px; gap: 12px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 13.5px; }
  .wrap { padding: 0 18px; }
  .grid.g2, .grid.g3 { grid-template-columns: 1fr; }
  .hero { padding: 52px 0 44px; }
  .cta-row .btn { flex: 1 1 auto; justify-content: center; }
  .term-body { font-size: 12.5px; }
  table.matrix { font-size: 13.5px; }
  table.matrix th:nth-child(3), table.matrix td:nth-child(3) { display: none; }
}

/* Mobile overflow fixes: let grid children shrink so code blocks scroll
   inside their own box, and wrap long flag names in reference tables. */
.step > div, .grid > *, .wrap { min-width: 0; }
table.flags td { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  table.flags, table.flags tbody, table.flags tr, table.flags td { display: block; width: auto; }
  table.flags tr { border-top: 1px solid var(--border-soft); padding: 6px 0; }
  table.flags td, table.flags td:first-child { border-top: 0; padding: 2px 10px; width: auto; white-space: normal; }
}
