*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #09090e;
  --ink:       #0d0d14;
  --surface:   #13131c;
  --surface2:  #1a1a27;
  --surface3:  #20202f;
  --rim:       rgba(255,255,255,0.06);
  --rim2:      rgba(255,255,255,0.1);
  --gold:      #c9a84c;
  --gold2:     #e8c96a;
  --gold-dim:  rgba(201,168,76,0.12);
  --ember:     #d95f28;
  --sky:       #3a82e8;
  --text:      #e8e8f2;
  --body:      #a0a0c0;
  --muted:     #606080;
  --ease:      cubic-bezier(0.4,0,0.2,1);
  --col-w:     760px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201,168,76,0.45); }

/* ══════════════════════════════════════════
   PROGRESS BAR
══════════════════════════════════════════ */
#readProgress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--ember));
  z-index: 9999;
  transition: width 0.1s;
  box-shadow: 0 0 10px rgba(201,168,76,0.5);
}

/* ══════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9,9,14,0.88);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--rim);
  padding: 0 2rem;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.25), transparent);
}
.nav-brand {
  display: flex; align-items: center; gap: 0.65rem;
  text-decoration: none;
}
.nav-brand-icon {
  width: 34px; height: 34px;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 8px;
  background: rgba(201,168,76,0.07);
  display: flex; align-items: center; justify-content: center;
}
.nav-brand-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-crumb {
  display: flex; align-items: center; gap: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.nav-crumb a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.nav-crumb a:hover { color: var(--text); }
.nav-crumb-sep { opacity: 0.3; }
.nav-crumb-current { color: var(--gold); }
.topbar-right {
  display: flex; align-items: center; gap: 0.75rem;
}
.btn-back {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  background: none;
  border: 1px solid var(--rim2);
  border-radius: 7px;
  font-size: 12px;
  font-family: 'Syne', sans-serif;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-back:hover { color: var(--text); border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.04); }
.btn-print {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 7px;
  font-size: 12px;
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  color: var(--gold);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-print:hover { background: rgba(201,168,76,0.18); border-color: rgba(201,168,76,0.45); }

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  border-bottom: 1px solid var(--rim);
  padding: 5rem 2rem 4rem;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
}
/* Grid */
.hero-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(201,168,76,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}
/* Gradient vignette */
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 20% 50%, rgba(201,168,76,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 80% 40%, rgba(58,130,232,0.04) 0%, transparent 70%);
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: 900px;
  margin: 0 auto;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 20px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1.5rem;
  animation: fadeSlideDown 0.6s var(--ease) both;
}
.hero-tag-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulseGold 2s ease-in-out infinite;
}
@keyframes pulseGold {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}
.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(52px, 7vw, 88px);
  letter-spacing: 0.04em;
  line-height: 0.92;
  color: var(--text);
  animation: fadeSlideDown 0.7s var(--ease) 0.1s both;
}
.hero-title span {
  background: linear-gradient(135deg, var(--gold2), var(--gold), var(--ember));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 1.5rem;
  margin-top: 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  animation: fadeSlideDown 0.7s var(--ease) 0.2s both;
}
.hero-meta-item { display: flex; align-items: center; gap: 0.4rem; }
.hero-meta-item svg { opacity: 0.5; }
.hero-meta-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); opacity: 0.3; }
.hero-desc {
  margin-top: 1.5rem;
  font-size: 15px;
  color: var(--body);
  max-width: 600px;
  line-height: 1.7;
  animation: fadeSlideDown 0.7s var(--ease) 0.3s both;
}

/* Version strip */
.version-strip {
  position: absolute;
  top: 2rem; right: 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-align: right;
  animation: fadeIn 0.8s 0.5s both;
}
.version-strip strong { display: block; color: var(--gold); font-size: 13px; margin-bottom: 2px; }

/* ══════════════════════════════════════════
   LAYOUT: sidebar + content
══════════════════════════════════════════ */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 2rem 6rem;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3.5rem;
  align-items: start;
}

/* ══════════════════════════════════════════
   SIDEBAR — sticky TOC
══════════════════════════════════════════ */
.sidebar {
  position: sticky;
  top: 82px;
  animation: fadeIn 0.7s var(--ease) 0.4s both;
}
.toc-card {
  background: var(--surface);
  border: 1px solid var(--rim);
  border-radius: 14px;
  overflow: hidden;
}
.toc-header {
  padding: 0.85rem 1.2rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--rim);
  display: flex; align-items: center; gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.toc-header-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); opacity: 0.7; }
