/* ============================================================
   Sanvi Shrivastava — Writer's Workshop
   Aesthetic: Storybook-Editorial (warm paper, ink type, pastel tints)
   Type: Fraunces (display) + Newsreader (reading)
   ============================================================ */

:root {
  /* Surfaces — warm ivory paper */
  --paper: #f4eee1;
  --paper-2: #ebe1cd;
  --card: #fbf6ea;
  --ink: #2b2620;
  --ink-soft: #574f43;
  --ink-faint: #8a7f6e;

  /* Accents — printed ink + muted terracotta + sage */
  --clay: #b5573a;
  --clay-deep: #97432b;
  --sage: #6f7a5c;
  --sage-deep: #566145;

  /* Warm literary tints */
  --sand: #ece1c9;
  --tint-clay: #f0dccf;
  --tint-sage: #e5e7d6;
  --tint-sand: #efe6d0;

  /* Lines & effects */
  --line: #ded1b6;
  --line-strong: #cbb995;
  --shadow-sm: 0 1px 2px rgba(43, 38, 32, 0.06), 0 2px 8px rgba(43, 38, 32, 0.05);
  --shadow-md: 0 10px 30px -14px rgba(43, 38, 32, 0.3);
  --shadow-lg: 0 26px 54px -24px rgba(43, 38, 32, 0.38);
  --shadow-color: 0 16px 34px -20px rgba(181, 87, 58, 0.4);

  /* System */
  --radius: 22px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --container: 1140px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Newsreader", Georgia, serif;
}

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

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body {
  font-family: var(--font-body);
  font-optical-sizing: auto;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 560px at 8% -10%, rgba(111, 122, 92, 0.1), transparent 60%),
    radial-gradient(900px 520px at 100% 4%, rgba(181, 87, 58, 0.08), transparent 58%);
  background-attachment: fixed;
  font-size: 1.075rem;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--sage);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--clay);
  color: #fff;
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 200;
  background: var(--clay);
  transition: width 0.1s linear;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(251, 246, 236, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
    background 0.3s var(--ease);
}

.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 30px -22px rgba(43, 37, 64, 0.6);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--clay);
  color: #fbf6ea;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: var(--shadow-color);
  transform: rotate(-4deg);
  transition: transform 0.35s var(--ease);
}

.brand:hover .brand-mark {
  transform: rotate(4deg) scale(1.05);
}

.main-nav {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-pill);
  background: transparent;
  text-decoration: none;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  transition: color 0.25s var(--ease), background 0.25s var(--ease),
    box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.32rem;
  height: 2px;
  border-radius: 2px;
  background: var(--clay);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.main-nav a:hover {
  color: var(--ink);
  background: rgba(240, 220, 207, 0.5);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  transform: scaleX(1);
}

.main-nav a.active {
  color: var(--clay-deep);
  background: linear-gradient(135deg, rgba(240, 220, 207, 0.9), rgba(229, 231, 214, 0.72));
  box-shadow:
    inset 0 0 0 1px rgba(181, 87, 58, 0.22),
    0 10px 24px -18px rgba(181, 87, 58, 0.6);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-toggle:active {
  transform: scale(0.94);
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.nav-toggle__bars {
  position: relative;
  transition: background 0.2s var(--ease);
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  transition: transform 0.25s var(--ease);
}

.nav-toggle__bars::before {
  top: -6px;
}

.nav-toggle__bars::after {
  top: 6px;
}

.nav-toggle.is-open .nav-toggle__bars {
  background: transparent;
}

.nav-toggle.is-open .nav-toggle__bars::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle__bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Layout primitives ---------- */
main {
  position: relative;
  z-index: 2;
}

.band {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.15rem, 5vw, 2.5rem);
}

.band > * {
  max-width: var(--container);
  margin-inline: auto;
}

.soft-blue {
  background: linear-gradient(180deg, transparent, var(--tint-sage) 12%, var(--tint-sage) 88%, transparent);
}
.soft-pink {
  background: linear-gradient(180deg, transparent, var(--tint-clay) 12%, var(--tint-clay) 88%, transparent);
}
.soft-mint {
  background: linear-gradient(180deg, transparent, var(--tint-sand) 12%, var(--tint-sand) 88%, transparent);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--clay);
  margin-bottom: 0.85rem;
}

