/* Shared base, header, bands, buttons, footer and the Privacy/Terms reading layout.
   The homepage's own components live in home.css. */
* { box-sizing: border-box; }

/* Height of the sticky header, so in-page jumps and the sticky policy contents clear it. */
:root { --header-offset: 4.5rem; }

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

a { color: var(--primary-strong); text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 0.15em; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--primary-strong); outline-offset: 5px; }

.container { width: min(100% - 3rem, 76rem); margin-inline: auto; }
.skip-link { position: absolute; top: 0.5rem; left: 0.5rem; padding: 0.75rem 1rem; background: var(--surface); z-index: 11; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
main [id] { scroll-margin-top: var(--header-offset); }

/* One header on every page: sticky on desktop; below the menu breakpoint the links fold into a menu and navigation.js hides the bar on scroll down. */
.site-top { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--outline-variant); background: var(--surface); transition: transform 180ms ease; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-block: 0.7rem; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 0.65rem; color: var(--primary-strong); text-decoration: none; }
.brand-mark { display: block; width: clamp(2.5rem, 4vw, 3rem); height: auto; aspect-ratio: 1; flex: 0 0 auto; object-fit: contain; }
.brand-wordmark { color: var(--primary-strong); font-size: clamp(1.35rem, 2.1vw, 1.75rem); font-weight: 950; letter-spacing: 0.045em; line-height: 1; white-space: nowrap; }
.site-header nav, .site-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.25rem; }
.site-header nav a, .site-footer nav a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.site-header nav a { padding-inline: 0.2rem; color: var(--text-primary); font-size: 0.94rem; font-weight: 650; text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--primary-strong); }
.site-header nav .header-cta { padding: 0.6em 1.15em; color: var(--text-on-primary-strong); }
.site-header .desktop-nav { gap: 0.2rem 1.1rem; }
.site-header .desktop-nav a { font-size: 0.9rem; }
.mobile-menu { display: none; }

