/* Self-hosted fonts — eliminates Google Fonts CDN round-trip that caused 5.7s LCP delay (DAK-6602) */
@font-face { font-family: 'DM Sans'; font-style: italic; font-weight: 400; font-display: swap; src: url('/assets/fonts/DM-Sans-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 300; font-display: swap; src: url('/assets/fonts/DM-Sans-300.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/DM-Sans-400.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/DM-Sans-500.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/DM-Sans-600.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/Space-Mono-400.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/Space-Mono-700.woff2') format('woff2'); }

: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;
  --sidebar-w: 260px;
}

*, *::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; flex: 1; justify-content: center; }
.hdr-act { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hdr-brand-sub { font-size: 10px; font-weight: 400; letter-spacing: 1px; color: var(--t4); text-transform: lowercase; }
.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: 44px;
}
.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-gh { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; color: #fff; }
.hdr-gh:hover { color: #fff; }
.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: 44px; height: 44px;
  align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .2s; padding: 0;
  margin-left: auto;
}
.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;
  /* DAK-7384: 12 nav links overflow small phones — cap height to the viewport below the
     header and let the menu scroll internally. dvh handles mobile browser-chrome resize;
     vh is the fallback. overscroll-behavior stops the scroll leaking to the page body. */
  max-height: calc(100vh - var(--hh));
  max-height: calc(100dvh - var(--hh));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.mob-menu.open { display: flex; animation: mob-slide-down .2s ease; }
/* DAK-7384: lock background scroll while the menu is open so the page behind doesn't move */
body.mob-menu-open { overflow: hidden; }
@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: 768px) {
  .hdr-links, .hdr-act { display: none; }
  .mob-tog { display: flex; }
}

/* ── SHARED FOOTER (inner pages) ── */
.ftr { border-top: 1px solid var(--stroke); padding: 48px 0 32px; }
.ftr-in { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.ftr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-bottom: 32px; }
.ftr-col { display: flex; flex-direction: column; gap: 8px; }
.ftr-col-hd { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--t3); margin-bottom: 4px; }
.ftr-col a { color: var(--t3); font-size: 13px; transition: color .15s; text-decoration: none; padding: 4px 0; }
.ftr-col a:hover { color: var(--t1); }
.ftr-bottom { border-top: 1px solid var(--stroke); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.ftr-copy { color: var(--t3); font-size: 13px; }
.ftr-legal { display: flex; gap: 16px; }
.ftr-legal a { color: var(--t3); font-size: 12px; text-decoration: none; transition: color .15s; }
.ftr-legal a:hover { color: var(--t2); }
@media (max-width: 640px) { .ftr-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; } }

