/* PEAK design tokens, taken verbatim from styles/plug-ds.css in the existing
   plugmil.dev project so both properties stay one visual system. */
:root {
  --plug-bg: #060a08;
  --plug-bg-soft: #0a120d;
  --plug-surface: #0c1611;
  --plug-edge: #1f5c45;
  --plug-edge-soft: rgba(56, 255, 163, 0.14);
  --plug-edge-hover: rgba(56, 255, 163, 0.35);
  --plug-green: #38ffa3;
  --plug-green-bright: #7dffc9;
  --plug-green-dim: #5fe0aa;
  --plug-text: #dffaef;
  --plug-text-dim: rgba(223, 250, 239, 0.55);
  --plug-muted: rgba(95, 224, 170, 0.5);
  --plug-white: #f4fff9;
  --plug-warn: #ffa733;
  --plug-info: #3ecbff;
  --plug-pill-bg: #0e1a14;

  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', sans-serif;

  --shell: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4.5rem, 9vw, 9rem);
  --radius: 14px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@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;
  }
}

body {
  margin: 0;
  background: var(--plug-bg);
  color: var(--plug-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The grid is the only decorative layer. It sits behind everything, never
   intercepts a pointer, and disappears under reduced transparency. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(56, 255, 163, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 255, 163, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 15%, transparent 75%);
}

a { color: inherit; }
img, svg { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 2px solid var(--plug-green);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--plug-green);
  color: var(--plug-bg);
  padding: 0.65rem 1rem;
  font-weight: 600;
  z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(6, 10, 8, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--plug-edge-soft);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--plug-white);
  text-decoration: none;
  font-size: 0.95rem;
}
.brand__mark {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--plug-green);
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: var(--plug-green);
  font-size: 0.7rem;
  line-height: 1;
}
.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav a {
  color: var(--plug-text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 140ms ease;
}
.nav a:hover { color: var(--plug-green-bright); }
.nav__cta {
  border: 1px solid var(--plug-edge);
  border-radius: 8px;
  padding: 0.45rem 0.95rem;
  color: var(--plug-green) !important;
}
.nav__cta:hover {
  border-color: var(--plug-edge-hover);
  background: rgba(56, 255, 163, 0.06);
}
.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--plug-edge);
  border-radius: 8px;
  color: var(--plug-green);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--plug-bg-soft);
    border-bottom: 1px solid var(--plug-edge-soft);
    padding: 0.5rem var(--gutter) 1rem;
  }
  .nav[hidden] { display: none; }
  .nav a { padding: 0.8rem 0; border-bottom: 1px solid var(--plug-edge-soft); }
  .nav__cta { text-align: center; margin-top: 0.75rem; border-bottom: 1px solid var(--plug-edge) !important; }
}

/* ------------------------------------------------------------------ hero */
.hero { padding: clamp(3.5rem, 8vw, 7rem) 0 var(--section); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--plug-muted);
  border: 1px solid var(--plug-edge-soft);
  background: var(--plug-pill-bg);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  margin: 0 0 1.75rem;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--plug-warn);
  flex: none;
}
.dot--green { background: var(--plug-green); }

h1 {
  font-size: clamp(2.6rem, 7.2vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 1.5rem;
  font-weight: 700;
  color: var(--plug-white);
  max-width: 16ch;
}
h1 .accent { color: var(--plug-green); }

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--plug-text-dim);
  max-width: 58ch;
  margin: 0 0 2.5rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0.85rem 1.4rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--plug-green); color: #04160e; }
.btn--primary:hover { background: var(--plug-green-bright); }
.btn--ghost {
  border-color: var(--plug-edge);
  color: var(--plug-text);
  background: rgba(12, 22, 17, 0.6);
}
.btn--ghost:hover { border-color: var(--plug-edge-hover); background: rgba(56, 255, 163, 0.06); }

