/* =====================================================
   aithething.com — Main Stylesheet
   Dark mode default, light mode via [data-theme="light"]
   ===================================================== */

/* ── Tokens ── */
:root {
  --bg:          #05050a;
  --bg-2:        #0a0a12;
  --bg-card:     #0f0f1a;
  --bg-code:     #000000;
  --text:        #e8ecff;
  --text-muted:  #7788aa;
  --text-faint:  #3d4a60;
  --accent:      #00d4ff;
  --accent-dim:  rgba(0,212,255,0.12);
  --accent-2:    #b44fcc;
  --border:      rgba(0,212,255,0.1);
  --border-soft: rgba(255,255,255,0.05);
  --shadow:      0 4px 24px rgba(0,212,255,0.06);

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', 'Courier New', monospace;

  --radius: 8px;
  --max-w:  1200px;
  --nav-h:  64px;
}

[data-theme="light"] {
  --bg:          #f4f6ff;
  --bg-2:        #edf0ff;
  --bg-card:     #ffffff;
  --bg-code:     #1e1e2e;
  --text:        #0f1117;
  --text-muted:  #4b5563;
  --text-faint:  #9ca3af;
  --accent:      #0077cc;
  --accent-dim:  rgba(0,119,204,0.1);
  --accent-2:    #7c3aed;
  --border:      rgba(0,100,200,0.15);
  --border-soft: rgba(0,0,0,0.06);
  --shadow:      0 4px 24px rgba(0,0,0,0.08);
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.25s, color 0.25s;
}

img { max-width: 100%; height: auto; display: block; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Grid background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.4;
}

/* ── Focus ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Selection ── */
::selection {
  background: rgba(0,212,255,0.2);
  color: #fff;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0,212,255,0.2);
  border-radius: 3px;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  position: relative;
  z-index: 1;
}

main {
  flex: 1;
  padding-top: var(--nav-h);
  position: relative;
  z-index: 1;
}

/* ============================================================
   NAVIGATION
   ============================================================ */

header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}

header.scrolled {
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: 1rem;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.nav-links a {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--border-soft); }
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0,212,255,0.2);
}
[data-theme="light"] .nav-links a.active {
  border-color: rgba(0,119,204,0.2);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Theme toggle */
#theme-toggle {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}
#theme-toggle:hover {
  color: var(--text);
  background: var(--border-soft);
  border-color: var(--accent);
}

/* Mobile menu toggle */
#menu-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  transition: border-color 0.2s;
}
#menu-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s, opacity 0.3s;
}
#menu-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
#menu-toggle.open span:nth-child(2) { opacity: 0; }
#menu-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile nav */
#mobile-nav {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  height: auto;
  min-height: calc(100dvh - var(--nav-h));
  background:
    linear-gradient(180deg, rgba(5, 8, 18, 0.985) 0%, rgba(5, 8, 18, 0.97) 100%);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  padding: 1rem 1.25rem 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  overflow-y: auto;
}
#mobile-nav.open { display: block; }
#mobile-nav a {
  display: block;
  padding: 0.95rem 1rem;
  margin-bottom: 0.35rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
  transition: color 0.2s, background 0.2s, transform 0.2s;
}
#mobile-nav a:hover, #mobile-nav a.active {
  color: var(--accent);
  background: rgba(0, 212, 255, 0.08);
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-2);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.footer-brand .logo { font-size: 0.9rem; }

.footer-brand p {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-faint);
  line-height: 1.6;
  max-width: 260px;
}