.section-heading {
  margin-bottom: 2.5rem;
}

.section-heading:not(.centered) h2 {
  max-width: 46rem;
}

.section-heading.centered {
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
}

.section-heading.centered .eyebrow {
  justify-content: center;
}

.section-note {
  margin: 0.9rem auto 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.06;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
}

h3 {
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.2;
}

.prose p + p {
  margin-top: 1.1rem;
}

.poem-separator {
  width: min(14rem, 65%);
  margin: 1.35rem auto;
  border: 0;
  border-top: 2px dashed var(--line-strong);
}

.prose {
  color: var(--ink-soft);
  font-size: 1.12rem;
  line-height: 1.85;
}

.prose.wide {
  max-width: 60ch;
}

.two-column {
  columns: 2;
  column-gap: 2.6rem;
}

.two-column p {
  break-inside: avoid;
  margin-bottom: 1.1rem;
}

/* ---------- Buttons ---------- */
.button {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease), color 0.25s var(--ease);
  will-change: transform;
}

.button.primary {
  --btn-bg: var(--clay);
  box-shadow: var(--shadow-color);
}

.button.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 44px -18px color-mix(in srgb, var(--clay) 60%, transparent);
}

.button.ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--line-strong);
}

.button.ghost:hover {
  transform: translateY(-3px);
  background: var(--card);
  border-color: var(--clay);
  color: var(--clay);
  box-shadow: var(--shadow-md);
}

.button:active {
  transform: translateY(-1px) scale(0.99);
}

.button-icon {
  display: inline-grid;
  place-items: center;
  width: 1.75em;
  height: 1.75em;
  flex: 0 0 auto;
  margin-left: -0.42em;
  border-radius: 32%;
  background: color-mix(in srgb, currentColor 14%, transparent);
  transition: background 0.28s var(--ease), color 0.28s var(--ease),
    transform 0.3s var(--ease);
}

.button-icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  display: block;
}

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

.button--amazon:hover .button-icon {
  background: #fdf8ee;
  color: var(--clay);
}

.button--youtube:hover .button-icon {
  background: #ff0033;
  color: #fff;
}

.button--email:hover .button-icon {
  background: var(--clay);
  color: #fff;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 520px);
  align-items: start;
  gap: clamp(2rem, 6vw, 5.8rem);
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: clamp(3.5rem, 8vw, 6.5rem);
}

.hero-copy {
  position: relative;
  min-width: 0;
}

.hero-intro-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: clamp(1rem, 2.6vw, 1.8rem);
  margin-bottom: 1.25rem;
}

.welcome {
  display: block;
  width: fit-content;
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 6vw, 5.35rem);
  font-style: italic;
  font-weight: 650;
  line-height: 0.9;
  color: var(--clay);
  text-shadow: 0 14px 28px rgba(181, 87, 58, 0.16);
}

.hero-nameplate {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  width: min(100%, 245px);
  min-width: 0;
  margin: 0;
  padding: 1rem 1.4rem 1.05rem;
  border: 1px solid rgba(251, 246, 234, 0.18);
  border-radius: 14px;
  background: #2b2620;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(251, 246, 234, 0.08);
  color: #f3ead6;
  font-family: var(--font-display);
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  font-weight: 550;
  line-height: 1.08;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.nameplate-rule {
  width: 46px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--clay);
}

/* stacked (narrow) spacing above "Welcome!" */
.hero-nameplate {
  margin-bottom: 1.15rem;
}

/* wide screens: pin the card to the top-right so it never wraps down */
@media (min-width: 1150px) {
  .hero-nameplate {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    margin-bottom: 0;
  }
  .hero-intro-row {
    align-items: center;
    min-height: 6.5rem;
    padding-right: calc(245px + 1.8rem);
  }
}

