/* FOCAL RAYS — shared legal document styles */
:root {
  --bg: #F6F1EA;
  --surface: #FBF8F3;
  --surface-hover: #F8F3EC;
  --border: #E1D6C7;
  --border-ledger: #D9CCBA;
  --border-soft: #E6DCCF;
  --border-line: #E2D6C7;
  --ink: #241A17;
  --ink-title: #1D1714;
  --ink-2: #6D625C;
  --ink-3: #9C9088;
  --ink-feature: #5F554F;
  --amber: #A8823F;
  --amber-hover: #8C6B37;
  --amber-deep: #8A681F;
  --amber-bright: #F2C56B;
  --amber-whisper: rgba(168, 130, 63, 0.08);
  --amber-border: rgba(168, 130, 63, 0.28);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --nav-height: 64px;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Geist Sans", "Geist", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
}

a { color: var(--amber-deep); text-decoration: none; }
a:hover { color: var(--amber-hover); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--amber-whisper);
  border: 1px solid var(--amber-border);
  color: var(--amber-deep);
  font-weight: 600;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-height);
  background: rgba(246, 241, 234, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  font-size: 0.875rem;
  color: var(--ink-2);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}

.nav-link:hover {
  background: var(--border);
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.btn:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--surface);
}

.doc-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 48px) 24px 80px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}

.doc-rail {
  position: sticky;
  top: calc(var(--nav-height) + 20px);
}

.back-link {
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 28px;
  text-decoration: none;
}

.back-link:hover { color: var(--ink); }

.rail-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}

.toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 24px;
}

.toc a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--ink-2);
  text-decoration: none;
  line-height: 1.35;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}

.toc a:hover {
  background: var(--surface);
  color: var(--ink);
}

.rail-meta {
  border: 1px solid var(--border-ledger);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.rail-meta span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 6px;
}

.rail-meta strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ink-title);
  font-weight: 650;
}

.doc {
  min-width: 0;
}

.doc-header {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-line);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--amber-deep);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--amber);
}

.doc-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink-title);
}

.doc-lede {
  margin-top: 16px;
  max-width: 58ch;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.65;
}

.doc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.chip {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 3px;
  border: 1px solid var(--amber-border);
  background: var(--amber-whisper);
  color: var(--amber-deep);
}

.doc-section {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 18px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border-soft);
}

.section-num {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--amber-deep);
  padding-top: 6px;
}

.section-body h2 {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink-title);
  margin-bottom: 12px;
  line-height: 1.25;
}

.section-body h3 {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ink);
  margin: 16px 0 8px;
}

.section-body p,
.section-body li {
  color: var(--ink-feature);
  font-size: 0.95rem;
  line-height: 1.7;
}

.section-body p + p { margin-top: 12px; }

.section-body ul {
  margin: 8px 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 10px;
}

.section-body li::marker { color: var(--amber); }

.muted {
  color: var(--ink-3) !important;
  font-size: 0.875rem !important;
  margin-top: 16px !important;
}

.spec-table {
  margin: 14px 0 16px;
  border: 1px solid var(--border-ledger);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.9rem;
  color: var(--ink-2);
}

.spec-row:last-child { border-bottom: 0; }

.spec-row strong {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}

.pay-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.pay-grid span {
  border: 1px solid var(--border-ledger);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}

.doc-footer-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 8px;
}

.doc-footer-nav a {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
}

.doc-footer-nav a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .doc-shell {
    grid-template-columns: 1fr;
  }

  .doc-rail {
    position: static;
    border: 1px solid var(--border-ledger);
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 18px;
  }

  .toc {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .doc-section {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

@media (max-width: 520px) {
  .toc { grid-template-columns: 1fr; }
  .pay-grid { grid-template-columns: 1fr; }
  .spec-row {
    flex-direction: column;
    gap: 4px;
  }
  .spec-row strong { text-align: left; }
  .doc-footer-nav { flex-direction: column; }
}
