/* Shared by /about, /privacy and /terms. These are plain static HTML files
   served straight from /public — they don't go through the Vite build, so this
   stylesheet can't @import the token layer in src/styles and instead restates
   the handful of values it needs. Keep the two in step by hand.

   This used to set Georgia — the only serif on the site, and the only place
   that broke the Inter-everywhere rule. */

:root {
  color-scheme: light dark;

  --paper: #faf8f4;
  --ink: #1d1c1a;
  --ink-soft: #55524c;
  --ink-faint: #767269;
  --rule: rgba(29, 28, 26, 0.12);
  --focus: #c9793f;
  --notice-bg: #fdf3d6;
  --notice-border: #e0c46c;
  --notice-ink: #6b5518;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --chrome-bg: rgba(24, 22, 19, 0.72);
  --chrome-border: rgba(255, 255, 255, 0.12);
  --chrome-ink: #f7f2e9;
  --chrome-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  --radius-pill: 999px;
  --radius-lg: 18px;
  --fast: 0.18s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Must match the dark block in src/styles/tokens.css — same hand-copy problem as
   the nav above. The chrome tokens are identical in both themes, so they aren't
   repeated here. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131416;
    --ink: #ece7de;
    --ink-soft: #a9a49b;
    --ink-faint: #8a857c;
    --rule: rgba(247, 242, 233, 0.14);
    --focus: #e08c4a;
    --notice-bg: #2a2310;
    --notice-border: #5c4a18;
    --notice-ink: #e8cf8f;
  }
}

* {
  box-sizing: border-box;
}

/* Same reason as chrome.css: `hidden` loses to any class rule that sets its own
   display. The sign-out link and the nav toggle both ship hidden. */
[hidden] {
  display: none !important;
}

body {
  max-width: 38rem;
  margin: 0 auto;
  /* Top padding clears the fixed nav pill. */
  padding: clamp(6rem, 15vh, 8rem) clamp(1.1rem, 4vw, 1.5rem) 5rem;
  font-family: var(--font);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

h2 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  margin: 3rem 0 0.75rem;
}

