/* ============================================================
   SCENERY — Shared Stylesheet
   Cinema-dark aesthetic, film grain, amber accents
   ============================================================ */

:root {
  --bg:        #0a0a0c;
  --bg2:       #111116;
  --bg3:       #16161c;
  --surface:   #1c1c24;
  --border:    rgba(255,255,255,0.07);
  --amber:     #e8a020;
  --amber2:    #f5c842;
  --teal:      #00b4a6;
  --text:      #e8e8ec;
  --muted:     #7a7a8c;
  --white:     #ffffff;
  --radius:    12px;
  --radius-lg: 20px;
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-w:     1100px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Film-grain overlay ─── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  background-size: 256px;
  opacity: 0.4;
  mix-blend-mode: overlay;
  animation: grain 0.5s steps(1) infinite;
}
@keyframes grain {
  0%,100%{transform:translate(0,0)}
  10%{transform:translate(-2%,-3%)}
  20%{transform:translate(3%,1%)}
  30%{transform:translate(-1%,2%)}
  40%{transform:translate(2%,-1%)}
  50%{transform:translate(-3%,3%)}
  60%{transform:translate(1%,-2%)}
  70%{transform:translate(-2%,1%)}
  80%{transform:translate(3%,-3%)}
  90%{transform:translate(-1%,2%)}
}

/* ─── Typography ─── */
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-head);
  line-height: 1.2;
  color: var(--white);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--text); margin-bottom: 1rem; }
a  { color: var(--amber); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--amber2); }
strong { color: var(--white); font-weight: 600; }
code, pre {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
}

/* ─── Layout ─── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }
.section { padding: 5rem 0; }
.section + .section { border-top: 1px solid var(--border); }

/* ─── Nav ─── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(10,10,12,0.85);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex; align-items: center;
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 2rem;
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-logo span { color: var(--amber); }
.nav-links { display: flex; gap: 0.25rem; align-items: center; }
.nav-links a {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--white);
  background: var(--surface);
}
.nav-back {
  color: var(--muted) !important;
  font-size: 0.8rem !important;
  display: flex; align-items: center; gap: 0.4rem;
}
.nav-back::before { content: '←'; }
main { padding-top: 64px; }

/* ─── Hero ─── */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
  padding: 6rem 0 4rem;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 60% 40%, rgba(232,160,32,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 10% 80%, rgba(0,180,166,0.04) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
}
.hero-scanlines {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,0.012) 2px,
    rgba(255,255,255,0.012) 4px
  );
}
.hero-content { position: relative; z-index: 2; max-width: 54%; }
.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 0.75rem;
  white-space: nowrap;
}
.hero-eyebrow::before {
  content: '';
  width: 32px; height: 1px;
  background: var(--amber);
  display: inline-block;
}
.hero h1 { margin-bottom: 1.25rem; }
.hero h1 em { font-style: italic; color: var(--amber); }
.hero-sub {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}
.hero-stats {
  display: flex; gap: 3rem; flex-wrap: wrap;
  margin-bottom: 3rem;
}
.hero-stat-value {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.hero-stat-value span { color: var(--amber); }
.hero-stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: all var(--transition);
  cursor: pointer; border: none;
}
.btn-primary {
  background: var(--amber);
  color: #000;
}
.btn-primary:hover {
  background: var(--amber2);
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(232,160,32,0.25);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--surface);
  color: var(--white);
  border-color: rgba(255,255,255,0.15);
}

