/* ─── Tideform shared styles for legal pages ─── */
:root {
  --bg:           #ede6d6;
  --bg-deep:      #e3dac6;
  --paper:        #f6f1e3;
  --ink:          #0e1a14;
  --ink-soft:     #1f2e25;
  --muted:        #6b6f63;
  --line-soft:    rgba(14, 26, 20, 0.14);
  --accent:       #c0552a;
  --accent-deep:  #9a3f1c;
  --good:         #3a6b4a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  z-index: 100;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

::selection { background: var(--accent); color: var(--paper); }

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

.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--ink);
  opacity: 0.4;
}

/* ─── Topbar ─── */
.topbar {
  border-bottom: 1px solid var(--line-soft);
  padding: 20px 0;
  background: rgba(237, 230, 214, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.brand-mark { width: 28px; height: 28px; }

.nav { display: flex; gap: 36px; align-items: center; }
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  transition: color .18s ease;
}
.nav a:hover { color: var(--accent); }
@media (max-width: 760px) { .nav { display: none; } }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all .2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-soft);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-arrow { font-size: 16px; line-height: 1; transform: translateY(-1px); }

/* ─── Legal page layout ─── */
.legal-hero {
  padding: 80px 0 56px;
  border-bottom: 1px solid var(--line-soft);
}
.legal-hero h1 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1;
  letter-spacing: -0.022em;
  margin-top: 24px;
  margin-bottom: 24px;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.legal-hero h1 .italic { font-style: italic; font-variation-settings: "opsz" 144, "SOFT" 100; color: var(--ink-soft); }
.legal-meta {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.legal-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 72px;
  padding: 64px 0 110px;
  align-items: start;
}
@media (max-width: 880px) {
  .legal-body { grid-template-columns: 1fr; gap: 32px; padding: 48px 0 80px; }
}

.legal-toc {
  position: sticky;
  top: 96px;
  font-size: 13px;
}
.legal-toc h6 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.legal-toc ol {
  list-style: none;
  counter-reset: toc;
}
.legal-toc li { counter-increment: toc; margin-bottom: 8px; }
.legal-toc a {
  display: flex;
  gap: 12px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 0;
  line-height: 1.4;
  transition: color .2s ease;
}
.legal-toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 2px;
}
.legal-toc a:hover { color: var(--accent); }
@media (max-width: 880px) { .legal-toc { position: static; } }

.legal-content {
  max-width: 68ch;
  font-size: 16px;
  color: var(--ink-soft);
}
.legal-content > p:first-child {
  font-size: 18px;
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding-left: 20px;
  margin-bottom: 48px;
  font-family: 'Fraunces', serif;
  font-weight: 400;
  line-height: 1.4;
  font-variation-settings: "opsz" 24, "SOFT" 80;
}
.legal-content section {
  border: none;
  padding: 0;
  margin-bottom: 48px;
}
.legal-content h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 20px;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 144, "SOFT" 60;
  display: flex;
  gap: 16px;
  align-items: baseline;
}
.legal-content h2 .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.1em;
  flex-shrink: 0;
  width: 32px;
}
.legal-content h3 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--ink);
  margin-top: 28px;
  margin-bottom: 10px;
}
.legal-content p { margin-bottom: 16px; line-height: 1.65; }
.legal-content ul, .legal-content ol {
  margin-bottom: 18px;
  padding-left: 0;
  list-style: none;
}
.legal-content ul li {
  position: relative;
  padding: 6px 0 6px 24px;
  line-height: 1.55;
}
.legal-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 12px;
  height: 1px;
  background: var(--ink);
}
.legal-content ol { counter-reset: ol-counter; }
.legal-content ol li {
  counter-increment: ol-counter;
  position: relative;
  padding: 6px 0 6px 32px;
  line-height: 1.55;
}
.legal-content ol li::before {
  content: counter(ol-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
}
.legal-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.legal-content a:hover { color: var(--accent-deep); }
.legal-content strong { color: var(--ink); font-weight: 500; }
.legal-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--paper);
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--line-soft);
}
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  font-size: 14px;
}
.legal-content table thead th {
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink);
  background: var(--bg-deep);
}
.legal-content table tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  line-height: 1.5;
}
.legal-content table tbody tr:last-child td { border-bottom: 1px solid var(--ink); }
.legal-content table tbody td:first-child {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  color: var(--ink);
  width: 28%;
}

.legal-callout {
  border: 1px solid var(--line-soft);
  background: var(--paper);
  padding: 24px 28px;
  border-radius: 6px;
  margin: 28px 0;
}
.legal-callout h4 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 8px;
}
.legal-callout p { margin: 0; font-size: 14px; }

/* ─── Footer ─── */
footer {
  padding: 80px 0 40px;
  background: var(--ink);
  color: var(--paper);
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(246, 241, 227, 0.12);
}
@media (max-width: 880px) { .footer-top { grid-template-columns: 1fr 1fr; gap: 36px; } }
@media (max-width: 540px) { .footer-top { grid-template-columns: 1fr; } }
.footer-brand h3 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 36px;
  line-height: 1.1;
  margin-bottom: 16px;
  max-width: 14ch;
  font-variation-settings: "opsz" 144, "SOFT" 80;
}
.footer-brand p {
  color: rgba(246, 241, 227, 0.6);
  font-size: 14px;
  max-width: 36ch;
  line-height: 1.55;
}
.footer-col h6 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(246, 241, 227, 0.5);
  margin-bottom: 18px;
  font-weight: 500;
}
.footer-col a, .footer-col p {
  display: block;
  color: var(--paper);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.8;
  transition: color .2s ease;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: rgba(246, 241, 227, 0.5);
  font-family: 'JetBrains Mono', monospace;
}
.footer-bottom a { color: rgba(246, 241, 227, 0.7); text-decoration: none; }
.footer-bottom a:hover { color: var(--accent); }
