/*
 * Lodestar — lodestar.nookpages.com. One stylesheet for every page: no web fonts, scripts or third-party files.
 * Colours come from Lodestar's theme (packages/tokens from app.manifest.ts: sapphire #3558B2, brass #C8A15A, tinted
 * neutrals, the night-blue dark mode) and from the icon (assets/icon.png: its night-blue field, #1C2851 to #121D3E,
 * and its brass star, #D9B66E). Text pairs meet WCAG AA (4.5:1 or more) in both modes. Brass is never text on a light
 * background (2.3:1 on it): there it's shapes only, and words in brass use the darker #77560A. Type is the system's own
 * (SF Pro on Apple devices), as in the app: no serif.
 */

:root {
  color-scheme: light dark;

  --bg: #f8faff;
  --surface: #ffffff;
  --sapphire-muted: #e3e9f6;
  --brass-muted: #f8f3ea;
  --text: #06070a;
  --text-secondary: #5a5e64;
  --link: #3558b2;
  --link-hover: #264187;
  --accent: #3558b2;
  --accent-hover: #264187;
  --on-accent: #ffffff;
  --brass: #c8a15a;
  --brass-text: #77560a;
  --marker: #aa843d;
  --tick: #3558b2;
  --border: #dadce2;
  --focus: #3558b2;

  /* The icon's night sky, the same in both modes: the home page's panel and the mark's tile. */
  --night-top: #1c2851;
  --night-bottom: #121d3e;
  --night-glow: #2a3f80;
  --night-edge: transparent;
  --star: #d9b66e;
  --on-night: #f8faff;
  --on-night-secondary: #c9d1e3;
  --on-star: #06070a;
  --shadow: 0 18px 40px rgb(18 29 62 / 0.28);

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 42rem;
  --wide: 64rem;
  --gutter: 1rem;
  --radius: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #040915;
    --surface: #10192c;
    --sapphire-muted: #18284b;
    --brass-muted: #2f2616;
    --text: #f8faff;
    --text-secondary: #a4abb9;
    --link: #7aa1fc;
    --link-hover: #a3c0ff;
    --accent: #3558b2;
    --accent-hover: #486dc9;
    --on-accent: #ffffff;
    --brass-text: #c8a15a;
    --marker: #c8a15a;
    --tick: #7aa1fc;
    --border: #222b3e;
    --focus: #7aa1fc;
    --night-edge: #2b3966;
    --shadow: 0 18px 44px rgb(0 0 0 / 0.45);
  }
}

@media (min-width: 40rem) {
  :root {
    --gutter: 1.5rem;
  }
}

/* Base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

@media (min-width: 48rem) {
  body {
    font-size: 1.125rem;
  }
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 1.6rem + 2.4vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.45rem, 1.3rem + 0.8vw, 1.85rem);
  margin: 3rem 0 0.75rem;
  scroll-margin-top: 1.5rem;
}

h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
  scroll-margin-top: 1.5rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

p {
  text-wrap: pretty;
}

ul,
ol {
  padding-left: 1.4rem;
}

li {
  margin-top: 0.4rem;
}

li:first-child {
  margin-top: 0;
}

li::marker {
  color: var(--marker);
}

strong {
  font-weight: 650;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}

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

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.page {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  padding-block: 2.5rem 4rem;
}

.narrow {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  padding-bottom: 3rem;
}

.center {
  text-align: center;
}

.fineprint {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Skip link: hidden until focused */