h1, h2, h3 { line-height: 1.15; }
h1, h2 { letter-spacing: -0.04em; }
h1 { margin: 0.9rem 0 1.4rem; font-size: clamp(3rem, 6.2vw, 5.2rem); }
h2 { margin: 0.5rem 0 1rem; font-size: clamp(2rem, 3.8vw, 3.15rem); }
h3 { margin: 0.75rem 0; font-size: 1.35rem; letter-spacing: -0.025em; }
p { margin: 0.75rem 0; }
.eyebrow { color: var(--text-secondary); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.lead { font-size: clamp(1.15rem, 1.8vw, 1.38rem); line-height: 1.55; }

/* Page sections are full-width bands that alternate in tone. Cards are for objects inside a band, never for a whole section. */
.band-white { background: var(--surface); }
.band-mint { background: var(--primary-surface); }
.band-cream { background: var(--accent-surface); }
.band-strong { background: var(--primary-strong); color: var(--text-on-primary-strong); }
.band-strong :focus-visible { outline-color: var(--surface); }
.band-strong .eyebrow { color: var(--primary-surface); }
.band-strong .text-link { color: inherit; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.4rem; margin-top: 1.75rem; }
.button { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.8em; min-width: 0; max-width: 100%; min-height: 2.9rem; padding: 0.8em 1.3em; border: 2px solid var(--primary-strong); border-radius: 999px; background: var(--primary-strong); color: var(--text-on-primary-strong); font-weight: 750; text-align: center; text-decoration: none; transition: transform 160ms ease, box-shadow 160ms ease; }
.button:hover { box-shadow: 0 0.45rem 1rem var(--shadow); transform: translateY(-2px); }
/* Inline flow, not flex: a flex gap would split the underline between the text and its arrow. */
.text-link { display: inline-block; padding-block: 0.6rem; font-weight: 700; }

.site-footer { padding-block: 3rem 1.5rem; border-top: 1px solid var(--outline-variant); background: var(--surface); color: var(--text-primary); }
.footer-inner { display: grid; grid-template-columns: minmax(12rem, 0.8fr) minmax(0, 1.2fr); gap: 1.5rem 3rem; }
.footer-brand .brand { max-width: 100%; flex-wrap: wrap; }
.footer-brand .brand-mark { width: 2.7rem; }
.footer-brand .brand-wordmark, .footer-brand-lockup .brand-wordmark { color: var(--primary-strong); }
.footer-brand p { color: var(--text-secondary); font-size: 0.9rem; }
.site-footer nav { justify-content: flex-end; gap: 0.3rem 1.2rem; }
.site-footer nav a { color: var(--text-primary); font-size: 0.88rem; text-decoration-thickness: 1px; }
.footer-note { grid-column: 1 / -1; margin: 0; padding-top: 1rem; border-top: 1px solid var(--outline-variant); color: var(--text-secondary); font-size: 0.78rem; }
.footer-note a { color: inherit; }
/* Footer credits: the attribution line is always visible; only the creator list collapses. */
.credits-note { grid-column: 1 / -1; margin: 0; padding-top: 0.5rem; border-top: 1px solid var(--outline-variant); color: var(--text-secondary); font-size: 0.82rem; }
.credits-note a { color: var(--text-primary); }
.credits { grid-column: 1 / -1; font-size: 0.82rem; }
.credits summary { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; font-weight: 700; cursor: pointer; list-style: none; }
.credits summary::-webkit-details-marker { display: none; }
.credits summary::after { content: "+"; color: var(--primary-strong); font-size: 1.25rem; font-weight: 600; line-height: 1; }
.credits[open] summary::after { content: "−"; }
.credits ul { columns: 11rem; column-gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.credits li { padding-block: 0.15rem; break-inside: avoid; }
.credits a { color: var(--text-primary); }

/* Privacy and Terms use the homepage band system: a mint title band, then a white reading band holding the contents panel and the document. */
.policy-heading { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3.5rem); }
.policy-heading h1 { margin-block: 0.6rem 1rem; font-size: clamp(2.5rem, 5.2vw, 4rem); }
.policy-heading > p { max-width: 40rem; }
.policy-heading > p:last-child { margin-bottom: 0; color: var(--text-secondary); font-size: 0.88rem; }
.policy { display: grid; grid-template-columns: minmax(13rem, 0.72fr) minmax(0, 1.65fr); align-items: start; gap: 1.5rem 3rem; padding-block: clamp(2.5rem, 5vw, 4rem) clamp(3.5rem, 7vw, 6rem); }
.policy-contents { position: sticky; top: calc(var(--header-offset) + 1rem); grid-column: 1; max-height: calc(100svh - var(--header-offset) - 2rem); padding: 1.25rem; overflow: auto; border: 1px solid var(--outline-variant); border-radius: 1.25rem; background: var(--primary-surface); }
.policy-contents h2 { margin: 0 0 0.8rem; font-size: 1.15rem; letter-spacing: -0.02em; }
.policy-contents ol { display: grid; gap: 0.2rem; margin: 0; padding: 0; list-style: none; counter-reset: policy; }
.policy-contents li { counter-increment: policy; }
.policy-contents a { display: block; padding: 0.45rem 0.55rem; border-radius: 0.55rem; color: var(--text-secondary); font-size: 0.82rem; line-height: 1.35; text-decoration: none; }
.policy-contents a::before { content: counter(policy, decimal-leading-zero) " "; color: var(--primary-strong); font-size: 0.68rem; font-weight: 800; }
.policy-contents a:hover { background: var(--surface); color: var(--text-primary); }
.policy-body { grid-column: 2; min-width: 0; }
.policy-body > section { margin: 0; padding: 0.4rem 0 2rem; }
.policy-body > section + section { padding-top: 1.75rem; border-top: 1px solid var(--outline-variant); }
.policy-body h2 { margin: 0.5rem 0 1rem; font-size: clamp(1.45rem, 2.7vw, 2rem); letter-spacing: -0.03em; }
.policy-body h3 { margin: 1.5rem 0 0.5rem; font-size: 1.15rem; }
.policy-body p, .policy-body li { color: var(--text-primary); }
.policy-body li + li { margin-top: 0.45rem; }
.policy-body ul, .policy-body ol { padding-left: 1.4rem; }
.policy-body a { font-weight: 600; }
.policy-body strong { font-weight: 750; }
.data-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; margin-block: 1.4rem; padding: 0.8rem; border: 1px solid var(--outline-variant); border-radius: 1.2rem; background: var(--surface-container); }
.data-list article { padding: 1rem 1.1rem; border: 1px solid var(--outline-variant); border-radius: 0.8rem; background: var(--surface); }
.data-list h3 { margin-top: 0; color: var(--primary-strong); }
.unconfirmed { padding: 0.15em 0.3em; border-radius: 0.25em; background: var(--warning-bg); color: var(--on-warning-bg); }
p.unconfirmed { padding: 0.9rem 1rem; border-left: 3px solid var(--on-warning-bg); }
.policy table { width: 100%; margin-block: 1rem; border: 1px solid var(--outline-variant); border-collapse: separate; border-spacing: 0; border-radius: 0.8rem; background: var(--surface); table-layout: fixed; }
.policy th, .policy td { padding: 0.8rem; overflow-wrap: anywhere; text-align: left; vertical-align: top; border-bottom: 1px solid var(--outline-variant); }
.policy th { background: var(--surface-container); font-size: 0.9rem; }
.policy tr:last-child td { border-bottom: 0; }
.site-footer .container { width: min(100% - 3rem, 76rem); }

