/* Shared foundation and compact desktop layout. */
:root {
  color-scheme: light;
  --ink: #183942;
  --teal: #256775;
  --teal-dark: #19515d;
  --muted: #626b6b;
  --paper: #eeece8;
  --line: #eee5da;
  --surface: #f1efeb;
  --card: #f8f6f2;
  --card-line: #eee4d9;
  --section-line: #f7ece2;
  --image-base: #f5eadc;
  --description: #626766;
  --mobile-description: #47595b;
  --body-ink: #303e3f;
  --button-ink: #fff;
  --control-line: #9dbbbc;
  --reader-control-line: #d4dfda;
  --hover-surface: #edf4ee;
  --reader-hover: #eaf1ec;
  --saved-surface: #edf2ec;
  --pill: #ffe6d5;
  --pill-ink: #8c4a27;
  --accent: #b48057;
  --focus: #a35622;
  --shadow: #886f4310;
  --progress-surface: #f1efebf5;
  --progress-track: #e1e9e4;
  --hero-fade: linear-gradient(90deg,#eeece8 0%,#eeece8f5 33%,#eeece8d9 46%,#eeece880 58%,#eeece800 76%);
  --art-filter: none;
  --brand-filter: none;
  --mobile-hero-blend: multiply;
  --font-size: 22px;
}

:root[data-theme="night"] {
  color-scheme: dark;
  --ink: #e8e2d7;
  --teal: #87c5bf;
  --teal-dark: #a2d7ce;
  --muted: #b5b3aa;
  --paper: #202321;
  --line: #424941;
  --surface: #252925;
  --card: #2b302b;
  --card-line: #454c44;
  --section-line: #373e36;
  --image-base: #30372f;
  --description: #c0bfb5;
  --mobile-description: #d0cbbf;
  --body-ink: #ded9cd;
  --button-ink: #192e2b;
  --control-line: #708c82;
  --reader-control-line: #637a6d;
  --hover-surface: #343f36;
  --reader-hover: #343f36;
  --saved-surface: #303a31;
  --pill: #4b3b2e;
  --pill-ink: #edc6a5;
  --accent: #d6ad86;
  --focus: #eac194;
  --shadow: #00000024;
  --progress-surface: #252925f5;
  --progress-track: #505d50;
  --hero-fade: linear-gradient(90deg,#202321 0%,#202321fa 33%,#202321e6 46%,#202321a6 58%,#20232133 76%);
  --art-filter: brightness(.65) saturate(.8);
  --brand-filter: brightness(2) saturate(.65);
  --mobile-hero-blend: normal;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial,Helvetica,sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

a:focus-visible,button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 0.3125rem;
}

button:disabled {
  cursor: default;
  opacity: .4;
}

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

h1,h2,h3,p {
  margin: 0;
}

h1,h2,h3 {
  font-family: Georgia,"Times New Roman",serif;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.375rem,4vw,3.3125rem);
  line-height: 1.07;
  letter-spacing: -1.8px;
}

h2 {
  font-size: 2.1875rem;
  line-height: 1.2;
  letter-spacing: -1px;
}

h3 {
  font-size: 1.5625rem;
  line-height: 1.2;
  letter-spacing: -.5px;
}

p {
  line-height: 1.6;
}

.wrap {
  width: min(70rem,calc(100% - 4rem));
  margin-inline: auto;
}

/* Only image pixels are dimmed; captions, controls and click targets stay intact. */
.card-image img,.reader-cover,.story-illustration img,.illustration-video {
  filter: var(--art-filter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Header and welcome. */
.theme-control {
  flex: 0 0 auto;
}

.theme-control button {
  min-height: 2.75rem;
  min-width: 2.75rem;
  display: grid;
  place-items: center;
  padding: .5rem;
  border: 1px solid var(--control-line);
  border-radius: .5rem;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
}

.theme-control button:hover {
  background: var(--hover-surface);
}

.theme-icon {
  width: 1.375rem;
  height: 1.375rem;
}

.theme-icon-night,:root[data-theme="night"] .theme-icon-day {
  display: none;
}

:root[data-theme="night"] .theme-icon-night {
  display: block;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.375rem;
  gap: 1.5rem;
}

.brand {
  display: flex;
  gap: 0.6875rem;
  align-items: center;
  font: 600 1.4375rem Georgia,serif;
  white-space: nowrap;
}

.brand img {
  filter: var(--brand-filter);
  width: 2.375rem;
  height: 2.375rem;
}

nav {
  margin-left: auto;
  display: flex;
  gap: 1.875rem;
  font-size: 0.875rem;
}

nav a {
  padding: 0.75rem 0;
}

.account-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
}

.account-nav-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

nav a:hover {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 0.375rem;
}

.hero {
  display: grid;
  align-items: center;
  gap: 0.625rem;
  height: 16.25rem;
  grid-template-columns: 1.15fr 1fr;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding-bottom: 0.75rem;
}

.hero h1 {
  font-size: 2.6875rem;
  max-width: 35.625rem;
}

.hero-description {
  line-height: 1.5;
  color: var(--description);
  font-size: 1rem;
  margin: 0.8125rem 0 1.0625rem;
}

.button {
  min-height: 2.875rem;
  display: inline-flex;
  gap: 1.375rem;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.4375rem;
  border-radius: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background .15s,transform .15s;
}

.button:hover {
  transform: translateY(-1px);
}

.primary {
  background: var(--teal);
  color: var(--button-ink);
}

.primary:hover {
  background: var(--teal-dark);
}

.secondary {
  border: 1px solid var(--control-line);
  background: transparent;
  color: var(--teal);
}

.secondary:hover {
  background: var(--hover-surface);
}

.button>span {
  font-size: 1.3125rem;
  line-height: 1rem;
}

.hero-art {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  max-width: 26.875rem;
  width: 100%;
  justify-self: end;
}

.hero-art picture {
  display: contents;
}

.hero-art img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  z-index: 1;
}

/* Story catalog. */
.catalog-section {
  background: var(--surface);
  padding: 1.25rem 0 1.75rem;
  border-top: 1px solid var(--section-line);
  scroll-margin-top: 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.875rem;
}

.section-count {
  font-size: 0.8125rem;
  color: var(--muted);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 1.5rem;
}

.story-card {
  border: 1px solid var(--card-line);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0.25rem 0.8125rem var(--shadow);
  background: var(--card);
  display: flex;
  flex-direction: column;
}

.card-image {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--image-base);
}