.hero-copy h1 {
  font-size: clamp(2.7rem, 6.4vw, 4.6rem);
  margin: 0.4rem 0 1.1rem;
}

.hero-copy h1 .accent {
  font-style: italic;
  color: var(--clay);
  position: relative;
  white-space: nowrap;
  padding-bottom: 0.08em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='24' viewBox='0 0 300 24' fill='none'%3E%3Cpath d='M4 15 C 60 6, 120 20, 180 10 S 260 18, 296 8' stroke='%23b5573a' stroke-width='4' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 92%;
  background-size: 100% 0.5em;
}

.hero-copy > p {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 42ch;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.8rem;
}

.hero-divider {
  width: min(100%, 34rem);
  margin-top: 1.35rem;
  border-top: 1px dashed var(--line-strong);
}

.mentor-note {
  width: fit-content;
  max-width: 32rem;
  margin-top: 1.25rem;
  padding: 0.72rem 1rem;
  border-left: 4px solid var(--sage);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(229, 231, 214, 0.62);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.16rem);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.8rem;
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px dashed var(--line-strong);
}

.hero-stats .stat {
  display: flex;
  flex-direction: column;
}

.hero-stats .num {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.hero-stats .label {
  font-size: 0.86rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  margin-top: 0.35rem;
}

/* Hero art */
.hero-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  margin-top: clamp(0.7rem, 3vw, 2.3rem);
}

.hero-cues {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.hero-cues span {
  position: absolute;
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(190, 169, 126, 0.46);
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 246, 0.82);
  box-shadow: var(--shadow-sm);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
  white-space: nowrap;
}

.hero-cues span:nth-child(1) {
  top: 12%;
  left: 0;
  transform: rotate(-4deg);
}

.hero-cues span:nth-child(2) {
  top: 5%;
  right: 3%;
  transform: rotate(3deg);
}

.hero-cues span:nth-child(3) {
  right: 0;
  bottom: 16%;
  transform: rotate(-2deg);
}

.hero-art::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 40% 60% 58% 42% / 50% 44% 56% 50%;
  background: radial-gradient(circle at 48% 45%, rgba(240, 220, 207, 0.72), rgba(229, 231, 214, 0.52) 54%, rgba(251, 246, 234, 0) 73%);
  filter: blur(10px);
  animation: blob 14s ease-in-out infinite;
}

.hero-image {
  position: relative;
  z-index: 2;
  display: block;
  width: min(108%, 560px);
  height: auto;
  border-radius: 28px;
  mix-blend-mode: multiply;
  filter: contrast(0.97) saturate(0.92) drop-shadow(0 20px 28px rgba(43, 38, 32, 0.08));
  -webkit-mask-image: radial-gradient(ellipse 77% 66% at 50% 50%, #000 58%, rgba(0, 0, 0, 0.78) 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 77% 66% at 50% 50%, #000 58%, rgba(0, 0, 0, 0.78) 72%, transparent 100%);
  transition: transform 0.5s var(--ease);
}

.hero-art:hover .hero-image {
  transform: translateY(-4px);
}

@keyframes blob {
  0%, 100% { border-radius: 40% 60% 58% 42% / 50% 44% 56% 50%; }
  50% { border-radius: 58% 42% 44% 56% / 44% 58% 42% 56%; }
}

/* ---------- About ---------- */
.about .prose {
  color: var(--ink-soft);
}

.author-books {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  padding: clamp(1.4rem, 4vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 246, 234, 0.72);
  box-shadow: var(--shadow-md);
}

.author-books__intro h3 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  margin-bottom: 0.65rem;
}

.author-books__intro p:not(.eyebrow) {
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.8rem, 2vw, 1.1rem);
}

