/* CSS Reset & Design Tokens */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-canvas: #F4EFE6;
  --bg-surface: #FBF9F4;
  --bg-surface-alt: #E9E1D2;
  --text-main: #1E1D1B;
  --text-muted: #5B6470;
  --text-subtle: #7A8492;
  --accent: #A8481F;
  --accent-hover: #8C3B18;
  --navy: #1F2A44;
  --border-hairline: #CFC6B5;
  --border-subtle: #DDD5C6;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-canvas);
  color: var(--text-main);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-main);
  background-color: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Links & Focus */
a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Layout Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
}

/* Header */
header {
  padding: 28px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 36px;
  align-items: center;
  justify-content: space-between;
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
}

.brand-wordmark span {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.brand-wordmark span em {
  font-weight: 300;
  font-style: italic;
}

nav.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
}

nav.site-nav a {
  padding: 8px 0;
}

.nav-btn {
  padding: 10px 18px;
  border: 1px solid var(--text-main);
  border-radius: 2px;
  font-size: 14px;
  font-weight: 500;
}

.nav-btn:hover {
  background: var(--text-main);
  color: var(--bg-canvas);
}

.hairline-divider {
  height: 1px;
  background-color: var(--text-main);
  opacity: 0.85;
  width: 100%;
}

/* Page Hero */
.legal-hero {
  padding: clamp(48px, 6vw, 80px) 0 clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--border-hairline);
}

.legal-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-eyebrow .badge-dot {
  color: var(--accent);
  font-weight: 600;
}

h1.page-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(40px, 5.5vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin-bottom: 20px;
}

.lead-paragraph {
  font-size: 19px;
  line-height: 1.55;
  color: #33363D;
  max-width: 66ch;
}

.meta-updated {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 2px;
}

/* Main Legal Grid Layout */
.legal-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 48px clamp(32px, 5vw, 72px);
  padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 8vw, 100px);
  align-items: flex-start;
}

/* Sidebar / Table of Contents */
aside.toc-sidebar {
  flex: 0 0 260px;
  position: sticky;
  top: 32px;
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.toc-list {
  list-style: none;
  font-size: 13.5px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc-list a {
  color: var(--text-muted);
  display: block;
  padding: 2px 0;
}

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

.toc-list a span.num {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-right: 6px;
  color: var(--accent);
}

.print-button {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-hairline);
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 2px;
  cursor: pointer;
}

.print-button:hover {
  color: var(--text-main);
  border-color: var(--text-main);
}

/* Reading Column */
article.legal-content {
  flex: 1 1 540px;
  max-width: 68ch;
}

.section-block {
  padding-bottom: 44px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--border-hairline);
}

.section-block:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

h2.section-heading {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--text-main);
}

.summary-lead {
  font-size: 16.5px;
  font-weight: 500;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 14px 18px;
  border-radius: 4px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.summary-lead em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}

.callout-box {
  margin: 20px 0;
  background: #F1EBDF;
  border: 1px solid var(--border-hairline);
  padding: 16px 20px;
  border-radius: 4px;
  font-size: 15px;
  line-height: 1.55;
}

.callout-box strong {
  color: var(--text-main);
  display: block;
  margin-bottom: 6px;
}

p {
  margin-bottom: 16px;
  color: #2F333A;
}

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

ul, ol {
  margin: 16px 0 20px 24px;
  color: #2F333A;
}

li {
  margin-bottom: 8px;
}

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

strong {
  color: var(--text-main);
  font-weight: 600;
}

/* Placeholder styling */
.placeholder {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: #EAE3D6;
  border: 1px dashed var(--accent);
  padding: 1px 6px;
  border-radius: 2px;
  color: #6C2E13;
  font-weight: 500;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-hairline);
  padding: 40px 0 60px;
  font-size: 14px;
  color: var(--text-muted);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 24px;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-main);
  font-weight: 500;
}

.footer-brand em {
  font-style: italic;
  font-weight: 300;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
}

.footer-legal-bar {
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  font-size: 13px;
}

.footer-legal-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-legal-links a {
  color: var(--text-muted);
}

.footer-legal-links a:hover,
.footer-legal-links a.active {
  color: var(--accent);
}

.footer-legal-links span.sep {
  color: var(--border-hairline);
  font-size: 11px;
}

/* Print Styles */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 11pt;
  }
  .brand-wordmark svg path {
    fill: #000 !important;
    stroke: #000 !important;
  }
  aside.toc-sidebar,
  nav.site-nav,
  .print-button,
  footer {
    display: none !important;
  }
  article.legal-content {
    max-width: 100% !important;
  }
  .legal-layout {
    padding: 0 !important;
  }
  .legal-hero {
    padding-top: 0 !important;
  }
  .summary-lead, .callout-box {
    background: #F7F7F7 !important;
    border: 1px solid #CCC !important;
  }
  .section-block {
    page-break-inside: avoid;
  }
  a {
    color: #000 !important;
    text-decoration: underline !important;
  }
}

/* Mobile adjustments */
@media (max-width: 820px) {
  aside.toc-sidebar {
    flex: 1 1 100%;
    position: static;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 18px;
    border-radius: 4px;
    margin-bottom: 12px;
  }
  .toc-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px 16px;
  }
}

.note-small {
  margin-top: 6px;
  font-size: 13px;
}

.list-indent {
  margin: 8px 0 0 20px;
}

/* "By Sam S" under the wordmark */
.brand-wordmark span .brand-by {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted, #6B675E);
}
