/* ============================================================
   Backrooms: Escape Together Wiki — engine theme
   Ported from legacy globals.css (Tailwind @apply expanded).
   Dark single theme, system fonts (Trebuchet / Georgia / Courier).
   ============================================================ */

:root {
  --bg-primary: #0f1115;
  --bg-secondary: #151922;
  --text-primary: #f3f1eb;
  --text-secondary: #b5b1a6;
  --border-color: rgba(255, 248, 232, 0.1);
  --accent-color: #cbb06a;
  --accent-soft: rgba(203, 176, 106, 0.16);
  --header-bg: rgba(2, 6, 23, 0.78);
  --panel-bg: rgba(21, 25, 34, 0.92);
  --content-max: 1240px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #020617;
  color: var(--text-primary);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-feature-settings: "ss01" 1;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
table { border-collapse: collapse; }

/* ---------- grid background ---------- */

.site-grid-background {
  position: relative;
  min-height: 100vh;
  background: #020617;
  isolation: isolate;
}

.site-grid-background::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: #020617;
  background-image:
    linear-gradient(to right, rgba(71, 85, 105, 0.3) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(71, 85, 105, 0.3) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
  background-size: 32px 32px, 32px 32px, 100% 100%;
}

.page-wrap { padding-top: 64px; min-height: 100vh; }

/* ---------- header / navbar ---------- */

.site-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 50;
  height: 64px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
}
@media (min-width: 1024px) {
  .header-inner { padding: 0 1.25rem; }
}

.brand {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.brand-icon { width: 22px; height: 22px; flex-shrink: 0; }

.brand-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}
@media (min-width: 640px) {
  .brand-text { font-size: 1.25rem; }
}

.site-nav {
  display: none;
  align-items: center;
  gap: 1rem;
}
@media (min-width: 1024px) {
  .site-nav { display: flex; gap: 1.25rem; }
}

.site-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--text-primary); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  position: relative;
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.05); }
@media (min-width: 1024px) { .nav-toggle { display: none; } }

.nav-toggle span {
  position: absolute;
  left: 10px;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle span:nth-child(1) { top: 12px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 28px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.5);
}
@media (min-width: 1024px) { .nav-overlay { display: none !important; } }

.mobile-nav {
  position: fixed;
  top: 61px;
  left: 0;
  bottom: 0;
  z-index: 45;
  width: 280px;
  overflow-y: auto;
  padding: 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
@media (min-width: 1024px) { .mobile-nav { display: none !important; } }

.mobile-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--text-primary);
}
.mobile-nav a:hover { background: rgba(255, 255, 255, 0.05); }

/* ---------- home layout shell ---------- */

.home-main { min-height: 100vh; }

.home-shell {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}
@media (min-width: 640px) { .home-shell { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) {
  .home-shell { padding: 2.5rem 2rem 4rem; }
}

.home-content { display: flex; flex-direction: column; gap: 1.5rem; }

.mt-8 { margin-top: 2rem; }

/* ---------- generic panels ---------- */

.hero-grid { display: grid; gap: 1.5rem; }

.hero-copy,
.hero-media,
.panel-section,
.topic-section,
.overview-section,
.faq-section,
.bottom-panel,
.content-section,
.guide-meta-section {
  border: 1px solid var(--border-color);
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.03), rgba(255, 248, 232, 0)),
    var(--panel-bg);
  border-radius: 12px;
}

.panel-section,
.topic-section,
.overview-section,
.faq-section,
.bottom-panel,
.content-section,
.guide-meta-section { padding: 1.5rem; }
@media (min-width: 640px) {
  .panel-section,
  .topic-section,
  .overview-section,
  .faq-section,
  .bottom-panel,
  .content-section,
  .guide-meta-section { padding: 2rem; }
}

.hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 1.5rem;
}
@media (min-width: 640px) { .hero-copy { padding: 2rem; } }

.hero-copy-grid {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}
@media (min-width: 1024px) {
  .hero-copy-grid { grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr); }
}

