:root {
  --bg: #f5efe5;
  --bg-deep: #ebe2d2;
  --surface: #fffbf6;
  --ink: #33261d;
  --ink-soft: #5a463a;
  --ink-mute: #746355;
  --line: #d8c8ba;
  --terracotta: #a86d4b;
  --terracotta-deep: #8c4f30;
  --accent: #8c6348;
  --accent-soft: #efe1d4;
  --sage: #8f9e84;
  --gold: #c8a872;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
  font-size: 16px;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 28px; }

/* ----- top nav ----- */
.legal-nav {
  border-bottom: 1px solid var(--line);
  background: rgba(245, 239, 229, 0.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
  overflow: visible;
}
.legal-nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 28px; max-width: 1200px;
}
.legal-nav .logo {
  display: flex; align-items: center; gap: 10px;
  font-family: "Cormorant Garamond", serif; font-weight: 600;
  font-size: 22px; color: var(--terracotta);
  text-decoration: none;
}
.legal-nav .logo img { height: 90px; width: auto; }
.legal-nav .back {
  color: var(--ink-soft); text-decoration: none;
  font-size: 14px; font-weight: 500;
}
.legal-nav .back:hover { color: var(--terracotta-deep); }

/* ----- main ----- */
.legal { padding: 64px 0 96px; position: relative; }
.legal::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 320px;
  background: radial-gradient(60% 80% at 30% 0%, rgba(200, 168, 114, 0.28) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}
.legal .wrap { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "Manrope", sans-serif;
  font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 8px 14px; border-radius: 999px;
  margin-bottom: 24px;
}

h1.display {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  font-size: clamp(44px, 6vw, 68px);
  line-height: 1.05;
  margin: 0 0 14px;
  color: var(--ink);
}

.meta {
  color: var(--ink-mute);
  font-size: 13.5px;
  margin: 0 0 36px;
  font-family: "Manrope", monospace;
  letter-spacing: 0.04em;
}

.lede {
  font-size: 18.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 40px;
  max-width: 64ch;
}
.lede b { color: var(--ink); font-weight: 600; }

/* ----- toc ----- */
.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 28px;
  margin: 0 0 56px;
}
.toc ol {
  margin: 0; padding: 0; list-style: none;
  counter-reset: toc;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 28px;
}
.toc li { counter-increment: toc; position: relative; padding-left: 28px; }
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  font-family: "Manrope", monospace;
  font-size: 11px;
  color: var(--terracotta);
  letter-spacing: 0.05em;
  padding-top: 4px;
  font-weight: 600;
}
.toc a {
  color: var(--ink-soft); text-decoration: none;
  font-size: 14.5px; font-weight: 500;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color .15s ease, border-color .15s ease;
}
.toc a:hover { color: var(--terracotta-deep); border-bottom-color: var(--terracotta-deep); }

/* ----- sections ----- */
section {
  scroll-margin-top: 80px;
  margin: 0 0 48px;
}
section h2 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 0 0 18px;
  color: var(--ink);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
section h3 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  margin: 28px 0 12px;
  color: var(--ink);
}
section p, section li { color: var(--ink-soft); }
section p { margin: 0 0 16px; }
section ul { margin: 0 0 16px; padding-left: 22px; }
section ul li { margin-bottom: 8px; line-height: 1.55; }
section ul li::marker { color: var(--terracotta); }
section b, section strong { color: var(--ink); font-weight: 600; }
section a {
  color: var(--terracotta-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
section a:hover { color: var(--ink); }

/* ----- table ----- */
.table-wrap {
  margin: 18px 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
table th, table td {
  text-align: left;
  padding: 14px 16px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
table thead th {
  background: var(--bg-deep);
  font-family: "Manrope", sans-serif;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  font-weight: 700;
}
table tbody tr:last-child td { border-bottom: none; }
table tbody td { color: var(--ink-soft); }

/* ----- callout ----- */
.callout {
  margin: 56px 0 0;
  background:
    radial-gradient(60% 100% at 0% 0%, rgba(200, 168, 114, 0.25) 0%, transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 32px;
}
.callout h3 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 26px;
  margin: 0 0 10px;
  color: var(--ink);
}
.callout p { margin: 0 0 8px; color: var(--ink-soft); font-size: 15px; }
.callout p.muted { color: var(--ink-mute); font-size: 13.5px; margin-top: 14px; }
.callout a { color: var(--terracotta-deep); text-decoration: underline; text-underline-offset: 3px; }

/* ----- footer ----- */
.legal-foot {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 28px 0;
}
.legal-foot .wrap {
  max-width: 1200px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--ink-mute);
  font-size: 13.5px;
}
.legal-foot .links { display: flex; gap: 22px; }
.legal-foot a {
  color: var(--ink-soft); text-decoration: none; font-weight: 500;
}
.legal-foot a:hover { color: var(--terracotta-deep); }
.legal-foot a[aria-current="page"] { color: var(--terracotta-deep); }

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .legal { padding: 40px 0 64px; }
  .legal-nav .wrap { padding: 12px 20px; }
  .toc ol { grid-template-columns: 1fr; }
}
