:root {
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg-primary: #000000;
  --bg-secondary: #0d0d0e;
  --bg-card: #161618;
  --bg-card-hover: #1c1c1f;
  --border-color: #27272a;
  --border-subtle: #1f1f23;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-red: #e53935;
  --accent-red-hover: #ef4444;
  --accent-red-subtle: rgba(229, 57, 53, 0.14);
  --accent-green: #30d158;
  --accent-green-subtle: rgba(48, 209, 88, 0.14);
  --accent-blue: #0a84ff;
  --accent-blue-subtle: rgba(10, 132, 255, 0.14);
  --sidebar-width: 290px;
  --max-content-width: 820px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-subtle: 0 4px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg-primary: #fbfbfd;
  --bg-secondary: #f5f5f7;
  --bg-card: #ffffff;
  --bg-card-hover: #f9f9fb;
  --border-color: #e5e5ea;
  --border-subtle: #f0f0f4;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #86868b;
  --accent-red: #d32f2f;
  --accent-red-hover: #b71c1c;
  --accent-red-subtle: rgba(211, 47, 47, 0.08);
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Nav Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .site-header {
  background: rgba(251, 251, 253, 0.8);
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 10px rgba(229, 57, 53, 0.35);
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(229, 57, 53, 0.35);
  display: block;
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.brand-tag {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.pill-badge .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-secondary);
  transform: translateY(-1px);
}

.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-print:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-secondary);
}

/* Page Layout */
.page-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 48px;
  flex: 1;
  width: 100%;
}

/* Sidebar / Table of Contents */
.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 32px);
  height: fit-content;
  max-height: calc(100vh - var(--header-height) - 64px);
  overflow-y: auto;
  padding-right: 12px;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.toc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.toc-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-link {
  display: block;
  padding: 6px 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* Hero Section */
.hero-card {
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(22, 22, 24, 0.4) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 44px);
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-red) 0%, #ff8a80 100%);
}

.hero-header-top {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.hero-logo-img {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 18px rgba(229, 57, 53, 0.4);
  flex-shrink: 0;
}

.hero-eyebrow-wrapper {
  display: flex;
  flex-direction: column;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-red);
  margin-bottom: 6px;
}

.hero-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin-bottom: 0;
  text-wrap: balance;
  color: var(--text-primary);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.hero-meta strong {
  color: var(--text-primary);
}

/* Key Highlights Grid */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.highlight-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.highlight-box:hover {
  transform: translateY(-2px);
  border-color: var(--accent-red);
}

.highlight-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-red-subtle);
  color: var(--accent-red);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.highlight-box:nth-child(2) .highlight-icon {
  background: var(--accent-green-subtle);
  color: var(--accent-green);
}

.highlight-box:nth-child(3) .highlight-icon {
  background: var(--accent-blue-subtle);
  color: var(--accent-blue);
}

.highlight-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.highlight-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Main Content Typography */
.content-area {
  max-width: var(--max-content-width);
}

.policy-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: clamp(24px, 3vw, 36px);
  margin-bottom: 24px;
}

.section-anchor {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.section-anchor:hover .anchor-icon {
  opacity: 1;
}

.anchor-icon {
  opacity: 0;
  color: var(--accent-red);
  font-size: 1rem;
  transition: opacity 0.15s ease;
}

h2 {
  font-size: clamp(1.35rem, 2vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 16px;
  color: var(--text-primary);
  text-wrap: balance;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin: 22px 0 10px;
  color: var(--text-primary);
  text-wrap: balance;
}

p {
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 14px;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

p:last-child {
  margin-bottom: 0;
}

ul {
  margin: 12px 0 16px 20px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

li {
  font-size: 0.98rem;
  line-height: 1.6;
}

li strong {
  color: var(--text-primary);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  color: var(--accent-red);
}

/* Callout Box */
.callout {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent-red);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

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

/* Contact Card */
.contact-card {
  background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}

.contact-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 110px;
}

.contact-value {
  color: var(--text-primary);
  font-weight: 500;
}

.contact-value a {
  color: var(--accent-red);
  text-decoration: none;
  font-weight: 600;
}

.contact-value a:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
  padding: 36px 24px;
  margin-top: auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Responsive Media Queries */
@media (max-width: 960px) {
  .page-wrapper {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 24px;
  }

  .sidebar {
    display: none; /* Hide sticky sidebar on mobile */
  }

  .highlights-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero-header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .hero-logo-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
}

/* Print Stylesheet */
@media print {
  body {
    background: #ffffff !important;
    color: #111111 !important;
  }

  .site-header,
  .sidebar,
  .btn-print,
  .theme-toggle,
  .site-footer {
    display: none !important;
  }

  .page-wrapper {
    display: block !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .hero-card,
  .policy-section,
  .highlight-box,
  .contact-card {
    background: transparent !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 20px !important;
  }

  h1, h2, h3, strong {
    color: #000000 !important;
  }

  p, li {
    color: #333333 !important;
  }
}
