/* Tokens */
:root {
  --navy: #092953;
  --blue: #0564ed;
  --sky: #eaf5ff;
  --muted: #566a82;
  --line: #dce7f2;
  --bg: #fff;
  --bg-alt: #f4f9fe;
  --bg-alt2: #f7faff;
  --header-bg: rgba(255, 255, 255, 0.93);
  --surface: #fff;
  --btn-bg: #0564ed;
  --btn-bg-hover: #084fb8;
  --focus: #029fe6;
  --tbd-bg: #fff3a3;
  --tbd-text: #3d2f00;
  --tbd-line: #8a6d00;
  --hero-bg: radial-gradient(at 85% 35%, #cce9ff 0, transparent 48%), linear-gradient(110deg, #f7fbff, #eaf5ff);
  --board-shadow: 0 22px 70px rgba(27, 93, 165, 0.11);
  --split-shadow: 0 18px 35px rgba(30, 84, 138, 0.03);
  --half-second: #092953;
}

/* Light is the default. Dark applies only when the visitor chooses it with the header switch. */
:root[data-theme="dark"] {
  --navy: #e8f1ff;
  --blue: #7db1ff;
  --sky: #0c2a52;
  --muted: #a9bdd6;
  --line: #23446f;
  --bg: #061a36;
  --bg-alt: #0a2344;
  --bg-alt2: #0b2748;
  --header-bg: rgba(6, 26, 54, 0.93);
  --surface: #0c2a52;
  --btn-bg: #0564ed;
  --btn-bg-hover: #2a7cf2;
  --focus: #7db1ff;
  --hero-bg: radial-gradient(at 85% 35%, #123a6e 0, transparent 48%), linear-gradient(110deg, #071f40, #0a2344);
  --board-shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
  --split-shadow: 0 18px 35px rgba(0, 0, 0, 0.25);
  --half-second: #123a6e;
  color-scheme: dark;
}

/* Reset and base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--navy);
  background: var(--bg);
  font: 16px/1.6 Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

main:focus {
  outline: none;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 36px;
}

section[id] {
  scroll-margin-top: 96px;
}

/* Type */
h1,
h2 {
  letter-spacing: -1.3px;
  line-height: 1.13;
}

h1 {
  font-size: clamp(2.25rem, 1.6rem + 3vw, 4.125rem);
  letter-spacing: -3px;
  line-height: 1.04;
}

h2 {
  font-size: clamp(1.75rem, 1.5rem + 1.2vw, 2.375rem);
  margin: 13px 0;
}

h1 span,
h2 span {
  color: var(--blue);
}

h3 {
  font-size: 17px;
  letter-spacing: -0.3px;
  line-height: 1.4;
}

p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.3px;
  line-height: 1.6;
  text-transform: uppercase;
}

/* Utilities */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: -1000px;
  z-index: 50;
  padding: 12px 16px;
  background: var(--surface);
  font-weight: 700;
}

.skip-link:focus {
  left: 12px;
}

mark.tbd {
  padding: 0 4px;
  background: var(--tbd-bg);
  color: var(--tbd-text);
  outline: 2px dashed var(--tbd-line);
  outline-offset: 1px;
}

.textlink {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 21px;
  border: 1px solid transparent;
  border-radius: 8px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--btn-bg);
  color: #fff;
}

.btn-primary:hover {
  background: var(--btn-bg-hover);
}

.btn-light {
  background: var(--surface);
  border-color: var(--line);
  color: var(--navy);
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(15px);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 30px;
  min-height: 94px;
}

.brand {
  --logo-width: 242px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-right: auto;
  text-decoration: none;
}

.brand picture {
  display: block;
  width: var(--logo-width);
}

.brand img {
  display: block;
  width: 100%;
}

.beta {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--sky);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

nav a {
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

nav a:hover {
  color: var(--blue);
}

.pill {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* Stays hidden until the script runs, so it never shows when it can't work. */
.theme-toggle {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  font: 16px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  color: var(--blue);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
}

.hero::before {
  content: "";
  position: absolute;
  top: -180px;
  right: -220px;
  width: 780px;
  height: 780px;
  border: 1px solid var(--line);
  border-radius: 50%;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding-top: 65px;
  padding-bottom: 75px;
}

.hero h1 {
  margin: 25px 0;
}

.hero p {
  max-width: 450px;
  font-size: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 30px;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 27px;
}

.hero .hero-notice {
  margin: 18px 0 8px;
  font-size: 12px;
  line-height: 1.6;
}

.art-board {
  padding: 30px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--board-shadow);
  transform: rotate(-3deg);
}

.art-board img {
  display: block;
  width: 100%;
  margin: 28px 0 22px;
}

.board-top,
.board-facts {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}

.board-top {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.board-facts {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.board-facts strong {
  color: var(--navy);
}

.art-board h3 {
  margin: 16px 0 8px;
}

.art-board ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

/* Shared section layout */
.section-block {
  padding: 72px 0;
}

.section-intro {
  max-width: 640px;
  margin: 0 0 32px;
}

/* Weekly raffle */
#weekly {
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  list-style: none;
}

.step {
  display: flex;
  flex-direction: column;
  padding: 27px 23px;
  background: linear-gradient(160deg, var(--bg-alt), var(--bg));
}

.step + .step {
  border-left: 1px solid var(--line);
}

.step-number {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  background: var(--sky);
  border-radius: 50%;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.step h3 {
  margin: 20px 0 0;
}

.step-description {
  margin: 13px 0 0;
  font-size: 13px;
  line-height: 1.75;
}

.detail-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 29px;
}

.detail-note h3 {
  margin: 0;
  font-size: 13px;
}

.detail-note p {
  margin: 8px 0 0;
  font-size: 13px;
}

.detail-note ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.closing-note {
  margin: 25px 0 0;
  font-size: 12px;
}

/* 50/50 split */
#split {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  gap: 80px;
  align-items: center;
}

.split-copy p:not(.eyebrow) {
  max-width: 420px;
  font-size: 14px;
}

.split-card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--split-shadow);
}

