/* ============================================================
   KRUX site.css — shared chrome for every deployable page.
   Self-contained, no Tailwind, no JS dependencies.
   Import on every page: <link rel="stylesheet" href="site.css">
   ============================================================ */

/* ── Webfonts ── */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-ExtraBold.woff2') format('woff2');
  font-weight: 800 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('fonts/InstrumentSerif-Italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('fonts/InstrumentSerif-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ── Tokens ── */
:root {
  --bg:           #0A0E13;
  --bg-1:         #0D1117;
  --bg-2:         #111827;
  --bg-3:         #1F2937;
  --border:       #1F2937;
  --border-mid:   #374151;
  --fg:           #F9FAFB;
  --fg-1:         #E5E7EB;
  --fg-2:         #B0B6C1;
  --fg-3:         #8A93A1;
  --fg-4:         #5E6675;
  --fg-5:         #374151;
  --accent:       #10B981;
  --accent-dim:   #059669;
  --accent-bright:#34D399;
  --amber:        #F59E0B;
  --red:          #EF4444;
  --gold:         #FACC15;
  --cyan:         #67E8F9;
  --seal:         oklch(58% 0.135 38);
  --mono:         'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display:      'Instrument Serif', 'Source Serif 4', Georgia, serif;
}

/* ── Reset + base ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--bg-1); }
a { color: inherit; text-decoration: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Animations ── */
@keyframes krux-pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.k-pulse { animation: krux-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }

/* ============================================================
   SITE NAV — sticky top
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 19, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-nav .inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  gap: 24px;
  position: relative;
}
@media (max-width: 820px) {
  .site-nav .inner { padding: 16px 22px; gap: 14px; }
}
.site-nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 28px;
}
.site-nav .brand img {
  height: 22px;
  width: auto;
  display: block;
}
.site-nav .brand .ke {
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.18em;
  margin-left: 4px;
  font-weight: 600;
  padding-left: 10px;
  border-left: 1px solid var(--border-mid);
  height: 14px;
  display: inline-flex;
  align-items: center;
}
.site-nav .links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav .links a {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 600;
  transition: color 120ms;
}
.site-nav .links a:hover, .site-nav .links a.on { color: var(--fg); }
.site-nav .right { display: flex; align-items: center; gap: 18px; }
.site-nav .signin {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 600;
}
.site-nav .signin:hover { color: var(--fg); }
.site-nav .cta {
  padding: 11px 20px;
  background: var(--accent);
  color: var(--bg-1);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.site-nav .cta:hover { background: var(--accent-bright); }
.site-nav .live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.site-nav .live .d {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  animation: krux-pulse 2s infinite;
}

@media (max-width: 820px) {
  /* Mobile-first nav: hide desktop links, show menu button */
  .site-nav .links { display: none; }
  .site-nav .live { display: none; }
  .site-nav .signin { display: none; }
  .site-nav .cta { padding: 10px 14px; font-size: 11px; letter-spacing: 0.18em; }
  .site-nav .brand img { height: 18px; }
  .site-nav .brand .ke {
    font-size: 9.5px;
    padding-left: 8px;
    letter-spacing: 0.16em;
  }
}

/* Mobile menu toggle button — hidden on desktop */
.site-nav .menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--fg-1);
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
}
.site-nav .menu-btn:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 820px) {
  .site-nav .menu-btn { display: inline-flex; align-items: center; gap: 6px; }
  .site-nav .menu-btn::before { content: "≡"; font-size: 16px; line-height: 1; }
}

/* Mobile drawer (toggled by menu-btn JS) */
.mobile-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 14, 19, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 80px 32px 32px;
  flex-direction: column;
  gap: 8px;
  animation: drawer-in 200ms ease-out;
}
.mobile-drawer.open { display: flex; }
@keyframes drawer-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mobile-drawer .close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--fg-1);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.mobile-drawer .close:hover { border-color: var(--accent); color: var(--accent); }
.mobile-drawer a {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.mobile-drawer a.cta {
  color: var(--accent);
  border-bottom: none;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid var(--accent);
  text-align: center;
  background: rgba(16,185,129,0.08);
}
.mobile-drawer .ledger {
  margin-top: auto;
  padding-top: 24px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 600;
}

/* ============================================================
   SECTION + LAYOUT PRIMITIVES
   ============================================================ */
section { border-top: 1px solid var(--border); }
section:first-of-type { border-top: none; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 104px 32px;
}
.wrap-narrow {
  max-width: 780px;
  margin: 0 auto;
  padding: 104px 32px;
}
@media (max-width: 900px) {
  .wrap, .wrap-narrow { padding: 72px 24px; }
}
@media (max-width: 560px) {
  .wrap, .wrap-narrow { padding: 52px 20px; }
}

/* ── Kickers / eyebrows ── */
.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 700;
  margin-bottom: 28px;
}
.kicker .bar { width: 28px; height: 1px; background: var(--accent); }
.kicker .num { color: var(--accent); }
.kicker.center { justify-content: center; }
.kicker.quiet { color: var(--fg-3); margin-bottom: 22px; }

