/* Load after styles.css. Content stays visible without JavaScript or motion. */
:root {
  --motion-feedback: 160ms;
  --motion-panel: 240ms;
  --motion-entry: 400ms;
  --motion-ease-out: cubic-bezier(.22, .61, .36, 1);
}

html:not(.js) .js-only { display: none !important; }
html.cover-is-open { overflow: hidden; }

/* Only the heading and the existing open frame take part in the intro. */
.home-hero.hero-intro-play .hero-copy h1 {
  animation: hero-heading-entry var(--motion-entry) var(--motion-ease-out) both;
}
.home-hero.hero-intro-play .hero-portrait .portrait-frame.open-frame::before {
  animation: hero-frame-entry var(--motion-entry) var(--motion-ease-out) both;
}
@keyframes hero-heading-entry {
  from { transform: translateY(6px); }
  to { transform: translateY(0); }
}
@keyframes hero-frame-entry {
  from { opacity: .45; }
  to { opacity: 1; }
}

/* Replace the older ungated hover rules, including the former 4px arrow. */
a:hover svg,
.text-link:hover svg,
.button:hover svg,
.round-link:hover svg,
.work-entries a:hover svg,
.calendar-link:hover svg,
.cover-open:hover svg { transform: translateX(0); }
.button-dark:hover { background: var(--bordeaux); color: var(--paper); }
.button-light:hover { background: var(--rose); color: var(--bordeaux); }
.button-outline:hover { background: transparent; color: var(--bordeaux); }
.round-link:hover { background: transparent; color: var(--bordeaux); border-color: var(--clay); }
.site-nav a:hover::after { transform: scaleX(0); }
.site-nav a[aria-current]::after { transform: scaleX(1); }
a {
  transition:
    color var(--motion-feedback) var(--motion-ease-out),
    text-decoration-color var(--motion-feedback) var(--motion-ease-out);
}

.text-link,
.button,
.round-link,
.work-entries a,
.book-list-cover,
.site-nav a,
.theater-nav a,
.calendar-link,
.cover-open,
.episode-toggle,
.cover-viewer-close {
  transition:
    color var(--motion-feedback) var(--motion-ease-out),
    background-color var(--motion-feedback) var(--motion-ease-out),
    border-color var(--motion-feedback) var(--motion-ease-out),
    text-decoration-color var(--motion-feedback) var(--motion-ease-out);
}
a svg,
.text-link svg,
.button svg,
.round-link svg,
.work-entries svg,
.calendar-link svg,
.cover-open svg {
  flex-shrink: 0;
  transition: transform var(--motion-feedback) var(--motion-ease-out);
}
.site-nav a:not(.nav-contact)::after,
.theater-nav a::after {
  transition: transform var(--motion-feedback) var(--motion-ease-out);
}
.book-list-cover .book-cover {
  transition: transform var(--motion-feedback) var(--motion-ease-out);
}
a:focus-visible svg,
.text-link:focus-visible svg,
.button:focus-visible svg,
.round-link:focus-visible svg,
.work-entries a:focus-visible svg,
.calendar-link:focus-visible svg,
.cover-open:focus-visible svg { transform: translateX(3px); }
.book-list-cover:focus-visible .book-cover { transform: translateY(-3px); }
.button-dark:focus-visible { background: #6a1d30; }
.button-light:focus-visible { background: var(--paper); }
.button-outline:focus-visible,
.round-link:focus-visible { background: var(--bordeaux); color: var(--paper); border-color: var(--bordeaux); }
.site-nav a:focus-visible::after { transform: scaleX(1); }

@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-color: var(--rose); }
  a:hover svg,
  .text-link:hover svg,
  .button:hover svg,
  .round-link:hover svg,
  .work-entries a:hover svg,
  .calendar-link:hover svg,
  .cover-open:hover svg { transform: translateX(3px); }
  .book-list-cover:hover .book-cover { transform: translateY(-3px); }
  .button-dark:hover { background: #6a1d30; }
  .button-light:hover { background: var(--paper); }
  .button-outline:hover,
  .round-link:hover { background: var(--bordeaux); color: var(--paper); border-color: var(--bordeaux); }
  .site-nav a:hover::after,
  .theater-nav a:hover::after { transform: scaleX(1); }
}
@media (hover: none), (pointer: coarse) {
  a:hover:not(:focus-visible) { text-decoration-color: currentColor; }
}

/* Native details: immediate layout change, one short content fade per opening. */
.episode-disclosure { margin-top: 16px; min-width: 0; }
.episode-disclosure > .episode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 0;
  border-bottom: 1px solid currentColor;
  color: var(--bordeaux);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  list-style: none;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.episode-toggle::-webkit-details-marker { display: none; }
.episode-toggle::marker { content: ''; }
.disclosure-icon { flex-shrink: 0; width: 1em; text-align: center; }
.episode-disclosure[open] > .episode-toggle { border-bottom-color: var(--rose); }
.episode-panel { max-width: 840px; min-width: 0; padding: 24px 0 6px; }
.episode-panel > :first-child { margin-top: 0; }
.episode-disclosure[open] > .episode-panel {
  animation: episode-content-entry var(--motion-panel) var(--motion-ease-out) both;
}
@keyframes episode-content-entry {
  from { opacity: .6; }
  to { opacity: 1; }
}