.hero-copy::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(201, 164, 93, 0.08), transparent 32%),
    linear-gradient(180deg, transparent 0%, rgba(255, 248, 232, 0.02) 100%);
  pointer-events: none;
}

.hero-copy h1 {
  position: relative;
  margin-top: 0.75rem;
  max-width: 48rem;
  font-size: 36px;
  font-weight: 600;
  line-height: 1.02;
  color: var(--text-primary);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}
@media (min-width: 640px) { .hero-copy h1 { font-size: 48px; } }
@media (min-width: 1024px) { .hero-copy h1 { font-size: 60px; } }

.hero-lead {
  margin-top: 1.25rem;
  max-width: 42rem;
  font-size: 16px;
  line-height: 1.75rem;
  color: var(--text-secondary);
}
@media (min-width: 640px) { .hero-lead { font-size: 18px; } }

.hero-summary {
  background: rgba(15, 17, 21, 0.56);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
}

.definition-box {
  background: rgba(201, 164, 93, 0.08);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
}

.definition-box strong,
.hero-summary strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  font-family: "Courier New", monospace;
}

.definition-box p {
  margin-top: 0.75rem;
  font-size: 14px;
  line-height: 1.75rem;
  color: var(--text-primary);
}
@media (min-width: 640px) { .definition-box p { font-size: 16px; } }

.hero-summary ul { margin-top: 0.75rem; display: grid; gap: 0.5rem; list-style: none; }

.hero-summary li {
  position: relative;
  padding-left: 1rem;
  font-size: 14px;
  line-height: 1.5rem;
  color: var(--text-secondary);
}

.hero-summary li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--accent-color);
}

.hero-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero-jump-links { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }

.hero-jump-links a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0 0.75rem;
  background: rgba(255, 248, 232, 0.04);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-family: "Courier New", monospace;
  transition: color 0.2s;
}
.hero-jump-links a:hover { color: var(--text-primary); }

.primary-action,
.secondary-action,
.text-link { transition: color 0.2s, background-color 0.2s, border-color 0.2s; }

.primary-action {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 1.25rem;
  background: var(--accent-color);
  color: #111111;
  font-size: 14px;
  font-weight: 600;
}
.primary-action:hover { background: #d7bb72; color: #111111; }

.secondary-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0 1.25rem;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  background: transparent;
}
.secondary-action:hover { color: #f3e3b0; }

.snapshot-grid {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}
@media (min-width: 640px) { .snapshot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.snapshot-grid dt {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  font-family: "Courier New", monospace;
}

.snapshot-grid dd { margin-top: 0.5rem; font-size: 14px; line-height: 1.5rem; color: var(--text-primary); }

.hero-media { display: flex; flex-direction: column; overflow: hidden; }
.hero-media-wide { order: -1; }

.hero-video-shell {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.02), rgba(255, 248, 232, 0)),
    #090b0f;
}
@media (min-width: 1024px) { .hero-video-shell { aspect-ratio: 16 / 8.4; } }

.hero-video-shell iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.hero-media-note {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(15, 17, 21, 0.92);
  border-top: 1px solid var(--border-color);
  padding: 1.25rem;
}
@media (min-width: 1024px) {
  .hero-media-note { flex-direction: row; align-items: center; justify-content: space-between; }
  .hero-media-note p { margin-top: 0; max-width: 48rem; }
}