.footer-col h4 {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer-col ul { list-style: none; }
.footer-col ul li + li { margin-top: 0.5rem; }
.footer-col ul a {
  font-size: 0.85rem;
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-col ul a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--border-soft);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-bottom p {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.footer-bottom .tagline {
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* ============================================================
   PAGE HEADER (used on interior pages)
   ============================================================ */

.page-header {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-soft);
  padding: 3.5rem 0 2.5rem;
  overflow: hidden;
}

.page-header .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.page-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.page-header p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.7;
}

/* ============================================================
   HERO (home page)
   ============================================================ */

.hero {
  min-height: calc(90vh - var(--nav-h));
  display: flex;
  align-items: center;
  padding: 5rem 0 4rem;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 60%;
  background: radial-gradient(ellipse at center, rgba(0,212,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}

[data-theme="light"] .hero::after {
  background: radial-gradient(ellipse at center, rgba(0,119,204,0.05) 0%, transparent 60%);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid rgba(0,212,255,0.2);
  background: rgba(0,212,255,0.05);
  border-radius: 999px;
  margin-bottom: 2rem;
}

.hero-pill span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

.hero-pill p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(0,212,255,0.8);
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero h1 .gradient {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 620px;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.375rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-dim);
  border-color: rgba(0,212,255,0.35);
  color: var(--accent);
}
.btn-primary:hover {
  background: rgba(0,212,255,0.2);
  border-color: rgba(0,212,255,0.6);
  text-decoration: none;
}

.btn-ghost {
  background: var(--border-soft);
  border-color: var(--border-soft);
  color: var(--text-muted);
}
.btn-ghost:hover {
  color: var(--text);
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}

.btn-solid {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-solid:hover {
  opacity: 0.9;
  text-decoration: none;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.375rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  border-color: rgba(0,212,255,0.25);
  box-shadow: var(--shadow);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2em 0.55em;
  border-radius: 4px;
  border: 1px solid;
}

.badge-cyan    { color: #00d4ff; border-color: rgba(0,212,255,0.3); background: rgba(0,212,255,0.06); }
.badge-purple  { color: #b44fcc; border-color: rgba(180,79,204,0.3); background: rgba(180,79,204,0.06); }
.badge-green   { color: #4ade80; border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.06); }
.badge-yellow  { color: #facc15; border-color: rgba(250,204,21,0.3); background: rgba(250,204,21,0.06); }
.badge-orange  { color: #fb923c; border-color: rgba(251,146,60,0.3); background: rgba(251,146,60,0.06); }
.badge-blue    { color: #60a5fa; border-color: rgba(96,165,250,0.3); background: rgba(96,165,250,0.06); }
.badge-red     { color: #f87171; border-color: rgba(248,113,113,0.3); background: rgba(248,113,113,0.06); }

.card-date {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.625rem;
  color: var(--text);
  transition: color 0.2s;
}
.card:hover h3 { color: var(--accent); }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 .ext { font-size: 0.75em; color: var(--text-faint); margin-left: 0.2em; }

.card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border-soft);
}

.card-source {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.card-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  opacity: 0.65;
  text-decoration: none;
  transition: opacity 0.2s;
}
.card-link:hover { opacity: 1; text-decoration: none; }

.read-time {
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ============================================================
   GRIDS
   ============================================================ */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* ============================================================
   SECTIONS
   ============================================================ */

.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: var(--bg-2);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.home-about {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: 3.5rem;
  align-items: center;
}

.home-about-copy {
  max-width: 44rem;
}

.home-about-copy .eyebrow {
  margin-bottom: 0.5rem;
}

.home-about-copy h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.home-about-copy p:not(.comment) {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.75;
}

.home-about-copy .comment {
  margin-top: 0.35rem;
}

.home-about-cta {
  display: inline-flex;
}

.home-about-stats {
  align-self: start;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.section-header div .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 0.35rem;
}

.section-header h2 {
  font-size: 1.65rem;
  font-weight: 700;
}

.view-all {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  opacity: 0.65;
  text-decoration: none;
  transition: opacity 0.2s;
}
.view-all:hover { opacity: 1; text-decoration: none; }

/* Stat card */
.stat-card {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.stat-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.stat-card .label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.stat-card .sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}

/* ============================================================
   CTA BANNER
   ============================================================ */

.cta-banner {
  padding: 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, rgba(0,212,255,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.cta-banner h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.875rem;
  position: relative;
}

.cta-banner p {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 2rem;
  position: relative;
}

.cta-banner .cta-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

/* ============================================================
   ARTICLE PAGE
   ============================================================ */

.article-header {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-soft);
  padding: 3rem 0 2.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  opacity: 0.6;
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: opacity 0.2s;
}
.back-link:hover { opacity: 1; text-decoration: none; }

.article-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  max-width: 800px;
}

.article-header .lede {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 740px;
  line-height: 1.7;
}

.article-header .article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

/* Article body */
.article-body {
  max-width: 760px;
  margin: 3rem auto;
  padding: 0 1.25rem 4rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.article-body h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-soft);
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}

.article-body p { margin-bottom: 1.25rem; }

.article-body a { color: var(--accent); }
.article-body a:hover { opacity: 0.8; }

.article-body strong { color: var(--text); font-weight: 600; }

.article-body ul, .article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.article-body li { margin-bottom: 0.375rem; }

.article-body blockquote {
  border-left: 3px solid rgba(0,212,255,0.4);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.article-body pre {
  background: var(--bg-code);
  border: 1px solid rgba(0,212,255,0.12);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.article-body p code,
.article-body li code {
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.85em;
  color: var(--accent);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  overflow-x: auto;
  display: block;
}
.article-body th {
  text-align: left;
  padding: 0.625rem 0.875rem;
  border-bottom: 2px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.article-body td {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-muted);
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 2.5rem 0;
}

.article-nav {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid var(--border-soft);
}

/* ============================================================
   ABOUT PAGE SPECIFICS
   ============================================================ */

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.4rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,212,255,0.5);
  background: var(--bg);
  transform: translateX(-50%);
}

.timeline-item .era {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  opacity: 0.65;
  margin-bottom: 0.25rem;
}

.timeline-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.timeline-item p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 600px;
}

/* Principle cards */
.principle-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.principle-card:hover { border-color: rgba(0,212,255,0.2); }
.principle-card .bar {
  width: 2rem; height: 2px;
  background: var(--accent);
  margin-bottom: 1rem;
}
.principle-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.625rem;
}
.principle-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 3rem;
  align-items: start;
}

.contact-rules h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  margin-top: 1.75rem;
}
.contact-rules h3:first-child { margin-top: 0; }

.contact-rules ul { list-style: none; }
.contact-rules ul li {
  display: flex;
  gap: 0.75rem;
  padding: 0.35rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.contact-rules ul li .icon { flex-shrink: 0; font-size: 0.9rem; }

.terms-box {
  margin-top: 1.75rem;
  padding: 1.25rem;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.terms-box h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}
.terms-box p {
  font-size: 0.8rem;
  color: var(--text-faint);
  line-height: 1.65;
  margin-bottom: 0.625rem;
}
.terms-box p:last-child { margin-bottom: 0; }

.form-box {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 2rem 1.75rem;
}

.form-box h2 {
  font-family: var(--font-mono);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* Formspree / native form styles */
.form-field { margin-bottom: 1.25rem; }

.form-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  font-size: 0.875rem;
  color: var(--text);
  font-family: var(--font-mono);
  transition: border-color 0.2s;
  outline: none;
}
[data-theme="light"] .form-field input,
[data-theme="light"] .form-field textarea {
  background: #f8f9ff;
  color: var(--text);
}

.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--text-faint); }

.form-field input:focus,
.form-field textarea:focus {
  border-color: rgba(0,212,255,0.5);
}

.form-field textarea { resize: vertical; min-height: 140px; }

.form-consent {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.checkbox-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  cursor: pointer;
}

.checkbox-row input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.checkbox-row span {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.botcheck-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.submit-button {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}

/* Jotform iframe container */
.jotform-container {
  width: 100%;
  min-height: 600px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
}
.jotform-container iframe {
  width: 100%;
  border: none;
  display: block;
}

/* Jotform placeholder */
.jotform-placeholder {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
}
.jotform-placeholder code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem 1.25rem;
  display: block;
  margin-top: 1rem;
  color: var(--accent);
  text-align: left;
  white-space: pre;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: 2rem;
  background: linear-gradient(180deg, rgba(0,212,255,0.05), rgba(0,212,255,0.02));
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 760px;
}

.empty-state h2,
.empty-state h3 {
  color: var(--text);
  margin: 0;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0;
}

.empty-state-research {
  background: linear-gradient(180deg, rgba(180,79,204,0.08), rgba(180,79,204,0.03));
}

.empty-state-compact {
  padding: 1.5rem;
}

.lead-story {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 1.5rem;
  align-items: stretch;
}

.lead-story-main,
.lead-story-side,
.lead-home-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}

.lead-story-main {
  padding: 2rem;
  background:
    radial-gradient(circle at top right, rgba(0,212,255,0.12), transparent 35%),
    linear-gradient(180deg, rgba(0,212,255,0.05), rgba(0,212,255,0.015));
}

.lead-label,
.lead-side-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.7;
}

