:root {
  --navy: #14213d;
  --navy-soft: #283655;
  --cream: #f7f1e5;
  --paper: #fffdf8;
  --coral: #ff5b61;
  --butter: #f7d978;
  --sage: #9fc9b1;
  --violet: #6e52c7;
  --line: rgba(20, 33, 61, .15);
  --shadow: 0 28px 80px rgba(32, 42, 74, .14);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 150px;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--navy);
  background: var(--cream);
  font-family: var(--sans);
  line-height: 1.7;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

main,
section,
article,
header,
footer,
nav,
div,
figure,
aside {
  min-width: 0;
}

h1,
h2,
h3,
p,
li,
th,
td,
figcaption,
a {
  overflow-wrap: anywhere;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  opacity: .28;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255, 91, 97, .16), transparent 28%),
    radial-gradient(circle at 90% 65%, rgba(159, 201, 177, .28), transparent 25%);
}

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

a {
  color: inherit;
}

button {
  font: inherit;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 20px;
  z-index: 1000;
  padding: 12px 18px;
  color: var(--paper);
  background: var(--navy);
  border-radius: 12px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: fixed;
  top: 20px;
  right: 0;
  left: 0;
  z-index: 200;
  pointer-events: none;
}

.header-shell {
  width: min(1120px, calc(100% - 40px));
  min-height: 76px;
  margin-inline: auto;
  padding: 10px 14px 10px 20px;
  display: grid;
  grid-template-columns: 225px 1fr auto;
  align-items: center;
  gap: 24px;
  background: rgba(255, 253, 248, .88);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 28px;
  box-shadow: 0 16px 50px rgba(28, 38, 66, .12);
  backdrop-filter: blur(20px);
  pointer-events: auto;
}

.logo {
  width: 205px;
  display: block;
}

.logo img {
  width: 100%;
}

#site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vw, 42px);
}

#site-nav a {
  position: relative;
  padding: 10px 0;
  color: var(--navy-soft);
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
}

#site-nav a::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 3px;
  content: "";
  background: var(--coral);
  border-radius: 10px;
  transform: scaleX(0);
  transition: transform .3s var(--ease);
}

#site-nav a:hover::after,
#site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.age-mark {
  width: 48px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--navy);
  border-radius: 50%;
  font-size: .8rem;
}

.menu-toggle {
  display: none;
}

.hero {
  position: relative;
  min-height: 900px;
  padding: 150px max(28px, 5vw) 100px;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(400px, 1.05fr);
  align-items: center;
  gap: clamp(45px, 7vw, 120px);
  overflow: hidden;
}

.hero::before {
  position: absolute;
  top: -10%;
  left: -10%;
  z-index: -1;
  width: 48vw;
  aspect-ratio: 1;
  content: "";
  background: var(--butter);
  border-radius: 48% 52% 63% 37% / 45% 36% 64% 55%;
  transform: rotate(18deg);
  opacity: .62;
}

.hero::after {
  position: absolute;
  right: 3%;
  bottom: 3%;
  z-index: -1;
  width: 190px;
  aspect-ratio: 1;
  content: "";
  background: var(--sage);
  border-radius: 58% 42% 31% 69% / 47% 65% 35% 53%;
  transform: rotate(-18deg);
}

.hero-copy {
  max-width: 760px;
  justify-self: end;
}

.hero h1 {
  margin: 0;
  font: 700 clamp(4rem, 7vw, 7.5rem)/.92 var(--serif);
  letter-spacing: -.065em;
}

.hero h1::first-letter {
  color: var(--coral);
}

.hero-art {
  position: relative;
  max-width: 820px;
}

.hero-art::before,
.hero-art::after {
  position: absolute;
  z-index: -1;
  content: "";
  border-radius: 50%;
}

.hero-art::before {
  top: -35px;
  right: -30px;
  width: 120px;
  aspect-ratio: 1;
  background: var(--coral);
}

.hero-art::after {
  bottom: -42px;
  left: -42px;
  width: 145px;
  aspect-ratio: 1;
  background: var(--violet);
}

.hero-art figure {
  position: relative;
  margin: 0;
  padding: 12px;
  background: var(--paper);
  border-radius: 43% 57% 52% 48% / 38% 42% 58% 62%;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotate(1.5deg);
}

.hero-art figure img {
  width: 100%;
  min-height: 430px;
  max-height: 650px;
  object-fit: cover;
  border-radius: inherit;
}

.hero-art figcaption {
  position: absolute;
  right: 34px;
  bottom: 25px;
  max-width: 65%;
  padding: 10px 15px;
  color: var(--paper);
  background: rgba(20, 33, 61, .84);
  border-radius: 18px;
  font-size: .7rem;
  font-weight: 700;
}

