/*
 * ChinUp — base stylesheet.
 * Palette sampled from the logo: navy #00365c, orange #fe672e, cream #fdf4e5.
 * Type: Nunito carries the headlines because it matches the rounded geometry of
 * the wordmark; Source Sans 3 sets body copy so the two faces never compete.
 */

:root {
  --navy:        oklch(0.32 0.077 244);   /* #00365c */
  --navy-deep:   oklch(0.24 0.063 244);
  --navy-soft:   oklch(0.47 0.058 244);
  --orange:      oklch(0.70 0.191 41);    /* #fe672e */
  --orange-deep: oklch(0.60 0.173 41);
  --cream:       oklch(0.97 0.026 84);    /* #fdf4e5 */
  --cream-warm:  oklch(0.94 0.031 84);
  --paper:       oklch(0.99 0.011 84);
  --line:        oklch(0.87 0.024 84);
  --shadow:      0 1px 2px oklch(0.32 0.077 244 / 0.06), 0 12px 32px oklch(0.32 0.077 244 / 0.07);

  --display: "Nunito", "Trebuchet MS", sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

  --wrap: 68rem;
  --read: 42rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-wrap: pretty;
  /* A faint horizon wash, so the page is not a flat fill. */
  background-image: radial-gradient(120% 60% at 50% -10%, oklch(0.94 0.043 220 / 0.55), transparent 60%);
  background-repeat: no-repeat;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy); color: var(--cream);
  padding: 0.75rem 1rem; z-index: 100; border-radius: 0 0 0.5rem 0;
}
.skip-link:focus { left: 0; }

a { color: var(--navy); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--orange-deep); }
a, button { transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 2px; }

/* ── Header ─────────────────────────────────────────────── */
.site-header { border-bottom: 1px solid var(--line); background: oklch(0.99 0.011 84 / 0.85); backdrop-filter: blur(8px); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 0.85rem 0; flex-wrap: wrap; }
.mark { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--display); font-weight: 800; font-size: 1.15rem; text-decoration: none; letter-spacing: -0.01em; }
.mark img { display: block; height: 30px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 1.25rem; font-size: 0.95rem; flex-wrap: wrap; }
.nav-links a { text-decoration: none; font-weight: 600; }
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer;
  font-family: var(--display); font-weight: 700; font-size: 0.95rem;
  padding: 0.6rem 1.15rem; border-radius: 999px; border: 1px solid transparent; text-decoration: none;
}
.btn-orange { background: var(--orange); color: oklch(0.99 0.011 84); }
.btn-orange:hover { background: var(--orange-deep); color: oklch(0.99 0.011 84); }
.btn-quiet { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-quiet:hover { background: var(--navy); color: var(--cream); }

/* ── Legal page shell ───────────────────────────────────── */
.crumb { font-size: 0.85rem; padding: 1.25rem 0 0; color: var(--navy-soft); }
.crumb ol { list-style: none; display: flex; gap: 0.5rem; margin: 0; padding: 0; flex-wrap: wrap; }
.crumb li + li::before { content: "/"; margin-right: 0.5rem; color: var(--line); }

.legal-hero { padding: 2rem 0 2.5rem; }
.legal-hero .kicker {
  font-family: var(--display); font-weight: 800; font-size: 0.72rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange-deep);
}
.legal-hero h1 {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.025em;
  font-size: clamp(2rem, 5.5vw, 3.1rem); line-height: 1.05; margin: 0.6rem 0 0.75rem; max-width: 20ch;
}
.legal-hero h1 em { font-style: normal; color: var(--orange); }
.legal-hero .lede { font-size: 1.15rem; max-width: 52ch; color: var(--navy-soft); margin: 0; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2.5rem; align-items: end; }
.stamp {
  background: var(--paper); border: 1px solid var(--line); border-radius: 1rem;
  padding: 1.25rem; box-shadow: var(--shadow);
}
.stamp span { display: block; font-family: var(--display); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-soft); }
.stamp strong { display: block; font-family: var(--display); font-size: 1.35rem; margin: 0.2rem 0 0.5rem; }
.stamp p { margin: 0; font-size: 0.95rem; color: var(--navy-soft); }

