/* ============================================================
   DD&SA — Neural Theme (site-wide)
   Drop into /assets/neural-theme.css and include on any page with:
     <link rel="stylesheet" href="/assets/neural-theme.css" />
   Designed to layer over existing pages: it themes the common
   elements (body, header, nav, cards, sections, footer, video)
   and lifts page content above the canvas injected by
   /assets/neural-bg.js.
   ============================================================ */

:root {
  --ink:        #04070f;
  --navy:       #0a1228;
  --navy-line:  #1b2a4a;
  --gold:       #c49a2a;
  --gold-hot:   #ffd96b;
  --text:       #eef2fc;
  --muted:      #9aa6c4;

  --display: Georgia, "Times New Roman", serif;
  --bodyfont: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;

  --radius: 14px;
  --max: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* anchor targets land clear of the sticky header */
[id] { scroll-margin-top: 96px; }

body {
  font-family: var(--bodyfont);
  background: var(--ink);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  margin: 0;
}

/* everything except the injected canvas (z 0) and veil (z 1)
   sits above the living background */
body > * { position: relative; z-index: 2; }

a { color: var(--gold-hot); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold-hot);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.2; }

/* ---------- header / nav ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50 !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(rgba(4,7,15,0.82), rgba(4,7,15,0.66));
  border-bottom: 1px solid rgba(196,154,42,0.18);
}

nav {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px clamp(20px, 5vw, 48px);
  flex-wrap: wrap;
  gap: 10px;
}

.nav-links { display: flex; gap: clamp(14px, 3vw, 30px); font-size: 16px; flex-wrap: wrap; }
.nav-links a {
  color: var(--muted);
  letter-spacing: 0.02em;
  transition: color 0.25s ease;
  position: relative;
  padding-bottom: 3px;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--gold-hot); text-decoration: none; }
.nav-links a:hover::after { width: 100%; }

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding: 110px clamp(20px, 6vw, 60px) 70px;
  max-width: 960px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}

.hero p {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--muted);
  max-width: 700px;
  margin: 0 auto 40px;
}

/* gilt accent for any element you wrap in <span class="gilt"> */
.gilt {
  background: linear-gradient(105deg, var(--gold) 0%, var(--gold-hot) 45%, var(--gold) 90%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ddsa-shimmer 7s linear infinite;
}

@keyframes ddsa-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 34px;
  border-radius: 999px;
  font-size: 1rem;
  letter-spacing: 0.05em;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #a8821e);
  color: #0a0d18;
  font-weight: 600;
  box-shadow: 0 6px 26px rgba(196,154,42,0.35);
}
.btn-gold:hover { box-shadow: 0 10px 36px rgba(196,154,42,0.55); }

.btn-ghost {
  border: 1px solid rgba(196,154,42,0.45);
  color: var(--gold-hot);
}
.btn-ghost:hover { background: rgba(196,154,42,0.08); }

/* ---------- sections ---------- */
/* frosted panel so long-form text stays readable while the
   network breathes at the edges */
.section {
  max-width: var(--max);
  margin: 40px auto 70px;
  padding: 60px clamp(20px, 6vw, 60px) 70px;
  background: linear-gradient(165deg, rgba(9,14,32,0.68), rgba(5,9,22,0.68));
  border: 1px solid rgba(27,42,74,0.5);
  border-radius: var(--radius);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.section h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }

/* heroes stay open so the living network shows through */
.hero, section.hero {
  background: none;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ---------- downloads grid ---------- */
.downloads-grid a {
  display: block;
  background: linear-gradient(165deg, rgba(16,22,44,0.92), rgba(8,12,26,0.92));
  border: 1px solid rgba(27,42,74,0.9);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--text);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.downloads-grid a:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: rgba(196,154,42,0.55);
  box-shadow: 0 14px 36px rgba(0,0,0,0.5), 0 0 24px rgba(196,154,42,0.10);
  color: var(--gold-hot);
}

/* ---------- cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 26px;
  margin-top: 40px;
}

.card {
  position: relative;
  display: block;
  background: linear-gradient(165deg, rgba(16,22,44,0.92), rgba(8,12,26,0.92));
  border: 1px solid rgba(27,42,74,0.9);
  border-radius: var(--radius);
  padding: 32px 28px 30px;
  color: var(--text);
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0,0,0,0.5);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  text-decoration: none;
  transform: translateY(-6px);
  border-color: rgba(196,154,42,0.55);
  box-shadow: 0 22px 50px rgba(0,0,0,0.55), 0 0 34px rgba(196,154,42,0.12);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 12%, rgba(196,154,42,0.10), transparent 38%),
    radial-gradient(circle at 8% 95%, rgba(27,42,74,0.55), transparent 45%);
  opacity: 0.7;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }

.card h3 { font-size: 1.3rem; margin: 0 0 12px; position: relative; }
.card p  { color: var(--muted); font-size: 0.98rem; position: relative; margin: 0; }

/* ---------- long-form content (essays, blueprint, about pages) ---------- */
.content, article, .prose {
  max-width: 820px;
  margin: 0 auto;
  padding: 60px clamp(20px, 6vw, 60px) 90px;
  background: linear-gradient(165deg, rgba(10,16,36,0.78), rgba(6,10,24,0.78));
  border: 1px solid rgba(27,42,74,0.7);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.content h1, article h1, .prose h1,
.content h2, article h2, .prose h2 { color: var(--text); }

.content h2, article h2, .prose h2 {
  border-bottom: 1px solid rgba(196,154,42,0.25);
  padding-bottom: 10px;
  margin-top: 2.2em;
}

.content p, article p, .prose p { color: #d7ddf0; }

blockquote {
  border-left: 3px solid var(--gold);
  margin: 1.6em 0;
  padding: 0.4em 0 0.4em 1.2em;
  color: var(--muted);
  font-style: italic;
}

/* ---------- media ---------- */
video, iframe.video, .video-frame video {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
  box-shadow: 0 30px 80px rgba(0,0,0,0.65), 0 0 60px rgba(196,154,42,0.08);
}

.video-frame {
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(140deg,
    rgba(196,154,42,0.55), rgba(27,42,74,0.7) 40%,
    rgba(196,154,42,0.18) 70%, rgba(255,217,107,0.45));
}
.video-frame video { border-radius: calc(var(--radius) - 1px); }

/* ---------- tables (for blueprint / data pages) ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
}
th, td {
  border: 1px solid rgba(27,42,74,0.9);
  padding: 10px 14px;
  text-align: left;
}
th {
  background: rgba(196,154,42,0.12);
  color: var(--gold-hot);
  font-family: var(--display);
  letter-spacing: 0.03em;
}
tr:nth-child(even) td { background: rgba(16,22,44,0.45); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid rgba(196,154,42,0.18);
  background: rgba(3,5,11,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 44px clamp(20px, 6vw, 60px);
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
