/* ============================================================
   vulture.vision — shared design system
   Brand: "sharp, smart, bespoke" · Space Grotesk + Space Mono
   Pairs with theme.js (light/dark, cross-subdomain persistence).

   Per-page stylesheets/inline <style> may add page-specific rules
   on top of this foundation.
   ============================================================ */

/* ── TOKENS ─────────────────────────────────────────── */
:root {
  --ink:      #15140F;
  --accent:   #E84B2C;
  --paper:    #F2F1EC;
  --card:     #FFFFFF;
  --hairline: #d8d6cd;
  --muted:    #8d8a7e;
  --faint:    #bdbab0;

  --border-hover: #c9c7bd;

  --radius: 3px;
  --shadow: 0 1px 3px rgba(0,0,0,.07);
  --shadow-lift: 0 6px 22px rgba(21,20,15,.10);

  --sans: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'Space Mono', monospace;

  --maxw: 1120px;
}

/* ── DARK THEME (brand "inverse on dark") ───────────── */
[data-theme="dark"] {
  --ink:      #F2F1EC;   /* foreground: text + mark turn light */
  --paper:    #15140F;   /* page background → ink */
  --card:     #1c1b15;   /* lifted dark surface */
  --hairline: #322f27;
  --muted:    #9a9789;
  --faint:    #56544b;
  /* --accent unchanged — orange reads on both */
  --border-hover: #4a473e;
  --shadow: 0 1px 3px rgba(0,0,0,.45);
  --shadow-lift: 0 10px 30px rgba(0,0,0,.55);
}

html { transition: background-color .25s ease; }
body { transition: background-color .25s ease, color .25s ease; }

/* ── RESET / BASE ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── UTILITY ────────────────────────────────────────── */
.mono-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

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

/* ── TOP BAR ────────────────────────────────────────── */
.topbar { border-bottom: 1px solid var(--hairline); }
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand svg { display: block; height: 34px; width: auto; }
.brand-word {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
#greeting { white-space: nowrap; }

/* ── RETURN-TO-BASE LINK (subpages) ─────────────────── */
.return-base {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .15s ease;
}
.return-base:hover { color: var(--accent); }

/* ── THEME TOGGLE ───────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.theme-toggle:hover { border-color: var(--border-hover); color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── PAGE HEADER (subpages) ─────────────────────────── */
.page-head {
  text-align: center;
  padding: 48px 0 36px;
}
.page-title {
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
.page-sub {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 16px;
}
.page-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 10px;
}

/* ── BUTTON ─────────────────────────────────────────── */
.btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 18px;
  cursor: pointer;
  transition: opacity .15s ease, border-color .15s ease, color .15s ease, background .15s ease;
}
.btn:hover:not(:disabled) { opacity: .85; }
.btn:disabled { opacity: .4; cursor: default; }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline);
}
.btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); opacity: 1; }

/* ── LIVE DOT ───────────────────────────────────────── */
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  flex: none;
}
.live-dot::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: live-ping 2s ease-out infinite;
}
@keyframes live-ping {
  0%   { transform: scale(.6); opacity: .7; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ── NOTICE / ERROR BANNER ──────────────────────────── */
.notice {
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 24px;
  background: transparent;
}

/* ── DATA TABLE ─────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 420px;
}
.data-table th,
.data-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--hairline);
}
.data-table th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
.data-table td {
  font-size: 14px;
  color: var(--ink);
}
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.data-table .num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}
.data-table .dim { color: var(--muted); }

/* ── SECTION HEAD ───────────────────────────────────── */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 14px;
  margin-bottom: 28px;
}
.section-head .right { color: var(--faint); }

/* ── CARD GRID ──────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 20px;
}
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 180px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  border-radius: var(--radius) 0 0 var(--radius);
  opacity: 0;
  transition: opacity .18s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--border-hover);
}
.card:hover::before { opacity: 1; }

.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--faint);
}
.card-arrow {
  font-size: 18px;
  color: var(--faint);
  transition: color .18s ease, transform .18s ease;
}
.card:hover .card-arrow { color: var(--accent); transform: translate(2px,-2px); }
.card-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.card-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: -4px;
}
.card-foot {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── FOOTER ─────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 28px 0 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer .mono-label { color: var(--faint); }
.site-footer .accent { color: var(--accent); }

/* ── LOGIN BUTTON (fallback styling for VV auth widget) ─ */
#auth-widget button,
#auth-widget a {
  font-family: var(--mono) !important;
  font-size: 11px !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  background: var(--ink) !important;
  color: var(--paper) !important;
  border: 1px solid var(--ink) !important;
  border-radius: var(--radius) !important;
  padding: 9px 16px !important;
  cursor: pointer;
  transition: opacity .15s ease;
}
#auth-widget button:hover,
#auth-widget a:hover { opacity: .85; }

/* ── RESPONSIVE (shared) ────────────────────────────── */
@media (max-width: 720px) {
  .wrapper { padding: 0 20px; }
  .topbar-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .grid { grid-template-columns: 1fr; }
  .section-head .right { display: none; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