.reading-layout { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 3rem; align-items: start; padding-bottom: 4rem; }
.article { max-width: var(--read); }
.article > p:first-of-type { font-size: 1.15rem; }
.article h2 {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.015em;
  font-size: 1.5rem; line-height: 1.2; margin: 2.75rem 0 0.75rem; scroll-margin-top: 1.5rem;
}
.article h3 { font-family: var(--display); font-weight: 700; font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
.article ul, .article ol { padding-left: 1.15rem; }
.article li { margin-bottom: 0.4rem; }
.article strong { font-weight: 700; }

.table-wrap { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--line); border-radius: 0.85rem; background: var(--paper); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; min-width: 30rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--display); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; }
tbody tr:last-child td { border-bottom: 0; }

.callout {
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--orange);
  border-radius: 0.75rem; padding: 1rem 1.15rem; margin: 1.75rem 0;
}
.callout span {
  display: block; font-family: var(--display); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--orange-deep); margin-bottom: 0.35rem;
}
.callout p:last-child { margin-bottom: 0; }

.todo { border-left-color: oklch(0.62 0.2 25); background: oklch(0.96 0.04 40); }
.todo span { color: oklch(0.5 0.19 25); }

.contents { position: sticky; top: 1.5rem; font-size: 0.9rem; display: grid; gap: 0.35rem; }
.contents span { font-family: var(--display); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-soft); margin-bottom: 0.25rem; }
.contents a { text-decoration: none; color: var(--navy-soft); padding: 0.15rem 0; }
.contents a:hover { color: var(--orange-deep); }

.form-box {
  background: var(--paper); border: 1px dashed var(--navy-soft); border-radius: 0.85rem;
  padding: 1.15rem; margin: 1.5rem 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem; white-space: pre-wrap; line-height: 1.6;
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { background: var(--navy-deep); color: var(--cream); padding: 2.5rem 0; margin-top: auto; }
.site-footer a { color: var(--cream); }
.site-footer a:hover { color: var(--orange); }
.foot { display: flex; flex-wrap: wrap; gap: 1rem 1.75rem; align-items: center; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.92rem; }
.foot nav a { text-decoration: none; }
.foot-note { font-size: 0.88rem; opacity: 0.75; max-width: 34ch; }
.foot-legal { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid oklch(1 0 0 / 0.12); font-size: 0.82rem; opacity: 0.7; }
.foot-legal p { margin: 0.25rem 0; }
.consent-reopen { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/* ── Cookie banner ──────────────────────────────────────── */
.consent {
  position: fixed; inset: auto 0 0 0; z-index: 90;
  background: var(--navy-deep); color: var(--cream);
  border-top: 3px solid var(--orange); box-shadow: 0 -8px 32px oklch(0.24 0.063 244 / 0.25);
}
.consent-inner {
  width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto;
  display: flex; gap: 1.5rem; align-items: center; justify-content: space-between;
  padding: 1.1rem 0; flex-wrap: wrap;
}
.consent-copy strong { font-family: var(--display); font-size: 1rem; display: block; }
.consent-copy p { margin: 0.25rem 0 0; font-size: 0.9rem; max-width: 58ch; opacity: 0.85; }
.consent-copy a { color: var(--cream); }
.consent-actions { display: flex; gap: 0.6rem; }
.consent-btn {
  cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 0.92rem;
  padding: 0.55rem 1.1rem; border-radius: 999px; border: 1px solid var(--cream); background: transparent; color: var(--cream);
}
.consent-btn:hover { background: oklch(1 0 0 / 0.1); }
.consent-yes { background: var(--orange); border-color: var(--orange); color: oklch(0.99 0.011 84); }
.consent-yes:hover { background: var(--orange-deep); border-color: var(--orange-deep); }

/* ── 404 ────────────────────────────────────────────────── */
.notfound { text-align: center; padding: 5rem 0 6rem; }
.notfound h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2.5rem, 8vw, 4rem); margin: 0 0 0.5rem; }
.notfound p { font-size: 1.1rem; color: var(--navy-soft); max-width: 44ch; margin: 0 auto 1.75rem; }

@media (max-width: 62rem) {
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .reading-layout { grid-template-columns: 1fr; gap: 2rem; }
  .contents { position: static; order: -1; border: 1px solid var(--line); border-radius: 0.85rem; padding: 1rem; background: var(--paper); }
}
@media (max-width: 34rem) {
  .nav { gap: 0.75rem; }
  .nav-links { gap: 0.9rem; font-size: 0.9rem; }
  .consent-actions { width: 100%; }
  .consent-btn { flex: 1; justify-content: center; }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
th[scope="row"] { width: 34%; }
