:root {
  --navy: #1a1f3a;
  --dark: #0f1225;
  --gold: #d4a843;
  --gold-dim: #b8923a;
  --text: #d4d4d8;
  --text-muted: #9b9bab;
  --card-bg: #1e2340;
  --card-border: #2a2f50;
  --white: #f0f0f5;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: Georgia, "Times New Roman", serif;
  background: var(--dark);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--gold); }

a:hover { color: var(--gold-dim); }

img { max-width: 100%; display: block; }

nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(15, 18, 37, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
  z-index: 100;
  padding: 0 2rem;
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 60px;
}

.nav-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 0.4rem;
  list-style: none;
  align-items: center;
  flex-wrap: nowrap;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
  border-color: rgba(212, 168, 67, 0.28);
  background: rgba(212, 168, 67, 0.08);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  cursor: pointer;
}

.nav-dropdown-trigger::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid var(--text-muted);
  margin-left: 4px;
  vertical-align: middle;
  transition: border-color 0.2s;
}

.nav-dropdown:hover .nav-dropdown-trigger::after,
.nav-dropdown-trigger.active::after {
  border-top-color: var(--gold);
}

.nav-submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 18, 37, 0.98);
  border: 1px solid var(--card-border);
  border-radius: 0 0 8px 8px;
  padding: 0.5rem 0;
  min-width: 210px;
  list-style: none;
  z-index: 200;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* Invisible bridge so mouse can travel from trigger to submenu */
.nav-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 4px;
  display: none;
}

.nav-dropdown:hover::after {
  display: block;
}

.nav-dropdown:hover .nav-submenu {
  display: block;
}

.nav-submenu a.active {
  color: var(--gold) !important;
  background: rgba(212, 168, 67, 0.08) !important;
}

.nav-submenu li {
  padding: 0;
}

.nav-submenu a {
  display: block;
  padding: 0.55rem 1rem !important;
  border-radius: 0 !important;
  border: none !important;
  font-size: 0.85rem;
}

