/* The Perch — shared stylesheet for static legal pages.
   Mirrors the brand tokens, grain overlay, and light/dark theming from
   the marketing index.html. Linked root-relative as /legal.css. */

:root {
  --cream: #F5F0E8;
  --dark: #1A1A14;
  --gold: #B8975A;
  --gold-light: #D4B07A;
  --muted: #6B6558;
  --border: rgba(var(--gold-rgb), 0.25);
  --text-rgb: 245, 240, 232;
  --gold-rgb: 184, 151, 90;
  --ink: #1a1a14;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Montserrat', sans-serif;
}

/* Light mode — swaps bg, text, border, and text-opacity variants. Gold
   keeps the same hue across both themes. */
[data-theme="light"] {
  --dark: #f5f0e8;
  --cream: #1a1a14;
  --muted: #6b6558;
  --border: rgba(154, 123, 60, 0.45);
  --text-rgb: 26, 26, 20;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--dark);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 300;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Grain texture overlay — sits behind content. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
  opacity: 0.2;
}

/* ─── Header ───────────────────────────────────────────────────── */
.legal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 4rem;
  background: var(--dark);
  border-bottom: 1px solid var(--border);
}

.legal-wordmark {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--cream);
  text-transform: uppercase;
  text-decoration: none;
}

.legal-wordmark span { color: var(--gold); }

/* Theme toggle button */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.theme-toggle:hover { border-color: var(--gold); color: var(--gold); }
.theme-toggle svg { width: 16px; height: 16px; }
/* Show sun in dark mode, moon in light mode — the icon shows what
   you'll switch TO, the standard convention. */
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ─── Content ──────────────────────────────────────────────────── */
.legal {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 7rem 2rem 5rem;
  flex: 1;
}

.legal-back {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  margin-bottom: 2.5rem;
  transition: color 0.3s ease;
}
.legal-back:hover { color: var(--gold-light); }

.legal h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 300;
  line-height: 1.1;
  color: var(--cream);
  margin-bottom: 0.75rem;
}

.legal h1 em {
  font-style: italic;
  color: var(--gold);
}

.legal-updated {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3rem;
}

.legal-lede {
  font-size: 1rem;
  line-height: 1.9;
  color: rgba(var(--text-rgb), 0.85);
  margin-bottom: 1.5rem;
}

.legal h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--gold);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.legal h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--cream);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.legal p {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.9;
  color: rgba(var(--text-rgb), 0.7);
  margin-bottom: 1rem;
}

.legal ul {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.legal li {
  position: relative;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.9;
  color: rgba(var(--text-rgb), 0.7);
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
}

.legal li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--gold);
}

.legal li strong { color: var(--gold); font-weight: 500; }
.legal p strong { color: var(--cream); font-weight: 500; }

.legal a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.3s ease;
}
.legal a:hover { color: var(--gold-light); text-decoration: underline; }

/* ─── Footer ───────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 4rem;
  background: var(--dark);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-links a {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(var(--text-rgb), 0.6);
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer-links a:hover { color: var(--gold); }

.footer-copy {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.footer-disclaimer {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(var(--text-rgb), 0.4);
  max-width: 720px;
}

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 700px) {
  .legal-header { padding: 1.5rem 1.5rem; }
  .legal { padding: 4rem 1.5rem 3rem; }
  .legal h1 { font-size: 2.25rem; }
  footer { padding: 2.5rem 1.5rem; }
}