/* ─── Cards ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
}
.card:hover {
  border-color: rgba(232,160,32,0.2);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(232,160,32,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--white); }
.card-body { font-size: 0.9rem; color: var(--muted); line-height: 1.6; }

/* ─── Doc cards (index page) ─── */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}
.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex; flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.doc-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(232,160,32,0.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}
.doc-card:hover {
  border-color: rgba(232,160,32,0.3);
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  color: var(--text);
}
.doc-card:hover::after { opacity: 1; }
.doc-card-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.75rem;
}
.doc-card-title { font-size: 1.3rem; color: var(--white); margin-bottom: 0.5rem; }
.doc-card-desc { font-size: 0.9rem; color: var(--muted); flex: 1; line-height: 1.6; }
.doc-card-arrow {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--amber);
  font-weight: 500;
  display: flex; align-items: center; gap: 0.4rem;
  transition: gap var(--transition);
}
.doc-card:hover .doc-card-arrow { gap: 0.7rem; }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; margin: 2rem 0; border-radius: var(--radius); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
thead tr { background: var(--bg3); }
thead th {
  padding: 0.9rem 1.1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody td { padding: 0.85rem 1.1rem; color: var(--text); vertical-align: top; }
tbody tr:last-child { border-bottom: none; }

/* ─── Stat row ─── */
.stat-row {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  margin: 2rem 0;
}
.stat-box {
  flex: 1; min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.stat-box .val {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--amber);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.stat-box .lbl {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── Section headers ─── */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.section-label::before {
  content: '';
  width: 20px; height: 1px;
  background: var(--amber);
}
.section-title {
  margin-bottom: 0.75rem;
}
.section-sub {
  font-size: 1rem;
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 2.5rem;
}

/* ─── Numbered list ─── */
.numbered-list { list-style: none; counter-reset: item; display: flex; flex-direction: column; gap: 1.25rem; }
.numbered-list li {
  display: flex; gap: 1rem; align-items: flex-start;
  counter-increment: item;
}
.numbered-list li::before {
  content: counter(item, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--amber);
  background: rgba(232,160,32,0.1);
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* ─── Badge ─── */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-amber { background: rgba(232,160,32,0.15); color: var(--amber); }
.badge-teal  { background: rgba(0,180,166,0.15);  color: var(--teal);  }
.badge-dim   { background: var(--bg3); color: var(--muted); border: 1px solid var(--border); }

/* ─── Timeline (roadmap) ─── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item {
  display: grid;
  grid-template-columns: 140px 24px 1fr;
  gap: 0 1.5rem;
  position: relative;
}
.tl-item:not(:last-child) .tl-line {
  position: absolute;
  left: calc(140px + 1.5rem + 11px);
  top: 28px;
  bottom: -16px;
  width: 2px;
  background: var(--border);
}
.tl-date {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--amber);
  padding-top: 4px;
}
.tl-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--amber);
  flex-shrink: 0;
  position: relative; z-index: 1;
  margin-top: 1px;
}
.tl-body { padding-bottom: 2.5rem; }
.tl-body h4 { font-size: 0.95rem; color: var(--white); margin-bottom: 0.5rem; }
.tl-body ul { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; }
.tl-body ul li {
  font-size: 0.88rem; color: var(--muted);
  display: flex; align-items: center; gap: 0.5rem;
}
.tl-body ul li::before { content: '→'; color: var(--amber); font-size: 0.75rem; }

/* ─── Two-col layout ─── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; gap: 2rem; } }

/* ─── Epic chip ─── */
.epic-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  background: rgba(232,160,32,0.1);
  border: 1px solid rgba(232,160,32,0.2);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--amber);
  margin-bottom: 0.5rem;
}

/* ─── Risk severity ─── */
.sev-high   { color: #f55; }
.sev-medium { color: var(--amber); }
.sev-low    { color: var(--teal); }

/* ─── Progress bar ─── */
.progress-bar {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.4rem;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transition: width 1s ease;
}

/* ─── Highlight block ─── */
.highlight-block {
  background: linear-gradient(135deg, rgba(232,160,32,0.08), rgba(0,180,166,0.05));
  border: 1px solid rgba(232,160,32,0.15);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  margin: 2rem 0;
}
.highlight-block p { color: var(--text); margin: 0; font-size: 1.05rem; line-height: 1.8; }
.highlight-block p:last-child { margin: 0; }

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  text-align: center;
}
.site-footer .logo {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.site-footer .logo span { color: var(--amber); }
.site-footer p { font-size: 0.85rem; color: var(--muted); }

/* ─── Animations ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.6s ease both; }
.fade-up-1 { animation-delay: 0.1s; }
.fade-up-2 { animation-delay: 0.2s; }
.fade-up-3 { animation-delay: 0.3s; }
.fade-up-4 { animation-delay: 0.4s; }

/* ─── Mobile ─── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-stats { gap: 1.5rem; }
  .hero-content { max-width: 100%; }
  .hero-visual { display: none; }
  .doc-grid { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 80px 18px 1fr; }
  .container { padding: 0 1.25rem; }
  .section { padding: 3rem 0; }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ─── Page-specific accent stripe ─── */
.page-stripe {
  height: 3px;
  background: linear-gradient(90deg, var(--amber) 0%, var(--teal) 50%, transparent 100%);
  position: fixed; top: 64px; left: 0; right: 0; z-index: 999;
}

/* ─── Nav pill active ─── */
.nav-pill {
  background: rgba(232,160,32,0.12);
  color: var(--amber) !important;
  border: 1px solid rgba(232,160,32,0.2);
}

/* ─── Chapter header ─── */
.chapter {
  display: flex; align-items: center; gap: 1rem;
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.chapter-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--amber);
  background: rgba(232,160,32,0.1);
  border: 1px solid rgba(232,160,32,0.2);
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
}
.chapter h2 { margin: 0; }

/* ─── Arch diagram boxes ─── */
.arch-layer {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}
.arch-layer-header {
  background: var(--bg3);
  padding: 0.6rem 1.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.arch-layer-body {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  padding: 1rem 1.2rem;
}
.arch-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text);
  display: flex; align-items: center; gap: 0.5rem;
}
.arch-box .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.arch-box .dot-teal { background: var(--teal); }