@media (max-width: 68rem) {
  .site-header .desktop-nav { display: none; }
  .site-header { row-gap: 0.4rem; }
  .mobile-menu { display: block; position: relative; margin-left: auto; }
  .mobile-menu summary { display: flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.5rem 0.75rem; border: 1px solid var(--outline-variant); border-radius: 999px; color: var(--text-primary); font-weight: 700; cursor: pointer; list-style: none; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-menu[open] nav { position: absolute; top: calc(100% + 0.5rem); right: 0; display: grid; width: min(18rem, calc(100vw - 2rem)); max-height: calc(100vh - 5rem); padding: 0.5rem; overflow-y: auto; border: 1px solid var(--outline-variant); border-radius: 1rem; background: var(--surface); box-shadow: 0 0.7rem 1.5rem var(--shadow); }
  .mobile-menu nav a { display: block; padding: 0.75rem 1rem; color: var(--text-primary); font-weight: 650; text-decoration: none; }
  .mobile-menu nav a:hover, .mobile-menu nav a:focus-visible { background: var(--primary-surface); }
  .site-top.is-hidden:not(:focus-within) { transform: translateY(-100%); }
}

/* The header hides on the way down, so jumps only need a small gap. */
@media (max-width: 56rem) {
  main [id] { scroll-margin-top: 2rem; }
}

@media (max-width: 54rem) {
  .container { width: min(100% - 2.5rem, 76rem); }
  .policy { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .policy-contents, .policy-body { grid-column: 1; }
  .policy-contents { position: static; max-height: none; }
  .policy-contents ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.15rem 0.6rem; }
}

@media (max-width: 38rem) {
  .container, .site-footer .container { width: calc(100% - 2rem); }
  .site-header { column-gap: 0.6rem; padding-block: 0.6rem; }
  .brand-mark { width: 2.5rem; }
  .brand-wordmark { font-size: clamp(1rem, 5vw, 1.4rem); letter-spacing: 0.055em; }
  .site-header nav { gap: 0.15rem 0.7rem; }
  .site-header nav a { min-height: 2.5rem; font-size: 0.8rem; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .site-footer nav { justify-content: flex-start; gap: 0.1rem 0.8rem; }
  .footer-note { grid-column: 1; }
  .policy { padding-block: 2rem 3rem; }
  .policy-heading h1 { font-size: clamp(2.3rem, 10vw, 3rem); }
  .policy-contents { padding: 1rem; }
  .policy-contents ol { grid-template-columns: minmax(0, 1fr); }
  .policy-body > section { padding-bottom: 1.5rem; }
  .policy th, .policy td { padding: 0.6rem; font-size: 0.83rem; }
}

@media (max-width: 24rem) {
  .brand { gap: 0.4rem; }
  .mobile-menu summary { gap: 0.35rem; padding-inline: 0.55rem; }
}

@media (max-width: 22rem) {
  .container, .site-footer .container { width: calc(100% - 1.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-top { transition: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

@media print {
  .site-top, .site-footer, .skip-link, .policy-contents { display: none; }
  body { background: var(--surface); font-size: 11pt; }
  .band-white, .band-mint, .band-cream, .band-strong { background: transparent; color: var(--text-primary); }
  .band-strong .eyebrow { color: var(--text-secondary); }
  .container, .site-footer .container { width: 100%; }
  .policy { display: block; max-width: none; }
  .policy-body > section { break-inside: auto; }
}
