/* Static legal pages (privacy.html and terms.html). Separate because CSP forbids inline styles.
   The look follows the landing page: dark mine background, a cream bar on top, the text on
   a cream sheet and a dark footer with an orange edge. The pages use only files that are in
   every build (fonts and /loading/), because privacy.html ships without the landing page too. */
@font-face {
  font-family: "Lilita One";
  src: url("/fonts/lilita-one-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito-latin-var.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}
:root {
  --ink: #3a2a1c;
  --soil: #7a5a3c;
  --soil-deep: #2e2016;
  --cream: #e3d7b5;
  --cream-light: #f3ead0;
  --orange: #e8772e;
  --orange-edge: #a8501a;
  --gold: #ffd24a;
  --green: #5fae4a;
  --green-edge: #34702a;
  --bg: #17110d;
  --display: "Lilita One", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg) radial-gradient(120% 420px at 50% 0, #3a2617 0%, rgba(23, 17, 13, 0) 100%) no-repeat;
  color: var(--ink);
  font: 500 16px/1.6 "Nunito", system-ui, sans-serif;
}

/* Top bar: the landing page's cream nav plate. */
.legal-bar {
  position: sticky;
  top: max(12px, env(safe-area-inset-top));
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 9px 12px 11px 16px;
  border: 3px solid var(--soil-deep);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff8e3, var(--cream));
  box-shadow: 0 3px 0 var(--soil-deep), 0 14px 26px rgba(20, 11, 6, 0.26),
    inset 0 3px 0 rgba(255, 255, 255, 0.75);
}
.legal-brand { display: flex; align-items: center; height: 48px; }
.legal-brand img { display: block; width: auto; height: 58px; margin-block: -5px; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-inline: auto; }
.legal-nav a,
.legal-back {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border: 3px solid transparent;
  border-radius: 999px;
  color: var(--soil-deep);
  font: 400 1.2rem/1 var(--display);
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease,
    transform 0.14s ease;
}
.legal-nav a:hover {
  border-color: var(--soil-deep);
  background: var(--gold);
  box-shadow: 0 3px 0 var(--soil-deep);
  transform: translateY(-2px);
}
.legal-nav a[aria-current="page"]:not(:hover) {
  border-color: rgba(46, 32, 22, 0.28);
  background: #fffaf0;
  box-shadow: inset 0 -3px 0 rgba(46, 32, 22, 0.1);
}
.legal-back {
  border-color: var(--soil-deep);
  background: linear-gradient(180deg, #7cc965, var(--green));
  box-shadow: 0 4px 0 var(--green-edge), inset 0 3px 0 rgba(255, 255, 255, 0.4);
  color: #fff;
  text-shadow: 0 2px 0 rgba(30, 60, 24, 0.55);
}
.legal-back:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--green-edge), inset 0 3px 0 rgba(255, 255, 255, 0.4); }
.legal-back:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--green-edge), inset 0 3px 0 rgba(255, 255, 255, 0.4); }
a:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* The text sheet. */
main {
  width: min(820px, calc(100% - 32px));
  margin: 28px auto 48px;
  padding: 30px 34px 34px;
  border: 3px solid var(--soil-deep);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff8e3, var(--cream-light) 140px);
  box-shadow: 0 5px 0 #0c0806, 0 22px 40px rgba(0, 0, 0, 0.4), inset 0 3px 0 rgba(255, 255, 255, 0.75);
}
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; color: var(--soil-deep); }
h1 { margin: 0 0 6px; font-size: clamp(34px, 6vw, 48px); line-height: 1.05; color: var(--orange); text-shadow: 0 2px 0 var(--soil-deep); -webkit-text-stroke: 1px var(--soil-deep); }
h2 { margin: 32px 0 6px; padding-top: 18px; border-top: 2px solid rgba(46, 32, 22, 0.14); font-size: 24px; line-height: 1.2; scroll-margin-top: 110px; }
p { margin: 0 0 12px; }
p, li { overflow-wrap: anywhere; }
ul { margin: 0 0 12px; padding-left: 22px; }
li { margin: 4px 0; }
main a { color: var(--orange-edge); font-weight: 800; }
.contact { font-weight: 800; white-space: nowrap; }
.meta { margin: 0 0 16px; color: var(--soil); font-weight: 700; font-size: 14px; }
.draft {
  margin: 0 0 18px;
  padding: 10px 14px;
  border: 2px dashed var(--orange);
  border-radius: 14px;
  background: rgba(255, 210, 74, 0.18);
  font-weight: 700;
  font-size: 14px;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
th, td { padding: 9px 8px; border-bottom: 1px solid rgba(46, 32, 22, 0.16); text-align: left; vertical-align: top; }
th { font: 400 15px/1.2 var(--display); letter-spacing: 0.03em; color: var(--soil); }
td:first-child { font-weight: 900; }
@media (max-width: 560px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { padding: 10px 0; border-bottom: 1px solid rgba(46, 32, 22, 0.16); }
  td { padding: 2px 0; border: 0; }
}

/* Footer: the landing page's dark footer with the orange edge. */
.legal-footer {
  margin-top: auto;
  padding: 22px 24px calc(env(safe-area-inset-bottom) + 26px);
  border-top: 5px solid var(--orange);
  background: #120d0a;
  color: #cdbd9f;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
}
.legal-footer p { margin: 0; }

@media (max-width: 680px) {
  .legal-bar { position: static; padding: 8px 10px 10px 12px; border-radius: 18px; }
  .legal-brand { height: 40px; }
  .legal-brand img { height: 48px; margin-block: -4px; }
  /* The page links drop to their own row under the logo and the back button. */
  .legal-nav { order: 3; width: 100%; margin: 0; }
  .legal-nav a { flex: 1 1 auto; justify-content: center; padding: 0 12px; font-size: 1.05rem; }
  .legal-back { margin-left: auto; padding: 0 14px; font-size: 1.05rem; }
  main { margin: 18px auto 32px; padding: 22px 18px 24px; border-radius: 18px; }
  h2 { font-size: 21px; scroll-margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .legal-nav a, .legal-back { transition: none; }
}
