:root {
  color-scheme: light;
  --paper: #f7f3eb;
  --ink: #23241d;
  --muted: #625e51;
  --night: #161712;
  --gold: #efc477;
  --rule: #d7cebe;
  --display: Baskerville, "Palatino Linotype", Palatino, Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--body);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: .26em; }
img { display: block; max-width: 100%; }
figure, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #9b5817; outline-offset: 4px; }
.projection :focus-visible, .site-header :focus-visible, .hero :focus-visible { outline-color: #ffd795; }

h1, h2, h3, .brand {
  margin: 0;
  font: 400 1rem/1.05 var(--display);
}

h1 { font-size: clamp(2.8rem, 8vw, 6.1rem); letter-spacing: -.055em; }
h2 { font-size: clamp(2.1rem, 5vw, 3.8rem); letter-spacing: -.045em; }
h3 { font-size: clamp(1.5rem, 2.4vw, 2.15rem); letter-spacing: -.033em; }
.wrap { width: min(100% - 3rem, 80rem); margin-inline: auto; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; }
.skip { position: absolute; z-index: 4; left: 1rem; top: .7rem; transform: translateY(-160%); background: white; color: black; padding: .65rem 1rem; }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.site-header, .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.65rem;
  padding: .5rem max(1.5rem, calc((100% - 80rem)/2));
}
.site-header { min-height: 4.1rem; background: var(--night); color: #fbf3e5; }
.site-header nav { display: flex; gap: clamp(.85rem, 3vw, 2.25rem); }
.site-header a, .site-footer a { display: flex; align-items: center; min-height: 44px; text-decoration: none; }
.site-header a:hover, .site-footer a:hover { text-decoration: underline; }
.site-header nav, .site-footer > a:not(.brand) { font-size: .86rem; }
.brand { font-size: clamp(1.1rem, 2.7vw, 1.45rem); white-space: nowrap; }
.brand i { color: #c58f44; padding-inline: .27em; }
.site-footer { justify-content: flex-start; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-block: 1.25rem; }
.site-footer .brand { margin-right: auto; }

.hero {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 4.1rem);
  min-height: calc(100svh - 4.1rem);
  display: grid;
  align-items: end;
  background: #222119;
  overflow: hidden;
  color: #fff5e3;
}
.hero-art {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: center 37%;
  z-index: -2;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(18deg, #12120fec 0%, #17160f73 30%, #17160f00 62%);
}
.hero-copy {
  padding: 3rem 0 clamp(2.8rem, 7vh, 5.3rem);
  margin-left: max(1.5rem, calc((100% - 80rem)/2));
  width: fit-content;
  animation: enter .65s ease-out both;
}
.hero-copy h1 { font-size: clamp(4.4rem, 10.1vw, 10.2rem); line-height: .78; text-shadow: 0 2px 32px #21190787; }
.hero-copy h1 em, .book-intro h1 em { color: var(--gold); font-weight: normal; }
.hero-copy p { margin: 1.4rem 0 1.55rem; font-size: clamp(1rem, 1.6vw, 1.23rem); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .63rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 2rem;
  text-decoration: none;
  font-size: .93rem;
  font-weight: 650;
  transition: background-color .2s, color .2s, transform .2s;
}
.gold { color: #211a10; background: var(--gold); }
.gold:hover { background: #ffda95; transform: translateY(-2px); }
.section { padding-block: clamp(3rem, 8vw, 7rem); }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.95rem; }
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.3rem clamp(1rem, 3vw, 2rem); }
.story-card { display: block; text-decoration: none; }
.story-art { overflow: hidden; aspect-ratio: 1.65; background: #e8dfd0; }
.story-art img { width: 100%; height: 100%; object-fit: contain; transition: transform .38s ease; }
.story-card:hover img { transform: scale(1.025); }
.story-caption { display: grid; gap: .35rem; padding: .75rem 0; border-bottom: 1px solid var(--rule); }
.story-caption span, .availability, .eyebrow, .excerpt-label { font-size: .87rem; color: var(--muted); }

.reader-intro { padding-block: 1.3rem 1.85rem; }
.reader-intro h1 { font-size: clamp(2.5rem, 6.6vw, 5rem); margin-block: .5rem; }
.reader-intro p { color: var(--muted); }
.reader-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; gap: clamp(1.25rem, 3vw, 3.5rem); padding-bottom: 4.5rem; }
.reader-player { min-width: 0; }
.frame { display: grid; place-items: center; height: clamp(17rem, 55vh, 46rem); overflow: hidden; background: #191914; }
.frame img { width: 100%; height: 100%; min-height: 0; min-width: 0; object-fit: contain; touch-action: pan-y pinch-zoom; }
.frame:has(.reader-opening) { position: relative; }
.frame:has(.reader-opening:not(.leaving)) [data-image] { visibility: hidden; }
.reader-opening {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  gap: .55rem;
  padding: clamp(.55rem, 2vw, 1.25rem);
  background: #f5efdf;
  color: #201810;
}
.opening-layout {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: .5rem;
  width: 100%;
  min-height: 0;
  text-align: center;
}
.frame .opening-layout img { display: block; width: 100%; height: 100%; max-height: 100%; }
.reader-opening.portrait .opening-layout {
  grid-template: minmax(0, 1fr) / repeat(2, minmax(0, 1fr));
  gap: clamp(.65rem, 2vw, 2rem);
  justify-items: stretch;
  text-align: left;
}
.opening-title {
  margin: 0;
  color: #201810;
  font: italic clamp(1.3rem, 3.35vw, 3.75rem)/1.04 Baskerville, Georgia, serif;
  text-wrap: balance;
}
.opening-author { margin: .35rem 0 0; font: clamp(.8rem, 1.45vw, 1.2rem)/1.25 Georgia, serif; }
.opening-skip { color-scheme: light; }
.reader-opening.leaving { opacity: 0; transition: opacity .5s ease-in; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .reader-opening.leaving { transition: none; } }
.reader-controls { margin-top: .65rem; }
.reader-navigator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem .8rem;
  margin-bottom: .65rem;
}
.reader-navigator progress { width: 100%; height: .4rem; accent-color: #8b5e28; }
.reader-navigator .reading-gallery {
  position: relative;
  grid-column: 1 / -1;
  display: flex;
  gap: .55rem;
  overflow-x: auto;
  padding: .3rem;
}
.reader-navigator .reading-gallery button {
  flex: 0 0 5.5rem;
  aspect-ratio: 4 / 3;
  padding: .18rem;
  border: 2px solid var(--rule);
  border-radius: .35rem;
  background: #e8dfd1;
}
.reader-navigator .reading-gallery button[aria-current] { border-color: #8b5e28; }
.reader-navigator .reading-gallery img { width: 100%; height: 100%; object-fit: contain; }
audio { display: block; width: 100%; height: 50px; }
.sequence { display: flex; align-items: center; justify-content: space-between; gap: .3rem; padding-block: .65rem; }
.sequence output { font-size: .84rem; text-align: center; font-variant-numeric: tabular-nums; }
.step { background: transparent; color: inherit; border: 1px solid currentColor; border-radius: 1.5rem; padding: .45rem .9rem; min-height: 44px; font-size: .87rem; white-space: nowrap; }
.step:hover:not([aria-disabled="true"]) { background: #98773324; }
.step[aria-disabled="true"] { opacity: .53; cursor: default; }
.view-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.feedback { margin-top: .5rem; font-size: .94rem; }
.story-text { min-width: 0; overflow-wrap: anywhere; scroll-margin-top: 1rem; }
.story-text h2 { font-size: 2.15rem; margin-bottom: .95rem; }
.story-text p { font: 1.25rem/1.52 var(--display); margin-bottom: .85rem; white-space: pre-line; }
.story-text .excerpt-label { font: 600 .84rem/1.4 var(--body); }
.story-text details { padding-block: .65rem; border-top: 1px solid var(--rule); }
.story-text summary { cursor: pointer; min-height: 2.75rem; display: list-item; padding-block: .45rem; }
.story-text .credits p { font: .94rem/1.65 var(--body); }
.credits ul { padding-left: 1.15rem; font-size: .9rem; }
.credits li + li { margin-top: .55rem; }
.credits h3 { font-size: 1.4rem; }
.projection { color-scheme: dark; background: #11110e; color: #fff5e3; min-height: 100vh; }
.projection .reader-layout { display: block; width: min(100% - 3rem, 112rem); padding-bottom: 1rem; }
.projection .reader-intro { width: min(100% - 3rem, 112rem); padding-block: .45rem .75rem; }
.projection .reader-intro h1 { font-size: clamp(1.65rem, 3.2vw, 3.15rem); margin-bottom: .25rem; }
.projection .reader-intro p { color: #d5c7b1; font-size: .9rem; }
.projection .frame { height: min(74vh, 62rem); background: #090907; }
[data-story-background="cream"] :is(.frame, .reader-opening) { background: #f5e8d2; }
.projection .sequence output, .projection .step, .projection .view-tools .text-link { font-size: clamp(.95rem, 1.65vw, 1.25rem); }
.projection .reader-controls { max-width: 50rem; margin-inline: auto; }
.reader-player:fullscreen, .screen-expanded .reader-player {
  background: #090907;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0 1.2rem .65rem;
}
.screen-expanded .reader-player { position: fixed; inset: 0; z-index: 3; }
:is(.reader-player:fullscreen, .screen-expanded .reader-player) .frame { height: 100%; }
:is(.reader-player:fullscreen, .screen-expanded .reader-player) .reader-controls { width: min(100%, 57rem); color: #fff5e3; }
@media (min-width: 950px) and (min-height: 480px) {
  .reading .reader-player { position: sticky; top: 1.15rem; }
}
@media (orientation: landscape) and (min-width: 850px) {
  .projection .reader { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); }
  .projection .reader-player { display: grid; height: 100%; grid-template-rows: minmax(0, 1fr) auto; }
  .projection .frame { height: 100%; }
  .projection .reader-controls { width: min(100%, 50rem); }
}

.book { padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.book-intro { max-width: 54rem; margin-bottom: 3rem; }
.book-intro h1 { margin-block: .7rem; }
.book-intro h1 em { color: #90551f; }
.book-intro > p:last-child { max-width: 35rem; color: var(--muted); }
.leaf {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 5rem);
  padding: clamp(1.35rem, 6vw, 5.5rem);
  background: #eae2d4;
}
.leaf-copy p { margin-block: 1rem 1.45rem; max-width: 28rem; }
.paper figure { margin-inline: auto; max-width: 27rem; animation: enter .28s ease-out both; }
.paper img { width: 100%; height: auto; background: white; box-shadow: .2rem .7rem 2rem #4c38294d; }
.editions { padding-top: clamp(2.5rem, 7vw, 5.3rem); }
.edition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 2.5rem; margin-top: 1.2rem; }
.edition-grid section { display: grid; justify-items: start; align-content: start; gap: .8rem; border-top: 1px solid var(--rule); padding-block: 1.15rem; }
.availability { border-left: 2px solid #a87b41; padding-left: .65rem; }
.message { padding-block: 3.5rem; }
.message p { margin-block: 1rem; }
.message :is(.button, #checkout) { margin-top: 1.3rem; }
@keyframes enter {
  from { opacity: 0; transform: translateY(.45rem); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-aspect-ratio: 19/10) and (min-width: 731px) {
  .hero::after {
    content: "";
    position: absolute;
    inset: -2rem;
    z-index: -3;
    background: center / cover no-repeat url("../media/char-de-feu.webp");
    filter: blur(1.6rem) brightness(.42);
  }
  .hero-art { object-fit: contain; object-position: center; }
}
@media (max-width: 950px) {
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reader-layout { gap: 1.5rem; }
}
@media (max-width: 730px) {
  .wrap { width: calc(100% - 2rem); }
  .site-header, .site-footer { padding-inline: 1rem; }
  .hero { display: flex; flex-direction: column; align-items: stretch; min-height: auto; }
  .hero::before { display: none; }
  .hero-art { position: static; height: auto; object-fit: contain; }
  .hero-copy { margin-inline: 1.25rem; padding: 1.6rem 0 2rem; }
  .hero-copy h1 { font-size: clamp(3.55rem, 13vw, 6.15rem); line-height: .92; }
  .hero-copy p { margin-block: .8rem 1.15rem; }
  .reader-layout { grid-template-columns: minmax(0, 1fr); padding-bottom: 2.75rem; }
  .reading .frame { height: auto; min-height: 0; }
  .reading .frame:has(.reader-opening) { min-height: clamp(16rem, 58svh, 27rem); }
  .reading .frame img { width: auto; height: auto; max-height: 53vh; max-height: 53svh; }
  .leaf, .edition-grid { grid-template-columns: minmax(0, 1fr); }
  .paper { grid-row: 2; }
}
@media (max-width: 390px) {
  .story-grid { gap: 1.2rem .85rem; }
  .story-caption h3 { font-size: 1.32rem; }
  .site-header nav { gap: .75rem; }
  .site-header { gap: .55rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

.tv-phone {
  max-width: 46rem;
  padding-block: clamp(2rem, 6vw, 4.5rem);
}
.tv-phone h1 {
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  margin-bottom: 1.4rem;
}
.tv-steps { padding-left: 1.55rem; }
.tv-steps li + li { margin-top: .65rem; }
.tv-address { overflow-wrap: anywhere; }
.tv-help { margin-block: 1rem 1.5rem; border-block: 1px solid var(--rule); padding: .6rem 0; }
.tv-help summary { cursor: pointer; min-height: 44px; padding-block: .4rem; }
.tv-help p { margin-bottom: .6rem; }
.tv-form { display: grid; max-width: 30rem; gap: .55rem; margin-block: 1.4rem; }
.tv-form label { font-weight: 650; }
.tv-form input, .tv-form select {
  min-height: 48px;
  min-width: 0;
  background: #fffdfa;
  color: var(--ink);
  border: 1px solid #736956;
  border-radius: .4rem;
  padding: .55rem .65rem;
  font: inherit;
}
.tv-form input { width: 10ch; font-size: 1.35rem; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.tv-form select { margin-bottom: .3rem; }
.tv-form button { justify-self: start; }
.tv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1rem; }
.tv-phone .feedback { margin-bottom: .65rem; min-height: 1.5em; }
.tv-control-group { padding-block: 1rem; border-block: 1px solid var(--rule); }
.tv-control-group > p { margin-block: .6rem 1rem; }
.tv-playback-actions { margin-bottom: .65rem; }
.tv-phone .tv-actions button:disabled { opacity: .53; cursor: default; }
.tv-phone .tv-actions .step:disabled:hover { background: transparent; }
.tv-reader-links { margin-block: .85rem 1.4rem; }

.tv-lobby { min-height: 100vh; display: grid; align-items: center; padding: 2rem clamp(1rem, 5vw, 5rem); }
.tv-card { width: min(100%, 70rem); margin-inline: auto; }
.tv-card .brand { display: inline-block; font-size: clamp(1.35rem, 3vw, 2rem); margin-bottom: 1rem; }
.tv-card .brand i { padding: 0; }
.tv-card h1 { font-size: clamp(2.65rem, 6vw, 5.5rem); }
.tv-card p:not(.brand) { font-size: clamp(1.1rem, 2.15vw, 1.85rem); line-height: 1.4; margin-block: .7rem; }
.tv-card .feedback { color: #decdb5; }
.tv-pairing { display: grid; grid-template-columns: minmax(0, 1fr) clamp(9rem, 18vw, 15rem); gap: 1.5rem 3rem; align-items: center; margin-block: 1rem; }
.tv-code { display: inline-block; font-size: clamp(2.6rem, 7vw, 6.25rem); color: var(--gold); letter-spacing: .12em; font-variant-numeric: tabular-nums; font-weight: 650; }
.tv-qr svg { display: block; width: 100%; height: auto; }
.tv-lobby .button, .tv-lobby .step { font-size: clamp(1rem, 1.7vw, 1.4rem); }
.tv-stage {
  width: 100%;
  height: calc(100vh - 4rem);
  height: calc(100dvh - 4rem);
  min-height: 17rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: .55rem;
}
.tv-stage:fullscreen { background: #090907; padding: .75rem 1.25rem; }
.tv-stage h1 { font-size: clamp(1.6rem, 3vw, 3rem); }
.tv-stage-opening { grid-template-rows: minmax(0, 1fr) auto auto; }
.tv-stage-opening > h1 { display: none; }
.tv-stage .frame { height: 100%; }
.tv-stage .feedback { margin: 0; color: var(--gold); }

@media (max-width: 580px) {
  .tv-pairing { grid-template-columns: 1fr; }
  .tv-qr { width: 9rem; }
}