.card-image img {
  object-fit: cover;
  width: 100%;
  transition: transform .4s;
  aspect-ratio: 1.95;
}

.story-card:hover .card-image img {
  transform: scale(1.025);
}

.card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0.75rem 0.875rem;
}

.card-content h3 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3125rem;
}

.card-content>p {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
  margin: 0.4375rem 0 auto;
  padding-bottom: 0.6875rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.3125rem;
  font-size: 0.6875rem;
  color: var(--muted);
  margin: 0 0 0.625rem;
}

.pill {
  display: inline-block;
  padding: 0.3125rem 0.5rem;
  font-size: 0.625rem;
  line-height: 1.4;
  border-radius: 0.4375rem;
  background: var(--pill);
  color: var(--pill-ink);
  white-space: nowrap;
}

.card-content .button {
  width: 100%;
  min-height: 2.6875rem;
  font-size: 0.875rem;
}

.demo-notice {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.875rem;
}

.about {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3.4375rem;
  padding-block: 2.0625rem;
}

.about h2 {
  font-size: 1.875rem;
}

.about p {
  font-size: 0.875rem;
  line-height: 1.8;
}

.about p.muted {
  font-size: 0.75rem;
  margin-top: 0.75rem;
  color: var(--muted);
}

.footer {
  padding-block: 1.5rem 1.875rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5625rem;
  color: var(--muted);
  font-size: 0.6875rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.5rem;
}

.footer-about {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .875rem;
  color: var(--teal);
}

.about-more {
  display: inline-block;
  padding-block: .75rem;
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: .25em;
}

.footer-wordmark {
  font-size: 0.6875rem;
  letter-spacing: 2px;
  color: var(--teal);
}

.footer-wordmark span {
  display: block;
  font-size: 0.625rem;
  letter-spacing: 0;
  margin-top: 0.4375rem;
  color: var(--muted);
}

.skip-link {
  position: fixed;
  top: 0.625rem;
  left: 0.625rem;
  z-index: 100;
  padding: 0.75rem;
  background: var(--card);
  transform: translateY(-150%);
}

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

.eyebrow {
  font-size: 0.625rem;
  letter-spacing: 1.7px;
  font-weight: 700;
  color: var(--teal);
}

/* Reader: works without JavaScript; controls enhance it. */
.reader-wrap {
  width: min(47.5rem,calc(100% - 3rem));
  margin: 2.25rem auto 4.5rem;
}

.back-link {
  display: inline-flex;
  gap: 0.75rem;
  font-size: 0.8125rem;
  padding: 0.75rem 0;
  color: var(--teal);
}