.lead-story-main h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.08;
  margin: 0.75rem 0 1rem;
}

.lead-story-main h2 a {
  color: var(--text);
  text-decoration: none;
}

.lead-story-main h2 a:hover {
  color: var(--accent);
}

.lead-summary {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 60ch;
}

.lead-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.lead-highlights span {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.lead-story-side {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(180deg, rgba(250,204,21,0.06), rgba(250,204,21,0.02)),
    var(--bg-card);
}

.lead-story-side h3 {
  font-size: 1.25rem;
  margin: 0.6rem 0 0.8rem;
}

.lead-story-side p {
  color: var(--text-muted);
}

.lead-story-side blockquote {
  margin: 1.25rem 0 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid rgba(250,204,21,0.35);
  color: var(--text);
  line-height: 1.7;
}

.lead-home-card {
  max-width: 760px;
  background:
    radial-gradient(circle at top right, rgba(0,212,255,0.1), transparent 32%),
    var(--bg-card);
}

.lead-home-card-research {
  background:
    radial-gradient(circle at top right, rgba(180,79,204,0.14), transparent 34%),
    var(--bg-card);
}

.research-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  gap: 1.5rem;
  align-items: stretch;
}

.research-lead-main,
.research-lead-side {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}

.research-lead-main {
  padding: 2rem;
  background:
    radial-gradient(circle at top right, rgba(180,79,204,0.16), transparent 35%),
    linear-gradient(180deg, rgba(180,79,204,0.08), rgba(180,79,204,0.02));
}

