:root {
  --font-serif: "Iowan Old Style", "Apple Garamond", "Baskerville", "Times New Roman", "Droid Serif", Times, "Source Serif Pro", serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Light Theme (Parchment & Warm Gold/Bronze) */
  --bg-primary: #f8f6f0;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-muted: #f0ebe1;
  --bg-highlight: #fbf0dc;

  --border-subtle: #e5dec9;
  --border-strong: #c8beaa;

  --text-primary: #211c18;
  --text-secondary: #574f46;
  --text-muted: #7d7367;

  --accent-gold: #9d6819;
  --accent-gold-hover: #7b5113;
  --accent-gold-subtle: #f5eedf;
  --accent-green: #2a6f44;
  --accent-green-bg: #eaf5ee;
  --accent-blue: #1c5d99;
  --accent-blue-bg: #eaf1f8;

  --card-shadow: 0 4px 20px rgba(60, 48, 30, 0.05);
  --header-shadow: 0 2px 10px rgba(60, 48, 30, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --nav-height: 64px;
}

[data-theme="dark"] {
  --bg-primary: #121110;
  --bg-surface: #1a1816;
  --bg-surface-elevated: #24211e;
  --bg-surface-muted: #25221e;
  --bg-highlight: #2c251b;

  --border-subtle: #332d26;
  --border-strong: #4d4439;

  --text-primary: #f3ede2;
  --text-secondary: #c2b9aa;
  --text-muted: #8e8477;

  --accent-gold: #d89e43;
  --accent-gold-hover: #f0b75d;
  --accent-gold-subtle: #2d2417;
  --accent-green: #48b871;
  --accent-green-bg: #152d1e;
  --accent-blue: #5ba2e6;
  --accent-blue-bg: #15283c;

  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --header-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary: #121110;
    --bg-surface: #1a1816;
    --bg-surface-elevated: #24211e;
    --bg-surface-muted: #25221e;
    --bg-highlight: #2c251b;

    --border-subtle: #332d26;
    --border-strong: #4d4439;

    --text-primary: #f3ede2;
    --text-secondary: #c2b9aa;
    --text-muted: #8e8477;

    --accent-gold: #d89e43;
    --accent-gold-hover: #f0b75d;
    --accent-gold-subtle: #2d2417;
    --accent-green: #48b871;
    --accent-green-bg: #152d1e;
    --accent-blue: #5ba2e6;
    --accent-blue-bg: #15283c;

    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    --header-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  height: var(--nav-height);
  box-shadow: var(--header-shadow);
}

.nav-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.brand-badge {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.925rem;
  font-weight: 500;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-gold);
  background-color: var(--accent-gold-subtle);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.theme-toggle:hover {
  color: var(--accent-gold);
  border-color: var(--border-strong);
  background: var(--bg-surface-muted);
}

/* Page Hero */
.hero {
  padding: 3.5rem 1.5rem 2rem;
  max-width: 1080px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-green);
  background: var(--accent-green-bg);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.hero-tag svg {
  width: 14px;
  height: 14px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.75rem 0;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 0 1.25rem 0;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Layout Grid */
.layout-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
}

.layout-single {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* Sidebar / Table of Contents */
.toc-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  max-height: calc(100vh - var(--nav-height) - 3rem);
  overflow-y: auto;
}

.toc-title {
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toc-link {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  line-height: 1.35;
}

.toc-link:hover,
.toc-link.active {
  color: var(--accent-gold);
  background: var(--accent-gold-subtle);
  font-weight: 500;
}

/* Content Area */
.content-body {
  min-width: 0;
}

/* Highlight / Summary Cards */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
}

.summary-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.summary-card-icon.green {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.summary-card-icon.gold {
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
}

.summary-card-icon.blue {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
}

.summary-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.35rem 0;
  color: var(--text-primary);
}

.summary-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
}

/* Typography & Policy Sections */
.policy-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--card-shadow);
}

.policy-section h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.policy-section h2 span.section-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-gold);
  background: var(--accent-gold-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.policy-section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem 0;
  color: var(--text-primary);
}

.policy-section p {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
  font-size: 0.975rem;
}

.policy-section ul,
.policy-section ol {
  margin: 0 0 1.25rem 0;
  padding-left: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.975rem;
}

.policy-section li {
  margin-bottom: 0.5rem;
}

.policy-section strong {
  color: var(--text-primary);
}

.policy-section a {
  color: var(--accent-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.policy-section a:hover {
  color: var(--accent-gold-hover);
}

/* Callout Box */
.callout {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
  border-left: 4px solid var(--accent-gold);
  background: var(--accent-gold-subtle);
}

.callout.info {
  border-left-color: var(--accent-blue);
  background: var(--accent-blue-bg);
}

.callout.success {
  border-left-color: var(--accent-green);
  background: var(--accent-green-bg);
}

.callout-title {
  font-weight: 600;
  font-size: 0.925rem;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.callout p {
  margin: 0;
  font-size: 0.9rem;
}

/* Comparison / Compliance Table */
.table-wrapper {
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

thead {
  background: var(--bg-surface-muted);
}

th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

td {
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

tr:last-child td {
  border-bottom: none;
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.badge-green {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.badge-gold {
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
}

/* FAQ Accordion */
.faq-item {
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.25rem 0;
}

.faq-item:first-child {
  padding-top: 0;
}

.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-question {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.faq-answer {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-container {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* Responsive */
@media (max-width: 860px) {
  .layout-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .toc-sidebar {
    display: none;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .nav-links {
    gap: 0.5rem;
  }

  .nav-links a {
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
  }
}

@media print {
  .site-header, .site-footer, .toc-sidebar, .theme-toggle {
    display: none !important;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
  .policy-section {
    border: none;
    box-shadow: none;
    padding: 1rem 0;
  }
}