/* ── 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: #6a9955; }
.kw { color: #569cd6; }
.st { color: #ce9178; }
.fn { color: #dcdcaa; }
.tp { color: #4ec9b0; }
.nm { color: #b5cea8; }
.nb { color: #9cdcfe; }
.op { color: var(--t2); }
.vr { color: var(--t1); }

/* ── HIGHLIGHT.JS THEME (VSCode Dark+) ── */
.hljs-keyword,.hljs-selector-tag,.hljs-literal,.hljs-meta { color: #569cd6; }
.hljs-string,.hljs-template-tag,.hljs-template-variable,.hljs-link { color: #ce9178; }
.hljs-comment,.hljs-quote { color: #6a9955; font-style: italic; }
.hljs-number,.hljs-symbol,.hljs-regexp,.hljs-selector-pseudo { color: #b5cea8; }
.hljs-title,.hljs-section,.hljs-title.function_ { color: #dcdcaa; }
.hljs-type,.hljs-class,.hljs-built_in,.hljs-selector-class { color: #4ec9b0; }
.hljs-variable,.hljs-attr,.hljs-params,.hljs-property { color: #9cdcfe; }
.hljs-name,.hljs-tag { color: #569cd6; }
.hljs-punctuation,.hljs-operator { color: var(--t2); }
.hljs-addition { color: #4ec9b0; }
.hljs-deletion { color: #f14c4c; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: bold; }

/* ── GLOBAL CTA BUTTON FIX ── */
a.cta-btn, .cta-btn { color: #0a0a0a !important; text-decoration: none; }
a.cta-btn:hover, .cta-btn:hover { color: #0a0a0a !important; }
a.cta-btn svg, .cta-btn svg { stroke: #0a0a0a; }
a.cta-btn-ghost, .cta-btn-ghost { color: var(--t2) !important; }
a.cta-btn-ghost:hover, .cta-btn-ghost:hover { color: var(--gold) !important; }

/* ── 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; }
}

/* ── VISUAL ENHANCEMENTS ── */
.page-hero {
  position: relative; padding: 80px 0 48px; text-align: center;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(212,168,67,.06) 0%, transparent 70%);
}
.page-hero h1 {
  font-size: 36px; font-weight: 700; letter-spacing: -.8px;
  background: linear-gradient(135deg, var(--t1) 0%, var(--gold-l) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-hero p { color: var(--t3); font-size: 17px; max-width: 560px; margin: 12px auto 0; line-height: 1.6; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 24px 0; }
.card {
  background: var(--surface); border: 1px solid var(--stroke); border-radius: 12px;
  padding: 24px; transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover {
  border-color: var(--stroke-h); transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.card h3 { font-size: 15px; font-weight: 600; color: var(--t1); margin-bottom: 6px; }
.card p { font-size: 13px; color: var(--t3); line-height: 1.5; margin: 0; }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover { color: inherit; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
  background: var(--gold-bg); border: 1px solid rgba(212,168,67,.2); color: var(--gold);
}

.glow-line {
  height: 1px; border: none; margin: 48px 0;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
  opacity: .3;
}

.feature-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.feature-table th { text-align: left; padding: 10px 14px; background: var(--elevated); border: 1px solid var(--stroke); color: var(--t3); font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.feature-table td { padding: 10px 14px; border: 1px solid var(--stroke); color: var(--t2); font-size: 14px; }
.feature-table tr:hover td { background: rgba(255,255,255,.015); }
.feature-table .check { color: var(--green); font-weight: 700; }
.feature-table .cross { color: var(--t4); }

.verdict-box {
  background: linear-gradient(135deg, rgba(212,168,67,.04) 0%, rgba(212,168,67,.01) 100%);
  border: 1px solid rgba(212,168,67,.2); border-radius: 12px;
  padding: 28px 32px; margin: 32px 0;
}
.verdict-box h3 { color: var(--gold); font-size: 14px; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.verdict-box p { color: var(--t2); line-height: 1.7; margin: 0; }

.faq-section { margin: 32px 0; }
.faq-section h3 { font-size: 15px; font-weight: 600; color: var(--t1); margin: 24px 0 8px; text-transform: none; letter-spacing: normal; line-height: 1.4; }
.faq-section h3:first-child { margin-top: 0; }
.faq-section p { color: var(--t2); line-height: 1.7; margin: 0 0 20px; font-size: 14px; }

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

/* ── BREADCRUMBS ── */
.breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--t4); padding: 12px 0 0; flex-wrap: wrap; }
.breadcrumbs a { color: var(--t4); transition: color .15s; }
.breadcrumbs a:hover { color: var(--t2); }
.breadcrumbs-sep { color: var(--t4); opacity: .5; }
.breadcrumbs span { color: var(--t3); }

/* ── SCROLL TO TOP ── */
.scroll-top { position: fixed; bottom: 24px; right: 24px; width: 40px; height: 40px; border-radius: 50%; background: var(--elevated); border: 1px solid var(--stroke); color: var(--t3); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s; opacity: 0; pointer-events: none; z-index: 90; }
.scroll-top.visible { opacity: 1; pointer-events: all; }
.scroll-top:hover { border-color: var(--stroke-h); color: var(--gold); background: var(--hover); }

/* ── CODE TABS ── */
.code-tabs { margin: 16px 0 24px; border: 1px solid var(--stroke); border-radius: 10px; overflow: hidden; }
.tabs-nav { display: flex; background: var(--elevated); border-bottom: 1px solid var(--stroke); overflow-x: auto; scrollbar-width: none; }
.tabs-nav::-webkit-scrollbar { display: none; }
.tab-btn { padding: 10px 16px; font-size: 12px; font-weight: 600; color: var(--t4); background: none; border: none; cursor: pointer; white-space: nowrap; transition: color .15s; font-family: var(--mono); letter-spacing: .3px; border-bottom: 2px solid transparent; }
.tab-btn:hover { color: var(--t2); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-pane { display: none; position: relative; }
.tab-pane.active { display: block; }
.tab-pane pre { margin: 0; border-radius: 0; border: none; border-top: none; }
.copy-btn { position: absolute; top: 10px; right: 10px; padding: 4px 10px; font-size: 11px; background: var(--hover); border: 1px solid var(--stroke); border-radius: 5px; color: var(--t4); cursor: pointer; font-family: var(--mono); transition: all .15s; z-index: 1; }
.copy-btn:hover { color: var(--t2); border-color: var(--stroke-h); }

/* ── PATTERN PAGE ENHANCEMENTS ── */
.pat-hero { padding: 20px 0 24px; margin-bottom: 8px; }
.pat-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pat-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; padding: 3px 10px; border-radius: 20px; }
.pat-badge.beginner { background: rgba(74,222,128,.08); border: 1px solid rgba(74,222,128,.2); color: #4ade80; }
.pat-badge.intermediate { background: var(--gold-bg); border: 1px solid rgba(212,168,67,.2); color: var(--gold); }
.pat-badge.advanced { background: rgba(249,115,22,.08); border: 1px solid rgba(249,115,22,.2); color: #f97316; }
.pat-badge.cat { background: var(--elevated); border: 1px solid var(--stroke); color: var(--t3); }
.pat-meta { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--t4); margin-top: 6px; flex-wrap: wrap; }
.pat-meta-icon { font-style: normal; }
.pat-diagram { background: var(--elevated); border: 1px solid var(--stroke); border-radius: 10px; padding: 20px 16px; margin: 20px 0 28px; overflow-x: auto; }
.pat-diagram svg { display: block; max-width: 100%; height: auto; }
.prereq { background: var(--elevated); border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; padding: 14px 18px; margin: 16px 0 24px; }
.prereq strong { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 8px; }
.prereq ul { margin: 0 0 0 16px; }
.prereq li { font-size: 13px; color: var(--t3); margin-bottom: 4px; }
.pat-cta { background: linear-gradient(135deg, rgba(212,168,67,.06) 0%, rgba(212,168,67,.02) 100%); border: 1px solid rgba(212,168,67,.18); border-radius: 12px; padding: 28px 32px; margin-top: 48px; text-align: center; }
.pat-cta h3 { font-size: 18px; font-weight: 600; color: var(--t1); margin-bottom: 8px; border: none; margin-top: 0; padding-top: 0; }
.pat-cta p { color: var(--t3); margin-bottom: 20px; font-size: 14px; }
.pat-cta a.btn { display: inline-flex; }
.sb-cat { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--t4); padding: 16px 20px 4px; }
