/* ============================================================
   TECHTOWN-THEME.css  v4.0
   MediaVerse Acoustic Study — Unified Design System
   Brand: #292663 Indigo, #EC008C Magenta, #FBB04C Gold
   Background: #F8F7F4 (off-white) — NEVER dark mode
   ============================================================ */

/* 1. CUSTOM PROPERTIES */
:root {
  --bg: #F8F7F4;
  --bg-card: #ffffff;
  --bg-hero: #F8F7F4;
  --indigo: #292663;
  --magenta: #EC008C;
  --gold: #FBB04C;
  --purple: #92278F;
  --tx: #1a1a2e;
  --tx2: #4a4a68;
  --tx3: #7a7a96;
  --border: #e8e6e1;
  --border-light: #f0eeea;
  --shadow-sm: 0 1px 3px rgba(41,38,99,0.04);
  --shadow-md: 0 4px 16px rgba(41,38,99,0.06);
  --shadow-lg: 0 12px 40px rgba(41,38,99,0.08);
  --radius: 12px;
  --radius-lg: 20px;
  --nav-h: 56px;
  --section-gap: 80px;
  --pass: #16a34a;
  --warn: #d97706;
  --fail: #dc2626;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'IBM Plex Mono', 'Menlo', monospace;
}

/* 2. RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--tx);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--magenta); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--indigo); }
.mono { font-family: var(--mono); }

/* 3. TYPOGRAPHY */
h1, h2, h3, h4 { color: var(--tx); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
h1 { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.025em; }
h1 span { color: var(--indigo); }
h2 { font-size: 1.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; color: var(--tx2); }
p { margin-bottom: 1rem; color: var(--tx2); }
.lead { font-size: 1.15rem; line-height: 1.8; color: var(--tx2); max-width: 680px; }
.eyebrow {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--indigo);
  margin-bottom: 0.75rem;
}

/* 4. LAYOUT */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 2rem; }
.section { padding: var(--section-gap) 0; }
.section + .section { border-top: 1px solid var(--border-light); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* 5. NAVIGATION */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(248,247,244,0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 2rem;
}
.site-nav .nav-inner {
  max-width: 1120px; margin: 0 auto; width: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.site-nav .nav-logo {
  font-weight: 700; font-size: 0.9rem; color: var(--indigo);
  letter-spacing: -0.02em; white-space: nowrap;
}
.site-nav .nav-links {
  display: flex; gap: 0.25rem; list-style: none;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.site-nav .nav-links a {
  padding: 0.5rem 0.85rem; font-size: 0.82rem; font-weight: 500;
  color: var(--tx2); white-space: nowrap;
  border-radius: 8px; transition: all 0.2s;
  text-decoration: none;
}
.site-nav .nav-links a:hover { color: var(--tx); background: rgba(41,38,99,0.04); }
.site-nav .nav-links a.active {
  color: var(--indigo); font-weight: 600;
  background: rgba(41,38,99,0.06);
}

/* 6. HERO */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}
.hero .eyebrow { margin-bottom: 1rem; }
.hero h1 { margin-bottom: 1rem; }
.hero .lead { margin: 0 auto 2rem; }
.hero-left { text-align: left; }
.hero-left .lead { margin: 0 0 2rem; }

/* 7. CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none; color: inherit; display: block;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.card h3 { font-size: 0.95rem; margin-bottom: 0.35rem; color: var(--tx); }
.card p { font-size: 0.84rem; color: var(--tx2); line-height: 1.55; margin-bottom: 0.5rem; }
.card .status {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600;
}
.card .status.live { color: var(--pass); }
.card .status.wip { color: var(--warn); }
.card .status.coming { color: var(--tx3); }

/* 8. STAT CARDS */
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  text-align: center;
}
.stat-card .k {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--tx3); margin-bottom: 0.35rem;
}
.stat-card .v {
  font-family: var(--mono); font-size: 1.5rem; font-weight: 700;
  color: var(--indigo);
}
.stat-card .v small { font-size: 0.7em; font-weight: 500; color: var(--tx2); }

/* 9. TABLES */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 2rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
thead th {
  background: var(--indigo); color: #ffffff;
  font-weight: 600; text-align: left;
  padding: 0.65rem 1rem; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}
thead th:first-child { border-radius: var(--radius) 0 0 0; }
thead th:last-child { border-radius: 0 var(--radius) 0 0; }
tbody td {
  padding: 0.65rem 1rem; border-bottom: 1px solid var(--border-light);
  color: var(--tx);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(41,38,99,0.02); }
table.clean { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }

/* 10. BADGES & MARKERS */
.badge {
  display: inline-block; font-family: var(--mono);
  font-size: 0.65rem; font-weight: 700; padding: 2px 8px;
  border-radius: 6px; letter-spacing: 0.02em;
}
.badge.pass { background: rgba(22,163,74,0.1); color: var(--pass); }
.badge.warn { background: rgba(217,119,6,0.1); color: var(--warn); }
.badge.fail { background: rgba(220,38,38,0.1); color: var(--fail); }
.ac {
  background: rgba(251,176,76,0.15); color: #b88600;
  font-family: var(--mono); font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 6px;
}
.hp {
  border: 1px solid var(--indigo); color: var(--indigo);
  font-family: var(--mono); font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 6px;
}

