/* ═══════════════════════════════════════════════════════════════
   AUDIENTIA — Unified Design System
   Version 2.0 — Coherent Site-wide Styles
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  /* Colors */
  --black:    #080808;
  --offblack: #0f0f0f;
  --gray:     #161616;
  --gray2:    #1e1e1e;
  --gray3:    #252525;
  --cream:    #e8e4df;
  --white:    #f0ece8;
  --red:      #d42020;
  --red2:     #b81818;
  --red-dim:  rgba(212,32,32,0.08);
  --red-glow: rgba(212,32,32,0.18);
  --muted:    #888;
  --dim:      #444;
  --border:   rgba(255,255,255,0.06);
  --border2:  rgba(255,255,255,0.12);

  /* Accent colors */
  --blue:   #3b82f6;
  --cyan:   #22d3ee;
  --green:  #4ade80;
  --amber:  #fbbf24;
  --purple: #c084fc;

  /* Typography */
  --font-display:   'Bebas Neue', sans-serif;
  --font-condensed: 'Barlow Condensed', sans-serif;
  --font-body:      'Barlow', sans-serif;
  --font-mono:      'Space Mono', monospace;

  /* Sizes — increased for legibility */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 16px;
  --text-md:   18px;
  --text-lg:   20px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── BASE ──────────────────────────────────────────────────── */
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--red); }

/* ── GLOBAL BACKGROUND GRID ────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, black 30%, transparent 100%);
}

/* ── CUSTOM CURSOR ─────────────────────────────────────────── */
#cur {
  position: fixed;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: transform 0.08s;
}
#cur-ring {
  position: fixed;
  width: 32px; height: 32px;
  border: 1px solid rgba(212,32,32,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: all 0.15s ease;
}

/* ── NAVIGATION ────────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; width: 100%;
  z-index: 1000;
  padding: 0 52px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition), border-color var(--transition);
}
.site-nav.scrolled,
.site-nav.solid {
  background: rgba(8,8,8,0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 4px;
  color: var(--white);
  cursor: pointer;
}
.nav-logo span { color: var(--red); }

.nav-links {
  display: flex;
  gap: 40px;
  align-items: center;
}

.nav-link {
  font-family: var(--font-condensed);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--transition);
  position: relative;
  white-space: nowrap;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--red);
  transition: width var(--transition);
}
.nav-link:hover  { color: var(--white); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--white); }
.nav-link.active::after { width: 100%; }

.nav-cta {
  font-family: var(--font-condensed);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 9px 22px;
  background: var(--red);
  color: var(--white);
  border: 1px solid var(--red);
  border-radius: 1px;
  cursor: pointer;
  transition: all var(--transition);
}
.nav-cta:hover { background: var(--red2); transform: translateY(-1px); }

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--white);
  transition: var(--transition);
}

/* ── PAGE WRAPPER ──────────────────────────────────────────── */
.page-body {
  padding-top: 68px;
  position: relative;
  z-index: 1;
}

/* ── SECTIONS ──────────────────────────────────────────────── */
.section {
  padding: 110px 52px;
  border-top: 1px solid var(--border);
  position: relative;
}
.section-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.section-eyebrow {
  font-family: var(--font-condensed);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-eyebrow::before { content: '//'; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 5.5vw, 72px);
  line-height: 0.92;
  color: var(--white);
  margin-bottom: 52px;
}
.section-title .outline {
  -webkit-text-stroke: 1.5px rgba(240,236,232,0.2);
  color: transparent;
}
.section-title .red { color: var(--red); }

/* ── TYPOGRAPHY IMPROVEMENTS ───────────────────────────────── */
p, .body-text {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--muted);
}
p strong, .body-text strong {
  color: var(--white);
  font-weight: 500;
}

.lead-text {
  font-size: var(--text-md);
  line-height: 1.75;
  color: var(--muted);
  max-width: 680px;
}

h1 { font-family: var(--font-display); }
h2 { font-family: var(--font-display); }
h3 {
  font-family: var(--font-condensed);
  font-size: var(--text-lg);
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--white);
}

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
  font-family: var(--font-condensed);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 13px 30px;
  cursor: pointer;
  transition: all var(--transition);
  border-radius: 1px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
  border: 1px solid var(--red);
}
.btn-primary:hover {
  background: var(--red2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212,32,32,0.3);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted);
}
.btn-outline:hover {
  border-color: var(--white);
  color: var(--white);
}



/* ── TAG PILLS ─────────────────────────────────────────────── */
.tag-pill {
  font-family: var(--font-condensed);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 14px;
  border: 1px solid var(--border2);
  color: var(--muted);
  border-radius: 2px;
}
.tag-pill.hot {
  border-color: rgba(212,32,32,0.4);
  color: var(--red);
  background: rgba(212,32,32,0.06);
}