.book-card {
  position: relative;
  margin: 0;
  padding: 0.7rem 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.book-card:hover {
  transform: translateY(-5px) rotate(-1deg);
  box-shadow: var(--shadow-md);
}

.book-badge {
  display: block;
  width: fit-content;
  margin: 0 auto 0.45rem;
  padding: 0.34rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #fbf6ea;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.book-card img {
  width: 100%;
  aspect-ratio: 5 / 8;
  object-fit: cover;
  border-radius: 10px;
  background: var(--paper-2);
  box-shadow: 0 10px 18px -16px rgba(43, 38, 32, 0.7);
}

.book-card figcaption {
  margin-top: 0.65rem;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.1;
}

.book-buy {
  position: relative;
  display: block;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.book-buy__hint {
  position: absolute;
  left: 50%;
  bottom: 0.6rem;
  transform: translate(-50%, 0.5rem);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #fbf6ea;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}

.book-card:hover .book-buy__hint,
.book-buy:focus-visible .book-buy__hint {
  opacity: 1;
  transform: translate(-50%, 0);
}

.book-buy:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 12px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.75rem;
}

.author-contact-actions {
  margin-top: 0.85rem;
}

/* ---------- Speech / statement ---------- */
.statement {
  position: relative;
  max-width: 52rem;
  margin-inline: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.8rem, 4vw, 3rem);
  box-shadow: var(--shadow-md);
  text-align: left;
}

.statement::before {
  content: "\201C";
  position: absolute;
  top: -0.35em;
  left: 0.35em;
  font-family: var(--font-display);
  font-size: 6rem;
  line-height: 1;
  color: var(--tint-clay);
  z-index: 0;
}

.statement > * {
  position: relative;
  z-index: 1;
}

.statement p {
  font-size: 1.2rem;
  color: var(--ink-soft);
  line-height: 1.8;
}

.statement p + p {
  margin-top: 1.1rem;
}

.statement h3 {
  margin-top: 1.8rem;
  color: var(--clay);
}

.video-feature {
  max-width: 58rem;
  margin: clamp(1.6rem, 4vw, 2.6rem) auto 0;
  padding: clamp(1rem, 2.4vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 246, 234, 0.74);
  box-shadow: var(--shadow-md);
}

.video-feature__copy {
  margin-bottom: 1rem;
  text-align: center;
}

.video-feature__copy h3 {
  font-size: clamp(1.55rem, 3.2vw, 2.25rem);
}

.video-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(251, 246, 234, 0.08);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Writing tips ---------- */
.writing-tips {
  display: grid;
  gap: 1.05rem;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(251, 246, 234, 0.84), rgba(229, 231, 214, 0.6)),
    var(--card);
  box-shadow: var(--shadow-sm);
}

.writing-tips .section-heading {
  margin-bottom: 0;
}

.tips-board {
  display: grid;
  gap: 0.9rem;
}

.tips-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tips-tab {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 0.48rem 0.82rem;
  background: rgba(255, 253, 246, 0.62);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease),
    color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.tips-tab:hover,
.tips-tab:focus-visible {
  border-color: rgba(181, 87, 58, 0.55);
  color: var(--clay-deep);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(74, 61, 49, 0.08);
}

.tips-tab.active {
  border-color: rgba(181, 87, 58, 0.55);
  background: var(--tint-clay);
  color: var(--clay-deep);
}

.tips-panels {
  min-height: 15rem;
}

.tips-panel {
  padding: clamp(1rem, 2.5vw, 1.35rem);
  border: 1px solid rgba(203, 185, 149, 0.72);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 246, 0.72);
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px rgba(203, 185, 149, 0.55);
  animation: tipsFade 0.26s var(--ease);
}

.tips-panel[hidden] {
  display: none;
}

.tips-panel h3 {
  margin-bottom: 0.65rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
}

.tips-list {
  display: grid;
  gap: 0.5rem;
  list-style: none;
}

.tips-list li {
  position: relative;
  padding-left: 1.45rem;
  font-size: clamp(0.96rem, 1.7vw, 1.05rem);
  line-height: 1.55;
}

.tips-list li::before {
  content: "";
  position: absolute;
  top: 0.58em;
  left: 0;
  width: 0.62rem;
  height: 0.62rem;
  border: 1px solid rgba(181, 87, 58, 0.55);
  border-radius: 3px;
  background: rgba(251, 246, 234, 0.82);
}