/* The unchanged caption keeps the wrapper height stable when a player loads. */
.embed-shell,
.embed-shell.is-loaded,
.embed-shell.embed-audio,
.embed-shell.embed-audio.is-loaded,
.media-grid .embed-shell,
.media-grid .embed-shell.is-loaded,
.episode-detail > .embed-shell,
.episode-detail > .embed-shell.is-loaded,
.episode-detail > .embed-audio,
.episode-detail > .embed-audio.is-loaded {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  min-width: 0;
  padding: 0;
  aspect-ratio: auto;
  overflow: hidden;
}
.embed-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.embed-audio .embed-slot {
  height: 352px;
  min-height: 352px;
  aspect-ratio: auto;
}
.embed-shell .embed-slot iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.embed-shell .embed-slot .embed-button {
  min-height: 48px;
  max-width: calc(100% - 36px);
  margin: 0;
  padding: 13px 18px;
  gap: 16px;
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
}
.embed-caption { min-width: 0; padding: 24px 30px 28px; border-top: 1px solid var(--rose); }
.embed-shell .embed-caption .eyebrow { font-size: 11px; line-height: 1.6; }
.embed-shell .embed-caption .embed-title {
  max-width: none;
  margin-top: 12px !important;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.embed-shell .embed-caption .embed-notice {
  max-width: 60ch;
  margin-top: 15px !important;
  font-size: 12px !important;
  line-height: 1.65;
  opacity: .9;
}

.theater-nav { display: flex; flex-wrap: wrap; gap: 10px 28px; max-width: 100%; margin-top: 0; margin-bottom: 32px; }
.theater-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 0;
  color: var(--bordeaux);
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.theater-nav a::after {
  position: absolute;
  right: 0;
  bottom: 3px;
  left: 0;
  height: 1px;
  background: currentColor;
  content: '';
  transform: scaleX(0);
  transform-origin: left;
}
.theater-nav a[aria-current='location']::after,
.theater-nav a:focus-visible::after { transform: scaleX(1); }
[data-theater-section] { scroll-margin-top: 24px; }
.performance-details .calendar-link {
  min-height: 44px;
  max-width: 100%;
  margin-top: 16px;
  padding-block: 8px;
  gap: 10px;
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
}

.book-detail .book-display { flex-direction: column; gap: 22px; }
.cover-open,
.cover-viewer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: var(--bordeaux);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  white-space: normal;
}
.cover-open { flex-shrink: 0; }
.cover-viewer {
  position: fixed;
  inset: 0;
  width: min(calc(100% - 40px), 760px);
  max-width: calc(100% - 40px);
  max-height: calc(100vh - 40px);
  max-height: calc(100svh - 40px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--clay);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}
.cover-viewer::backdrop { background: rgb(36 33 38 / .65); }
.cover-viewer[open] { animation: cover-dialog-entry var(--motion-panel) var(--motion-ease-out) both; }
.cover-viewer-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; min-width: 0; padding: clamp(20px, 4vw, 36px); }
.cover-viewer-close { align-self: flex-end; flex-shrink: 0; }
.cover-viewer #cover-viewer-title {
  max-width: 100%;
  margin: 0;
  color: var(--bordeaux);
  font-family: var(--body);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: center;
  overflow-wrap: anywhere;
}
.cover-viewer-image {
  display: block;
  align-self: center;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 220px);
  max-height: calc(100svh - 220px);
  object-fit: contain;
}
@keyframes cover-dialog-entry {
  from { opacity: .6; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .js .site-header .site-nav[data-state='opening'],
  .js .site-header .site-nav[data-state='open'],
  .js .site-header .site-nav[data-state='closing'] {
    display: flex;
    min-width: 0;
    max-height: calc(100vh - 86px);
    max-height: calc(100svh - 86px);
    overflow-x: hidden;
    overflow-y: auto;
  }
  .js .site-header .site-nav[data-state='closed'] { display: none; }
  .js .site-header .site-nav[data-state='opening'],
  .js .site-header .site-nav[data-state='open'] { animation: site-nav-entry var(--motion-panel) var(--motion-ease-out) both; }
  .js .site-header .site-nav[data-state='closing'] { animation: site-nav-exit var(--motion-panel) var(--motion-ease-out) both; }
  .js .site-header .site-nav[data-state='open'] { opacity: 1; transform: none; }
  .theater-nav { margin-bottom: 24px; }
}
@keyframes site-nav-entry {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes site-nav-exit {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-6px); }
}
@media (max-width: 700px) {
  .episode-panel { padding-top: 20px; }
  .embed-caption { padding: 20px 22px 23px; }
  .embed-shell .embed-caption .embed-title { font-size: 25px; }
  .theater-nav { gap: 6px 22px; margin-top: 0; }
  .theater-nav a { font-size: 12px; }
  .cover-viewer { width: calc(100% - 24px); max-width: calc(100% - 24px); max-height: calc(100vh - 24px); max-height: calc(100svh - 24px); }
  .cover-viewer-inner { gap: 16px; padding: 18px; }
  .cover-viewer-image { max-height: calc(100vh - 200px); max-height: calc(100svh - 200px); }
}
@media (prefers-reduced-motion: reduce) {
  :root { --motion-feedback: 0ms; --motion-panel: 0ms; --motion-entry: 0ms; }
  .home-hero.hero-intro-play .hero-copy h1,
  .home-hero.hero-intro-play .hero-portrait .portrait-frame.open-frame::before,
  .episode-disclosure[open] > .episode-panel,
  .cover-viewer[open],
  .js .site-header .site-nav[data-state] { animation: none !important; }
  .hero-copy h1,
  a svg,
  .text-link svg,
  .button svg,
  .round-link svg,
  .work-entries svg,
  .calendar-link svg,
  .cover-open svg,
  .book-list-cover .book-cover { transform: none !important; }
}
