:root {
  --header-green: #00ff00;
  --active-red: #d60000;
  --paper: #ffffff;
  --mist: #e3e9e9;
  --mist-dark: #cbd4d4;
  --ink: #111111;
  --link: #003c88;
  --space: #0b000b;
  --frame: #25202d;
  --shadow: 0 16px 48px rgb(0 0 0 / 45%);
  --content-width: 66rem;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 18rem;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--space);
  background-image: image-set(
    url("/assets/galaxy.avif") type("image/avif"),
    url("/assets/galaxy.jpg") type("image/jpeg")
  );
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
  font: 1rem/1.6 Arial, Helvetica, sans-serif;
}

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

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

a:hover {
  text-decoration-thickness: 0.14em;
}

a:focus-visible,
summary:focus-visible {
  outline: 4px solid #005fcc;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.65rem 0.85rem;
  color: white;
  background: #005fcc;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  width: min(100% - 2rem, var(--content-width));
  margin: clamp(1rem, 4vw, 3.5rem) auto;
  box-shadow: var(--shadow);
}

.site-header {
  display: flex;
  min-height: 10rem;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 4px solid #008a00;
  background: var(--header-green);
}

.site-title,
.brand-name {
  max-width: 18ch;
  margin: 0;
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive;
  font-size: clamp(2.2rem, 6.4vw, 4.5rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.045em;
  color: var(--ink);
}

.brand-name {
  display: block;
}

.site-kicker {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: right;
}

.primary-nav {
  border-bottom: 1px solid #899292;
  background: var(--mist);
}

.primary-nav ul {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-nav li + li {
  border-left: 1px solid #b2bbbb;
}

.primary-nav a {
  display: grid;
  min-height: 3.35rem;
  padding: 0.65rem 0.4rem;
  place-items: center;
  color: #222;
  font-size: 0.83rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.primary-nav a:hover {
  background: #f5f8f8;
}

.primary-nav a[aria-current="page"] {
  color: #fff;
  background: var(--active-red);
}

.page {
  min-height: 36rem;
  padding: clamp(1.25rem, 4vw, 3rem);
  background: var(--paper);
}

.page > :first-child,
.panel > :first-child,
.card > :first-child {
  margin-top: 0;
}

.page > :last-child,
.panel > :last-child,
.card > :last-child {
  margin-bottom: 0;
}

h1,
h2,
h3 {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.12;
}

h1 {
  margin: 0 0 1rem;
  color: #087608;
  font-size: clamp(2.25rem, 6vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

h2 {
  margin: 2.75rem 0 1rem;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.14rem;
}

.lede {
  max-width: 48rem;
  margin-bottom: 2rem;
  font-size: clamp(1.08rem, 2.2vw, 1.35rem);
}

.archive-note {
  display: inline-block;
  margin-bottom: 0.65rem;
  padding: 0.3rem 0.5rem;
  color: #fff;
  background: #087608;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-grid,
.card-grid,
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.home-grid {
  align-items: start;
}

.panel,
.card {
  border: 1px solid var(--mist-dark);
  background: #f8fafa;
}

.panel-heading {
  margin: 0;
  padding: 0.85rem 1rem;
  color: #fff;
  background: linear-gradient(#dfe6e6, #bdcaca);
  text-shadow: 0 1px 1px rgb(0 0 0 / 25%);
  font-size: 1.15rem;
}

.panel-body,
.card-body {
  padding: 1rem;
}

.news-item {
  display: grid;
  grid-template-columns: 6.75rem 1fr;
  gap: 1rem;
  align-items: start;
}

.news-item + .news-item {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--mist-dark);
}

.news-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0.3rem solid #fff;
  object-fit: cover;
  box-shadow: 0 0 0 1px #b6bebe;
}

.news-item h3 {
  margin: 0 0 0.3rem;
}

.news-item p {
  margin: 0.35rem 0;
}

.video-card {
  position: relative;
  display: block;
  overflow: hidden;
  color: inherit;
  background: #101010;
  text-decoration: none;
}

.video-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: opacity 160ms ease;
}

.video-card::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3.25rem;
  height: 2.25rem;
  border-radius: 0.45rem;
  background: rgb(0 0 0 / 78%);
  content: "▶";
  color: #fff;
  font-size: 1.2rem;
  line-height: 2.25rem;
  text-align: center;
  transform: translate(-50%, -50%);
}

.video-card:hover img {
  opacity: 0.82;
}

.video-meta {
  padding: 0.85rem 1rem 1rem;
  color: #fff;
  background: #111;
}

.video-meta strong,
.video-meta span {
  display: block;
}

.video-meta span {
  margin-top: 0.25rem;
  color: #c5c5c5;
  font-size: 0.78rem;
}

.question-box {
  padding: 1.15rem;
  border-left: 0.6rem solid var(--active-red);
  background: #f6ccd0;
}

.question-box h2 {
  margin-top: 0;
  color: #9e0000;
}

details {
  margin-top: 1rem;
}

summary {
  width: fit-content;
  cursor: pointer;
  color: var(--link);
  font-weight: 700;
}

.topic-list,
.resource-list,
.source-list {
  padding-left: 1.25rem;
}

.topic-list li + li,
.resource-list li + li,
.source-list li + li {
  margin-top: 0.55rem;
}

.section-rule {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid var(--mist-dark);
}

.alphabet {
  display: flex;
  margin: 1.5rem 0 2rem;
  padding: 0;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.alphabet a,
.alphabet span {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid var(--mist-dark);
  background: #f3f6f6;
  font-weight: 700;
  text-decoration: none;
}

.alphabet span {
  color: #9aa1a1;
}

.dictionary {
  margin: 0;
}

.dictionary-group {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  padding: 1.75rem 0;
  border-top: 1px solid var(--mist-dark);
  scroll-margin-top: 1rem;
}

.dictionary-letter {
  margin: 0;
  color: #334ba5;
  font-size: 2.6rem;
  font-weight: 400;
}

.dictionary-entries dd + dt {
  margin-top: 1.35rem;
}

.dictionary dt {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.dictionary dd {
  max-width: 46rem;
  margin: 0.25rem 0 0;
}

.dictionary dd p {
  margin: 0;
}

.dictionary dd a {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.88rem;
}

.experiment-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 1.5rem 0;
  padding: 0;
  gap: 1rem;
  counter-reset: step;
  list-style: none;
}

.experiment-steps li {
  padding: 1rem;
  border: 1px solid var(--mist-dark);
  background: #f8fafa;
  counter-increment: step;
}

.experiment-steps li::before {
  display: block;
  margin-bottom: 0.6rem;
  content: counter(step);
  color: #087608;
  font: 700 2rem/1 "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive;
}

.callout {
  margin: 2rem 0;
  padding: 1rem 1.25rem;
  border: 2px solid #e0b600;
  background: #fff7b8;
}

.card-grid.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card h2,
.card h3 {
  margin: 0;
}

.card p {
  margin-bottom: 0;
}

.contact-grid {
  align-items: stretch;
}

.contact-card {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--mist-dark);
  background: #f8fafa;
}

.contact-card.accent {
  border: 0;
  color: #8f0000;
  background: #ff9b9b;
}

.contact-card h2 {
  margin-top: 0;
}

.button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border: 2px solid #820000;
  color: #fff;
  background: var(--active-red);
  font-weight: 700;
  text-decoration: none;
}

.site-footer {
  display: flex;
  padding: 0.8rem 1rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #dcd8e4;
  background: rgb(0 0 0 / 84%);
  font-size: 0.76rem;
}

.site-footer a {
  color: #fff;
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 46rem) {
  body {
    background-attachment: scroll;
  }

  .site-shell {
    width: min(100% - 1rem, var(--content-width));
    margin-block: 0.5rem;
  }

  .site-header {
    min-height: auto;
    flex-direction: column;
    gap: 0.75rem;
  }

  .site-kicker {
    text-align: left;
  }

  .primary-nav ul {
    grid-template-columns: repeat(3, 1fr);
  }

  .primary-nav li + li,
  .primary-nav li:nth-child(4) {
    border-left: 1px solid #b2bbbb;
  }

  .primary-nav li:nth-child(n + 4) {
    border-top: 1px solid #b2bbbb;
  }

  .home-grid,
  .card-grid,
  .card-grid.three-up,
  .contact-grid,
  .experiment-steps {
    grid-template-columns: 1fr;
  }

  .dictionary-group {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

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

@media print {
  body {
    background: #fff;
  }

  .site-shell {
    width: 100%;
    margin: 0;
    box-shadow: none;
  }

  .primary-nav,
  .site-footer,
  .skip-link {
    display: none;
  }
}