.toc-nav { padding: 0.75rem 0; list-style: none; }
.toc-item { }
.toc-link {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.5rem 1.2rem;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 2px solid transparent;
  line-height: 1.3;
}
.toc-link:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.toc-link.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: var(--gold-dim);
}
.toc-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--muted);
  opacity: 0.5;
  min-width: 14px;
  text-align: right;
  flex-shrink: 0;
}
.toc-link.active .toc-num { opacity: 1; color: var(--gold); }

.toc-divider { height: 1px; background: var(--rim); margin: 0.4rem 1.2rem; }

/* Info box below TOC */
.info-card {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--rim);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
}
.info-card-title {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.info-row {
  display: flex; flex-direction: column; gap: 0.55rem;
}
.info-item {
  display: flex; align-items: flex-start; gap: 0.5rem;
  font-size: 11.5px;
  color: var(--body);
  line-height: 1.4;
}
.info-label {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-width: 60px;
  flex-shrink: 0;
  padding-top: 1px;
}

/* ══════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════ */
.content { min-width: 0; }
.content > * + * { margin-top: 3.5rem; }

/* Section */
.section {
  animation: fadeSlideUp 0.5s var(--ease) both;
  scroll-margin-top: 90px;
}

/* Section heading */
.section-header {
  display: flex; align-items: flex-start; gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rim);
  position: relative;
}
.section-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 60px; height: 1px;
  background: var(--gold);
  border-radius: 1px;
}
.section-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  margin-top: 3px;
  flex-shrink: 0;
  line-height: 1;
}
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 0.06em;
  color: var(--text);
  line-height: 1;
}
.section-sub {
  font-size: 12px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  margin-top: 3px;
  display: block;
}

/* Body text */
.body-text {
  color: var(--body);
  font-size: 14.5px;
  line-height: 1.8;
}
.body-text p { margin-bottom: 1rem; }
.body-text p:last-child { margin-bottom: 0; }
.body-text strong { color: var(--text); font-weight: 600; }
.body-text a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(201,168,76,0.3);
  transition: all 0.2s;
}
.body-text a:hover { color: var(--gold2); border-color: var(--gold2); }
.body-text em { color: var(--text); font-style: normal; font-weight: 500; }

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 1.25rem 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--rim);
}
.data-table thead {
  background: var(--surface2);
}
.data-table th {
  padding: 0.75rem 1.1rem;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  border-bottom: 1px solid var(--rim);
}
.data-table td {
  padding: 0.8rem 1.1rem;
  color: var(--body);
  border-bottom: 1px solid var(--rim);
  vertical-align: top;
  line-height: 1.5;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table td:first-child { color: var(--text); font-weight: 500; }

/* Highlight box */
.highlight-box {
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  display: flex; gap: 0.85rem;
  align-items: flex-start;
  margin: 1.25rem 0;
  font-size: 13.5px;
  line-height: 1.6;
}
.highlight-box.info {
  background: rgba(58,130,232,0.07);
  border: 1px solid rgba(58,130,232,0.2);
  color: #8ab4f8;
}
.highlight-box.warning {
  background: rgba(201,168,76,0.07);
  border: 1px solid rgba(201,168,76,0.2);
  color: #d4b060;
}
.highlight-box.danger {
  background: rgba(217,95,40,0.07);
  border: 1px solid rgba(217,95,40,0.2);
  color: #e08060;
}
.highlight-box.success {
  background: rgba(62,194,122,0.07);
  border: 1px solid rgba(62,194,122,0.2);
  color: #7adfa0;
}
.highlight-icon { flex-shrink: 0; margin-top: 1px; }
.highlight-box strong { display: block; margin-bottom: 0.25rem; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }

/* Ordered / unordered list */
.legal-list {
  list-style: none;
  color: var(--body);
  font-size: 14.5px;
  line-height: 1.75;
  margin: 0.75rem 0;
}
.legal-list li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.55rem;
}
.legal-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 10px;
  top: 4px;
  opacity: 0.7;
}
.legal-list.numbered { counter-reset: lnum; }
.legal-list.numbered li::before {
  content: counter(lnum, decimal-leading-zero);
  counter-increment: lnum;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  top: 3px;
  color: var(--gold);
  font-weight: 500;
}