.story-heading {
  text-align: center;
  margin: 2.1875rem auto;
}

.story-heading h1 {
  font-size: 3.4375rem;
  margin: 1rem 0;
}

.story-heading>p:not(.eyebrow) {
  font-size: 1rem;
  color: var(--muted);
  max-width: 35rem;
  margin: 0 auto 1.25rem;
}

.reader-cover {
  width: 100%;
  aspect-ratio: 1.85;
  object-fit: cover;
  border-radius: 0.9375rem;
}

.story-types {
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.45;
  margin-bottom: .625rem;
  overflow-wrap: anywhere;
}

.story-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .375rem;
}

.reading-time {
  color: var(--muted);
  font-size: .6875rem;
  line-height: 1.4;
}

.story-audio {
  margin: 1.25rem 0 .5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .9375rem;
  background: var(--paper);
}

.audio-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .75rem;
}

.audio-heading h2 {
  font-size: 1.25rem;
  margin: 0;
}

.audio-heading>span {
  color: var(--muted);
  font-size: .875rem;
}

.story-audio audio {
  display: block;
  width: 100%;
  min-width: 0;
  height: 54px;
}

.audio-help, .audio-unavailable {
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.6;
}

.audio-help {
  margin: .625rem 0 0;
}

.audio-help a {
  display: inline-block;
  padding: .625rem .25rem;
  text-decoration: underline;
  color: var(--teal);
}

.reader-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--paper);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.3125rem 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.25rem;
}

.font-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.toolbar-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-right: 0.625rem;
}

.font-controls button,.save-button {
  border: 1px solid var(--reader-control-line);
  border-radius: 0.375rem;
  background: transparent;
  color: var(--teal);
  padding: 0.625rem;
  min-height: 2.75rem;
  min-width: 2.75rem;
}

.save-button {
  font-size: 0.75rem;
  padding-inline: 0.9375rem;
}

.font-controls button:hover,.save-button:hover {
  background: var(--reader-hover);
}

.story-body {
  font-family: Georgia,"Times New Roman",serif;
  font-size: calc(var(--font-size) + 1.375rem - 22px);
  line-height: 1.9;
  max-width: 30em;
  margin: 1.75rem auto 2.8125rem;
  color: var(--body-ink);
}

.story-body p {
  line-height: 1.9;
  margin-bottom: 1.15em;
  scroll-margin-top: 6.875rem;
}

.story-illustration {
  margin: 1.75em 0;
}

.story-illustration img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.9375rem;
}

.illustration-toggle {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0.9375rem;
  background: transparent;
  overflow: hidden;
  color: #fff;
  cursor: pointer;
}

.illustration-toggle:disabled {
  cursor: default;
  opacity: 1;
}

.illustration-hint {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 1.5rem;
  background: #233f3ee6;
  font: 500 0.8125rem/1.4 Arial,sans-serif;
  pointer-events: none;
}

.illustration-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
}

.illustration-toggle.has-frame .illustration-video {
  opacity: 1;
}

.illustration-status {
  font: 400 0.8125rem/1.5 Arial,sans-serif;
  color: var(--muted);
  margin-top: 0.5rem;
}

.story-body p:first-child:first-letter {
  float: left;
  font-size: 3.1em;
  line-height: 1;
  padding: 0.5rem 0.625rem 0 0;
  color: var(--teal);
}

.reader-status {
  font-size: 0.75rem;
  color: var(--teal);
  min-height: 1.5rem;
  margin-top: 0.625rem;
}

.saved-place {
  margin-top: 0.9375rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background: var(--saved-surface);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.75rem;
}

.saved-place button {
  border: 0;
  background: transparent;
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 0.25rem;
  min-height: 2.1875rem;
}

.reading-end {
  text-align: center;
  border-top: 1px solid var(--line);
  padding: 2.375rem 0.9375rem;
}

.reading-end>span {
  font: 2.5rem Georgia,serif;
  color: var(--accent);
}

.reading-end h2 {
  font-size: 2rem;
  margin-top: 0.9375rem;
}

.reading-end p {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 27.5rem;
  margin: 0.875rem auto 1.5rem;
}

.reader-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--progress-surface);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.125rem;
  padding: 0.75rem 1.25rem;
  z-index: 5;
  font-size: 0.6875rem;
  backdrop-filter: blur(0.5rem);
}

progress {
  width: min(22.5rem,45vw);
  height: 0.3125rem;
  accent-color: var(--teal);
  border: 0;
}