.tips-list em,
.favorite-reminder {
  color: var(--clay-deep);
}

.favorite-reminder {
  max-width: 46rem;
  font-family: var(--font-display);
  font-size: clamp(1.22rem, 3vw, 1.8rem);
  font-style: italic;
  line-height: 1.35;
}

@keyframes tipsFade {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Play heading ---------- */
#plays .section-heading {
  max-width: var(--container);
}

/* ---------- Stories reader ---------- */
.genre-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.genre-tab {
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.genre-tab:hover {
  transform: translateY(-2px);
  border-color: var(--clay);
  color: var(--clay);
}

.genre-tab.active {
  background: var(--clay);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-color);
}

.genre-description {
  max-width: 46rem;
  margin: 0 auto 1.05rem;
  padding: 0.85rem 1.1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 246, 0.72);
  box-shadow: var(--shadow-sm);
  text-align: center;
  animation: softTabIn 0.34s var(--ease) both;
}

.genre-description p {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
}

.story-search {
  max-width: 44rem;
  margin: -0.45rem auto 1.25rem;
  text-align: center;
}

.story-search::after {
  content: "";
  display: block;
  width: min(100%, 38rem);
  margin: 1rem auto 0;
  border-top: 1px dashed var(--line-strong);
}

.story-search label {
  display: block;
  margin-bottom: 0.42rem;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.story-search__field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.28rem 0.45rem 0.28rem 0.92rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 246, 0.86);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.story-search__field:focus-within {
  border-color: var(--clay);
  box-shadow: 0 12px 26px rgba(181, 87, 58, 0.12);
  transform: translateY(-1px);
}

.story-search__field span {
  color: var(--clay-deep);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
}

.story-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0.68rem 0.55rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.story-search input::placeholder {
  color: var(--ink-faint);
}

.story-search__status {
  min-height: 1.2rem;
  margin-top: 0.45rem;
  color: var(--ink-faint);
  font-size: 0.9rem;
}

.story-options {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  min-height: 2.6rem;
  padding-top: 1.35rem;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}

.story-options.is-ready {
  opacity: 1;
  transform: translateY(0);
}

.story-options[hidden] {
  display: none;
}

.story-options::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(100%, 46rem);
  border-top: 1px dashed var(--line-strong);
  transform: translateX(-50%);
}

.story-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-height: 6.25rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(181, 87, 58, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(251, 246, 234, 0.72);
  color: var(--ink-soft);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
  animation: softTabIn 0.34s var(--ease) both;
}

.story-option::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.48) 42%, transparent 72%);
  transform: translateX(-115%);
  transition: transform 0.55s var(--ease);
  pointer-events: none;
}

.story-option__title {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
  transition: transform 0.25s var(--ease);
}

.story-option__preview {
  position: relative;
  z-index: 1;
  color: var(--ink-faint);
  font-size: 0.84rem;
  line-height: 1.35;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}

.story-option__moods {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.story-option__mood {
  padding: 0.18rem 0.48rem;
  border: 1px solid rgba(89, 102, 133, 0.18);
  border-radius: var(--radius-pill);
  background: rgba(232, 238, 244, 0.52);
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: lowercase;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.story-option__meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-self: flex-start;
  margin-top: auto;
}

.story-option__badge {
  padding: 0.22rem 0.55rem;
  border: 1px solid rgba(181, 87, 58, 0.22);
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 246, 0.78);
  color: var(--clay-deep);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
}

.story-option__length {
  border-color: rgba(96, 124, 94, 0.24);
  background: rgba(229, 236, 219, 0.7);
  color: var(--sage-deep);
}

.story-option:hover {
  transform: translateY(-3px) rotate(-0.35deg);
  border-color: var(--clay);
  color: var(--clay);
  box-shadow: 0 14px 26px rgba(181, 87, 58, 0.13);
}

.story-option:hover::after {
  transform: translateX(115%);
}