.skip {
  position: absolute;
  left: var(--gutter);
  top: -10rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.skip:focus {
  top: 0.75rem;
}

/* Header and footer */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand svg {
  width: 1.9rem;
  height: 1.9rem;
  flex: none;
}

/* The mark, as on the app icon: the brass star in its ring on the night blue. */
.mark-tile {
  fill: var(--night-top);
}

.mark-star {
  fill: var(--star);
}

.mark-ring {
  stroke: var(--star);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list li {
  margin-top: 0;
}

.nav-list a {
  display: inline-block;
  padding-block: 0.6rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-decoration: none;
}

.nav-list a:hover {
  color: var(--text);
  text-decoration: underline;
}

.nav-list a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-decoration-thickness: 2px;
}

/* English · Español: the page's own language as text, the other one as a link. */
.nav-list .lang {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.75rem 2.25rem;
}

.site-footer p {
  margin: 0;
}

.site-footer .nav-list a {
  font-size: 0.9rem;
  text-decoration: underline;
}

.site-footer .nav-list a:hover {
  color: var(--text);
}

/* Landing page: a night-sky panel, the icon's colours, in both modes */

.hero {
  padding-top: 1.5rem;
}

.hero-panel {
  padding: 3.25rem 1.25rem 2.5rem;
  border: 1px solid var(--night-edge);
  border-radius: 2rem;
  /* A few stars, in the top band and along the edges, clear of the words; then the icon's glow and gradient. */
  background:
    radial-gradient(circle at 8% 6%, rgb(248 250 255 / 0.85) 0 1px, transparent 1.6px),
    radial-gradient(circle at 22% 11%, rgb(248 250 255 / 0.5) 0 1px, transparent 1.6px),
    radial-gradient(circle at 36% 4%, rgb(217 182 110 / 0.8) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 64% 9%, rgb(248 250 255 / 0.6) 0 1px, transparent 1.6px),
    radial-gradient(circle at 79% 5%, rgb(248 250 255 / 0.85) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 93% 12%, rgb(248 250 255 / 0.55) 0 1px, transparent 1.6px),
    radial-gradient(circle at 3% 36%, rgb(248 250 255 / 0.5) 0 1px, transparent 1.6px),
    radial-gradient(circle at 97% 48%, rgb(217 182 110 / 0.7) 0 1px, transparent 1.6px),
    radial-gradient(circle at 2.5% 72%, rgb(248 250 255 / 0.45) 0 1px, transparent 1.6px),
    radial-gradient(circle at 97.5% 84%, rgb(248 250 255 / 0.5) 0 1px, transparent 1.6px),
    radial-gradient(circle at 30% 97%, rgb(248 250 255 / 0.45) 0 1px, transparent 1.6px),
    radial-gradient(circle at 71% 96%, rgb(248 250 255 / 0.5) 0 1px, transparent 1.6px),
    radial-gradient(ellipse 50rem 22rem at 50% 0%, var(--night-glow), transparent 70%),
    linear-gradient(180deg, var(--night-top), var(--night-bottom));
  box-shadow: var(--shadow);
  color: var(--on-night);
  text-align: center;
}

@media (min-width: 40rem) {
  .hero-panel {
    padding: 4rem 2.5rem 3rem;
  }
}

.hero-panel h1 {
  max-width: 40rem;
  margin-inline: auto;
}

.hero-mark {
  width: 7.5rem;
  height: 7.5rem;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 0 1.25rem rgb(217 182 110 / 0.35));
}

.hero-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--on-night-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede {
  max-width: 34rem;
  margin-inline: auto;
  color: var(--on-night-secondary);
  font-size: 1.15em;
}

.promise {
  max-width: 34rem;
  margin: 1.5rem auto 1.75rem;
  color: var(--star);
  font-size: clamp(1.2rem, 1.1rem + 0.6vw, 1.45rem);
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
}

.hero-note {
  max-width: 34rem;
  margin-inline: auto;
  color: var(--on-night-secondary);
  font-size: 0.9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

/* On the night panel the button is brass, which stands out there (7:1); the sapphire wouldn't. */
.hero-panel .button {
  background: var(--star);
  color: var(--on-star);
}

.hero-panel .button:hover {
  background: #e7cb8f;
  color: var(--on-star);
}

.definition {
  max-width: 36rem;
  margin: 3rem auto 1rem;
  padding: 1.5rem var(--gutter);
  text-align: center;
}

.definition-text {
  margin: 0;
  font-size: clamp(1.3rem, 1.15rem + 0.9vw, 1.75rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.definition-note {
  margin: 1rem 0 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.definition-note::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin: 0 auto 1rem;
  background: var(--brass);
}

.section {
  padding-block: 1rem;
}

.section-title {
  text-align: center;
}

.section-intro {
  max-width: 36rem;
  margin: 0 auto 2rem;
  color: var(--text-secondary);
  text-align: center;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.cards > li {
  margin-top: 0;
}

.card {
  padding: 1.25rem 1.4rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-secondary);
}

.card h3 {
  margin-top: 0;
  color: var(--text);
  font-size: 1.15rem;
}

.card-pro {
  border-color: var(--brass);
  background: var(--brass-muted);
  color: var(--text);
}

.card-pro .fineprint {
  color: var(--text);
}

.badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--brass);
  color: var(--on-star);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 0.2em;
}

/* A drawn check mark, so screen readers don't announce a symbol. */
.ticks {
  padding-left: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding-left: 1.75rem;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.3em;
  width: 0.4rem;
  height: 0.75rem;
  border: solid var(--tick);
  border-width: 0 0.16rem 0.16rem 0;
  transform: rotate(45deg);
}

.card-pro .ticks li::before {
  border-color: var(--brass-text);
}

/* Policy pages */

.doc-meta {
  color: var(--text-secondary);
}

.summary {
  margin: 2rem 0;
  padding: 1.4rem 1.5rem 0.6rem;
  border-radius: var(--radius);
  background: var(--sapphire-muted);
}

.summary h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.toc {
  margin: 2rem 0 1rem;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--brass);
}

.toc h2 {
  margin: 0 0 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
}

.toc li {
  margin-top: 0.15rem;
}

.facts dt {
  margin-top: 1rem;
  font-weight: 650;
}

.facts dd {
  margin: 0.15rem 0 0;
}

.note {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
}

.note > :last-child {
  margin-bottom: 0;
}

.lines {
  padding: 0;
  list-style: none;
}

.lines li {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
}

.email {
  font-weight: 600;
}

/* Printing a policy */

@media print {
  .skip,
  .site-header nav,
  .site-footer nav {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .summary,
  .note,
  .card {
    border: 1px solid #999999;
    background: none;
  }
}