.chapter-bar {
  position: sticky;
  top: 110px;
  z-index: 100;
  padding: 10px 0;
  background: rgba(247, 241, 229, .84);
  border-block: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

#chapters {
  width: min(1200px, calc(100% - 32px));
  margin-inline: auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

#chapters::-webkit-scrollbar {
  display: none;
}

#chapters a {
  flex: 0 0 auto;
  padding: 9px 15px;
  color: #59627a;
  background: rgba(255, 253, 248, .72);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  text-decoration: none;
  transition: color .25s ease, background .25s ease, border-color .25s ease;
}

#chapters a:hover,
#chapters a.active {
  color: var(--paper);
  background: var(--coral);
  border-color: var(--coral);
}

.article {
  width: min(900px, calc(100% - 40px));
  max-width: 100%;
  margin-inline: auto;
  padding: clamp(80px, 10vw, 150px) 0;
  color: var(--navy-soft);
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  overflow: visible;
}

.article > p:first-child {
  margin-top: 0;
  color: var(--navy);
  font: 400 clamp(1.4rem, 2.3vw, 2rem)/1.5 var(--serif);
}

.article p {
  margin: 0 0 1.45em;
}

.article h2 {
  position: relative;
  margin: clamp(80px, 10vw, 125px) 0 30px;
  padding-left: 34px;
  color: var(--navy);
  font: 700 clamp(2.3rem, 4.5vw, 4rem)/1.03 var(--serif);
  letter-spacing: -.045em;
}

.article h2::before {
  position: absolute;
  top: .15em;
  left: 0;
  width: 18px;
  height: 72%;
  content: "";
  background: var(--coral);
  border-radius: 70% 30% 60% 40% / 35% 65% 35% 65%;
  transform: rotate(8deg);
}

.article h3 {
  margin: 50px 0 20px;
  color: var(--violet);
  font: 700 clamp(1.5rem, 2.7vw, 2.3rem)/1.15 var(--serif);
  letter-spacing: -.025em;
}

.article ul,
.article ol {
  margin: 24px 0 38px;
  padding: 0;
  list-style: none;
  counter-reset: item;
}

.article li {
  position: relative;
  margin: 9px 0;
  padding: 6px 0 6px 42px;
}

.article ul > li::before {
  position: absolute;
  top: .88em;
  left: 11px;
  width: 10px;
  aspect-ratio: 1;
  content: "";
  background: var(--coral);
  border-radius: 50%;
  box-shadow: 7px 4px 0 var(--butter);
}

.article ol > li {
  counter-increment: item;
}

.article ol > li::before {
  position: absolute;
  top: 4px;
  left: 0;
  width: 29px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--paper);
  content: counter(item);
  background: var(--violet);
  border-radius: 50%;
  font-size: .68rem;
  font-weight: 900;
}

.article li ul,
.article li ol {
  margin: 10px 0 0;
}

.article aside {
  position: relative;
  max-width: 100%;
  margin: 50px 0;
  padding: 38px 46px 38px 98px;
  color: var(--navy);
  background: var(--butter);
  border-radius: 36px 18px 42px 22px;
  box-shadow: 12px 12px 0 var(--sage);
}

.article aside::before {
  position: absolute;
  top: 32px;
  left: 36px;
  content: "!";
  color: var(--coral);
  font: 700 3rem/1 var(--serif);
}

.article aside p:last-child,
.article aside > :last-child {
  margin-bottom: 0;
}

.article figure {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 70px 0;
  padding: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
  border-radius: 62px 24px 62px 24px;
  overflow: hidden;
}

.article figure:nth-of-type(even) {
  border-radius: 24px 62px 24px 62px;
}

.article figure img,
.article > img {
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  background: #121a2d;
  border-radius: inherit;
}

.article figcaption {
  padding: 14px 18px 7px;
  color: #747c8f;
  font-size: .72rem;
  font-weight: 700;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  margin: 45px 0 65px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  background: var(--paper);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(32, 42, 74, .09);
  -webkit-overflow-scrolling: touch;
}

.article table {
  width: max-content;
  min-width: 100%;
  max-width: none;
  margin: 0;
  border-collapse: collapse;
  background: var(--paper);
}

.article > table {
  width: 100%;
  max-width: 100%;
  margin: 45px 0 65px;
  display: block;
  overflow-x: auto;
  border-radius: 24px;
}

.article thead {
  color: var(--paper);
  background: var(--navy);
}

.article th,
.article td {
  min-width: 160px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: .84rem;
  line-height: 1.55;
}