progress::-webkit-progress-bar {
  background: var(--progress-track);
  border-radius: 0.3125rem;
}

progress::-webkit-progress-value {
  background: var(--teal);
  border-radius: 0.3125rem;
}

.error-page {
  text-align: center;
  padding-block: 6.25rem 8.125rem;
}

.error-page h1 {
  margin: 1.375rem auto;
}

.error-page>p:not(.eyebrow) {
  color: var(--muted);
  margin-bottom: 1.875rem;
}

.empty-state {
  padding: 1.875rem;
  border: 1px solid var(--line);
  border-radius: 0.875rem;
}

.empty-state p {
  margin-top: 0.9375rem;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

.section-heading h2 {
  font-size: 2rem;
}

.card-content h3 {
  font-size: 1.5rem;
}

/* Wide displays: scale the layout itself, retaining the 1920px proportions.
   Rem-based widths, type, spacing and artwork grow together; reading remains 30em. */
@media (min-width:1921px) {
  html {
    font-size: clamp(16px, .833333333vw, 32px);
  }
}

/* Tablet: three cards stay in one row. */
@media (min-width:621px) and (max-width:900px) {
  .wrap {
    width: calc(100% - 48px);
  }

  .hero {
    height: 245px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .section-count {
    display: none;
  }

  .story-grid {
    gap: 16px;
  }

  .card-content {
    padding: 12px;
  }

  .card-meta {
    font-size: 10px;
  }

  .card-content .button {
    font-size: 12px;
    padding-inline: 10px;
  }

  .about {
    gap: 30px;
  }

  .card-content h3 {
    font-size: 21px;
  }

  .card-meta>span:first-child:not(.story-rating) {
    display: none;
  }

}

/* Phone: compact illustration/text rows. */
@media (max-width:620px) {
  h2 {
    font-size: 28px;
    letter-spacing: -.7px;
  }

  .wrap {
    width: calc(100% - 40px);
  }

  .header {
    height: auto;
    min-height: 64px;
    gap: 0 8px;
    flex-wrap: wrap;
    padding-top: 10px;
  }

  .brand {
    font-size: 20px;
    gap: 8px;
  }

  .brand img {
    width: 32px;
    height: 32px;
  }

  nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    gap: 0.5rem;
  }

  nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-block: .5rem;
  }

  .hero {
    position: relative;
    isolation: isolate;
    width: 100%;
    min-height: 230px;
    height: auto;
    display: flex;
    align-items: center;
    padding: 18px 20px 22px;
    overflow: hidden;
  }

  .hero-copy {
    width: 58%;
    max-width: 300px;
    padding: 0;
    z-index: 3;
  }

  .hero h1 {
    font-size: 29px;
    line-height: 1.08;
    letter-spacing: -.8px;
    max-width: 100%;
  }

  .hero-description {
    font-size: 14px;
    line-height: 1.4;
    margin: 12px 0 0;
    color: var(--mobile-description);
  }

  .hero-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    isolation: isolate;
    overflow: hidden;
    z-index: 0;
  }

  .hero-art::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: var(--hero-fade);
  }

  .hero-art img {
    object-position: right bottom;
    filter: var(--art-filter);
    mix-blend-mode: var(--mobile-hero-blend);
  }

  .catalog-section {
    padding: 17px 0 25px;
  }

  .section-heading {
    margin-bottom: 13px;
  }

  .section-count {
    display: none;
  }

  .story-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .story-card {
    display: grid;
    grid-template-columns: 104px minmax(0,1fr);
    border-radius: 14px;
    min-height: 133px;
  }

  .card-image {
    height: 100%;
    min-height: 133px;
  }

  .card-image img {
    height: 100%;
    aspect-ratio: auto;
  }

  .card-content {
    padding: 11px 12px;
    min-width: 0;
  }

  .card-content>p {
    display: block;
    margin: 7px 0 auto;
    padding-bottom: 8px;
    font-size: 12px;
  }

  .card-content .story-types {
    margin-bottom: 0;
  }

  .card-meta {
    margin: 4px 0 8px;
  }

  .card-content .button {
    font-size: 12px;
    min-height: 44px;
    padding: 9px 11px;
    gap: 10px;
    margin-top: auto;
  }

  .demo-notice {
    text-align: left;
    line-height: 1.7;
    font-size: 11px;
    margin-top: 13px;
  }

  .about {
    display: block;
    padding-block: 25px;
  }

  .about h2 {
    font-size: 27px;
    margin-bottom: 15px;
  }

  .about p {
    font-size: 13px;
  }

  .footer {
    display: block;
    padding-block: 21px 27px;
  }

  .reader-wrap {
    width: calc(100% - 40px);
    margin-top: 20px;
  }

  .story-heading {
    margin: 25px auto;
  }

  .story-heading h1 {
    font-size: 38px;
    letter-spacing: -1px;
  }

  .story-heading>p:not(.eyebrow) {
    font-size: 14px;
  }

  .reader-cover {
    border-radius: 12px;
  }

  .reader-toolbar {
    gap: 8px;
    padding: 17px 0;
  }

  .toolbar-label {
    display: none;
  }

  .save-button {
    font-size: 11px;
    padding-inline: 10px;
  }

  .story-body {
    margin-top: 20px;
  }

  .story-body p {
    line-height: 1.8;
  }

  .reading-end {
    padding-inline: 0;
  }

  .reading-end h2 {
    font-size: 29px;
  }

  .reader-progress {
    font-size: 10px;
  }

  .error-page {
    padding-block: 65px 90px;
  }

  .error-page h1 {
    font-size: 37px;
    letter-spacing: -1px;
  }

  .card-content h3 {
    font-size: 21px;
    line-height: 1.15;
    letter-spacing: -.4px;
  }

  .footer>span {
    display: block;
    margin-top: 17px;
    font-size: 10px;
  }

  .story-heading .pill {
    font-size: 9px;
    white-space: normal;
  }

  .section-heading h2 {
    font-size: 27px;
  }

  .card-meta>span:first-child:not(.story-rating) {
    display: none;
  }

  .card-meta .pill {
    font-size: 10px;
    padding: 3px 6px;
  }

}

