/* Shared foundation: every design defines the colour tokens used here. */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}
img,
svg {
  max-width: 100%;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
}
.skip-link:focus {
  top: 1rem;
}

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

/* Header controls */
.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.language-switcher {
  display: flex;
  gap: 0.125rem;
}
.lang-link,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.5rem;
  color: var(--fg);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
}
.lang-link[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  cursor: default;
}
.lang-link:not([aria-current]) {
  color: var(--muted);
}
.lang-link:not([aria-current]):hover {
  color: var(--fg);
}

.theme-toggle .icon {
  display: none;
}
.theme-toggle:not([data-state]) .icon-auto,
.theme-toggle[data-state="auto"] .icon-auto,
.theme-toggle[data-state="light"] .icon-light,
.theme-toggle[data-state="dark"] .icon-dark {
  display: block;
}

/* Form */
.field-label {
  display: block;
  font-weight: 700;
}
.field-hint {
  margin: 0.25rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.field-row input {
  flex: 1 1 16rem;
  min-width: 0;
}
.field-row input,
.field-row button {
  min-height: 48px;
  font: inherit;
}
.link-hint {
  font-size: 0.9em;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .field-row button {
    border: 2px solid ButtonText;
  }
}

/* Atkinson Hyperlegible Next, self-hosted (SIL Open Font License, see fonts/OFL.txt) */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #fff6f8;
  --surface: #ffffff;
  --fg: #3a0f1f;
  --muted: #6b4552;
  --accent: #8c1d40;
  --accent-fg: #ffffff;
  --pink: #f4b8ca;
  --gold: #c99a3e;
  --line: #f0d9e0;
  --focus: #8c1d40;
  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c0d13;
    --surface: #28141c;
    --fg: #fbeaf0;
    --muted: #d4b5c0;
    --accent: #f5a3bc;
    --accent-fg: #1c0d13;
    --pink: #6e2944;
    --gold: #e2b75e;
    --line: #3d2129;
    --focus: #f5a3bc;
  }
}
:root[data-theme="dark"] {
  --bg: #1c0d13;
  --surface: #28141c;
  --fg: #fbeaf0;
  --muted: #d4b5c0;
  --accent: #f5a3bc;
  --accent-fg: #1c0d13;
  --pink: #6e2944;
  --gold: #e2b75e;
  --line: #3d2129;
  --focus: #f5a3bc;
}

body {
  font-family: var(--font);
  font-size: 1.15rem;
}
html {
  overflow-x: clip;
}
a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-thickness: 2px;
}

main,
.site-header,
.site-footer {
  max-width: 68rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
.site-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.wordmark {
  margin-right: auto;
  font-weight: 800;
  color: var(--fg);
  text-decoration: none;
  font-size: 1.3rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem;
  padding: clamp(1.5rem, 5vw, 4rem) 0 clamp(2.5rem, 6vw, 5rem);
}
h1 {
  margin: 0;
  font-size: clamp(3.75rem, 11vw, 7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
}
.etymology {
  display: inline-block;
  margin: 1rem 0 0;
  padding: 0.3rem 0.9rem;
  border: 2px solid var(--gold);
  border-radius: 1rem;
  font-size: 1rem;
}
.tagline {
  margin: 1.5rem 0 0;
  font-size: clamp(1.4rem, 3.4vw, 2.05rem);
  font-weight: 700;
  line-height: 1.25;
  max-width: 32rem;
}

.rally {
  width: 100%;
  max-width: 26rem;
  justify-self: center;
  overflow: visible;
}
.ring {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-dasharray: 4 8;
}
.core {
  fill: var(--accent);
}
.dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: rally 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) var(--delay) both;
}
.dot-accent {
  fill: var(--accent);
}
.dot-pink {
  fill: var(--pink);
}
.dot-gold {
  fill: var(--gold);
}
@keyframes rally {
  from {
    transform: translate(var(--dx), var(--dy)) scale(0.6);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.75rem);
}
.panel h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.2;
}
.panel > p:last-child {
  margin-bottom: 0;
}

.questions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.questions li {
  position: relative;
  padding-left: 2rem;
  max-width: 46rem;
}
.questions li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--gold);
}
.answer {
  margin: 2rem 0 0;
  padding-top: 1.5rem;
  border-top: 2px dashed var(--line);
  font-size: clamp(1.5rem, 3.6vw, 2.1rem);
  font-weight: 800;
  color: var(--accent);
}

.pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0 4rem;
}
.badge {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  background: var(--pink);
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 700;
}

.button-link,
.updates-form button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--accent);
  color: var(--accent-fg);
  border: 2px solid var(--accent);
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button-link:hover,
.updates-form button:hover {
  background: transparent;
  color: var(--accent);
}
.button-link .link-hint {
  font-weight: 400;
}
.updates-form {
  margin-top: 1.25rem;
}
.updates-form input {
  padding: 0.5rem 1rem;
  background: var(--bg);
  color: var(--fg);
  border: 2px solid var(--muted);
  border-radius: 999px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 1rem;
}
.site-footer p {
  margin: 0;
}
.footer-domain {
  font-weight: 700;
}
.a11y {
  color: var(--accent);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.legal {
  max-width: 46rem;
  padding-top: 2rem;
  padding-bottom: 4rem;
}
.legal h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  margin-bottom: 1.5rem;
}
.legal h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.4rem;
  line-height: 1.25;
}
.legal .lead {
  font-size: 1.3rem;
  font-weight: 700;
}
.legal dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.5rem 1.5rem;
  margin: 1rem 0;
}
.legal dt {
  font-weight: 700;
}
.legal dd {
  margin: 0;
}
.legal .muted {
  color: var(--muted);
}
.legal .updated {
  margin-top: 3rem;
  color: var(--muted);
  font-size: 1rem;
}
@media (max-width: 36rem) {
  .legal dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
  }
  .legal dd {
    margin-bottom: 0.75rem;
  }
}

.thanks {
  padding: 4rem 1rem;
}
.thanks h1 {
  margin-bottom: 1rem;
}

@media (max-width: 47.99rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .rally {
    max-width: 14rem;
    order: -1;
    justify-self: start;
  }
}

/* Netlify injects a "Powered by Netlify" badge frame on published pages. The CSP blocks its
   script, so it would only leave an empty frame for screen readers to stumble on. */
#nl-badge-frame,
#nl-hud-frame {
  display: none !important;
}
