:root {
  color-scheme: dark;
  --ink: #152622;
  --paper: #fcf5e8;
  --muted: #d9d2c4;
  --sand: #ebca92;
  --border: #fbf4e533;
  --page: min(100% - 48px, 1120px);
  color: var(--paper);
  background: var(--ink);
  font-family: Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--sand); outline-offset: 6px; }
img { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }
h1, h2 { font: 400 clamp(2.4rem, 5vw, 5rem)/1.02 Georgia, serif; letter-spacing: -0.045em; overflow-wrap: anywhere; }
p { line-height: 1.55; }

.masthead {
  width: var(--page);
  margin-inline: auto;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font: 400 1.25rem Georgia, serif;
  text-decoration: none;
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem clamp(0.65rem, 2vw, 1.1rem);
}

.masthead nav a { color: var(--muted); text-underline-offset: 0.3em; }
.masthead nav a[aria-current] { color: var(--sand); }

.home-hero {
  min-height: calc(100svh - 80px);
  display: grid;
  align-items: center;
  border-top: 1px solid #fbf4e516;
  background: radial-gradient(ellipse at 86% 24%, #2b4237, transparent 57%), #12231e;
}

.home-layout {
  width: var(--page);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  align-items: center;
  column-gap: clamp(36px, 6vw, 90px);
  row-gap: 32px;
  padding-block: clamp(36px, 5vw, 72px);
}

.home-intro::before {
  content: "";
  display: block;
  width: 3rem;
  height: 1px;
  margin-bottom: clamp(18px, 2.2vw, 32px);
  background: var(--sand);
}

.home-intro h1 {
  max-width: 14ch;
  font-size: clamp(2.75rem, 6vw, 5.2rem);
  line-height: 0.99;
  text-wrap: balance;
}

.home-description {
  max-width: 38ch;
  margin-top: 1.2rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
}

.home-featured {
  border: 1px solid #ebca9247;
  border-radius: 0.7rem;
  background: #1b3028;
  box-shadow: 0 24px 54px #09151044;
  transition: border-color 200ms ease;
}

.home-featured-link {
  display: block;
  border-radius: inherit;
  text-decoration: none;
}

.home-featured-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  overflow: clip;
  border-radius: 0.65rem 0.65rem 0 0;
  background: #263f37;
}

.home-featured-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
  transition: transform 320ms ease;
}

.home-featured-copy { padding: clamp(1.2rem, 3vw, 2rem); }
.home-featured-copy .kicker { margin-bottom: 0.6rem; }
.home-featured h2 {
  font-size: clamp(1.8rem, 3.1vw, 2.8rem);
  line-height: 1.06;
  text-wrap: pretty;
}
.featured-description { max-width: 48ch; margin-top: 0.7rem; color: var(--muted); }
.home-featured-link:focus-visible .card-action { text-decoration: underline; }

.kicker {
  color: var(--sand);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  margin-top: 1.6rem;
  min-height: 48px;
  color: var(--ink);
  background: var(--sand);
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease;
}

.button:hover { background: #ffe4b8; }
.section { width: var(--page); margin-inline: auto; padding: clamp(55px, 8vw, 110px) 0; }
.introduction { margin: 1rem 0; color: var(--muted); }
.card-action { color: var(--sand); text-underline-offset: 0.3em; font-weight: 700; }

.library { padding-top: clamp(2.25rem, 3.5vw, 3.5rem); }
.library h1 { font-size: clamp(3.65rem, 7vw, 5rem); }
.library .introduction { margin-bottom: 0; }
.story-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
  grid-auto-rows: 1fr;
  gap: clamp(1rem, 2.2vw, 1.65rem);
  list-style: none;
  margin: clamp(1.65rem, 3vw, 2.5rem) 0 0;
  padding: 0;
}

.story-card {
  --card-padding: clamp(1.15rem, 2.2vw, 1.55rem);
  --card-radius: 0.85rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: #1b2e28;
  transition: border-color 180ms ease, transform 180ms ease;
}

.library > .story-list > .story-card:only-child {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 34rem;
}

.story-card-link {
  display: block;
  flex: 1;
  border-radius: var(--card-radius);
  text-decoration: none;
}