/* Definition term */
.def-grid {
  display: grid;
  gap: 0.6rem;
  margin: 0.75rem 0;
}
.def-item {
  background: var(--surface);
  border: 1px solid var(--rim);
  border-radius: 8px;
  padding: 0.8rem 1.1rem;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1rem;
  font-size: 13.5px;
  line-height: 1.5;
  transition: background 0.2s;
}
.def-item:hover { background: var(--surface2); }
.def-term {
  font-weight: 600;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.def-desc { color: var(--body); }

/* Contact card */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--rim);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  transition: border-color 0.2s, background 0.2s;
}
.contact-card:hover { border-color: rgba(201,168,76,0.25); background: var(--surface2); }
.contact-card-label {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.contact-card-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: flex; align-items: center; gap: 0.4rem;
}
.contact-card-value a { color: var(--gold); text-decoration: none; }
.contact-card-value a:hover { color: var(--gold2); }

/* ══════════════════════════════════════════
   ASIDE — law citation
══════════════════════════════════════════ */
.law-refs {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin: 0.75rem 0;
}
.law-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  background: var(--surface2);
  border: 1px solid var(--rim2);
  color: var(--muted);
  letter-spacing: 0.04em;
  transition: all 0.2s;
  cursor: default;
}
.law-badge:hover { border-color: rgba(201,168,76,0.3); color: var(--gold); background: var(--gold-dim); }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.footer {
  background: var(--ink);
  border-top: 1px solid var(--rim);
  padding: 3rem 2rem 2rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rim);
}
.footer-brand {
  display: flex; align-items: center; gap: 0.6rem;
}
.footer-brand-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.footer-brand-sub {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: block;
}
.footer-links {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
}
.footer-link {
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.02em;
}
.footer-link:hover { color: var(--text); }
.footer-link.active { color: var(--gold); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 1.5rem;
  gap: 1rem; flex-wrap: wrap;
}
.footer-copy {
  font-size: 11.5px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}
.footer-copy span { color: var(--gold); }
.footer-legal-links {
  display: flex; gap: 1.25rem; flex-wrap: wrap;
}
.footer-legal-links a {
  font-size: 11px;
  color: #3a3a58;
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.04em;
}
.footer-legal-links a:hover { color: var(--muted); }

/* ══════════════════════════════════════════
   BACK TO TOP
══════════════════════════════════════════ */
.back-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 42px; height: 42px;
  background: var(--surface2);
  border: 1px solid var(--rim2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--muted);
  z-index: 500;
  transition: all 0.25s var(--ease);
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
}
.back-top.visible { opacity: 1; pointer-events: all; transform: translateY(0); }
.back-top:hover { color: var(--gold); border-color: rgba(201,168,76,0.4); background: var(--gold-dim); transform: translateY(-2px); }

/* ══════════════════════════════════════════
   KEYFRAMES
══════════════════════════════════════════ */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ══════════════════════════════════════════
   PRINT STYLES
══════════════════════════════════════════ */
@media print {
  .topbar, .sidebar, #readProgress, .back-top, .btn-print, .btn-back { display: none !important; }
  .layout { grid-template-columns: 1fr; }
  .hero { padding: 2rem; }
  body { background: #fff; color: #000; }
  .section-title { color: #000; }
  .body-text, .legal-list li, .def-desc, .data-table td { color: #333; }
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 2rem; }
  .sidebar { position: static; }
  .toc-nav { display: flex; flex-wrap: wrap; padding: 0.5rem; gap: 0.3rem; }
  .toc-link { padding: 0.3rem 0.75rem; border-left: none; border-radius: 6px; font-size: 12px; }
  .toc-link.active { border-left: none; background: var(--gold-dim); }
  .toc-divider { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .def-item { grid-template-columns: 1fr; gap: 0.25rem; }
  .footer-top { grid-template-columns: 1fr; gap: 1rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .version-strip { display: none; }
}
@media (max-width: 600px) {
  .hero { padding: 3.5rem 1.25rem 2.5rem; }
  .layout { padding: 2rem 1.25rem 4rem; }
  .topbar { padding: 0 1.25rem; }
  .hero-title { font-size: 46px; }
  .nav-crumb { display: none; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 0.6rem 0.8rem; }
}