:root {
  --bg: #0a0a0b;
  --bg-alt: #121214;
  --fg: #e8e6e3;
  --accent: #d4a85c;
  --accent-dim: #8b6914;
  --accent-subtle: rgba(212, 168, 92, 0.1);
  --muted: #888;
  --muted-light: #999;
  --card: #161618;
  --card-hover: #1c1c1f;
  --border: #2a2a2e;
  --border-light: #333;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --header-h: 3.75rem;
}

html { scroll-behavior: smooth; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-subtle); color: var(--accent); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: #e0b96e; text-decoration: underline; }

/* ===== Header ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

header .logo {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

header .logo span { color: var(--accent); }

header nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

header nav::-webkit-scrollbar { display: none; }

header nav a {
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  padding: 0.375rem 0.625rem;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
}

header nav a:hover {
  color: var(--fg);
  background: var(--card);
  text-decoration: none;
}

header nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* ===== Hero / Homepage ===== */
.hero {
  padding: 5rem 1.5rem 3rem;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.hero h1 span { color: var(--accent); }

.hero .subtitle {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--accent);
  margin-top: 0.75rem;
  letter-spacing: -0.01em;
}

.hero .meta {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
}

.hero .meta strong { color: var(--muted-light); }

.hero .description {
  margin-top: 1.5rem;
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

.hero .section-heading {
  font-size: 1.375rem;
  font-weight: 700;
  margin-top: 3.5rem;
  margin-bottom: 0.25rem;
}

/* ===== Chapter List ===== */
.chapter-list {
  list-style: none;
  margin-top: 1.25rem;
  text-align: left;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.chapter-list li {
  display: block;
}

.chapter-list li a {
  display: block;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  margin-bottom: 0.625rem;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.chapter-list li a:hover {
  background: var(--card-hover);
  border-color: var(--accent-dim);
  transform: translateY(-1px);
  text-decoration: none;
}

.chapter-list .title {
  font-weight: 600;
  color: var(--fg);
  display: block;
  margin-bottom: 0.2rem;
}

.chapter-list .title::before {
  content: "→ ";
  color: var(--accent);
  font-weight: 400;
}

.chapter-list .desc {
  font-size: 0.8125rem;
  color: var(--muted);
  display: block;
  line-height: 1.5;
}

/* ===== Download Button ===== */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.75rem 1.75rem;
  background: var(--accent);
  color: #0a0a0b;
  font-weight: 700;
  font-size: 0.9375rem;
  border-radius: 8px;
  transition: background 0.15s, transform 0.1s;
}

.download-btn:hover {
  background: #e0b96e;
  transform: translateY(-1px);
  text-decoration: none;
  color: #0a0a0b;
}

/* ===== Sections (homepage) ===== */
.section {
  max-width: 800px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.section p { color: var(--muted); margin-bottom: 1rem; }

/* ===== Stats ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
  max-width: 800px;
  margin: 2rem auto;
  border-radius: 10px;
  overflow: hidden;
}

.stat {
  background: var(--card);
  padding: 1.75rem 1rem;
  text-align: center;
}

.stat .num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat .label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== Bypass Template ===== */
.bypass-steps { counter-reset: step; margin-top: 1.5rem; }
.bypass-step {
  counter-increment: step;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--card);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}
.bypass-step::before {
  content: counter(step) ". ";
  font-weight: 700;
  color: var(--accent);
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}
footer a { color: var(--accent); }

/* ===== Chapter Pages ===== */
.chapter {
  max-width: 750px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.chapter h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.chapter .breadcrumb {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.chapter .breadcrumb a { color: var(--accent); }

.chapter h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.chapter h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.chapter h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.chapter p {
  margin-bottom: 1rem;
  color: rgba(232, 230, 227, 0.88);
}

.chapter blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  background: var(--card);
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  font-style: italic;
}

.chapter blockquote p { margin-bottom: 0; color: var(--muted); }
.chapter blockquote p + p { margin-top: 0.5rem; }

.chapter ul, .chapter ol {
  margin: 0.5rem 0 1rem 1.5rem;
  color: rgba(232, 230, 227, 0.88);
}
.chapter li { margin-bottom: 0.375rem; }
.chapter li > ul,
.chapter li > ol { margin-top: 0.25rem; margin-bottom: 0.25rem; }

.chapter strong { color: var(--fg); }

/* Tables */
.chapter table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.875rem;
  border-radius: 6px;
  overflow: hidden;
}

.chapter th, .chapter td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

.chapter th {
  background: var(--card);
  font-weight: 600;
  white-space: nowrap;
}

.chapter td { color: rgba(232, 230, 227, 0.85); }

.chapter tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

.chapter hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Footnotes */
.chapter .footnotes {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--muted);
}

.chapter .footnotes h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--fg);
}

.chapter .footnotes ol {
  margin-left: 1.25rem;
  list-style: decimal;
}

.chapter .footnotes li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.chapter .footnotes li:target {
  background: var(--accent-subtle);
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
}

.chapter sup { font-size: 0.6875rem; }
.chapter sup a {
  color: var(--accent);
  font-weight: 600;
}
.chapter sup a:hover { text-decoration: none; }

/* ===== Code ===== */
code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  background: var(--card);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  background: var(--bg-alt);
  padding: 1.125rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  line-height: 1.55;
}

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

/* ===== Annexures / reports ===== */
.annexure-list { list-style: none; }
.annexure-list li a {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  transition: background 0.15s, border-color 0.15s;
}
.annexure-list li a:hover {
  background: var(--card-hover);
  border-color: var(--accent-dim);
  text-decoration: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  header {
    padding: 0 1rem;
    height: auto;
    min-height: var(--header-h);
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  header .logo { font-size: 0.9375rem; padding: 0.5rem 0; }

  header nav {
    width: 100%;
    padding-bottom: 0.5rem;
    gap: 0.125rem;
  }

  header nav a {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .hero { padding: 3rem 1rem 2rem; }
  .hero h1 { font-size: 1.75rem; }

  .stats { grid-template-columns: repeat(2, 1fr); }

  .chapter h1 { font-size: 1.625rem; }

  .chapter table { font-size: 0.8125rem; display: block; overflow-x: auto; }
  .chapter th, .chapter td { white-space: nowrap; }
}

/* ===== Print ===== */
@media print {
  header { position: static; backdrop-filter: none; background: white; }
  body { background: white; color: black; }
  a { color: black; }
  .chapter blockquote { border-left-color: #ccc; background: #f5f5f5; }
  .chapter table { border: 1px solid #ccc; }
  .chapter th { background: #eee; }
  pre, code { background: #f5f5f5; border-color: #ddd; }
  footer { border-top-color: #ccc; }
}