.research-lead-main h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.08;
  margin: 0.75rem 0 1rem;
}

.research-lead-main h2 a {
  color: var(--text);
  text-decoration: none;
}

.research-lead-main h2 a:hover {
  color: var(--accent-2);
}

.research-lead-side {
  padding: 1.5rem;
  background:
    linear-gradient(180deg, rgba(96,165,250,0.08), rgba(96,165,250,0.02)),
    var(--bg-card);
}

.research-metric + .research-metric {
  margin-top: 1rem;
}

.research-metric-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.research-metric-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.research-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.9fr);
  gap: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background:
    radial-gradient(circle at top right, rgba(180,79,204,0.12), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}

.research-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.research-chip-card {
  padding: 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
}

.research-chip-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  color: var(--accent-2);
  margin-bottom: 0.35rem;
}

.research-chip-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.research-callout {
  margin: 2rem 0;
  padding: 1.25rem 1.4rem;
  border-left: 3px solid rgba(180,79,204,0.45);
  background: rgba(180,79,204,0.06);
  border-radius: 0 12px 12px 0;
}

.research-findings-grid,
.research-framework-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}

.research-finding-card,
.research-framework-card {
  padding: 1.25rem;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-card);
}

.research-finding-card h3,
.research-framework-card h3 {
  margin: 0.4rem 0 0.6rem;
}

.research-finding-card p,
.research-framework-card p {
  margin: 0;
}

.research-callout-inline {
  margin-top: -0.5rem;
  margin-bottom: 2rem;
}

.research-rank-grid .research-finding-card h3 {
  margin: 0.4rem 0 0.55rem;
}

.research-output-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}

.research-output-card {
  padding: 1.15rem;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.01) 100%),
    var(--bg-card);
  box-shadow: 0 16px 34px rgba(0,0,0,0.22);
}

.research-output-card-wide {
  grid-column: 1 / -1;
}

.research-output-card h3 {
  margin: 0.5rem 0 0.75rem;
  font-size: 1.15rem;
}

.research-output-card p {
  color: var(--text-muted);
}

.research-output-image {
  display: block;
  width: 100%;
  margin: 0.85rem 0 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--bg-2);
}

