:root {
  --navy: #02102E;
  --gold: #DFB772;
  --rust: #A44819;
  --cream: #E2DCCE;
  --paper: #F7F4EE;
  --ink: #02102E;
  --ink-soft: #3B4459;
  --rule: #D9CFBB;
  --measure: 40rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  font-size: 1.1875rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--rust); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--navy); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px;
}

.skip {
  position: absolute; left: -999px; top: 0.5rem;
  background: var(--navy); color: var(--paper); padding: 0.5rem 0.9rem; z-index: 10;
}
.skip:focus { left: 1rem; }

/* Masthead */
.masthead { background: var(--navy); border-bottom: 3px solid var(--gold); }
.masthead-inner {
  max-width: 68rem; margin: 0 auto; padding: 1.6rem 1rem;
  display: flex; justify-content: center;
}
.brand { display: inline-block; line-height: 0; }
.brand img { height: 2.6rem; width: auto; display: block; }
.wordmark {
  display: inline-block; line-height: 1.3; text-align: center;
  color: var(--gold); font-weight: 600; font-size: 1.6rem;
  letter-spacing: 0.32em; text-transform: uppercase;
}

/* Title band */
.titleband { border-bottom: 1px solid var(--rule); background: var(--cream); }
.titleband-inner { max-width: 68rem; margin: 0 auto; padding: 2.4rem 1rem 2rem; text-align: center; }
.eyebrow {
  margin: 0 0 0.35rem; font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--rust);
}
h1 {
  margin: 0; font-weight: 500; font-size: clamp(2.4rem, 6vw, 3.4rem);
  line-height: 1.05; letter-spacing: 0.01em;
}
.meta { display: flex; justify-content: center; gap: 2rem; margin: 1.1rem 0 0; }
.meta div { display: flex; gap: 0.45rem; align-items: baseline; }
.meta dt {
  font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft);
}
.meta dd { margin: 0; font-weight: 600; font-size: 1.05rem; }

/* Layout */
.layout {
  max-width: 68rem; margin: 0 auto; padding: 2.25rem 1rem 3rem;
  display: grid; grid-template-columns: 1fr; gap: 1.5rem;
}
@media (min-width: 900px) {
  .layout { grid-template-columns: 14rem minmax(0, 1fr); gap: 3.5rem; padding-top: 3rem; }
  .toc { position: sticky; top: 1.5rem; align-self: start; }
}

/* Table of contents */
.toc details { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 0.6rem 0; }
.toc summary {
  cursor: pointer; list-style: none;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-soft);
}
.toc summary::-webkit-details-marker { display: none; }
.toc ol { margin: 0.6rem 0 0.2rem; padding-left: 1.3rem; font-size: 1.05rem; }
.toc li { margin: 0.2rem 0; }
.toc li::marker { color: var(--gold); font-weight: 600; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--rust); text-decoration: underline; }
.print-btn {
  margin-top: 1rem; width: 100%;
  font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--navy);
  background: transparent; border: 1px solid var(--navy); padding: 0.5rem 0.75rem; cursor: pointer;
}
.print-btn:hover { background: var(--navy); color: var(--paper); }

/* Terms body */
.terms { max-width: var(--measure); }
.terms-section { padding-bottom: 1.4rem; margin-bottom: 1.8rem; border-bottom: 1px solid var(--rule); }
.terms-section:last-child { border-bottom: 0; }
.terms h2 {
  margin: 0 0 0.9rem; font-weight: 600; font-size: 1.85rem; line-height: 1.2;
  scroll-margin-top: 1.5rem;
}
.terms h2::after {
  content: ""; display: block; width: 2.5rem; height: 2px; background: var(--gold); margin-top: 0.5rem;
}
.terms h3 {
  margin: 1.6rem 0 0.35rem; font-weight: 600; font-size: 1.22rem; line-height: 1.3;
  scroll-margin-top: 1.5rem;
}
.terms p { margin: 0 0 0.9rem; }
.terms ul, .terms ol { margin: 0 0 1rem; padding-left: 1.35rem; }
.terms li { margin: 0.3rem 0; }
.terms li::marker { color: var(--gold); }
.terms strong { font-weight: 700; }

/* Footer */
.colophon { background: var(--navy); color: var(--cream); border-top: 3px solid var(--gold); }
.colophon-inner { max-width: 68rem; margin: 0 auto; padding: 1.8rem 1rem 2.2rem; text-align: center; }
.colophon a { color: var(--gold); }
.colophon a:hover { color: var(--paper); }
.colophon .contact { margin: 0 0 0.6rem; font-size: 1.05rem; }
.colophon .note { margin: 0 auto; max-width: 38rem; font-size: 0.95rem; font-style: italic; opacity: 0.85; }

@media (max-width: 480px) {
  body { font-size: 1.125rem; }
  .brand img { height: 1.9rem; }
  .meta { flex-direction: column; gap: 0.2rem; align-items: center; }
}

@media print {
  @page { margin: 0.7in; }
  body { background: #fff; font-size: 11pt; line-height: 1.45; }
  .masthead { background: #fff; border-bottom: 2px solid var(--gold); }
  .masthead-inner { padding: 0 0 0.6rem; }
  .brand img { content: url("/assets/logo-wordmark-onwhite.svg"); height: 0.35in; }
  .titleband { background: #fff; border-bottom: 0; }
  .titleband-inner { padding: 0.8rem 0; }
  .layout { display: block; padding: 0; }
  .toc, .skip, .print-btn { display: none; }
  .terms { max-width: none; }
  .terms h2 { font-size: 16pt; break-after: avoid; }
  .terms h3 { font-size: 12pt; break-after: avoid; }
  .terms-section { border-bottom: 0; margin-bottom: 0.5rem; }
  a { color: inherit; text-decoration: none; }
  .colophon { background: #fff; color: var(--ink); border-top: 1px solid var(--rule); }
  .colophon a { color: inherit; }
}