/* Narrow phones. */
@media (max-width:360px) {
  .wrap {
    width: calc(100% - 32px);
  }

  .brand {
    font-size: 18px;
  }

  .brand img {
    width: 28px;
    height: 28px;
  }

  .hero {
    padding-inline: 16px;
  }

  .hero-copy {
    width: 62%;
  }

  .hero h1 {
    font-size: 25px;
  }

  .story-card {
    grid-template-columns: 86px minmax(0,1fr);
  }

  .card-content {
    padding: 10px;
  }

  .card-content h3 {
    font-size: 20px;
  }

}

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

  *,*::before,*::after {
    transition: none !important;
    animation: none !important;
  }

}


/* Current catalog is fully public. This is a price label, not a purchase control. */
.card-access { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin-top: auto; }
.story-price { display: inline-flex; align-items: center; gap: .35rem; flex: none; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.price-coin { width: .8rem; height: .8rem; border: 1.5px solid var(--accent); border-radius: 50%; box-shadow: inset 0 0 0 2px var(--card); background: var(--pill); }
.card-access .button { flex: 1; width: auto; min-width: 9rem; }
@media (max-width: 620px) {
  .card-access { gap: .4rem; margin-top: 0; }
  .story-price { font-size: .7rem; }
  .card-access .button { flex-basis: 100%; min-width: 0; }
}

/* The server renders no protected text or media until access is confirmed. */
.story-owned { color: var(--teal); font-weight: 650; }
.story-unlock { padding: 1.6rem; margin: 1.5rem 0 3rem; background: var(--card); border: 1px solid var(--card-line); border-radius: 1rem; }
.story-unlock h2 { margin: 0 0 .8rem; font-size: 1.45rem; }
.story-unlock p { line-height: 1.65; overflow-wrap: anywhere; }
.unlock-preview { padding-bottom: 1.1rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--card-line); }
.unlock-preview p { margin: .5rem 0 0; }
.unlock-formats { color: var(--muted); font-size: .9rem; }
.story-unlock .unlock-note { color: var(--muted); font-size: .85rem; }
.story-offer { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 1.25rem; align-items: start; margin-bottom: 3rem; }
.story-offer .reader-cover { width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; margin: 0; border-radius: 1rem; }
.story-offer .story-unlock { margin: 0; }
.story-offer .story-purchase-form .button { width: 100%; }
.story-purchase-form { margin-block: 1rem; }
.unlock-wallet-link { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 901px) {
  .reader-wrap:has(.story-offer) { width: min(70rem,calc(100% - 4rem)); }
  .story-offer { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
}
@media (max-width: 620px) {
  .story-unlock { padding: 1.1rem; }
  .story-purchase-form .button { width: 100%; }
  .story-offer { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .story-offer .reader-cover { height: 180px; object-fit: cover; }
}