.split-label {
  color: var(--muted);
  font-size: 13px;
}

.fee {
  margin: 9px 0 0;
  padding: 10px 14px;
  background: var(--sky);
  border-radius: 5px;
  font-size: 12px;
}

.halves {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.half {
  padding: 28px 22px;
  background: #0564ed;
  border-radius: 8px;
  color: #fff;
}

.half:nth-child(2) {
  background: var(--half-second);
}

.half strong {
  font-size: 32px;
  letter-spacing: -1px;
  line-height: 1.1;
}

.half span {
  display: block;
  margin-top: 16px;
  font-size: 12px;
}

.split-foot {
  margin-top: 17px;
  color: var(--muted);
  font-size: 12px;
}

/* The cause */
.cause-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.cause-art {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  overflow: hidden;
  background: #092953;
  color: #fff;
}

.cause-art::before,
.cause-art::after {
  content: "";
  position: absolute;
  border: 1px solid #326398;
  border-radius: 50%;
}

.cause-art::before {
  width: 285px;
  height: 285px;
}

.cause-art::after {
  width: 220px;
  height: 220px;
}

.cause-art img {
  position: relative;
  z-index: 1;
  width: 78px;
}

.cause-art strong {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  font-size: 27px;
}

.cause-art small {
  position: relative;
  z-index: 1;
  color: #b4d4f5;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.cause-copy {
  padding: 36px 42px;
  background: var(--surface);
}

.cause-copy h3 {
  margin: 18px 0 10px;
  font-size: 27px;
  letter-spacing: -0.8px;
}

.cause-copy p {
  font-size: 14px;
}

.cause-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  padding: 5px 9px;
  background: var(--sky);
  border-radius: 20px;
  color: var(--blue);
  font-size: 11px;
}

/* Transparency records */
#records,
#rules {
  background: var(--bg-alt2);
}

.table-wrap {
  overflow-x: auto;
}

.record-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.record-table th {
  padding: 15px 20px;
  background: var(--sky);
  color: var(--navy);
  font-weight: 600;
  text-align: left;
}

.record-table td {
  padding: 18px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.record-table td[colspan] {
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.record-table code {
  font-family: Consolas, Menlo, Monaco, monospace;
}

.record-note {
  margin: 18px 0 0;
  font-size: 13px;
}

/* Questions */
.faq {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 90px;
}

.faq details {
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
}

.faq details:first-child {
  padding-top: 0;
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--blue);
  font-size: 20px;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  margin: 15px 30px 0 0;
  font-size: 14px;
}

/* Rules & terms */
.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 28px;
}

.rules-point {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.rules-point h3 {
  margin: 0;
}

.rules-point p {
  margin: 10px 0 0;
  font-size: 14px;
}

.rules-link {
  margin: 28px 0 0;
}

/* Footer */
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.footer-logo {
  display: block;
  width: 220px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 25px;
  font-size: 12px;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--blue);
}

.footer-bottom {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.footer-bottom p {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.6;
}

/* The header needs two rows before the nav, switch and app button run out of room. */
@media (max-width: 1180px) {
  .header-row {
    flex-wrap: wrap;
    gap: 10px 15px;
    min-height: 0;
    padding-top: 12px;
    padding-bottom: 8px;
  }

  .brand {
    --logo-width: 185px;
  }

  nav {
    order: 3;
    flex-basis: 100%;
    min-width: 0;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  section[id] {
    scroll-margin-top: 125px;
  }
}

@media (max-width: 900px) {
  nav a {
    font-size: 11px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .art-board {
    transform: none;
  }

  .steps {
    grid-template-columns: 1fr 1fr;
  }

  .step:nth-child(3) {
    border-left: 0;
  }

  .step:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .split-grid,
  .faq {
    gap: 40px;
  }

  .rules-grid {
    grid-template-columns: 1fr;
  }

  .cause-copy {
    padding: 28px;
  }
}

@media (max-width: 700px) {
  .wrap {
    padding-right: 16px;
    padding-left: 16px;
  }

  .hero-grid {
    padding-top: 40px;
    padding-bottom: 45px;
  }

  .brand {
    --logo-width: 150px;
  }

  .header-row .btn {
    padding: 10px 14px;
    font-size: 12px;
  }

  section[id] {
    scroll-margin-top: 112px;
  }

  .section-block {
    padding: 45px 0;
  }

  .steps,
  .detail-notes,
  .split-grid,
  .cause-grid,
  .faq {
    grid-template-columns: 1fr;
  }

  .cause-art {
    min-height: 265px;
  }

  .record-table th,
  .record-table td {
    padding-right: 10px;
    padding-left: 10px;
  }

  .step + .step {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .detail-notes,
  .split-grid,
  .faq {
    gap: 20px;
  }

  .split-card {
    padding: 20px;
  }

  .half {
    padding: 25px 17px;
  }

  .half strong {
    font-size: 24px;
  }

  .footer-top {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* No room beside the logo here, so the label sits under it. */
@media (max-width: 420px) {
  .header-row {
    column-gap: 8px;
  }

  .header-row .btn {
    padding: 10px 12px;
  }

  .brand {
    --logo-width: 132px;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
}

@media (max-width: 360px) {
  .header-row .btn {
    padding: 10px;
    font-size: 11px;
  }

  .brand {
    --logo-width: 104px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