/* ── QUOTE BAR ─────────────────────────────────────────────── */
.quote-bar {
  background: var(--red);
  padding: 64px 52px;
  position: relative;
  overflow: hidden;
}
.quote-bar::before {
  content: '\201C';
  position: absolute;
  top: -30px; left: 16px;
  font-size: 200px;
  color: rgba(0,0,0,0.12);
  font-family: Georgia, serif;
  line-height: 1;
}
.quote-text {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.5vw, 46px);
  color: var(--white);
  line-height: 1.15;
  max-width: 860px;
  position: relative; z-index: 1;
}
.quote-cite {
  font-family: var(--font-condensed);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-top: 18px;
  display: block;
  position: relative; z-index: 1;
}

/* ── CODE BLOCKS ───────────────────────────────────────────── */
.code-wrapper {
  background: var(--offblack);
  border: 1px solid var(--border);
  overflow: hidden;
  border-radius: 2px;
}
.code-header {
  background: var(--gray);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.code-filename {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--muted);
}
.code-filename span { color: var(--red); }
.code-dots { display: flex; gap: 6px; }
.code-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); }
.code-dot:first-child { background: var(--red); opacity: 0.7; }

pre {
  background: var(--black);
  padding: 32px 28px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 2;
  color: #888;
}
.kw  { color: #38bdf8; }
.str { color: #fbbf24; }
.num { color: #4ade80; }
.com { color: #3a3a3a; }
.fn  { color: var(--red); }
.prop{ color: #c084fc; }

/* ── FOOTER ────────────────────────────────────────────────── */
.site-footer {
  background: var(--offblack);
  padding: 52px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 4px;
}
.footer-logo span { color: var(--red); }
.footer-links {
  display: flex;
  gap: 32px;
}
.footer-link {
  font-family: var(--font-condensed);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dim);
  transition: color var(--transition);
}
.footer-link:hover { color: var(--muted); }
.footer-copy {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
}

/* ── METRIC CARDS ──────────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.metric-card {
  background: var(--offblack);
  padding: 28px 24px;
}
.metric-card-val {
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1;
  color: var(--white);
  margin-bottom: 6px;
}
.metric-card-val.ok  { color: var(--green); }
.metric-card-val.warn { color: var(--red); }
.metric-card-val.info { color: var(--amber); }
.metric-card-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── FADE ANIMATIONS ───────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.fade-up.on { opacity: 1; transform: none; }
[data-d="1"] { transition-delay: 0.08s; }
[data-d="2"] { transition-delay: 0.16s; }
[data-d="3"] { transition-delay: 0.24s; }
[data-d="4"] { transition-delay: 0.32s; }
[data-d="5"] { transition-delay: 0.40s; }

/* ── DIVIDER ───────────────────────────────────────────────── */
.rule { width: 40px; height: 2px; background: var(--red); margin-bottom: 28px; }

/* ── CARD / PANEL ──────────────────────────────────────────── */
.panel {
  background: var(--offblack);
  border: 1px solid var(--border);
  padding: 36px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition);
}
.panel:hover { border-color: rgba(212,32,32,0.3); }
.panel::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--red);
  transition: width var(--transition);
}
.panel:hover::before { width: 3px; }

/* ── LIVE STATUS DOT ───────────────────────────────────────── */
.dot-live {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
  animation: pulse-live 2s infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .site-nav { padding: 0 32px; }
  .section   { padding: 80px 32px; }
  .site-footer { padding: 40px 32px; flex-direction: column; gap: 20px; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 768px) {
  .site-nav      { padding: 0 24px; height: 60px; }
  .nav-hamburger { display: flex; }
  .section       { padding: 64px 24px; }
  .site-footer   { padding: 32px 24px; }

  /* Mobile nav drawer — hidden by default, slides down when .open is toggled */
  .nav-links {
    display: none;
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: rgba(8,8,8,0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 12px 0 20px;
    z-index: 999;
  }
  .nav-links.open { display: flex; }

  .nav-link {
    width: 100%;
    padding: 14px 28px;
    font-size: var(--text-sm);
    letter-spacing: 2px;
    /* Larger touch target */
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  .nav-link::after { display: none; }

  .nav-cta {
    margin: 10px 28px 0;
    width: calc(100% - 56px);
    justify-content: center;
    min-height: 48px;
  }

  /* Hamburger → X animation when open */
  .nav-hamburger.open span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }
  .nav-hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .nav-hamburger.open span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }
}

/* ── TOUCH / POINTER DEVICES ────────────────────────────────── */

/* Hide custom cursor on touch screens — it serves no purpose and floats oddly */
@media (hover: none) and (pointer: coarse) {
  #cur, #cur-ring { display: none !important; }
}

/* Prevent hover styles sticking after tap on iOS */
@media (hover: none) {
  .nav-link:hover       { color: var(--muted); }
  .nav-link:hover::after { width: 0; }
  .nav-cta:hover        { background: var(--red); transform: none; }
  .btn-primary:hover    { background: var(--red); transform: none; box-shadow: none; }
  .btn-outline:hover    { border-color: var(--border2); color: var(--muted); }
  .panel:hover          { border-color: var(--border); }
  .panel:hover::before  { width: 0; }
  .footer-link:hover    { color: var(--dim); }
}
