/* ============================================================================
   PATE Stack — shared brand system
   ----------------------------------------------------------------------------
   Layer model:
     1. @font-face       self-hosted IBM Plex Sans (no external requests)
     2. :root tokens     shared neutrals + type + DEFAULT accent
     3. components        reusable classes used across every site
   Per-site accent: each site ships sites/<domain>/site.css loaded AFTER this
   file, overriding --accent / --accent-2 / --accent-deep (+ optional bg glow).
   See docs/style-guide.md for the family accent map.
   ========================================================================== */

/* 1. Fonts — self-hosted, latin subset, swap so text paints immediately ----- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
}

/* 2. Tokens ---------------------------------------------------------------- */
:root {
  /* Shared neutrals — pulled toward leather's real DevTools UI for continuity */
  --bg: #0b1220;
  --bg-2: #0e1626;
  --panel: #121b2f;
  --panel-2: #17233c;
  --text: #e9f2ff;
  --muted: #91a9c8;
  --line: #223a61;

  /* DEFAULT accent (umbrella). Sites override via site.css. */
  --accent: #6ee7ff;
  --accent-2: #a78bfa;
  --accent-deep: #4f46e5;
  --accent-soft: rgba(110, 231, 255, 0.14); /* glow / tinted fills */

  /* Status — shared from leather UI */
  --ok: #46d9a0;
  --warn: #ffd26f;
  --err: #ff8a8a;

  /* Background glow position colors — sites may override --glow */
  --glow: rgba(110, 231, 255, 0.10);

  --max: 1040px;
  --radius: 12px;
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background:
    radial-gradient(900px 520px at 82% -8%, var(--glow) 0%, transparent 60%),
    radial-gradient(1200px 700px at 18% -10%, var(--bg-2) 0%, var(--bg) 55%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { letter-spacing: -0.01em; }

.wrap { width: min(var(--max), 92vw); margin: 0 auto; }

/* 3. Components ------------------------------------------------------------ */

/* Header / nav */
header.site {
  border-bottom: 1px solid var(--line);
  background: rgba(11, 18, 32, 0.72);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  gap: 16px;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.nav-links { display: flex; flex-wrap: wrap; gap: 12px; }
.nav-links a { color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--text); }

/* Hero */
.hero { padding: 76px 0 38px; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}
.kicker .badge {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
}
h1 { font-size: clamp(30px, 5vw, 56px); line-height: 1.07; margin: 16px 0 12px; }
.lead { color: var(--muted); max-width: 74ch; font-size: clamp(16px, 1.7vw, 19px); }

/* Buttons */
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  transition: border-color 0.15s ease, transform 0.05s ease;
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(100deg, var(--accent-deep), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 24px var(--accent-soft);
}
.btn.primary:hover { border-color: transparent; filter: brightness(1.06); }

/* Sections */
section { padding: 30px 0; }
.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
h2 { font-size: clamp(22px, 2.6vw, 30px); margin: 4px 0 14px; }

/* Card grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px;
}
.card h3 { margin-top: 0; margin-bottom: 8px; font-size: 17px; }
.card p { color: var(--muted); margin: 0; }
.card .lede { color: var(--accent); font-family: var(--font-mono); font-size: 13px; }

/* Feature rows (metaphor / instead-of style) */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px 18px;
}
.feature + .feature { margin-top: 10px; }
.feature .from { color: var(--muted); }
.feature .to { color: var(--text); }
.feature .to strong { color: var(--accent); font-weight: 600; }

/* Steps (quickstart) */
.steps { display: grid; gap: 12px; counter-reset: step; }
.step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px 18px;
}
.step h3 {
  margin: 0 0 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.step h3::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  flex: none;
}

/* Proof badges */
.proof { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  color: var(--muted);
}
.badge code {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 12px;
}

/* Code blocks */
.code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  background: #070c15;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre;
  color: #d6e4f5;
}
.code .c { color: var(--muted); }     /* comment */
.code .k { color: var(--accent); }    /* keyword / command */

/* Footer + stack map */
footer {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding: 28px 0 44px;
  color: var(--muted);
  font-size: 14px;
}
.footer-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}
.footer-map a {
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.footer-map a:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.footer-map a .role { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.footer-map a strong { color: var(--text); font-weight: 600; }

.small { font-size: 13px; color: var(--muted); }

/* Responsive: collapse nav links under the brand on narrow screens */
@media (max-width: 680px) {
  .nav { flex-direction: column; align-items: flex-start; gap: 10px; }
  .nav-links { gap: 10px 14px; }
  .feature { grid-template-columns: 1fr; gap: 4px; }
  .hero { padding: 52px 0 30px; }
}
