/* Us & God public pages. One stylesheet, no scripts, no web fonts.
   Colours: cream #FFF9F1, navy #14203D, blue #2F5BEA, coral #FF6B5E, gold #FFC24B.
   Coral and gold are used as shapes only; text on them is always navy, never white.
   Contrast (text on background, WCAG): navy on cream 15.4, blue on cream 5.3,
   secondary on cream 5.7, white on blue 5.5; dark mode: text 16.6, link 7.8, secondary 8.4.
   When this file changes, bump the ?v= number in each page's <link> (it is cached for a year). */

@font-face { font-family: "Figtree"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/Figtree-500.ttf") format("truetype"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/Figtree-700.ttf") format("truetype"); }

:root {
  color-scheme: dark;
  --gold: #FFC24B;
  --coral: #FF6B5E;
  --radius: 20px;
  --gutter: 16px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Figtree", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #0E1630;
  --surface: #17213F;
  --text: #F4F6FF;
  --muted: #A9B2C7;
  --link: #8FA8FF;
  --tint: #1F2A4D;
  --tint-edge: #FFC24B;
  --line: #2C3860;
  --button-bg: #8FA8FF;
  --button-text: #0E1630;
  --sky: #131C3A;
}

/* Dark is the default for everyone. The switch (theme.js) sets data-theme="light" on the page, and
   every colour that changes between the two is a token here, so no other rule needs a light or dark variant. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FFF9F1;
  --surface: #FFFFFF;
  --text: #14203D;
  --muted: #5B6478;
  --link: #2F5BEA;
  --tint: #FFF1D1;
  --tint-edge: #FFC24B;
  --line: #E7DFD0;
  --button-bg: #2F5BEA;
  --button-text: #FFFFFF;
  --sky: #EEF2FF;
}

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

html {
  background-color: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.6;
  overflow-wrap: break-word;
}

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

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, .button:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background-color: var(--surface);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  z-index: 10;
}
.skip:focus { top: 0.5rem; }

/* Header */
.site-header { padding: 1.25rem 0 0.75rem; }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}
.brand img { width: 2rem; height: 2rem; flex: none; border-radius: 9px; display: block; }
.hdr-right { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.1rem; }
.theme-toggle { display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem; padding: 0; border-radius: 50%; border: 2px solid var(--text); background-color: transparent; color: var(--text); cursor: pointer; }
.theme-toggle svg { width: 1.15rem; height: 1.15rem; display: block; }
.theme-toggle:hover { background-color: var(--tint); }
.theme-toggle:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.nav a { color: var(--text); text-decoration: none; padding: 0.35rem 0; font-weight: 600; }
.nav a:hover, .nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.3em;
}

/* Main */
main { display: block; padding: 1.25rem 0 3rem; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; margin-top: 2.25rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; }
p, ul, ol, table, dl { margin: 0 0 1rem; }
ul, ol { padding-left: 1.35rem; }
li { margin-bottom: 0.4rem; }
strong { font-weight: 700; }

.meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.5rem; }
.small { color: var(--muted); font-size: 0.95rem; }

/* Landing */
.hero {
  background-color: var(--sky);
  background-image: linear-gradient(180deg, var(--sky), var(--bg));
  border-radius: var(--radius);
  padding: 2rem 1.25rem 2.25rem;
  margin: 0.5rem 0 2rem;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 0.5em; }
.lede { font-size: 1.2rem; margin-bottom: 1.25rem; }
.verse {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.45;
  border-left: 4px solid var(--gold);
  padding: 0.1rem 0 0.1rem 1rem;
  margin: 1.5rem 0 0;
}
.verse cite { display: block; font-family: var(--sans); font-style: normal; font-size: 0.95rem; color: var(--muted); margin-top: 0.4rem; }

.cards { display: grid; gap: 1rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.cards li {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  margin: 0;
}
.cards h2 { font-size: 1.15rem; margin: 0 0 0.35rem; }
.cards p { margin: 0; }
.dot { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; margin-right: 0.5rem; }
.dot.gold { background-color: var(--gold); }
.dot.coral { background-color: var(--coral); }
.dot.blue { background-color: var(--link); }

.notice {
  background-color: var(--tint);
  border: 2px solid var(--tint-edge);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 0 0 2rem;
}
.notice p:last-child { margin-bottom: 0; }

.button {
  display: inline-block;
  background-color: var(--button-bg);
  color: var(--button-text);
  font-weight: 700;
  text-decoration: none;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
}
.button:hover { text-decoration: underline; }

/* Legal and support pages */
.summary {
  background-color: var(--tint);
  border: 2px solid var(--tint-edge);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem 0.6rem;
  margin: 0 0 2rem;
}
.summary h2 { margin-top: 0; font-size: 1.2rem; }
.summary ul { margin-bottom: 0.6rem; }

.toc { background-color: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1.25rem; margin: 0 0 1.5rem; }
.toc p { margin: 0 0 0.4rem; font-weight: 700; }
.toc ol { margin: 0; columns: 1; }

.table-scroll { overflow-x: auto; margin: 0 0 1rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; background-color: var(--surface); }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.7rem; border: 1px solid var(--line); }
th { background-color: var(--tint); }
caption { text-align: left; color: var(--muted); font-size: 0.95rem; padding-bottom: 0.4rem; }

.placeholder {
  background-color: var(--tint);
  border: 1px dashed var(--muted);
  border-radius: 6px;
  padding: 0.05rem 0.4rem;
  font-weight: 600;
}

details {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 1.1rem;
  margin: 0 0 0.75rem;
}
summary { cursor: pointer; font-weight: 700; }
details[open] summary { margin-bottom: 0.5rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0 2.5rem; color: var(--muted); font-size: 0.95rem; }
.site-footer p { margin: 0 0 0.5rem; }
.site-footer a { color: var(--link); }

@media (min-width: 40rem) {
  body { font-size: 1.125rem; }
  h1 { font-size: 2.4rem; }
  .hero { padding: 2.75rem 2rem 3rem; }
  .hero h1 { font-size: 2.8rem; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .toc ol { columns: 2; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