/* --------------------------------------------------------------- console */
.console {
  margin-top: clamp(3rem, 6vw, 5rem);
  border: 1px solid var(--plug-edge-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--plug-surface), var(--plug-bg-soft));
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
}
.console__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--plug-edge-soft);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--plug-muted);
}
.console__lights { display: flex; gap: 0.35rem; }
.console__lights span {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(223, 250, 239, 0.16);
}
.console__body {
  margin: 0;
  padding: 1.25rem 1.25rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.75;
  color: var(--plug-text-dim);
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
.console__body b { color: var(--plug-green); font-weight: 600; }
.console__body i { color: var(--plug-info); font-style: normal; }
.console__body u { color: var(--plug-white); text-decoration: none; }
.console__note {
  border-top: 1px solid var(--plug-edge-soft);
  padding: 0.7rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--plug-muted);
}

/* -------------------------------------------------------------- sections */
section { padding-block: var(--section); }
.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--plug-muted);
  margin: 0 0 0.85rem;
}
h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  color: var(--plug-white);
  font-weight: 700;
}
h3 { font-size: 1.05rem; margin: 0 0 0.5rem; color: var(--plug-white); font-weight: 600; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.rule { border: 0; border-top: 1px solid var(--plug-edge-soft); margin: 0; }

/* Deliberately uneven: the first card is the lead, the rest support it. */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(12, 1fr); }
.card {
  grid-column: span 4;
  border: 1px solid var(--plug-edge-soft);
  border-radius: var(--radius);
  background: var(--plug-surface);
  padding: 1.5rem;
  transition: border-color 160ms ease, transform 160ms ease;
}
.card:hover { border-color: var(--plug-edge); transform: translateY(-2px); }
.card--wide { grid-column: span 8; }
.card p { color: var(--plug-text-dim); font-size: 0.95rem; }
.card__tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--plug-muted);
  display: block;
  margin-bottom: 0.9rem;
}
@media (max-width: 900px) {
  .card, .card--wide { grid-column: span 12; }
}

.steps { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, 1fr); counter-reset: step; }
.step { border-top: 2px solid var(--plug-edge); padding-top: 1.1rem; }
.step::before {
  counter-increment: step;
  content: '0' counter(step);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--plug-green);
  display: block;
  margin-bottom: 0.6rem;
}
.step p { color: var(--plug-text-dim); font-size: 0.95rem; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- status */
.status-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.status-table caption { text-align: left; color: var(--plug-text-dim); padding-bottom: 0.9rem; font-size: 0.9rem; }
.status-table th, .status-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--plug-edge-soft);
  vertical-align: top;
}
.status-table th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--plug-muted);
  font-weight: 500;
}
.status-table td:first-child { color: var(--plug-white); font-weight: 600; }
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.tag--dev { color: var(--plug-warn); }
.tag--live { color: var(--plug-green); }
.tag--blocked { color: var(--plug-text-dim); }
.table-wrap { overflow-x: auto; }

.callout {
  border: 1px solid var(--plug-edge-soft);
  border-left: 2px solid var(--plug-green);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--plug-bg-soft);
  padding: 1.35rem 1.5rem;
  color: var(--plug-text-dim);
  font-size: 0.95rem;
}
.callout strong { color: var(--plug-white); }

/* ---------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--plug-edge-soft);
  padding-block: 3rem 4rem;
  color: var(--plug-text-dim);
  font-size: 0.875rem;
}
.footer-grid { display: flex; flex-wrap: wrap; gap: 2.5rem 4rem; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer-links a { color: var(--plug-text-dim); text-decoration: none; }
.footer-links a:hover { color: var(--plug-green-bright); }
.colophon { font-family: var(--font-mono); font-size: 0.72rem; color: var(--plug-muted); margin-top: 2.5rem; }

/* ------------------------------------------------------------ doc pages */
.doc { padding-block: clamp(3rem, 7vw, 5.5rem) var(--section); max-width: 74ch; }
.doc h1 { font-size: clamp(2rem, 4.5vw, 3rem); max-width: none; }
.doc h2 { font-size: 1.35rem; margin-top: 2.5rem; }
.doc p, .doc li { color: var(--plug-text-dim); }
.doc a { color: var(--plug-green-dim); }
.doc ul { padding-left: 1.2rem; }
.doc li { margin-bottom: 0.5rem; }
.doc code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--plug-pill-bg);
  border: 1px solid var(--plug-edge-soft);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
}