.article th {
  color: var(--butter);
  font-size: .69rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.article tbody tr:nth-child(even) {
  background: rgba(159, 201, 177, .13);
}

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

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.site-footer {
  position: relative;
  min-height: 360px;
  padding: 95px max(30px, 7vw) 60px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  align-items: center;
  gap: 45px;
  color: var(--paper);
  background: var(--navy);
  overflow: hidden;
}

.site-footer > img {
  position: relative;
  z-index: 2;
  width: min(330px, 70vw);
  filter: brightness(0) invert(1);
}

.site-footer nav {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 28px;
}

.site-footer nav a {
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
}

.site-footer nav a:hover {
  color: var(--butter);
}

.site-footer p {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(255, 255, 255, .6);
  font-size: .73rem;
  font-weight: 700;
}

.footer-shape {
  position: absolute;
  right: -8%;
  bottom: -65%;
  width: 50vw;
  aspect-ratio: 1;
  background: var(--coral);
  border-radius: 58% 42% 60% 40%;
  transform: rotate(25deg);
}

@media (max-width: 1000px) {
  .hero {
    min-height: 820px;
    grid-template-columns: 1fr 1fr;
    gap: 35px;
  }

  .hero h1 {
    font-size: clamp(3.7rem, 7vw, 6rem);
  }

  .hero-art figure img {
    min-height: 360px;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 135px;
  }

  .site-header {
    top: 10px;
  }

  .header-shell {
    width: calc(100% - 20px);
    min-height: 66px;
    grid-template-columns: 1fr auto auto;
    border-radius: 22px;
  }

  .logo {
    width: 174px;
  }

  .menu-toggle {
    width: 43px;
    height: 40px;
    padding: 10px 8px;
    display: grid;
    align-content: center;
    gap: 7px;
    color: var(--navy);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .menu-toggle > span:not(.sr-only) {
    height: 2px;
    display: block;
    background: currentColor;
    transition: transform .3s var(--ease);
  }

  .menu-toggle[aria-expanded="true"] > span:first-child {
    transform: translateY(4px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] > span:nth-child(2) {
    transform: translateY(-5px) rotate(-45deg);
  }

  #site-nav {
    position: absolute;
    top: 72px;
    right: 0;
    left: 0;
    padding: 18px;
    display: grid;
    gap: 0;
    background: var(--paper);
    border-radius: 22px;
    box-shadow: var(--shadow);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity .25s ease, transform .25s var(--ease), visibility .25s;
  }

  #site-nav.open {
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  #site-nav a {
    padding: 13px 3px;
    border-bottom: 1px solid var(--line);
  }

  #site-nav a::after {
    display: none;
  }

  .age-mark {
    width: 40px;
  }

  .hero {
    min-height: auto;
    padding: 125px 18px 90px;
    grid-template-columns: 1fr;
    gap: 65px;
  }

  .hero-copy {
    justify-self: start;
  }

  .hero h1 {
    font-size: clamp(3.6rem, 13vw, 6rem);
  }

  .hero-art {
    width: min(94%, 620px);
    margin-inline: auto;
  }

  .hero-art figure img {
    min-height: 330px;
  }

  .chapter-bar {
    top: 85px;
  }

  .article {
    width: min(100% - 28px, 760px);
    padding-top: 80px;
  }

  .article aside {
    margin-inline: 0;
  }

  .site-footer {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .site-footer > img {
    margin-inline: auto;
  }

  .site-footer nav {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 430px) {
  .header-shell {
    padding-left: 13px;
    gap: 8px;
  }

  .logo {
    width: 145px;
  }

  .age-mark {
    width: 36px;
    font-size: .72rem;
  }

  .hero h1 {
    font-size: clamp(3.15rem, 15vw, 4.4rem);
  }

  .hero-art figure {
    padding: 7px;
  }

  .hero-art figure img {
    min-height: 260px;
  }

  .hero-art figcaption {
    right: 18px;
    bottom: 15px;
    max-width: 78%;
  }

  .article h2 {
    padding-left: 26px;
    font-size: 2.35rem;
  }

  .article h2::before {
    width: 13px;
  }

  .article aside {
    padding: 30px 20px 30px 58px;
    border-radius: 24px 13px 28px 15px;
  }

  .article aside::before {
    top: 26px;
    left: 20px;
  }

  .article figure {
    width: 100%;
    padding: 7px;
    border-radius: 28px 14px 28px 14px;
  }

  .table-scroll {
    width: 100%;
    max-width: 100%;
    border-radius: 16px;
  }

  .article th,
  .article td {
    min-width: 145px;
    padding: 12px;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