.nav-submenu a:hover {
  background: rgba(212, 168, 67, 0.1) !important;
  border: none !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

.hero {
  padding: 140px 2rem 80px;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.hero-seal {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.5rem;
}

.hero-label,
.eyebrow {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.hero h1,
.page-hero h1 {
  font-size: 2.8rem;
  color: var(--white);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.hero-sub,
.page-intro {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
}

.hero-cta,
.button-link {
  display: inline-block;
  padding: 14px 36px;
  background: var(--gold);
  color: var(--dark);
  text-decoration: none;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: background 0.2s, transform 0.2s;
}

.hero-cta:hover,
.button-link:hover {
  background: var(--gold-dim);
  color: var(--dark);
  transform: translateY(-1px);
}

.divider {
  width: 60px;
  height: 2px;
  background: var(--gold);
  margin: 0 auto;
  opacity: 0.5;
}

.section,
.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 60px 2rem;
}

.section.narrow,
.narrow-page { max-width: 920px; }

.section h2,
.content-card h2,
.checklist-group h2,
.table-card h2,
.empty-state h2 {
  font-size: 1.6rem;
  color: var(--white);
  margin-bottom: 1rem;
}

.section p,
.content-card p,
.empty-state p,
.table-card p {
  font-size: 1.02rem;
  color: var(--text);
  margin-bottom: 1.2rem;
}

.layers {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 2rem 60px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.layer-card,
.content-card,
.table-card,
.empty-state,
.toc-card,
.checklist-group,
.explore-card,
.article-block {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.layer-card {
  padding: 2rem 1.5rem;
}

.layer-card .layer-num {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.layer-card h3,
.explore-card h3,
.checklist-group h2,
.accordion-item summary span:first-child {
  font-size: 1.15rem;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.layer-card p,
.explore-card p,
.checklist-group p,
.accordion-body p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.principles {
  max-width: 780px;
  margin: 0 auto;
  padding: 60px 2rem;
}

.principles h2,
.explore h2 { text-align: center; margin-bottom: 2rem; }

.principle {
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--card-border);
}

.principle strong {
  color: var(--gold);
  font-size: 1rem;
}

.principle p {
  font-size: 0.95rem;
  color: var(--text);
  margin-top: 0.3rem;
}

.explore {
  max-width: 940px;
  margin: 0 auto;
  padding: 60px 2rem;
}

.explore .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.explore-card {
  display: block;
  padding: 1.5rem;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s;
}

.explore-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.card-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 0.95rem;
}

.card-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-shell { padding-top: 120px; }
.page-hero.narrow { max-width: 820px; margin: 0 auto 2rem; text-align: center; }

.content-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.toc-card { padding: 1rem; }
.toc-sticky { position: sticky; top: 88px; }
.toc-label {
  font-family: "Helvetica Neue", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 0.9rem;
}

.toc-list {
  padding-left: 1.1rem;
  display: grid;
  gap: 0.55rem;
}

.toc-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.toc-list a:hover { color: var(--gold); }

.content-card { padding: 2rem; }
.stack-lg > * + * { margin-top: 1.1rem; }

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: var(--white);
  line-height: 1.3;
  margin: 1.5rem 0 0.8rem;
}

.prose h1 { font-size: 2.2rem; margin-top: 0; }
.prose h2 { font-size: 1.55rem; }
.prose h3 { font-size: 1.15rem; }
.prose h4 { font-size: 1rem; }

.article-block {
  padding: 1.6rem;
  margin-top: 1.5rem;
  scroll-margin-top: 80px;
}

.article-block:first-of-type { margin-top: 0; }

.prose p,
.prose li,
.prose dd,
.prose dt,
.prose blockquote,
.prose th,
.prose td { color: var(--text); }

.prose p,
.prose ul,
.prose ol,
.prose dl,
.prose blockquote,
.prose pre,
.prose table,
.prose hr { margin: 0 0 1rem; }

.prose ul,
.prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.35rem; }

.prose code {
  background: rgba(212, 212, 216, 0.08);
  border: 1px solid rgba(212, 212, 216, 0.1);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.92em;
}

.prose pre {
  padding: 1rem;
  overflow-x: auto;
  background: rgba(15, 18, 37, 0.85);
  border: 1px solid var(--card-border);
  border-radius: 8px;
}

.prose pre code { background: none; border: none; padding: 0; }

.prose hr {
  border: none;
  border-top: 1px solid var(--card-border);
}

.prose blockquote {
  border-left: 3px solid var(--gold);
  padding: 0.85rem 1rem;
  background: rgba(212, 168, 67, 0.06);
  border-radius: 0 8px 8px 0;
}

.definition-list {
  display: grid;
  gap: 0.9rem;
}

.definition-item {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(15, 18, 37, 0.45);
  border: 1px solid rgba(212, 168, 67, 0.12);
  border-radius: 8px;
}

.definition-item dt {
  color: var(--gold);
  font-weight: 700;
}

.definition-item dd { margin: 0; }

.accordion-item {
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(15, 18, 37, 0.45);
}

.accordion-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.accordion-item summary::-webkit-details-marker { display: none; }
.accordion-item[open] summary { border-bottom: 1px solid var(--card-border); }
.accordion-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.accordion-body { padding: 1.2rem; }

.article-skeleton {
  display: grid;
  gap: 0.9rem;
  list-style: none;
}

.article-skeleton li {
  padding: 1rem 1.1rem;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(15, 18, 37, 0.45);
}

.article-skeleton strong {
  display: block;
  color: var(--white);
  margin-bottom: 0.35rem;
}

.article-skeleton span { color: var(--text-muted); }

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.checklist-group { padding: 1.4rem; }
.checklist-items { display: grid; gap: 0.75rem; margin-top: 1rem; }

.checkbox-item {
  display: grid;
  grid-template-columns: 1.35rem 1fr;
  gap: 0.8rem;
  align-items: start;
}

.checkbox-item input {
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  border: 1.5px solid var(--gold);
  border-radius: 3px;
  background: transparent;
  margin-top: 0.2rem;
  position: relative;
}

.checkbox-item input:checked::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.02rem;
  width: 0.35rem;
  height: 0.7rem;
  border: solid var(--gold);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-item label {
  color: var(--text);
  cursor: pointer;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  text-align: left;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--card-border);
}

th {
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--white);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

td { color: var(--text-muted); }

.empty-state {
  margin-top: 1.5rem;
  padding: 1.5rem;
  text-align: center;
}

footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 2rem;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left,
.footer-links a {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: "Helvetica Neue", Arial, sans-serif;
  text-decoration: none;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a:hover { color: var(--gold); }

/* Checkbox accordion (companions, FAQ) */
.accordion {
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(15, 18, 37, 0.45);
  margin-bottom: 0.75rem;
}

.accordion-toggle {
  display: none;
}

.accordion-label {
  display: block;
  cursor: pointer;
  padding: 1.1rem 1.2rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 1.05rem;
  color: var(--white);
  transition: color 0.2s;
  position: relative;
  padding-right: 2.5rem;
}

.accordion-label::after {
  content: "+";
  position: absolute;
  right: 1.2rem;
  top: 1.1rem;
  color: var(--gold);
  font-size: 1.3rem;
  font-weight: 300;
  transition: transform 0.2s;
}

.accordion-toggle:checked + .accordion-label::after {
  content: "−";
}

.accordion-label:hover {
  color: var(--gold);
}

.companion-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-family: Georgia, "Times New Roman", serif;
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-toggle:checked ~ .accordion-body {
  max-height: none;
  border-top: 1px solid var(--card-border);
}

.accordion-inner {
  padding: 1.2rem;
}

.accordion-inner h3 {
  color: var(--white);
  font-size: 1.15rem;
  margin: 1.5rem 0 0.8rem;
}

.accordion-inner h3:first-child {
  margin-top: 0;
}

.accordion-inner h4 {
  color: var(--white);
  font-size: 1rem;
  margin: 1.2rem 0 0.6rem;
}

.accordion-inner p {
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.accordion-inner ul,
.accordion-inner ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.accordion-inner li {
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.accordion-inner table {
  margin: 1rem 0;
}

/* Info box */
.info-box {
  background: rgba(212, 168, 67, 0.06);
  border: 1px solid rgba(212, 168, 67, 0.18);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
}

.info-box p {
  font-size: 0.95rem;
  color: var(--text);
  margin: 0;
}

/* Status badges */
.status-badge {
  display: inline-block;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 168, 67, 0.3);
  color: var(--gold);
}

.status-badge.coming {
  border-color: rgba(100, 149, 237, 0.3);
  color: #6495ed;
}

.status-badge.draft {
  border-color: rgba(212, 168, 67, 0.3);
  color: var(--gold);
}

/* Commentary items */
.commentary-item {
  padding: 1rem 1.2rem;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(15, 18, 37, 0.45);
  margin-bottom: 0.75rem;
}

.commentary-item h3 {
  color: var(--white);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.commentary-item p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
  font-style: italic;
}

/* Checklist */
.checklist-category {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1.4rem;
  margin-bottom: 1rem;
}

.checklist-category h3 {
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--card-border);
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.checklist-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  min-width: 1.15rem;
  border: 1.5px solid var(--gold);
  border-radius: 3px;
  background: transparent;
  margin-top: 0.2rem;
  cursor: pointer;
  position: relative;
}

.checklist-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.02rem;
  width: 0.35rem;
  height: 0.7rem;
  border: solid var(--gold);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checklist-item label {
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
  line-height: 1.5;
}

.checklist-ref {
  display: inline-block;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 0.3rem;
  white-space: nowrap;
}

/* Content section override for sub-pages */
.content-page .section {
  padding-top: 0;
}

.content-page .section h2 {
  font-size: 1.4rem;
  color: var(--gold);
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--card-border);
}

.content-page .section h2:first-child {
  margin-top: 0;
}

@media (max-width: 980px) {
  .content-layout,
  .checklist-grid { grid-template-columns: 1fr; }
  .toc-sticky { position: static; }
}

@media (max-width: 1050px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(15, 18, 37, 0.98);
    padding: 1rem 2rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--card-border);
  }
  .nav-links.open .nav-dropdown { position: static; }
  .nav-links.open .nav-submenu {
    display: block;
    position: static;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0 0 1rem;
    min-width: 0;
  }
  .nav-links.open .nav-submenu a {
    padding: 0.35rem 0.55rem !important;
  }
  .nav-links.open .nav-dropdown-trigger {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: none;
    letter-spacing: normal;
    padding-top: 0.75rem;
  }
  .nav-links.open .nav-dropdown-trigger::after { display: none; }
}

@media (max-width: 768px) {
  .hero h1,
  .page-hero h1 { font-size: 2rem; }
  .layers,
  .explore-grid { grid-template-columns: 1fr; }
  .definition-item { grid-template-columns: 1fr; }
  footer { flex-direction: column; text-align: center; }
}