.hero-media-note strong { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.hero-media-note p { font-size: 14px; line-height: 1.5rem; color: var(--text-secondary); }
.hero-video-section { align-items: start; }

/* ---------- panel headers / kickers ---------- */

.panel-header { max-width: 48rem; }

.section-kicker {
  margin: 0;
  color: var(--accent-color);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: "Courier New", monospace;
}

.panel-header h2,
.split-block h2,
.bottom-panel h2 {
  margin-top: 0.75rem;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}
@media (min-width: 640px) {
  .panel-header h2,
  .split-block h2,
  .bottom-panel h2 { font-size: 30px; }
}

.panel-header p,
.split-block p,
.bottom-panel p,
.fact-grid p,
.topic-card p,
.qa-list p,
.list-block span {
  margin-top: 0.75rem;
  font-size: 14px;
  line-height: 1.75rem;
  color: var(--text-secondary);
}
@media (min-width: 640px) {
  .panel-header p,
  .split-block p,
  .bottom-panel p,
  .fact-grid p,
  .topic-card p,
  .qa-list p,
  .list-block span { font-size: 16px; }
}

/* ---------- card grids ---------- */

.fact-grid,
.takeaway-grid {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .fact-grid,
  .takeaway-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .fact-grid,
  .takeaway-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.takeaway-grid article,
.fact-grid article {
  background: rgba(255, 248, 232, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.takeaway-grid h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-family: "Courier New", monospace;
}

.takeaway-grid p { margin-top: 0.75rem; font-size: 16px; line-height: 1.75rem; color: var(--text-primary); }

.fact-grid h3,
.qa-list h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}

.fact-grid a,
.text-link,
.qa-list a,
.inline-links a {
  color: var(--accent-color);
  margin-top: 1rem;
  display: inline-flex;
  font-size: 14px;
  font-weight: 500;
}
.fact-grid a:hover,
.text-link:hover,
.qa-list a:hover,
.inline-links a:hover { color: #f3e3b0; }

.topic-grid,
.level-card-grid,
.entity-grid,
.walkthrough-grid {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}
@media (min-width: 1024px) {
  .topic-grid,
  .level-card-grid,
  .entity-grid,
  .walkthrough-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- glance tables ---------- */

.glance-table-wrap {
  margin-top: 2rem;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.glance-table { width: 100%; }

.glance-table th {
  background: rgba(255, 248, 232, 0.04);
  padding: 1rem;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-family: "Courier New", monospace;
}

.glance-table td {
  border-top: 1px solid var(--border-color);
  padding: 1rem;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.75rem;
  color: var(--text-secondary);
}

.glance-table td:first-child,
.glance-table td:nth-child(3) { color: var(--text-primary); }

.glance-table a { color: var(--accent-color); font-weight: 500; transition: color 0.2s; }
.glance-table a:hover { color: #f3e3b0; }

/* ---------- topic / entity / level cards ---------- */

.topic-card {
  display: block;
  background: rgba(255, 248, 232, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.2s, background-color 0.2s;
}
.topic-card:hover {
  border-color: rgba(203, 176, 106, 0.35);
  background: rgba(203, 176, 106, 0.06);
}

.topic-card-image { overflow: hidden; padding: 0; }
.topic-card-image img { display: block; width: 100%; height: 220px; object-fit: cover; }
@media (min-width: 640px) { .topic-card-image img { height: 260px; } }

.topic-card-image-entity {
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.02), rgba(255, 248, 232, 0)),
    rgba(255, 248, 232, 0.015);
}

.entity-card-media {
  display: flex;
  height: 220px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1rem;
  background:
    radial-gradient(circle at 50% 35%, rgba(203, 176, 106, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(9, 11, 15, 0.92), rgba(15, 17, 21, 0.96));
}
@media (min-width: 640px) { .entity-card-media { height: 260px; padding: 1.25rem; } }

.topic-card-image-entity img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.25));
}

.topic-card-body { padding: 1.25rem; }

.topic-card span,
.level-stage-card-header,
.entity-card span,
.walkthrough-step span {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  font-family: "Courier New", monospace;
}

.topic-card strong {
  display: block;
  margin-top: 0.75rem;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}

.level-card-grid-all { }
@media (min-width: 1280px) { .level-card-grid-all { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.level-stage-card {
  overflow: hidden;
  background: rgba(255, 248, 232, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.level-stage-card-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
}

.level-stage-card img { display: block; width: 100%; height: 220px; object-fit: cover; }
.level-stage-card-body { padding: 1.25rem; }
.level-stage-card-body p { font-size: 14px; line-height: 1.75rem; color: var(--text-secondary); }
@media (min-width: 640px) { .level-stage-card-body p { font-size: 16px; } }

.level-overview-grid {
  margin-top: 2rem;
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 1280px) {
  .level-overview-grid { grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr); }
}

.level-overview-grid .hero-media img { width: 100%; height: 260px; object-fit: cover; }

.entity-card,
.walkthrough-step {
  overflow: hidden;
  background: rgba(255, 248, 232, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.entity-card img,
.walkthrough-step img { display: block; width: 100%; height: 220px; object-fit: cover; }

.entity-card-body,
.walkthrough-step-body { padding: 1.25rem; }

.entity-card h3,
.walkthrough-step h3 {
  margin-top: 0.75rem;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}

.entity-card p,
.walkthrough-step p,
.objective-list p {
  margin-top: 0.75rem;
  font-size: 14px;
  line-height: 1.75rem;
  color: var(--text-secondary);
}
@media (min-width: 640px) {
  .entity-card p,
  .walkthrough-step p,
  .objective-list p { font-size: 16px; }
}

.entity-card ul { margin-top: 1rem; list-style: none; display: grid; gap: 0.5rem; }
.entity-card li {
  position: relative;
  padding-left: 1rem;
  font-size: 14px;
  line-height: 1.5rem;
  color: var(--text-secondary);
}
.entity-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--accent-color);
}

.objective-list {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}
@media (min-width: 768px) { .objective-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.objective-list article {
  background: rgba(255, 248, 232, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.objective-list strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}

.objective-list p,
.objective-list a { overflow-wrap: anywhere; word-break: break-word; }

/* ---------- split / list blocks ---------- */

.split-block { display: grid; gap: 2rem; }
@media (min-width: 1024px) {
  .split-block { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .split-block.reverse > :first-child { order: 2; }
  .split-block.reverse > :last-child { order: 1; }
}

.list-block { display: grid; gap: 0.75rem; }

.list-block a,
.qa-list article {
  display: block;
  background: rgba(255, 248, 232, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.list-block strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}

.list-block span { display: block; margin-top: 0.5rem; }

.qa-list { margin-top: 2rem; display: grid; gap: 1rem; }
.qa-list article strong { color: var(--text-primary); font-size: 15px; }
.qa-list article p { margin-top: 0.5rem; }

.inline-links { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 1rem; }

/* ---------- bottom / content sections ---------- */

.bottom-grid { display: grid; gap: 1.5rem; }
@media (min-width: 1024px) { .bottom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.content-section {
  border: 1px solid var(--border-color);
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.03), rgba(255, 248, 232, 0)),
    var(--panel-bg);
  border-radius: 12px;
}

.content-shell { display: flex; flex-direction: column; gap: 2rem; }
.content-columns { display: grid; gap: 2rem; }
@media (min-width: 1024px) { .content-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.content-columns h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}
.content-columns p { margin-top: 0.75rem; font-size: 14px; line-height: 1.75rem; color: var(--text-secondary); }
@media (min-width: 640px) { .content-columns p { font-size: 16px; } }

/* ---------- guide meta (frontmatter-driven) ---------- */

.guide-meta-grid {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}
@media (min-width: 768px) { .guide-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.guide-meta-card,
.guide-meta-list article {
  background: rgba(255, 248, 232, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.guide-meta-card span,
.guide-meta-panel .section-kicker {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  font-family: "Courier New", monospace;
}

.guide-meta-card strong,
.guide-meta-list strong {
  display: block;
  margin-top: 0.75rem;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}

.guide-meta-card p,
.guide-meta-list p { margin-top: 0.75rem; font-size: 14px; line-height: 1.75rem; color: var(--text-secondary); }
@media (min-width: 640px) { .guide-meta-card p, .guide-meta-list p { font-size: 16px; } }

.guide-meta-panel { margin-top: 2rem; }
.guide-meta-list { margin-top: 1rem; display: grid; gap: 1rem; }
@media (min-width: 768px) { .guide-meta-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- prose (legal pages) ---------- */

.prose { max-width: none; }
.prose > *:first-child { margin-top: 0; }
.prose h2 {
  margin: 3rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}
.prose h3 {
  margin: 2rem 0 1rem;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}
.prose p { margin-bottom: 1.5rem; line-height: 1.75; color: var(--text-secondary); }
.prose a { color: var(--accent-color); font-weight: 500; transition: color 0.2s; }
.prose a:hover { text-decoration: underline; }
.prose ul { margin: 1.5rem 0; list-style: none; display: grid; gap: 0.5rem; padding-left: 1.5rem; }
.prose ul li { position: relative; color: var(--text-secondary); }
.prose ul li::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 0.65rem;
  height: 0.5rem;
  width: 0.5rem;
  border-radius: 9999px;
  background: var(--accent-color);
}
.prose ol { margin: 1.5rem 0; padding-left: 1.5rem; display: grid; gap: 0.5rem; color: var(--text-secondary); }
.prose li { color: var(--text-secondary); }
.prose strong { color: var(--text-primary); font-weight: 600; }
.prose code {
  border-radius: 4px;
  padding: 0.125rem 0.375rem;
  font-size: 14px;
  background: rgba(255, 248, 232, 0.08);
  color: #efe5c8;
}
.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid var(--accent-color);
  background: rgba(255, 248, 232, 0.03);
  font-style: italic;
}
.prose table {
  margin: 1.5rem 0;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}
.prose th {
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
}
.prose td {
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  padding: 0.75rem;
  color: var(--text-secondary);
}

/* ---------- legal layout ---------- */

.legal-main { min-height: 100vh; }
.legal-shell { max-width: 980px; margin: 0 auto; padding: 1.5rem 1rem; }
@media (min-width: 1024px) { .legal-shell { padding: 1.5rem; } }

.legal-card {
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-secondary);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.legal-head { border-bottom: 1px solid var(--border-color); padding: 1.5rem; }
.legal-kicker {
  margin: 0 0 0.5rem;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #9b9fb8;
}
.legal-head h1 {
  font-size: 30px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}
.legal-desc { margin-top: 0.75rem; max-width: 48rem; font-size: 14px; line-height: 1.5rem; color: var(--text-secondary); }
.legal-body { padding: 1.5rem; }

.error-card .error-actions { padding: 0 1.5rem 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- engagement / comments ---------- */

.engage-section {
  margin-top: 3rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.03), rgba(255, 248, 232, 0)),
    var(--panel-bg);
  padding: 1.5rem;
}
@media (min-width: 640px) { .engage-section { padding: 2rem; } }

.engage-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }

.engage-like {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 1rem;
  background: rgba(255, 248, 232, 0.02);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s, background-color 0.2s;
}
.engage-like:hover { border-color: rgba(203, 176, 106, 0.35); }
.engage-like[aria-pressed="true"], .engage-like[data-gf-liked] {
  background: var(--accent-soft);
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.engage-like-icon { font-size: 12px; }
.engage-count { font-weight: 500; color: var(--text-secondary); }

.engage-shares { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.engage-share {
  min-height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 0.875rem;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s, border-color 0.2s;
}
.engage-share:hover { color: var(--text-primary); border-color: rgba(203, 176, 106, 0.35); }
.engage-share-msg { font-size: 13px; color: var(--accent-color); }

.comments-block { margin-top: 2rem; }
.comments-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}
.comments-empty { margin-top: 0.75rem; font-size: 14px; color: var(--text-secondary); }
.comments-block:not([data-gf-empty]) .comments-empty { display: none; }

.comment-item {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.02);
}
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.75rem; }
.comment-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.comment-time { font-size: 12px; color: var(--text-secondary); }
.comment-text { margin-top: 0.5rem; font-size: 14px; line-height: 1.7; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }
.comment-reply {
  margin-top: 0.5rem;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent-color);
  font-size: 13px;
  font-weight: 500;
}
.comment-replies { margin-top: 0.75rem; display: grid; gap: 0.75rem; }
.comment-reply-item { margin-top: 0; background: rgba(255, 248, 232, 0.03); }
[data-gf-owner] .comment-name::after {
  content: "Official";
  margin-left: 0.5rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-color);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: "Courier New", monospace;
}

.comment-form { margin-top: 2rem; display: grid; gap: 0.75rem; }
.comment-name-input,
.comment-text-input {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.03);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 14px;
}
.comment-name-input:focus,
.comment-text-input:focus {
  outline: 2px solid rgba(203, 176, 106, 0.45);
  outline-offset: 1px;
  border-color: var(--accent-color);
}
.comment-text-input { resize: vertical; }
.comment-form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.comment-submit {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 1.25rem;
  background: var(--accent-color);
  color: #111111;
  font-size: 14px;
  font-weight: 600;
}
.comment-submit:hover { background: #d7bb72; }
.comment-form-msg { font-size: 13px; color: var(--accent-color); }

/* ---------- ad band ---------- */

.ad-band {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
@media (min-width: 640px) { .ad-band { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .ad-band { padding-left: 1.75rem; padding-right: 1.75rem; } }
.ad-band > div { min-height: 0; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 1rem 3.5rem;
}
@media (min-width: 640px) { .footer-inner { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .footer-inner { padding: 3.5rem 1.75rem; } }

.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 1.08fr 1fr 1fr 0.78fr; gap: 1.5rem; }
}

.footer-brand-panel { padding-bottom: 1.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
@media (min-width: 1024px) {
  .footer-brand-panel { border-bottom: 0; border-right: 1px solid rgba(255, 255, 255, 0.1); padding: 0 2rem 0 0; }
}

.footer-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #d4c07a;
}

.footer-title {
  margin-top: 1rem;
  max-width: 10ch;
  font-size: 2.15rem;
  font-weight: 600;
  line-height: 0.93;
  color: var(--text-primary);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}
@media (min-width: 640px) { .footer-title { font-size: 2.8rem; } }

.footer-tagline { margin-top: 1.25rem; max-width: 30rem; font-size: 14px; line-height: 1.75rem; color: var(--text-secondary); }

.footer-brand-meta { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.footer-brand-meta span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 248, 232, 0.03);
  padding: 0 0.75rem;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.footer-nav-panel { }
@media (min-width: 1024px) { .footer-nav-panel { padding-left: 0.5rem; } }
@media (min-width: 1024px) { .footer-site-panel { padding-left: 0.75rem; } }

.footer-nav-heading {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #9b9fb8;
}
.footer-nav-heading-gap { margin-top: 1.5rem; }

.footer-site-links { margin-top: 1rem; list-style: none; display: grid; gap: 0.25rem; }

.footer-site-link {
  display: inline-flex;
  min-height: 34px;
  width: 100%;
  max-width: 100%;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s;
  overflow-wrap: anywhere;
}
.footer-site-link:hover { color: #f3e3b0; }
button.footer-site-link { cursor: pointer; }
.footer-site-link:focus-visible {
  outline: 2px solid rgba(203, 176, 106, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.footer-bottom p { max-width: 72rem; font-size: 14px; line-height: 1.75rem; color: rgba(181, 177, 166, 0.9); }
.footer-copy { margin-top: 1rem !important; font-size: 12px !important; color: rgba(181, 177, 166, 0.7) !important; }
.footer-copy a { font-weight: 500; color: var(--text-primary); transition: color 0.2s; }
.footer-copy a:hover { color: #d4c07a; }

/* ---------- mobile fine-tuning ---------- */

@media (max-width: 640px) {
  .glance-table-wrap { overflow-x: auto; }
  .glance-table { min-width: 560px; }
  .hero-copy h1 { font-size: 32px; }
  .legal-head h1 { font-size: 26px; }
  .footer-title { font-size: 2rem; }
  .engage-share { padding: 0 0.75rem; }
}