.story-option:hover .story-option__title {
  transform: translateX(3px);
}

.story-option:hover .story-option__preview {
  color: var(--ink-soft);
  opacity: 0.92;
}

.story-option:hover .story-option__mood {
  border-color: rgba(181, 87, 58, 0.24);
  background: rgba(255, 253, 246, 0.82);
  color: var(--ink-soft);
}

.story-option:hover .story-option__badge {
  border-color: rgba(181, 87, 58, 0.42);
  background: rgba(255, 246, 224, 0.9);
}

.story-option:hover .story-option__length {
  border-color: rgba(96, 124, 94, 0.42);
  background: rgba(229, 236, 219, 0.9);
  color: var(--sage-deep);
}

.story-option.active {
  background: var(--tint-clay);
  border-color: var(--clay);
  color: var(--clay-deep);
  box-shadow: 0 10px 22px rgba(181, 87, 58, 0.12);
}

.story-option.active .story-option__preview {
  color: var(--ink-soft);
}

.story-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 246, 0.72);
  color: var(--ink-soft);
  text-align: center;
}

.reader {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 3rem);
  box-shadow: var(--shadow-lg);
  max-width: 52rem;
  margin-inline: auto;
  overflow: hidden;
  transition: opacity 0.17s var(--ease), transform 0.17s var(--ease), box-shadow 0.25s var(--ease);
}

.reader.is-switching {
  opacity: 0;
  transform: translateY(8px);
}

.reader.just-switched {
  animation: softReaderIn 0.26s var(--ease) both;
}

.reader::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--clay);
}

/* Accent variants driven by data-accent */
.reader[data-accent="mint"]::before { background: var(--sage); }
.reader[data-accent="blush"]::before,
.reader[data-accent="pink"]::before { background: var(--clay); }
.reader[data-accent="sky"]::before,
.reader[data-accent="blue"]::before { background: var(--sage); }
.reader[data-accent="butter"]::before,
.reader[data-accent="gold"]::before { background: var(--clay-deep); }
.reader[data-accent="lilac"]::before { background: var(--sage-deep); }

.reader-bookmark {
  display: none;
}

.reader-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px dashed var(--line-strong);
}

.reader-progress {
  display: none;
  height: 0.42rem;
  margin: -0.35rem 0 1.1rem;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(190, 169, 126, 0.22);
}

.reader-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--clay));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.12s linear;
}

.reader-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
}

.font-controls {
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 246, 0.88);
  box-shadow: var(--shadow-sm);
}

.font-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.45rem;
  height: 2.05rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.font-control:hover,
.font-control:focus-visible {
  background: var(--butter);
  color: var(--clay);
  transform: translateY(-1px);
}

.font-control:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.font-size-label {
  min-width: 4.8rem;
  color: var(--ink-faint);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.reader-expand {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  gap: 0.05rem;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.88);
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.reader-expand:hover,
.reader-expand:focus-visible {
  color: var(--clay);
  border-color: var(--clay);
  background: var(--card);
  transform: translateY(-2px);
}

.reader-expand span {
  font-size: 1rem;
  line-height: 1;
}

.reader-genre {
  margin-bottom: 0.4rem;
}

.reader-title {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
}

.reader-byline {
  color: var(--ink-faint);
  font-style: italic;
  margin-top: 0.35rem;
}

.reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.reader-moods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-top: 0.6rem;
}

.reader-mood {
  padding: 0.22rem 0.58rem;
  border: 1px solid rgba(89, 102, 133, 0.18);
  border-radius: var(--radius-pill);
  background: rgba(232, 238, 244, 0.56);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: lowercase;
}

