@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-regular.v12.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-bold.v12.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4.v14.woff2") format("woff2");
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
}

:root {
  --ink: #101820;
  --white: #fff;
  --blue: #1565c0;
  --blue-dark: #0c4f9e;
  --blueprint: #e8f2fc;
  --red: #c62828;
  --brass: #a66f12;
  --muted: #4b5a68;
  --rule: #b8cadb;
  --max: 76rem;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Atkinson Hyperlegible", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 0.09em;
}

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

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.6rem 0.9rem;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-200%);
}

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

.site-header,
.site-footer,
.hero,
.story-section,
.science-section,
.author-section,
.final-cta,
.error-main {
  width: min(100%, var(--max));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 2px solid var(--ink);
}

.wordmark {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.wordmark span {
  color: var(--blue);
}

nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
  font-size: 0.95rem;
  font-weight: 700;
}

nav a {
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

.hero {
  min-height: min(48rem, calc(100vh - 5.5rem));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(20rem, 0.95fr);
  align-items: center;
  gap: clamp(3rem, 8vw, 7rem);
  padding-block: clamp(4rem, 10vw, 8rem);
  overflow: hidden;
}

.kicker {
  margin: 0 0 0.8rem;
  color: var(--blue-dark);
  font-size: 0.95rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 10ch;
  font-size: clamp(3.6rem, 8vw, 6.8rem);
}

h2 {
  max-width: 15ch;
  font-size: clamp(2.35rem, 5vw, 4.4rem);
}

h3 {
  margin: 1.25rem 0 0.45rem;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2rem);
  line-height: 1.1;
}

.hero-line {
  max-width: 20ch;
  margin: 1.5rem 0 1rem;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 600;
  line-height: 1.2;
}

.hero-summary {
  max-width: 37rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-top: 2rem;
}

