:root {
  /* Native widgets (scrollbars, any future form controls' popups) render
     dark to match the design instead of the browser's light-mode defaults.
     Same declaration as theme.css/map.css/admin.css; safe because no
     prefers-color-scheme conditionals exist and all backgrounds are
     authored. */
  color-scheme: dark;
  --bg: #171b20;
  --bg-warm: #27221c;
  --bg-deep: #101318;
  --slate: #3a4352;
  --panel: rgba(29, 33, 39, 0.84);
  --panel-solid: #1d2127;
  --panel-soft: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(216, 170, 93, 0.34);
  --text: #f6f2e9;
  --muted: #b9b0a2;
  --muted-soft: #8f897f;
  --gold: #d8aa5d;
  --gold-bright: #f0cf8a;
  --ink: #27221c;
  --danger-soft: rgba(202, 110, 100, 0.11);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max: 1180px;
  --reading: 760px;
}

* { box-sizing: border-box; }
/* Solid background-color beneath the body gradient — mobile browsers paint the
   landscape safe-area letterbox and rubber-band overscroll with the computed
   COLOR only, so a gradient set via the `background:` shorthand leaves it white.
   #171b20 (= --bg) matches this theme's own gradient start. Pair with the
   <meta name="theme-color"> each page carries. */
html { scroll-behavior: smooth; scroll-padding-top: 94px; background-color: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 10% -10%, rgba(58, 67, 82, 0.68), transparent 31rem),
    radial-gradient(circle at 92% 5%, rgba(216, 170, 93, 0.10), transparent 26rem),
    linear-gradient(150deg, var(--bg), var(--bg-warm) 56%, #181a1f);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .25;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 88%);
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

img { max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { color: var(--ink); background: var(--gold-bright); }

.container { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 100;
  padding: 10px 14px; border-radius: 10px; color: var(--ink); background: var(--gold-bright);
  transform: translateY(-160%); transition: transform .18s ease;
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(23, 27, 32, 0.76);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
/* --nav-h is the height of the top row. It lives on a custom property (rather
   than min-height alone) because the open menu makes .nav a WRAPPING flex
   container, where min-height no longer sizes the first line -- see the
   .site-header.open .brand rule in the 1020px block. */
.nav { --nav-h: 74px; min-height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 500 1.32rem/1 var(--serif); letter-spacing: .01em; }
/* The emblem PNG has an opaque baked background — crop it as a rounded tile
   rather than letterboxing the square (same treatment the landing hero uses). */
.brand-mark { width: 42px; height: 42px; object-fit: cover; border-radius: 10px; filter: drop-shadow(0 8px 18px rgba(0,0,0,.35)); }
.brand small { display: block; margin-top: 5px; color: var(--muted); font: 600 .66rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav-links a { position: relative; padding: 26px 0; color: var(--muted); font-size: .9rem; text-decoration: none; transition: color .2s ease; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 15px; height: 1px; background: var(--gold); box-shadow: 0 0 12px rgba(216,170,93,.6); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.button {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 0 18px; border: 1px solid transparent; border-radius: 999px;
  font: 700 .88rem/1 var(--sans); text-decoration: none; white-space: nowrap;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { color: var(--ink); background: linear-gradient(135deg, var(--gold-bright), var(--gold)); box-shadow: 0 10px 28px rgba(216,170,93,.2); }
.button-primary:hover { box-shadow: 0 14px 34px rgba(216,170,93,.3); }
.button-secondary { color: var(--text); border-color: var(--border); background: rgba(255,255,255,.045); }
.button-secondary:hover { border-color: var(--border-strong); background: rgba(255,255,255,.075); }
.button-ghost { color: var(--muted); }
.menu-toggle {
  display: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: 50%;
  color: var(--text); background: var(--panel-soft); cursor: pointer;
}

.page-hero { position: relative; padding: 82px 0 58px; overflow: hidden; }
.page-hero::after {
  content: ""; position: absolute; width: 380px; height: 380px; right: -190px; top: -70px; z-index: -1;
  border: 1px solid rgba(216,170,93,.12); border-radius: 50%;
  box-shadow: 0 0 0 64px rgba(216,170,93,.025), 0 0 0 126px rgba(255,255,255,.013);
}
/* No ::before rule here on purpose — the leading gold dash was removed. The
   flex `gap` went with it (the label is a single text node, so it did nothing
   else); add both back together if the dash is ever wanted again. */
.eyebrow { display: inline-flex; align-items: center; margin-bottom: 20px; color: var(--gold-bright); font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.page-hero h1 { max-width: 850px; margin: 0 0 20px; font: 500 clamp(3rem, 5.3vw, 5.6rem)/.98 var(--serif); letter-spacing: -.045em; text-wrap: balance; }
.page-hero .lead { max-width: 720px; margin: 0; color: var(--muted); font-size: clamp(1.02rem, 1.5vw, 1.18rem); line-height: 1.72; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.meta-pill { padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.025); font-size: .76rem; }

.public-main { padding: 24px 0 104px; }
.content-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.toc {
  position: sticky; top: 98px; padding: 20px; border: 1px solid var(--border); border-radius: 18px;
  background: rgba(23,27,32,.74); box-shadow: 0 16px 40px rgba(0,0,0,.2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.toc-title { margin: 0 0 13px; color: var(--gold); font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.toc nav { display: grid; gap: 3px; }
.toc a { padding: 9px 10px; border-radius: 9px; color: var(--muted); font-size: .82rem; line-height: 1.25; text-decoration: none; }
.toc a:hover { color: var(--text); background: rgba(255,255,255,.045); }
.toc .back-home { display: inline-flex; margin-top: 14px; color: var(--gold-bright); }

.content-panel {
  min-width: 0; padding: clamp(26px, 4vw, 54px); border: 1px solid var(--border); border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,.045), rgba(255,255,255,.015)), rgba(16,19,24,.72);
  box-shadow: var(--shadow);
}
.prose { max-width: var(--reading); }
.prose.wide { max-width: none; }
.prose section + section { margin-top: 54px; padding-top: 48px; border-top: 1px solid var(--border); }
.prose h2 { margin: 0 0 18px; font: 500 clamp(1.75rem, 2.8vw, 2.55rem)/1.1 var(--serif); letter-spacing: -.025em; }
.prose h3 { margin: 30px 0 10px; font: 500 1.22rem/1.2 var(--serif); }
.prose p, .prose li { color: var(--muted); font-size: .97rem; line-height: 1.76; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 12px 0 20px; padding-left: 1.35rem; }
.prose li + li { margin-top: 7px; }
.prose strong { color: var(--text); }
.prose a { color: var(--gold-bright); text-decoration-color: rgba(216,170,93,.5); text-underline-offset: 3px; }
.prose code { padding: .12em .38em; border: 1px solid var(--border); border-radius: 5px; color: var(--gold-bright); background: rgba(216,170,93,.07); font-size: .9em; }
.prose hr { height: 1px; margin: 42px 0; border: 0; background: var(--border); }
.prose .all-caps { padding: 18px; border-left: 2px solid var(--gold); border-radius: 0 12px 12px 0; color: var(--text); background: rgba(216,170,93,.07); font-size: .88rem; letter-spacing: .025em; }

.callout { margin: 20px 0; padding: 17px 18px; border: 1px solid rgba(216,170,93,.22); border-radius: 14px; color: var(--muted); background: rgba(216,170,93,.07); line-height: 1.62; }
.callout strong { color: var(--gold-bright); }
.contact-card { display: inline-flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 12px; color: var(--gold-bright); background: rgba(216,170,93,.07); text-decoration: none; }

.search-wrap { position: relative; margin-bottom: 26px; }
.search-wrap input { width: 100%; min-height: 48px; padding: 0 16px 0 44px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); background: rgba(255,255,255,.035); outline: none; }
.search-wrap input:focus { border-color: var(--border-strong); box-shadow: 0 0 0 4px rgba(216,170,93,.08); }
.search-wrap::before { content: "⌕"; position: absolute; left: 16px; top: 50%; color: var(--muted); font-size: 1.25rem; transform: translateY(-52%); }
.help-groups { display: grid; gap: 14px; }
.help-group { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.025); }
.help-group[open] { border-color: rgba(216,170,93,.25); background: linear-gradient(135deg, rgba(216,170,93,.06), rgba(255,255,255,.025)); }
.help-group summary { position: relative; padding: 19px 52px 19px 20px; cursor: pointer; list-style: none; font: 500 1.1rem/1.2 var(--serif); }
.help-group summary::-webkit-details-marker { display: none; }
.help-group summary::after { content: "+"; position: absolute; right: 19px; top: 50%; color: var(--gold); font: 400 1.5rem/1 var(--sans); transform: translateY(-50%); }
.help-group[open] summary::after { content: "−"; }
.help-body { padding: 0 20px 22px; border-top: 1px solid var(--border); }
.help-body h3:first-child { margin-top: 20px; }
.help-empty { display: none; padding: 22px; border: 1px dashed var(--border); border-radius: 14px; color: var(--muted); text-align: center; }

.recommendation-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.recommendation-card { min-height: 250px; display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--border); border-radius: 18px; background: rgba(255,255,255,.03); transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.recommendation-card:hover { transform: translateY(-4px); border-color: rgba(216,170,93,.28); background: rgba(255,255,255,.05); }
.rec-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.recommendation-card h2 { margin: 0; font: 500 1.55rem/1.15 var(--serif); }
.price-tag { flex: none; padding: 6px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--gold-bright); background: rgba(216,170,93,.06); font-size: .68rem; font-weight: 700; }
.recommendation-card p { margin: 16px 0 22px; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.recommendation-card a { margin-top: auto; color: var(--gold-bright); font-size: .85rem; font-weight: 700; text-decoration: none; }
.recommendation-card a::after { content: " ↗"; }

.cta { position: relative; overflow: hidden; margin-top: 30px; padding: clamp(34px, 6vw, 62px); border: 1px solid rgba(216,170,93,.28); border-radius: 24px; background: radial-gradient(circle at 80% 20%, rgba(216,170,93,.18), transparent 28%), linear-gradient(135deg, rgba(58,67,82,.36), rgba(39,34,28,.86)); box-shadow: var(--shadow); text-align: center; }
.cta::before { content: ""; position: absolute; inset: 11px; border: 1px solid rgba(255,255,255,.065); border-radius: 17px; pointer-events: none; }
.cta h2 { max-width: 720px; margin: 0 auto 14px; font: 500 clamp(2rem, 4vw, 3.8rem)/1 var(--serif); letter-spacing: -.035em; }
.cta p { max-width: 640px; margin: 0 auto 24px; color: var(--muted); line-height: 1.7; }
.cta-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

footer { padding: 42px 0 32px; color: var(--muted-soft); font-size: .78rem; }
.footer-grid { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 26px; border-bottom: 1px solid var(--border); }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover, .footer-links a[aria-current="page"] { color: var(--text); }
.copyright { padding-top: 22px; text-align: center; }

:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
[hidden] { display: none !important; }

/* The hamburger and the drop-down panel must appear at the SAME breakpoint the
   inline nav links disappear at — otherwise 821-1020px has no reachable
   navigation at all (links hidden, toggle still display:none). */
@media (max-width: 1020px) {
  .nav-links { display: none; }
  .menu-toggle { display: grid; place-items: center; }
  .site-header.open .nav { flex-wrap: wrap; padding-bottom: 14px; }
  /* Opening the menu wraps .nav onto two lines, and in a multi-line flex
     container the container's min-height no longer sets the first line's
     height -- each line is sized by its own items. Without this the top row
     collapsed from --nav-h to the tallest item (~44px) and the brand/buttons
     visibly jumped upward by ~11px the moment the menu opened. Restoring the
     row height on .brand (always present, always on the first line) sizes the
     line back to --nav-h, so the bar holds still. Not applied to .menu-toggle
     or the buttons: they carry explicit heights that make them circles/pills,
     and stretching those would distort them. */
  .site-header.open .brand { min-height: var(--nav-h); }
  .site-header.open .nav-links { order: 3; width: 100%; display: grid; gap: 2px; margin: 0; padding: 8px; border: 1px solid var(--border); border-radius: 16px; background: rgba(16,19,24,.96); }
  .site-header.open .nav-links a { padding: 13px 14px; border-radius: 10px; }
  .site-header.open .nav-links a:hover { background: rgba(255,255,255,.045); }
  .nav-links a[aria-current="page"]::after { display: none; }
  .content-shell { grid-template-columns: 220px minmax(0,1fr); }
}
@media (max-width: 820px) {
  .container { width: min(100% - 28px, var(--max)); }
  .nav { --nav-h: 66px; }
  .brand small { display: none; }
  .nav-actions .button-ghost { display: none; }
  .page-hero { padding: 64px 0 44px; }
  .content-shell { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .recommendation-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .nav-actions .button-primary { display: none; }
  /* ...but a signed-in visitor keeps theirs: it is the only route into the app
     from these pages, and the "Sign in" ghost button it sits beside is hidden
     for them anyway, so there is room. */
  body.is-signed-in .nav-actions .button-primary { display: inline-flex; }
}
/* The signed-in header carries one more always-visible control than the
   signed-out one, and below ~372px there is genuinely not room for emblem +
   wordmark + CTA + hamburger. `.brand` is a flex item with no min-width, so it
   shrinks under its content and the wordmark paints OUTSIDE its box, over the
   button (measured: at 320px the brand box is ~69px wide holding ~111px of
   content). Drop to the emblem alone, which still reads as the home link.
   Thresholded at 400 rather than 372 so 375px phones keep a comfortable margin
   instead of fitting by 3px. Signed-out pages are unaffected. */
@media (max-width: 400px) {
  body.is-signed-in .brand span { display: none; }
  .page-hero h1 { font-size: clamp(2.7rem, 15vw, 4.1rem); }
  .public-main { padding-bottom: 74px; }
  .content-panel { padding: 24px 18px; border-radius: 19px; }
  .toc nav { grid-template-columns: 1fr; }
  .footer-grid { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
  .recommendation-card { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