.reader-length {
  display: inline-flex;
  padding: 0.24rem 0.68rem;
  border: 1px solid rgba(181, 87, 58, 0.24);
  border-radius: var(--radius-pill);
  background: rgba(251, 246, 234, 0.82);
  color: var(--clay-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reader-length {
  border-color: rgba(96, 124, 94, 0.24);
  background: rgba(229, 236, 219, 0.72);
  color: var(--sage-deep);
}

.reader-body {
  font-size: calc(1.14rem * var(--reader-font-scale, 1));
  line-height: 1.9;
  color: var(--ink-soft);
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.reader-body p:first-child:first-letter {
  initial-letter: 2;
  -webkit-initial-letter: 2;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--clay);
  margin-right: 0.6rem;
}

.reader-body::-webkit-scrollbar {
  width: 8px;
}
.reader-body::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 8px;
}

.reader-nav {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line-strong);
}

.reader-nav__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.reader-nav__button:hover,
.reader-nav__button:focus-visible {
  color: var(--clay);
  border-color: var(--clay);
  transform: translateY(-2px);
}

.reader-to-top {
  position: absolute;
  right: clamp(1rem, 3vw, 2rem);
  bottom: 5.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.58rem 0.9rem;
  border: 1px solid rgba(181, 87, 58, 0.26);
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 246, 0.94);
  color: var(--clay-deep);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.reader-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.reader-to-top:hover,
.reader-to-top:focus-visible {
  border-color: var(--clay);
  background: var(--card);
  transform: translateY(-2px);
}

body.reader-expanded {
  overflow: hidden;
}

.reader.is-expanded {
  position: fixed;
  z-index: 100;
  inset: clamp(0.75rem, 3vw, 2rem);
  max-width: none;
  display: flex;
  flex-direction: column;
  padding: clamp(1.2rem, 3vw, 2.4rem);
  background: rgba(255, 253, 246, 0.97);
  backdrop-filter: blur(14px);
  box-shadow: 0 28px 80px rgba(43, 38, 32, 0.28);
  animation: readerExpand 0.28s var(--ease);
}

.reader.is-expanded .reader-bookmark {
  position: absolute;
  top: -1px;
  left: clamp(1.15rem, 3vw, 2.35rem);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  max-width: min(26rem, calc(100% - 8rem));
  padding: 0.58rem 0.95rem 0.78rem;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(50% + 9px) calc(100% - 9px), 50% 100%, calc(50% - 9px) calc(100% - 9px), 0 calc(100% - 9px));
  background: linear-gradient(135deg, rgba(240, 220, 207, 0.98), rgba(229, 231, 214, 0.94));
  color: var(--clay-deep);
  box-shadow: 0 14px 28px -22px rgba(43, 38, 32, 0.55);
  font-size: 0.78rem;
  line-height: 1.2;
  z-index: 2;
}

.reader.is-expanded .reader-bookmark__label {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
}

.reader.is-expanded .reader-bookmark__title {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader.is-expanded .reader-top {
  padding-top: 1.45rem;
}

.reader.is-expanded .reader-body {
  max-height: none;
  flex: 1;
  font-size: calc(clamp(1.08rem, 2vw, 1.28rem) * var(--reader-font-scale, 1));
  padding-right: 0.8rem;
}

.reader.is-expanded .reader-progress {
  display: block;
}

.reader.is-expanded .font-controls {
  display: flex;
}

.reader.is-expanded .reader-nav {
  display: flex;
}

.reader.is-expanded .reader-expand {
  color: var(--clay);
  border-color: var(--clay);
}

@keyframes readerExpand {
  from {
    opacity: 0.4;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes softReaderIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Plays ---------- */
.play-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3.5vw, 2.4rem);
  box-shadow: var(--shadow-md);
}

.play-preview h3 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0.02em;
}

.play-preview .eyebrow {
  margin-bottom: 0.5rem;
}

.play-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.script-reader {
  margin-top: 1.5rem;
  background: #fffdf6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 3vw, 2rem);
  box-shadow: inset 0 0 0 1px #fff, var(--shadow-md);
  font-family: "Newsreader", Georgia, serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-height: 65vh;
  overflow-y: auto;
  animation: fadeUp 0.5s var(--ease);
}

.script-reader[hidden] {
  display: none;
}

.script-title-page,
.script-cast,
.script-pages {
  max-width: 820px;
  margin-inline: auto;
}