p {
  margin: 0 0 1.15rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* Emphasis by weight, not by slant — no italics anywhere on this site. */
em {
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.25em;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Floating nav pill --------------------------------------------------- */
/* Restated from src/styles/chrome.css — these pages are served straight from
   /public and never see the Vite build, so they can't share that file. The two
   must be kept visually identical by hand. No JS runs here, so the auth slot is
   a plain link to /submit rather than the sign-in/sign-out toggle other pages
   get; /submit forwards an already-signed-in visitor onward, so it still lands
   in the right place. */
.site-nav {
  position: fixed;
  top: clamp(0.75rem, 2.5vh, 1.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 2vw, 1.5rem);
  padding: clamp(0.5rem, 1.2vw, 0.65rem) clamp(0.9rem, 3vw, 1.75rem);
  max-width: calc(100vw - 2rem);
  border-radius: var(--radius-pill);
  background: var(--chrome-bg);
  border: 1px solid var(--chrome-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.site-mark {
  color: var(--chrome-ink);
  font-size: clamp(0.8rem, 1.6vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  opacity: 0.9;
  white-space: nowrap;
}

/* Wraps at five nav items on a narrow screen — see the same note in
   chrome.css, which this file deliberately duplicates because /public never
   passes through Vite and so can't import it. Keep the two in step. */
.site-nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem clamp(0.75rem, 2vw, 1.25rem);
  padding-left: clamp(0.6rem, 2vw, 1.25rem);
  border-left: 1px solid var(--chrome-border);
}

.site-nav-links a {
  font: inherit;
  color: var(--chrome-ink);
  font-size: clamp(0.75rem, 1.5vw, 0.8rem);
  letter-spacing: 0.02em;
  text-decoration: none;
  opacity: 0.75;
  white-space: nowrap;
  transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-nav-links a:hover,
.site-nav-links a:focus-visible {
  opacity: 1;
}

.site-nav-links a[aria-current="page"] {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 0.4em;
  text-decoration-thickness: 1px;
  cursor: default;
}

.site-nav-links a.nav-auth {
  padding: 0.4em 0.9em;
  border: 1px solid color-mix(in srgb, var(--chrome-ink) 55%, transparent);
  border-radius: var(--radius-pill);
  opacity: 0.9;
}

.site-nav-links a.nav-auth:hover,
.site-nav-links a.nav-auth:focus-visible {
  opacity: 1;
  background: color-mix(in srgb, var(--chrome-ink) 12%, transparent);
}

/* ---- Page furniture ------------------------------------------------------ */
.page-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* The provenance note. Deliberately plain and last — a statement of record,
   not a banner. */
.provenance {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--ink-faint);
}

.provenance h2 {
  margin-top: 0;
}

.provenance p {
  font-size: inherit;
  color: inherit;
  margin-bottom: 0.9rem;
}

.provenance p:last-child {
  margin-bottom: 0;
}

.placeholder-notice {
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--notice-ink);
  margin-bottom: 2.5rem;
}

/* ---- Mobile menu -------------------------------------------------------
   Five links in a centred pill wrapped onto two lines on a phone and read as
   squashed. Below 46rem the pill becomes a full-width bar — wordmark left,
   toggle right — and the links move into a panel beneath it with real tap
   targets.

   Everything here is scoped to [data-enhanced], set by /nav.js. Without the
   script the links render as before rather than becoming unreachable. */

.nav-toggle {
  display: none;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0.5rem;
  /* Negative margin keeps the larger tap target from inflating the pill. */
  margin: -0.5rem;
  color: var(--chrome-ink);
  cursor: pointer;
  border-radius: 10px;
  line-height: 0;
}

.nav-toggle-bars {
  position: relative;
  display: block;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  width: 20px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--fast) var(--ease), background-color var(--fast) var(--ease);
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

/* Open: the middle bar goes, the outer two cross. */
.site-nav.is-open .nav-toggle-bars {
  background: transparent;
}

.site-nav.is-open .nav-toggle-bars::before {
  transform: translateY(6px) rotate(45deg);
}

.site-nav.is-open .nav-toggle-bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 46rem) {
  .site-nav[data-enhanced] {
    left: clamp(0.6rem, 3vw, 1rem);
    right: clamp(0.6rem, 3vw, 1rem);
    transform: none;
    max-width: none;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .site-nav[data-enhanced] .nav-toggle {
    display: block;
  }

  .site-nav[data-enhanced] .site-nav-links {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.4rem;
    border-left: 0;
    border-radius: var(--radius-lg);
    background: var(--chrome-bg);
    border: 1px solid var(--chrome-border);
    box-shadow: var(--chrome-shadow);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    /* visibility, not display, so the panel can animate and so its links stay
       out of the tab order while closed. */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.4rem);
    transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease),
      visibility var(--fast) var(--ease);
  }

  .site-nav[data-enhanced].is-open .site-nav-links {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .site-nav[data-enhanced] .site-nav-links a {
    font-size: 0.95rem;
    opacity: 0.88;
    padding: 0.72rem 0.8rem;
    border-radius: 10px;
    white-space: normal;
  }

  .site-nav[data-enhanced] .site-nav-links a:hover,
  .site-nav[data-enhanced] .site-nav-links a:focus-visible {
    opacity: 1;
    background: color-mix(in srgb, var(--chrome-ink) 10%, transparent);
  }

  /* The primary action keeps its emphasis, but as a full-width row rather than
     a pill floating in a list of plain text links. */
  .site-nav[data-enhanced] .site-nav-links a.nav-auth {
    margin-top: 0.25rem;
    padding: 0.72rem 0.8rem;
    border-radius: 10px;
    text-align: center;
    background: color-mix(in srgb, var(--chrome-ink) 12%, transparent);
  }

  .site-nav[data-enhanced] .site-nav-links a[aria-current="page"] {
    text-decoration: none;
    background: color-mix(in srgb, var(--chrome-ink) 14%, transparent);
  }
}