.button {
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border: 2px solid var(--ink);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.button:hover {
  color: var(--white);
  background: var(--blue-dark);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.button-primary {
  color: var(--white);
  background: var(--blue);
}

.button[data-pending="true"] {
  cursor: not-allowed;
}

.text-link {
  color: var(--blue-dark);
  font-weight: 700;
}

.availability {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.book-stage {
  position: relative;
  min-height: 37rem;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.book-stage::before {
  content: "";
  position: absolute;
  z-index: -3;
  width: 31rem;
  aspect-ratio: 1;
  border: 1px solid var(--rule);
  border-radius: 50%;
  box-shadow: inset 0 0 4rem rgba(21, 101, 192, 0.08);
}

.book-object {
  position: relative;
  z-index: 2;
  width: min(20rem, 78vw);
  aspect-ratio: 0.68;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  color: var(--white);
  background: var(--ink);
  border: 5px solid var(--brass);
  box-shadow: 0.8rem 1rem 0 var(--blue), 1.2rem 1.4rem 0 rgba(16, 24, 32, 0.18);
  transform: rotate(2.5deg);
  animation: book-power-on 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.book-dials {
  position: absolute;
  top: 22%;
  left: -1.05rem;
  display: grid;
  gap: 1.35rem;
}

.book-dials span {
  width: 1.45rem;
  aspect-ratio: 1;
  display: block;
  background: var(--brass);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px #d4a33f;
}

.book-topline {
  width: 100%;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
  text-align: center;
}

.cover-element {
  width: 9.5rem;
  aspect-ratio: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  margin-top: 3rem;
  padding: 0.55rem 0.8rem;
  color: var(--ink);
  background: var(--blueprint);
  border: 4px solid var(--blue);
  box-shadow: 0 0 2.4rem rgba(21, 101, 192, 0.75);
  animation: helium-pulse 5s 1.2s ease-in-out infinite;
}

.cover-element strong {
  align-self: center;
  font-family: var(--sans);
  font-size: 4.8rem;
  line-height: 1;
  text-align: center;
}

.atomic-number,
.atomic-weight {
  line-height: 1;
}

.atomic-weight {
  text-align: right;
}

.book-object p {
  margin: auto 0 0;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.cover-author {
  margin-top: 0.8rem;
  font-size: 0.9rem;
}

.orbit {
  position: absolute;
  z-index: -2;
  border: 2px solid var(--blue);
  border-radius: 50%;
  transform: rotate(-22deg);
}

.orbit::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -0.4rem;
  width: 0.8rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--red);
}

.orbit-one {
  width: 33rem;
  height: 13rem;
  animation: orbit-one 30s linear infinite;
}

.orbit-two {
  width: 13rem;
  height: 33rem;
  animation: orbit-two 36s linear infinite reverse;
}

.gas-dot {
  position: absolute;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 1rem rgba(198, 40, 40, 0.8);
  opacity: 0;
  animation: helium-drift 6s ease-in-out infinite;
}

.gas-dot-one {
  top: 12%;
  right: 5%;
  width: 0.7rem;
  height: 0.7rem;
}

.gas-dot-two {
  top: 24%;
  left: 3%;
  width: 0.45rem;
  height: 0.45rem;
  animation-delay: -2.2s;
}

.gas-dot-three {
  right: 13%;
  bottom: 16%;
  width: 0.5rem;
  height: 0.5rem;
  animation-delay: -4.1s;
}

.time-clue {
  position: absolute;
  z-index: 3;
  top: 15%;
  right: 3%;
  padding: 0.2rem 0.55rem;
  color: var(--brass);
  background: var(--white);
  border-bottom: 2px solid var(--brass);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  animation: time-clue 5s 1.2s ease-in-out infinite;
}

@keyframes book-power-on {
  0% {
    filter: brightness(0.55);
    transform: rotate(2.5deg) scale(0.975);
  }
  55% {
    filter: brightness(1.18);
  }
  100% {
    filter: brightness(1);
    transform: rotate(2.5deg) scale(1);
  }
}

@keyframes helium-pulse {
  0%, 72%, 100% {
    border-color: var(--blue);
    box-shadow: 0 0 2.4rem rgba(21, 101, 192, 0.75);
  }
  80% {
    border-color: var(--red);
    box-shadow: 0 0 3.2rem rgba(198, 40, 40, 0.85);
  }
  88% {
    border-color: var(--blue);
    box-shadow: 0 0 2.8rem rgba(21, 101, 192, 0.9);
  }
}

@keyframes orbit-one {
  from { transform: rotate(-22deg); }
  to { transform: rotate(338deg); }
}

@keyframes orbit-two {
  from { transform: rotate(-22deg); }
  to { transform: rotate(338deg); }
}

@keyframes helium-drift {
  0% {
    opacity: 0;
    transform: translate(0, 2.5rem) scale(0.65);
  }
  20%, 70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(1.8rem, -5rem) scale(1.1);
  }
}

@keyframes time-clue {
  0%, 72%, 100% { opacity: 0.55; }
  80%, 88% { opacity: 1; }
}

.story-section,
.science-section,
.author-section {
  padding-block: clamp(5rem, 10vw, 9rem);
}

.story-section {
  border-top: 2px solid var(--ink);
}

.section-heading {
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(3rem, 9vw, 8rem);
  align-items: start;
}

.year-panel {
  min-height: 20rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--white);
  background: var(--blue);
  border: 4px solid var(--ink);
  box-shadow: 0.65rem 0.65rem 0 var(--brass);
}

.year-panel > span {
  font-weight: 700;
}

.year-panel strong {
  font-family: var(--serif);
  font-size: clamp(4.5rem, 10vw, 7.8rem);
  line-height: 0.85;
}

.year-panel p {
  max-width: 17rem;
  margin: 2rem 0 0;
  line-height: 1.35;
}

.story-copy {
  max-width: 43rem;
}

.story-copy p {
  margin: 0 0 1.3rem;
}

.book-rhyme {
  display: grid;
  grid-template-columns: minmax(15rem, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(2rem, 9vw, 8rem);
  margin-top: clamp(4rem, 9vw, 7rem);
  padding: clamp(2rem, 5vw, 4rem);
  color: var(--white);
  background: var(--ink);
  border-left: 0.55rem solid var(--brass);
}

.book-rhyme .kicker {
  color: #8fc5ff;
}

.book-rhyme h3 {
  max-width: 13ch;
  margin-top: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.book-rhyme blockquote {
  margin: 0;
}

.book-rhyme blockquote p {
  margin: 0 0 1.5rem;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  font-weight: 600;
  line-height: 1.55;
}

.book-rhyme cite {
  color: #c7d2dc;
  font-size: 0.95rem;
  font-style: normal;
}

.lead {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 600;
  line-height: 1.4;
}

.science-section {
  width: 100%;
  max-width: none;
  background: var(--blueprint);
}

.science-intro,
.discovery-grid,
.table-figure {
  width: min(100%, calc(var(--max) - (2 * var(--gutter))));
  margin-inline: auto;
}

.science-intro {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(2rem, 8vw, 7rem);
  align-items: end;
}

.science-intro .section-heading {
  margin: 0;
}

.science-intro > p {
  margin: 0;
  font-size: 1.12rem;
}

.discovery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: clamp(4rem, 8vw, 7rem);
  border-block: 2px solid var(--ink);
}

.discovery-grid article {
  padding: clamp(2rem, 4vw, 3.5rem);
}

.discovery-grid article + article {
  border-left: 2px solid var(--ink);
}

.discovery-grid p {
  margin: 0;
}

.fact-icon {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fact-icon.red {
  stroke: var(--red);
}

.fact-icon.brass {
  stroke: var(--brass);
}

.table-figure {
  margin-top: clamp(4rem, 8vw, 7rem);
  margin-bottom: 0;
}

.table-figure picture {
  display: block;
  padding: clamp(0.7rem, 2vw, 1.4rem);
  background: var(--white);
  border: 2px solid var(--ink);
}

.table-figure img {
  width: 100%;
  height: auto;
}

.table-figure figcaption {
  max-width: 38rem;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.author-section {
  display: grid;
  grid-template-columns: minmax(15rem, 0.65fr) minmax(0, 1.35fr);
  gap: clamp(3rem, 10vw, 9rem);
  align-items: center;
}

.author-mark {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 4px solid var(--ink);
}

.author-mark::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  border-top: 2px solid var(--ink);
}

.author-mark span {
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 700;
}

.author-mark span:first-child {
  color: var(--white);
  background: var(--blue);
}

.author-mark span:last-child {
  align-self: end;
  color: var(--blue);
}

.author-copy h2 {
  margin-bottom: 2rem;
}

.author-copy p {
  max-width: 44rem;
}

.final-cta {
  width: 100%;
  max-width: none;
  padding-block: clamp(5rem, 10vw, 8rem);
  color: var(--white);
  background: var(--ink);
  text-align: center;
}

.final-cta h2 {
  max-width: 16ch;
  margin-inline: auto;
}

.final-cta > p:not(.availability) {
  margin: 1.5rem auto 2rem;
  font-size: 1.15rem;
}

.final-cta .availability {
  color: #c7d2dc;
}

.mini-element {
  width: 5rem;
  aspect-ratio: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  margin: 0 auto 2rem;
  padding: 0.3rem 0.5rem;
  color: var(--ink);
  background: var(--blueprint);
  border: 3px solid var(--blue);
  text-align: left;
}

.mini-element span {
  font-size: 0.75rem;
  line-height: 1;
}

.mini-element strong {
  align-self: center;
  font-size: 2.3rem;
  line-height: 1;
  text-align: center;
}

.site-footer {
  min-height: 6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.error-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.error-main {
  display: grid;
  grid-template-columns: minmax(10rem, 0.5fr) 1fr;
  align-items: center;
  gap: clamp(2rem, 8vw, 7rem);
  padding-block: 5rem;
}

.error-main h1 {
  margin-bottom: 1.5rem;
  font-size: clamp(3rem, 8vw, 6rem);
}

.error-main .button {
  margin-top: 1rem;
}

.error-element {
  aspect-ratio: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 1rem;
  color: var(--white);
  background: var(--blue);
  border: 5px solid var(--ink);
}

.error-element strong {
  place-self: center;
  font-family: var(--serif);
  font-size: clamp(5rem, 15vw, 10rem);
  line-height: 1;
}

.error-element small {
  justify-self: end;
}

@media (max-width: 52rem) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .book-stage {
    min-height: 34rem;
    order: 2;
  }

  .story-grid,
  .author-section,
  .book-rhyme {
    grid-template-columns: 1fr;
  }

  .year-panel {
    min-height: 17rem;
  }

  .science-intro {
    grid-template-columns: 1fr;
    align-items: start;
  }

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

  .discovery-grid article + article {
    border-top: 2px solid var(--ink);
    border-left: 0;
  }

  .author-mark {
    width: min(20rem, 100%);
  }
}

@media (max-width: 38rem) {
  .site-header {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
    padding-block: 1.3rem;
  }

  nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.88rem;
  }

  .hero {
    padding-top: 3.5rem;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .text-link {
    width: 100%;
    text-align: center;
  }

  .book-stage {
    min-height: 30rem;
  }

  .book-stage::before {
    width: 24rem;
  }

  .book-object {
    width: min(17rem, 78vw);
    padding: 1.3rem;
  }

  .cover-element {
    width: 8rem;
    margin-top: 2rem;
  }

  .cover-element strong {
    font-size: 3.8rem;
  }

  .orbit-one {
    width: 24rem;
    height: 10rem;
  }

  .orbit-two {
    width: 10rem;
    height: 24rem;
  }

  .author-section {
    padding-inline: var(--gutter);
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
    padding-block: 1.5rem;
  }

  .error-main {
    grid-template-columns: 1fr;
  }

  .error-element {
    width: min(15rem, 75vw);
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .gas-dot {
    opacity: 1;
  }
}