.story-card-link:focus-visible { outline-offset: 3px; }
.story-card:focus-within { border-color: var(--sand); }

.story-card-media {
  aspect-ratio: 8 / 5;
  overflow: hidden;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  background: #263f37;
}

.story-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.story-summary { padding: var(--card-padding); }

.story-summary .kicker { margin-bottom: 0.55rem; }
.story-summary :is(h2, h3) {
  margin: 0;
  font: 400 clamp(1.65rem, 2.25vw, 2.1rem)/1.08 Georgia, serif;
  letter-spacing: -0.035em;
  text-wrap: pretty;
}

.story-description { color: var(--muted); margin-top: 0.7rem; font-size: 0.94rem; }
.card-action { display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 1.1rem; }
.card-action span { transition: transform 180ms ease; }
.story-card-link:focus-visible .card-action { text-decoration: underline; }
.story-card-link:focus-visible .card-action span { transform: translate(3px, -2px); }

.story-related {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0.8rem var(--card-padding) 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

.story-related span { font-size: 0.73rem; font-weight: 700; }
.story-related a { justify-self: start; }
.story-related a, .topic-links a { color: var(--sand); text-underline-offset: 0.3em; }
.topic-links ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; list-style: none; padding: 0; }
.topic-links a { display: inline-block; padding-block: 0.5rem; }
.story-topic { margin-top: 3rem; }
.story-topic > h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); scroll-margin-top: 1.5rem; }
.story-topic .story-list { margin-top: 1.25rem; }
.prose { max-width: min(100% - 48px, 680px); }
.prose h2 { margin-top: 2rem; font-size: clamp(1.55rem, 3vw, 2.3rem); }
.prose p { margin-top: 1.2rem; }
.prose a { color: var(--sand); text-underline-offset: 0.3em; }

@media (min-width: 761px) and (max-height: 780px) {
  .home-layout { padding-block: clamp(20px, 3.6svh, 28px); }
  .home-featured-media { aspect-ratio: 2 / 1; }
  .home-featured-copy { padding-block: 1.5rem; }
}

@media (max-width: 760px) {
  .home-hero { min-height: 0; }
  .home-layout { grid-template-columns: minmax(0, 1fr); max-width: 38rem; }
  .home-intro h1 { font-size: min(clamp(2.65rem, 8vw, 4.15rem), 25vw); }
}

@media (max-width: 550px) {
  :root { --page: calc(100% - 36px); }
  .masthead { min-height: 65px; gap: 12px; }
  .brand { font-size: 1.125rem; }
  .library h1 { font-size: min(clamp(3.65rem, 7vw, 5rem), 30vw); }
}

@media (hover: hover) {
  .home-featured:hover { border-color: #ebca928f; }
  .home-featured-link:hover img { transform: scale(1.04); }
  .home-featured-link:hover .card-action { text-decoration: underline; }
  .home-featured-link:hover .card-action span { transform: translate(3px, -2px); }
  .story-card:hover { border-color: #ebca9270; transform: translateY(-3px); }
  .story-card-link:hover img { transform: scale(1.045); }
  .story-card-link:hover .card-action { text-decoration: underline; }
  .story-card-link:hover .card-action span { transform: translate(3px, -2px); }
}

@media (prefers-reduced-motion: no-preference) {
  .home-intro, .home-featured { animation: rise-in 420ms ease-out both; }
  .library h1, .library .introduction { animation: rise-in 360ms ease-out both; }
  .home-featured, .library .introduction { animation-delay: 65ms; }

  @supports (animation-timeline: view()) {
    .home-featured-media img {
      animation: featured-crop linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 80%;
    }
  }
}

@keyframes featured-crop {
  from { object-position: center 36%; }
  to { object-position: center 64%; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .button, .home-featured, .home-featured-media img,
  .story-card, .story-card-media img, .card-action span { transition: none; }
  .home-featured-link:hover img, .home-featured-link:hover .card-action span,
  .story-card:hover, .story-card-link:hover img,
  .story-card-link:is(:hover, :focus-visible) .card-action span { transform: none; }
}
