:root {
  --bg: #050505;
  --surface: #0d0d0d;
  --elevated: #161616;
  --hover: #1e1e1e;
  --stroke: #252525;
  --stroke-h: #3a3a3a;
  --gold: #D4A843;
  --gold-l: #F0CC70;
  --gold-dk: #8B6914;
  --gold-bg: rgba(212,168,67,.06);
  --gold-glow: rgba(212,168,67,.15);
  --t1: #f8f8f8;
  --t2: #c8c8c8;
  --t3: #8a8a8a;
  --t4: #5a5a5a;
  --green: #4ade80;
  --f: 'DM Sans', system-ui, -apple-system, sans-serif;
  --mono: 'Space Mono', 'Courier New', monospace;
  --hh: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { background: var(--bg); color: var(--t1); font-family: var(--f); font-size: 16px; line-height: 1.7; overflow-x: hidden; }
a { color: var(--gold); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold-l); }
::selection { background: rgba(212,168,67,.2); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(212,168,67,.15);
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1e1e1e; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

.skip-link {
  position: absolute; top: -100%; left: 16px;
  background: var(--gold); color: #0a0a0a;
  padding: 8px 16px; border-radius: 0 0 8px 8px;
  font-size: 14px; font-weight: 600;
  z-index: 9999; transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ── SHARED HEADER (inner pages) ── */
.hdr {
  position: sticky; top: 0; z-index: 100;
  height: var(--hh);
  background: rgba(5,5,5,.92);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border-bottom: 1px solid var(--stroke);
  display: flex; align-items: center; padding: 0 28px;
}
.hdr-in {
  max-width: 1200px; margin: 0 auto; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.hdr-brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--t1); font-family: var(--mono);
  font-size: 13px; font-weight: 700; letter-spacing: 2.5px; flex-shrink: 0;
  min-width: 44px; min-height: 44px;
}
.hdr-logo {
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(212,168,67,.18), 0 0 14px rgba(212,168,67,.1);
  transition: box-shadow .3s;
}
.hdr-brand:hover .hdr-logo {
  box-shadow: 0 0 0 1px rgba(212,168,67,.4), 0 0 22px rgba(212,168,67,.22);
}
.hdr-links { display: flex; align-items: center; gap: 2px; }
.hdr-links a {
  color: var(--t3); font-size: 13px; font-weight: 400;
  transition: color .2s; position: relative;
  padding: 6px 10px; border-radius: 6px;
  display: flex; align-items: center; min-height: 36px;
}
.hdr-links a::after {
  content: ''; position: absolute; bottom: 3px; left: 10px; right: 10px;
  height: 1px; background: var(--gold); transform: scaleX(0);
  transition: transform .22s ease; border-radius: 1px;
}
.hdr-links a:hover { color: var(--t1); }
.hdr-links a:hover::after, .hdr-links a.hdr-active::after { transform: scaleX(1); }
.hdr-links a.hdr-active { color: var(--gold); }
.hdr-sep {
  width: 1px; height: 16px; background: var(--stroke);
  margin: 0 6px; flex-shrink: 0; display: inline-block;
}
.hdr-cta {
  background: var(--gold) !important; color: #080808 !important;
  padding: 0 16px !important; border-radius: 7px;
  font-weight: 600 !important; font-size: 13px !important;
  min-height: 34px; display: inline-flex !important;
  align-items: center; flex-shrink: 0;
  transition: background .2s, box-shadow .2s;
}
.hdr-cta::after { display: none !important; }
.hdr-cta:hover {
  background: var(--gold-l) !important;
  box-shadow: 0 0 16px rgba(212,168,67,.2);
}

/* ── MOBILE NAV (shared) ── */
.mob-tog {
  display: none; background: rgba(255,255,255,.05);
  border: 1px solid var(--stroke); cursor: pointer;
  color: var(--t2); border-radius: 8px;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .2s; padding: 0;
}
.mob-tog:hover {
  color: var(--t1); border-color: var(--stroke-h);
  background: rgba(255,255,255,.08);
}
.mob-tog .x-icon { display: none; }
.mob-tog.open .ham-icon { display: none; }
.mob-tog.open .x-icon { display: block; }
.mob-menu {
  display: none; position: fixed; top: var(--hh);
  left: 0; right: 0; z-index: 99;
  background: rgba(5,5,5,.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--stroke);
  padding: 8px 16px 16px; flex-direction: column; gap: 2px;
}
.mob-menu.open { display: flex; animation: mob-slide-down .2s ease; }
@keyframes mob-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.mob-menu a {
  display: flex; align-items: center; padding: 0 12px;
  min-height: 48px; font-size: 14px; color: var(--t2);
  border-radius: 8px; transition: all .15s;
}
.mob-menu a:hover { color: var(--t1); background: rgba(255,255,255,.04); }
.mob-sep { height: 1px; background: var(--stroke); margin: 6px 0; }
.mob-cta {
  background: rgba(212,168,67,.1) !important;
  color: var(--gold) !important; font-weight: 600 !important;
}
.mob-cta:hover {
  background: rgba(212,168,67,.18) !important;
  color: var(--gold-l) !important;
}
@media (max-width: 640px) {
  .hdr-links { display: none; }
  .mob-tog { display: flex; }
}

/* ── SHARED FOOTER (inner pages) ── */
.ftr { border-top: 1px solid var(--stroke); padding: 32px 0; }
.ftr-in {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.ftr-copy { color: var(--t4); font-size: 13px; }
.ftr-links { display: flex; gap: 20px; }
.ftr-links a { color: var(--t4); font-size: 13px; transition: color .15s; }
.ftr-links a:hover { color: var(--t2); }

/* ── SHARED CODE STYLING ── */
code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--elevated); border: 1px solid var(--stroke);
  padding: 2px 6px; border-radius: 4px; color: var(--gold-l);
}
pre {
  background: var(--surface); border: 1px solid var(--stroke);
  border-radius: 10px; padding: 20px 22px;
  overflow-x: auto; margin: 16px 0 24px;
}
pre code {
  background: none; border: none; padding: 0;
  color: var(--t2); font-size: 13px; line-height: 1.8; display: block;
}
.cm { color: var(--t4); }
.kw { color: #93c5fd; }
.st { color: #86efac; }
.fn { color: var(--gold-l); }
.nb { color: #f9a8d4; }

/* ── SHARED BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 22px; border-radius: 9px;
  font-weight: 600; font-size: 14px; transition: all .15s;
  font-family: var(--f); border: none; cursor: pointer;
}
.btn-p { background: var(--gold); color: #0a0a0a; }
.btn-p:hover { background: var(--gold-l); }
.btn-g { border: 1px solid var(--stroke-h); color: var(--t2); }
.btn-g:hover { border-color: var(--t3); color: var(--t1); }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ── PROGRESSIVE ENHANCEMENT: content visible without JS ── */
html:not(.js) .reveal, html:not(.js) .rv { opacity: 1 !important; transform: none !important; }