.script-title-page {
  text-align: center;
  padding: clamp(1.5rem, 4vw, 3rem) 1rem;
  border-bottom: 1px dashed var(--line-strong);
}

.script-title-page h3 {
  margin: 0.35rem 0 0.5rem;
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  color: var(--ink);
}

.script-title-page p:last-child {
  margin: 0;
  font-style: italic;
}

.script-cast {
  margin-top: 1.4rem;
  padding: clamp(1rem, 3vw, 1.6rem);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.script-cast h4 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  color: var(--ink);
}

.script-cast p,
.stage-direction,
.script-dialogue p {
  margin: 0;
}

.script-cast p + p {
  margin-top: 0.45rem;
}

.script-pages {
  margin-top: 1.5rem;
  padding: clamp(1rem, 3vw, 1.75rem);
  background: #fffef9;
  border: 1px solid rgba(211, 192, 151, 0.58);
  border-radius: var(--radius-sm);
}

.stage-direction {
  margin: 1.1rem 0;
  padding: 0.85rem 1rem;
  background: rgba(231, 244, 241, 0.72);
  border-left: 4px solid var(--sage);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
  font-style: italic;
}

.script-dialogue {
  display: grid;
  grid-template-columns: minmax(6rem, 9rem) 1fr;
  gap: clamp(0.75rem, 2vw, 1.2rem);
  padding: 0.85rem 0;
  border-bottom: 1px dashed rgba(211, 192, 151, 0.6);
}

.script-dialogue:last-child {
  border-bottom: 0;
}

.script-speaker {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 800;
  color: var(--rose-deep);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.4rem clamp(1.15rem, 5vw, 2.5rem);
  max-width: var(--container);
  margin-inline: auto;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.98rem;
}

.site-footer a {
  color: var(--clay);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-sitemap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 1rem;
}

.footer-sitemap a {
  color: var(--ink-soft);
}

.footer-sitemap a:hover {
  color: var(--clay);
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 120;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  color: #fbf6ea;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(18px) scale(0.8);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.to-top.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.to-top:hover {
  transform: translateY(-3px) scale(1.06);
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].in {
  opacity: 1;
  transform: none;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-intro-row {
    justify-content: center;
  }
  .hero-copy > p {
    margin-inline: auto;
  }
  .hero-divider {
    margin-inline: auto;
  }
  .mentor-note {
    margin-inline: auto;
    text-align: center;
    border-left: 0;
    border-top: 4px solid var(--sage);
    border-radius: var(--radius-sm);
  }
  .hero-actions,
  .hero-stats {
    justify-content: center;
  }
  .hero-art {
    max-width: 380px;
    margin-inline: auto;
    margin-top: 0;
    order: -1;
  }
  .hero-cues {
    display: none;
  }
  .author-books {
    grid-template-columns: 1fr;
  }
  .writing-tips {
    grid-template-columns: 1fr;
  }
  .story-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two-column {
    columns: 1;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: grid;
  }
  .main-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: clamp(1rem, 4vw, 2.5rem);
    left: clamp(1rem, 4vw, 2.5rem);
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding: 0.6rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  }
  .main-nav.open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .main-nav a {
    padding: 0.75rem 1rem;
  }
  .main-nav a::after {
    display: none;
  }
  .main-nav a.active {
    background: var(--tint-clay);
  }
  .reader-top {
    flex-direction: column;
  }
  .reader-tools {
    width: 100%;
    justify-content: space-between;
  }
  .font-controls {
    max-width: calc(100% - 3.5rem);
  }
  .reader-nav {
    flex-direction: column;
    align-items: stretch;
  }
  .reader-to-top {
    right: 1rem;
    bottom: 6.2rem;
  }
  .story-options {
    grid-template-columns: 1fr;
  }
  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .play-preview {
    flex-direction: column;
    align-items: flex-start;
  }
  .script-dialogue {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .story-option,
  .story-option::after,
  .story-option__title,
  .story-option__preview,
  .reader-progress__bar {
    transition: none;
  }
}