.research-output-browser {
  margin: 0.9rem 0 0.9rem;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
  background: #0d1117;
  min-height: 560px;
}

.research-output-browser iframe {
  display: block;
  width: 100%;
  height: 560px;
  border: 0;
  background: #0d1117;
}

.arcade-article-header {
  background:
    radial-gradient(circle at 18% 18%, rgba(74,222,128,0.12), transparent 28%),
    radial-gradient(circle at 82% 0%, rgba(0,212,255,0.12), transparent 34%),
    linear-gradient(180deg, rgba(5,12,22,0.96), rgba(6,9,20,0.98));
}

.arcade-scoreboard {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 1rem;
  margin: 0 0 2rem;
}

.arcade-score-card {
  padding: 1.2rem;
  border: 1px solid rgba(74,222,128,0.22);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(74,222,128,0.08), rgba(255,255,255,0.015)),
    var(--bg-card);
  box-shadow: 0 18px 40px rgba(0,0,0,0.24);
}

.arcade-score-card-winner {
  border-color: rgba(0,212,255,0.42);
  background:
    radial-gradient(circle at top right, rgba(0,212,255,0.18), transparent 45%),
    linear-gradient(180deg, rgba(74,222,128,0.09), rgba(255,255,255,0.015)),
    var(--bg-card);
}

.arcade-rank {
  display: inline-flex;
  margin-bottom: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.arcade-score-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.arcade-score {
  margin: 0 0 0.55rem;
  font-family: var(--font-mono);
  font-size: 1.45rem;
  color: #4ade80;
}

.arcade-score-card p:not(.arcade-score) {
  margin: 0;
  color: var(--text-muted);
}

.arcade-prompt-box {
  margin: 1.25rem 0 2rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(74,222,128,0.08), rgba(0,212,255,0.04)),
    var(--bg-card);
}

.arcade-prompt-box p {
  margin-bottom: 0.85rem;
}

.arcade-prompt-box p:last-child {
  margin-bottom: 0;
}

.arcade-output-card .research-output-image {
  background: #07101c;
}

/* ============================================================
   UTILITIES
   ============================================================ */

.mt-sm  { margin-top: 0.75rem; }
.mt-md  { margin-top: 1.5rem; }
.mt-lg  { margin-top: 2.5rem; }
.mb-lg  { margin-bottom: 2rem; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.mono { font-family: var(--font-mono); }
.comment { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 960px) {
  .grid-3  { grid-template-columns: 1fr 1fr; }
  .grid-stats { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .lead-story { grid-template-columns: 1fr; }
  .research-lead { grid-template-columns: 1fr; }
  .research-hero-panel { grid-template-columns: 1fr; }
  .home-about { grid-template-columns: 1fr; gap: 2rem; }
  .research-output-grid { grid-template-columns: 1fr; }
  .arcade-scoreboard { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  #menu-toggle { display: flex; }

  .grid-3  { grid-template-columns: 1fr; }
  .grid-2  { grid-template-columns: 1fr; }
  .grid-stats { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .research-findings-grid,
  .research-framework-grid,
  .research-mini-grid,
  .research-output-grid { grid-template-columns: 1fr; }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .hero-pill {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    width: 100%;
    max-width: 28rem;
    border-radius: 16px;
    padding: 0.55rem 0.8rem;
  }
  .hero-pill span {
    margin-top: 0.38rem;
  }
  .hero-pill p {
    line-height: 1.45;
  }

  .research-output-card {
    padding: 1rem;
  }
  .research-output-card h3 {
    font-size: 1.03rem;
  }
  .research-output-browser {
    min-height: 420px;
  }
  .research-output-browser iframe {
    height: 420px;
  }

   .home-about-copy h2 { font-size: 1.55rem; }
   .home-about-copy p:not(.comment) { line-height: 1.8; }
   .home-about-copy .comment {
    font-size: 0.74rem;
    line-height: 1.6;
  }
  .home-about-cta {
    width: 100%;
    justify-content: center;
  }

  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  .cta-banner { padding: 2rem 1.25rem; }
  .cta-banner .cta-actions { flex-direction: column; }

  .footer-bottom { flex-direction: column; text-align: center; }
}