/* 11. CALLOUTS */
.callout {
  padding: 1.25rem 1.5rem; border-radius: var(--radius);
  font-size: 0.88rem; line-height: 1.65;
  margin: 1.5rem 0;
}
.callout.info { background: rgba(41,38,99,0.04); border-left: 3px solid var(--indigo); }
.callout.warn { background: rgba(251,176,76,0.08); border-left: 3px solid var(--gold); }
.callout.critical { background: rgba(236,0,140,0.06); border-left: 3px solid var(--magenta); }
.callout strong { color: var(--tx); }

/* 12. SIDEBAR LAYOUT */
.page-layout {
  display: flex; gap: 2.5rem;
  max-width: 1120px; margin: 0 auto; padding: 2rem;
}
.sidebar {
  width: 220px; flex-shrink: 0;
  position: sticky; top: calc(var(--nav-h) + 1.5rem);
  align-self: flex-start;
  max-height: calc(100vh - var(--nav-h) - 3rem);
  overflow-y: auto;
}
.sidebar h4 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--tx3); margin-bottom: 0.75rem;
}
.sidebar a {
  display: block; padding: 0.4rem 0.75rem; font-size: 0.82rem;
  color: var(--tx2); border-radius: 6px; margin-bottom: 2px;
  transition: all 0.15s;
}
.sidebar a:hover { background: rgba(41,38,99,0.04); color: var(--tx); }
.sidebar a.active { background: rgba(41,38,99,0.06); color: var(--indigo); font-weight: 600; }
.main-content { flex: 1; min-width: 0; }

/* 13. CONTENT SECTIONS */
.content-section {
  margin-bottom: 3rem;
  scroll-margin-top: calc(var(--nav-h) + 2rem);
}
.content-section h2 {
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
}

/* 14. ROOM CARDS */
.room-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.room-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.room-card .room-header {
  padding: 1rem 1.25rem; font-weight: 600; font-size: 0.9rem; color: #fff;
}
.room-card .room-header.vo { background: var(--magenta); }
.room-card .room-header.cr { background: var(--indigo); }
.room-card .room-header.vs { background: var(--purple); }
.room-card .room-header.es { background: var(--gold); color: var(--tx); }
.room-card .room-body { padding: 1.25rem; }
.room-card .room-body .room-stat {
  display: flex; justify-content: space-between;
  padding: 0.3rem 0; font-size: 0.82rem;
  border-bottom: 1px solid var(--border-light);
}
.room-card .room-body .room-stat:last-child { border-bottom: none; }
.room-card .room-body .room-stat .label { color: var(--tx3); }
.room-card .room-body .room-stat .val { font-family: var(--mono); font-weight: 600; color: var(--tx); }

/* 15. FORMULA DISPLAY */
.formula {
  font-family: var(--mono); font-size: 0.82rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 1rem 1.25rem;
  margin: 1rem 0; line-height: 1.8;
  overflow-x: auto;
}

/* 16. SVG CONTAINER */
.svg-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
  margin: 1rem 0;
}
.svg-wrap svg { width: 100%; height: auto; }

/* 17. BREADCRUMB */
.breadcrumb {
  max-width: 1120px; margin: 0 auto;
  padding: 0.75rem 2rem;
  font-size: 0.82rem; color: var(--tx3);
}
.breadcrumb a { color: var(--tx3); }
.breadcrumb a:hover { color: var(--indigo); }

/* 18. FOOTER */
footer {
  text-align: center; padding: 2.5rem 2rem;
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--tx3); border-top: 1px solid var(--border);
  margin-top: var(--section-gap);
}

/* 19. PHASE CARDS (BOM) */
.phase-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: 2.5rem; }
.phase-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; text-align: center;
}
.phase-card .phase-label {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
  color: var(--indigo); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 0.5rem;
}
.phase-card .phase-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.phase-card .phase-cost {
  font-family: var(--mono); font-size: 1.4rem; font-weight: 700; color: var(--indigo);
}

/* 20. SCROLL ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up {
  opacity: 0; animation: fadeUp 0.6s ease forwards;
}
.fade-up.delay-1 { animation-delay: 0.1s; }
.fade-up.delay-2 { animation-delay: 0.2s; }
.fade-up.delay-3 { animation-delay: 0.3s; }

/* 21. UTILITIES */
.text-indigo { color: var(--indigo); }
.text-magenta { color: var(--magenta); }
.text-gold { color: var(--gold); }
.text-muted { color: var(--tx3); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 2rem; }
.small { font-size: 0.82rem; }
.tiny { font-size: 0.72rem; }

/* 22. RESPONSIVE */
@media (max-width: 1023px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .phase-cards { grid-template-columns: repeat(2, 1fr); }
  .page-layout { flex-direction: column; }
  .sidebar {
    width: 100%; position: static;
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    max-height: none; padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
  }
  .sidebar h4 { width: 100%; }
  .sidebar a { padding: 0.35rem 0.65rem; font-size: 0.78rem; }
}
@media (max-width: 767px) {
  :root { --section-gap: 48px; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }
  .wrap { padding: 0 1.25rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .phase-cards { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 0 2rem; }
  .hero h1 { font-size: 1.8rem; }
  .site-nav { padding: 0 1rem; }
  .site-nav .nav-links a { padding: 0.4rem 0.6rem; font-size: 0.78rem; }
  table { font-size: 0.78rem; }
  th, td { padding: 0.5rem 0.65rem; }
}