/* ── Display type ── */
h1.display, .display-1 {
  font-size: clamp(56px, 8vw, 120px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.92;
  margin: 0;
  color: var(--fg);
}
h2.display, .display-2 {
  font-size: clamp(40px, 5.5vw, 76px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.98;
  margin: 0 0 28px;
  color: var(--fg);
}
.display-1 em, .display-2 em { font-style: normal; color: var(--accent); }

.lede {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.55;
  color: var(--fg-1);
  max-width: 60ch;
  font-weight: 500;
  margin: 0;
}
.lede.muted { color: var(--fg-2); }

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 700;
}

/* ── Inline marks ── */
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); display: inline-block; }
.bar-em { display: inline-block; width: 28px; height: 1px; background: var(--accent); vertical-align: middle; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg-1);
}
.btn-primary:hover { background: var(--accent-bright); }
.btn-ghost {
  background: transparent;
  border-color: var(--border-mid);
  color: var(--fg-2);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* KRUX brand wordmark — the official logo image. Used in nav + footer.
   The image is a transparent PNG of the actual letterforms. Do not
   replace with text-based fallback in production. */
.km-word {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 26px;
}
.km-word img {
  height: 22px;
  width: auto;
  display: block;
}

/* ============================================================
   FOOTER — ledger style
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-1);
  margin-top: 0;
}
.site-footer .inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 32px 28px;
}
@media (max-width: 560px) {
  .site-footer .inner { padding: 52px 20px 22px; }
}
.site-footer .grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 820px) {
  .site-footer .grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 520px) {
  .site-footer .grid { grid-template-columns: 1fr; gap: 28px; }
}
.site-footer .col h4 {
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 700;
  margin: 0 0 16px;
}
.site-footer .col ul { list-style: none; margin: 0; padding: 0; }
.site-footer .col li { margin: 8px 0; }
.site-footer .col a {
  font-size: 14px;
  color: var(--fg-1);
  font-weight: 500;
}
.site-footer .col a:hover { color: var(--accent); }
.site-footer .col p {
  font-size: 14px;
  color: var(--fg-2);
  margin: 6px 0;
  line-height: 1.6;
}
.site-footer .col .stamp {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 600;
  margin-top: 18px;
}
.site-footer .col .km-word {
  margin-bottom: 18px;
  height: 28px;
}
.site-footer .col .km-word img {
  height: 26px;
}
.site-footer .meta {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.site-footer .meta a:hover { color: var(--fg-1); }
.site-footer .meta .right { display: flex; gap: 22px; align-items: center; }

/* ============================================================
   PAGE STAMP — top-right confidential mark
   ============================================================ */
.page-stamp {
  position: absolute;
  top: 22px;
  right: 28px;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--fg-3);
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-stamp .num { color: var(--accent); font-weight: 700; }

/* ============================================================
   UTILITY: BADGES / TAGS
   ============================================================ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  border: 1px solid var(--border-mid);
  color: var(--fg-2);
}
.tag.green   { color: var(--accent); border-color: rgba(16,185,129,0.4); background: rgba(16,185,129,0.06); }
.tag.amber   { color: var(--amber); border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.06); }
.tag.red     { color: var(--red);   border-color: rgba(239,68,68,0.4);  background: rgba(239,68,68,0.06); }
.tag.gold    { color: var(--gold);  border-color: rgba(250,204,21,0.4); background: rgba(250,204,21,0.06); }
.tag.cyan    { color: var(--cyan);  border-color: rgba(103,232,249,0.4);background: rgba(103,232,249,0.06); }

/* ── Tabular nums everywhere they're useful ── */
.tabular { font-variant-numeric: tabular-nums; }
