@font-face {
  font-family: "Press Start 2P";
  src: url("../../fonts/PressStart2P-Regular.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #173f3b;
  --ink-soft: #4c6762;
  --paper: #f3ead6;
  --paper-light: #fffaf0;
  --coral: #e96f57;
  --mustard: #e6ab36;
  --teal: #2f7770;
  --plum: #7f4b6a;
  --line: rgba(23, 63, 59, .18);
  --shadow: 0 18px 50px rgba(23, 63, 59, .13);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 8% 9%, rgba(233,111,87,.13), transparent 24rem), radial-gradient(circle at 93% 31%, rgba(47,119,112,.12), transparent 30rem), var(--paper); font-family: Georgia, "Times New Roman", serif; font-size: 18px; line-height: 1.65; }
a { color: inherit; }
button { font-family: inherit; }
.skip-link { position: fixed; z-index: 99; top: .75rem; left: .75rem; padding: .75rem 1rem; color: white; background: var(--ink); border-radius: 999px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.site-header, footer { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.site-header { min-height: 88px; }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-weight: 700; text-decoration: none; }
.brand-mark { display: grid; width: 2.4rem; aspect-ratio: 1; place-items: center; border-radius: 50% 48% 52% 46%; color: var(--paper-light); background: var(--coral); box-shadow: inset -4px -5px 0 rgba(23,63,59,.12); font-family: "Press Start 2P", system-ui, sans-serif; font-size: .75rem; }
.back-link { min-height: 46px; display: inline-flex; align-items: center; padding: .55rem .85rem; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; font-weight: 700; text-decoration: none; }
.back-link:hover, .back-link:focus-visible { color: white; background: var(--ink); }
.eyebrow { margin: 0 0 .7rem; color: var(--coral); font: clamp(.55rem, 1vw, .7rem)/1.7 "Press Start 2P", system-ui, sans-serif; letter-spacing: .03em; text-transform: uppercase; }
h1, h2, p { text-wrap: pretty; }
h1, h2 { margin: 0; font-weight: 500; line-height: 1; letter-spacing: -.045em; }
h1 { font-size: clamp(3.2rem, 8vw, 7.2rem); }
h1 em { color: var(--teal); font-weight: 400; }

.story-hero { width: min(1180px, calc(100% - 2rem)); min-height: min(760px, calc(100svh - 88px)); margin-inline: auto; padding: clamp(3rem, 8vw, 7rem) 0; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(2rem, 6vw, 5rem); }
.story-hero > div:first-child > p:last-child { max-width: 37rem; margin: 1.6rem 0 0; color: var(--ink-soft); font-size: clamp(1.08rem, 1.8vw, 1.35rem); }
.hero-friends { display: flex; align-items: center; justify-content: center; min-height: 390px; }
.hero-friends span { width: 43%; max-width: 230px; aspect-ratio: 1; margin-inline: -6%; border: 8px solid var(--paper-light); border-radius: 50%; background-position: center; background-size: 104%; box-shadow: var(--shadow); }
.hero-friends span:nth-child(1) { transform: rotate(-8deg) translateY(2rem); }
.hero-friends span:nth-child(2) { z-index: 2; transform: translateY(-2rem); }
.hero-friends span:nth-child(3) { transform: rotate(8deg) translateY(2rem); }

.story-picker { width: min(1080px, calc(100% - 2rem)); margin: 0 auto clamp(5rem, 9vw, 8rem); display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.story-picker a { min-width: 0; display: flex; align-items: center; gap: .9rem; padding: 1rem; border: 1px solid var(--line); border-radius: 1.2rem .45rem 1.4rem .65rem; background: rgba(255,250,240,.78); box-shadow: 0 8px 25px rgba(23,63,59,.08); text-decoration: none; transition: transform .2s ease, border-color .2s ease; }
.story-picker a:hover, .story-picker a:focus-visible { border-color: var(--teal); transform: translateY(-4px); }
.story-picker .picker-long { border: 2px solid rgba(230,171,54,.7); background: rgba(255,250,240,.96); }
.story-picker .picker-long .picker-number { background: var(--mustard); }
.story-picker .picker-wide { grid-column: 1 / -1; justify-content: center; }
.picker-number { display: grid; width: 3rem; min-width: 3rem; aspect-ratio: 1; place-items: center; border-radius: 50%; color: white; background: var(--coral); font: .7rem "Press Start 2P", system-ui, sans-serif; }
.story-picker strong, .story-picker small { display: block; }
.story-picker strong { line-height: 1.2; }
.story-picker small { margin-top: .3rem; color: var(--ink-soft); font-size: .75rem; line-height: 1.3; }

.stories { display: grid; gap: clamp(5rem, 10vw, 9rem); padding-bottom: clamp(5rem, 10vw, 9rem); }
.story { scroll-margin-top: 1rem; width: min(1120px, calc(100% - 2rem)); margin-inline: auto; display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); align-items: start; gap: clamp(2rem, 6vw, 5rem); }
.story.reverse { grid-template-columns: minmax(0, 1.28fr) minmax(280px, .72fr); }
.story.reverse .story-cover { grid-column: 2; }
.story.reverse .story-content { grid-column: 1; grid-row: 1; }
.story-cover { position: sticky; top: 1rem; min-width: 0; padding: 1rem 1rem 1.35rem; border: 2px solid var(--line); border-radius: 2rem .65rem 2.5rem .9rem; background: var(--paper-light); box-shadow: var(--shadow); transform: rotate(-1.5deg); }
.story.reverse .story-cover { transform: rotate(1.5deg); }
.story-number { margin: .2rem 0 .8rem; color: var(--plum); font: .58rem/1.5 "Press Start 2P", system-ui, sans-serif; text-align: center; text-transform: uppercase; }
.cover-portrait { width: 100%; aspect-ratio: 1; border-radius: 1.4rem .45rem 1.8rem .7rem; background-position: center; background-size: 104%; }
.cover-friend { width: 34%; aspect-ratio: 1; margin: -25% .2rem 0 auto; border: 5px solid var(--paper-light); border-radius: 50%; background-position: center; background-size: 104%; box-shadow: 0 8px 22px rgba(23,63,59,.2); }
.story-cover > p:last-child { margin: 1rem .5rem .2rem; color: var(--ink-soft); font-size: .87rem; font-style: italic; line-height: 1.4; text-align: center; }
.story-content { min-width: 0; padding-top: 1rem; }
.story-content h2 { font-size: clamp(2.45rem, 5vw, 4.6rem); }
.story-controls { display: flex; flex-wrap: wrap; gap: .65rem; margin: 1.35rem 0 .5rem; }
.story-listen, .story-stop { min-height: 54px; padding: .75rem 1rem; border-radius: 999px; font-size: .92rem; font-weight: 700; cursor: pointer; }
.story-listen { border: 2px solid var(--ink); color: white; background: var(--ink); box-shadow: 0 5px 0 rgba(23,63,59,.2); }
.story-listen:hover, .story-listen:focus-visible, .story-listen.is-playing { border-color: var(--coral); background: var(--coral); transform: translateY(-2px); }
.story-listen.is-paused { color: var(--ink); border-color: var(--mustard); background: var(--mustard); }
.story-stop { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.story-stop:hover, .story-stop:focus-visible { background: rgba(23,63,59,.08); }
.story-status { min-height: 1.5em; margin: .4rem 0 1rem; color: var(--teal); font-size: .8rem; font-weight: 700; }
.story-text { color: #294f4a; font-size: clamp(1.04rem, 1.6vw, 1.18rem); line-height: 1.72; }
.story-text p { margin: 0 0 1.05em; }
.story-text p:first-child::first-letter { float: left; margin: .08em .1em 0 0; color: var(--coral); font-size: 4em; font-weight: 700; line-height: .72; }
.story-scene { margin: 2rem 0 2.2rem; }
.story-scene img { display: block; width: 100%; height: auto; border: 7px solid var(--paper-light); border-radius: 1.8rem .6rem 2.2rem .8rem; box-shadow: var(--shadow); }
.story-scene figcaption { width: fit-content; max-width: 90%; margin: -.8rem 1rem 0 auto; position: relative; padding: .55rem .8rem; color: var(--ink); background: var(--mustard); font-size: .76rem; font-style: italic; line-height: 1.35; transform: rotate(-1deg); }
.story-top { display: inline-flex; min-height: 44px; align-items: center; margin-top: .7rem; color: var(--ink-soft); font-size: .82rem; font-weight: 700; text-underline-offset: .25rem; }
.story-note { padding: clamp(2rem, 5vw, 4rem) 1rem; color: var(--paper-light); background: var(--ink); }
.story-note p { max-width: 760px; margin: 0 auto; font-size: .88rem; text-align: center; }
footer { padding: 2rem 0 3rem; border-top: 1px solid var(--line); font-size: .82rem; }
footer p { max-width: 39rem; margin: 0; color: var(--ink-soft); }
footer > a:last-child { min-height: 44px; display: inline-flex; align-items: center; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 4px; }

@media (max-width: 820px) {
  html, body { touch-action: pan-y; }
  body, body * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .site-header { min-height: 72px; }
  .story-hero { min-height: auto; grid-template-columns: 1fr; padding: 2.5rem 0 5rem; }
  .hero-friends { min-height: 230px; order: -1; }
  .hero-friends span { border-width: 5px; }
  .story-picker { grid-template-columns: 1fr; }
  .story-picker .picker-wide { grid-column: auto; justify-content: flex-start; }
  .story { width: min(680px, calc(100% - 1.1rem)); grid-template-columns: 1fr; gap: 1.5rem; }
  .story.reverse { grid-template-columns: 1fr; }
  .story.reverse .story-cover, .story.reverse .story-content { grid-column: 1; }
  .story.reverse .story-cover { grid-row: auto; }
  .story-cover { position: relative; top: auto; width: min(430px, 100%); margin-inline: auto; transform: none !important; }
  .story-content { padding-top: 0; }
  .story-controls { align-items: stretch; flex-direction: column; }
  .story-controls button { width: 100%; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  body { font-size: 16px; }
  .back-link { font-size: .78rem; }
  .story-hero h1 { font-size: clamp(2.8rem, 15vw, 4.1rem); }
  .hero-friends { min-height: 185px; }
  .story-content h2 { font-size: 2.35rem; }
  .story-text { font-size: 1.08rem; }
  .story-scene { margin-inline: -.25rem; }
  .story-scene img { border-width: 4px; border-radius: 1.2rem .45rem 1.5rem .6rem; }
}

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