.desk-opening {
  --opening-ink: #203b4b;
  --opening-muted: #53707f;
  --opening-accent: #1e40af;
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
  color: var(--opening-ink);
  background: radial-gradient(ellipse at 28% 5%, #fffefa 0, transparent 54%), linear-gradient(165deg, #f4f7f5 20%, #dce8ee 68%, #abc7d7);
  font-family: inherit;
  isolation: isolate;
}
.desk-opening *, .desk-opening *::before, .desk-opening *::after { box-sizing: border-box; }
.desk-opening::before {
  content: "";
  position: absolute;
  left: -15%;
  right: -15%;
  height: 54%;
  bottom: -35%;
  border-radius: 50%;
  border: 1px solid #88a8b759;
  background: linear-gradient(#ffffff47, #ecf4f4);
  transform: rotate(-7deg);
  pointer-events: none;
}
.opening-topline {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  left: max(32px, env(safe-area-inset-left));
  right: max(32px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 8;
}
.opening-brand { font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.opening-brand i { display: inline-block; width: 5px; height: 5px; margin: 0 0 2px 8px; border-radius: 50%; background: var(--opening-accent); }
.opening-skip { min-height: 44px; padding: 10px 14px; border: 1px solid #52717f40; border-radius: 24px; color: var(--opening-ink); background: #f7faf7ad; font: inherit; font-size: 13px; cursor: pointer; }
.opening-copy { position: absolute; z-index: 5; top: clamp(82px, 11vh, 118px); width: 100%; padding: 0 24px; text-align: center; pointer-events: none; transition: top .5s ease; }
.opening-byline { margin: 0 0 14px; color: var(--opening-muted); font-size: 12px; letter-spacing: .08em; }
.opening-copy h2 { margin: 0; font-size: clamp(38px, 4.8vw, 66px); font-weight: 500; letter-spacing: -.06em; line-height: 1.02; }
.opening-copy h2 span { display: block; }
.opening-copy h2 span:last-child { color: #607e8c; }
.opening-stage { position: absolute; inset: max(225px, 28vh) 0 158px; perspective: 1500px; perspective-origin: 50% 35%; pointer-events: none; transition: inset .5s ease; }
.opening-chapter { position: absolute; top: 0; left: 20px; right: 20px; display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 26px; opacity: 0; font-size: 12px; font-weight: 650; letter-spacing: .025em; transition: opacity .4s ease; }
.opening-chapter-steps { display: flex; gap: 5px; }
.opening-chapter-steps i { width: 18px; height: 3px; border-radius: 2px; background: #adc2cb; }
.opening-chapter-steps i.is-current { background: var(--opening-accent); }
.opening-orbit { position: absolute; width: 0; height: 0; left: 50%; top: 35%; transform-style: preserve-3d; }
.opening-cohort { position: absolute; width: 0; height: 0; transform-style: preserve-3d; }
.opening-page { position: absolute; display: flex; flex-direction: column; top: calc(var(--opening-card-height, 138px) / -2); left: calc(var(--opening-card-width, 202px) / -2); width: var(--opening-card-width, 202px); height: var(--opening-card-height, 138px); padding: 5px; background: #f9fbf9; border: 1px solid #d1dee3; border-radius: 5px; box-shadow: inset 0 1px 0 #ffffffeb, 0 2px 0 #b9cdd6, 0 4px 0 #e9f0f2, 1px 8px 12px #21475b21, 4px 23px 38px #21475b1c; transform-origin: center; backface-visibility: hidden; overflow: hidden; opacity: 0; }
.opening-page::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 1px 1px 0 #ffffff99, inset -1px -1px 0 #3e627316; pointer-events: none; }
.opening-page-header { flex: 0 0 22px; display: flex; align-items: center; justify-content: space-between; padding: 0 3px 4px; gap: 8px; color: #304f5e; font-size: 9px; font-weight: 650; white-space: nowrap; }
.opening-page-header span:first-child { overflow: hidden; text-overflow: ellipsis; }
.opening-page-header span:last-child { color: #637e89; font-size: 7px; font-variant-numeric: tabular-nums; }
.opening-page-image { display: block; width: 100%; height: 0; flex: 1 1 auto; min-height: 0; object-fit: cover; object-position: center top; border: 1px solid #dce5e8; border-radius: 2px; }
.opening-page-referral { flex: 1; min-height: 0; padding: 10px; display: grid; align-content: center; gap: 5px; color: #304f5e; background: #edf3f5; border: 1px solid #dce5e8; font-size: 13px; font-weight: 650; }
.opening-page-referral small { font-size: 8px; font-weight: 400; }
.opening-page-referral svg { width: 22px; height: 22px; color: var(--opening-accent); }
.opening-spiney { position: absolute; left: calc(50% - 250px); bottom: 0; width: 180px; height: 210px; z-index: 4; transform-origin: 50% 100%; }
.opening-spiney > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.opening-spiney, .opening-ground { transition: width .45s ease, height .45s ease, left .45s ease; }
.opening-copy h2 { transition: font-size .45s ease; }
@media (min-width: 1101px) {
  .desk-opening[data-chapter] .opening-spiney { width: 96px; height: 112px; left: 24px; }
  .desk-opening[data-chapter] .opening-ground { width: 96px; left: 24px; }
  .desk-opening[data-chapter] .opening-copy { top: 20px; }
  .desk-opening[data-chapter] .opening-byline { margin-bottom: 6px; }
  .desk-opening[data-chapter] .opening-copy h2 { font-size: 22px; }
  .desk-opening[data-chapter] .opening-stage { inset: 92px 0 148px; }
}
.desk-opening[data-ready="false"] :is(.opening-spiney, .opening-ground) { opacity: 0; }
.opening-spiney .outfit { display: none; }
.desk-opening[data-outfit="rain"] .opening-spiney .outfit-rain,
.desk-opening[data-outfit="snow"] .opening-spiney .outfit-snow,
.desk-opening[data-outfit="sun"] .opening-spiney .outfit-sun,
.desk-opening[data-outfit="party"] .opening-spiney .outfit-party,
.desk-opening[data-outfit="sleepy"] .opening-spiney .outfit-sleepy,
.desk-opening[data-outfit="hero"] .opening-spiney .outfit-hero,
.desk-opening[data-outfit="chef"] .opening-spiney .outfit-chef,
.desk-opening[data-outfit="soccer"] .opening-spiney .outfit-soccer { display: initial; }
.desk-opening[data-outfit="snow"] .opening-spiney .scarf,
.desk-opening[data-outfit="sun"] .opening-spiney .scarf,
.desk-opening[data-outfit="party"] .opening-spiney .scarf,
.desk-opening[data-outfit="sleepy"] .opening-spiney .scarf,
.desk-opening[data-outfit="hero"] .opening-spiney .scarf,
.desk-opening[data-outfit="chef"] .opening-spiney .scarf,
.desk-opening[data-outfit="soccer"] .opening-spiney .scarf { display: none; }
.opening-spiney .buddy, .opening-spiney .wave, .opening-spiney .arm-left,
.opening-spiney .opening-coat-left, .opening-spiney .opening-coat-right,
.opening-spiney .leg-left, .opening-spiney .leg-right,
.opening-spiney .opening-head { transform-box: view-box; }
.opening-spiney .buddy { transform-origin: 75px 160px; }
.opening-spiney .wave, .opening-spiney .opening-coat-right { transform-origin: 96px 81px; }
.opening-spiney .arm-left, .opening-spiney .opening-coat-left { transform-origin: 56px 83px; }
.opening-spiney .leg-left { transform-origin: 61px 146px; }
.opening-spiney .leg-right { transform-origin: 88px 145px; }
.opening-spiney .opening-head { transform-origin: 75px 67px; }
.opening-hand-pages { opacity: 0; pointer-events: none; }
.opening-greeting { position: absolute; z-index: 6; left: calc(50% - 32px); bottom: 46px; width: 370px; margin: 0; padding: 17px 20px; border: 1px solid #c3d5dd; border-radius: 16px 16px 16px 4px; background: #fbfdfb; box-shadow: 0 8px 20px #244b5e0d; opacity: 0; }
.opening-greeting::after { content: ""; position: absolute; width: 14px; height: 14px; left: -7px; bottom: 19px; background: #fbfdfb; border-left: 1px solid #c3d5dd; border-bottom: 1px solid #c3d5dd; transform: rotate(45deg); }
.opening-greeting strong, .opening-greeting span { display: block; position: relative; z-index: 1; }
.opening-greeting strong { font-size: 20px; font-weight: 600; letter-spacing: -.025em; line-height: 1.3; }
.opening-greeting span:not(:empty) { margin-top: 7px; color: #486777; font-size: 15px; line-height: 1.45; }
.opening-ground { position: absolute; bottom: -1px; left: calc(50% - 250px); width: 180px; height: 20px; background: radial-gradient(ellipse, #3761792e, transparent 66%); border-radius: 50%; }
.opening-static-story { position: absolute; top: 0; bottom: 230px; left: 50%; width: min(560px, calc(100% - 40px)); transform: translateX(-50%); overflow: auto; overscroll-behavior: contain; padding: 18px 22px; border: 1px solid #c3d5dd; border-radius: 14px; background: #fbfdfb; font-size: 14px; line-height: 1.5; pointer-events: auto; }
.opening-static-story p { margin: 0 0 13px; }
.opening-static-story p:last-child { margin-bottom: 0; }
.opening-static-story ol { margin: 0 0 13px; padding-left: 22px; }
.opening-static-story li { margin-bottom: 10px; padding-left: 4px; }
.opening-static-story li strong, .opening-static-story li span { display: block; }
.opening-static-story li strong { color: #53707f; font-size: 11px; margin-bottom: 3px; }
.desk-opening[data-reduced="true"] .opening-greeting, .desk-opening[data-reduced="true"] .opening-orbit, .desk-opening[data-reduced="true"] .opening-chapter, .desk-opening[data-reduced="true"] .opening-progress { display: none; }
.desk-opening[data-reduced="true"] .opening-spiney, .desk-opening[data-reduced="true"] .opening-ground { left: calc(50% - 90px); }
.opening-actions { position: absolute; z-index: 8; left: 20px; right: 20px; bottom: max(20px, env(safe-area-inset-bottom)); text-align: center; }
.opening-enter { display: inline-flex; gap: 24px; align-items: center; justify-content: center; min-height: 48px; padding: 14px 22px; color: #f9fbf9; background: #294c60; border: 1px solid #294c60; border-radius: 28px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.opening-enter svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.opening-actions p { margin: 10px 0 0; color: #486777; font-size: 12px; }
.opening-preference { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 6px 10px; color: #486777; font-size: 12px; line-height: 1.3; cursor: pointer; }
.opening-preference input { width: 16px; height: 16px; margin: 0; accent-color: var(--opening-accent); cursor: pointer; }
.opening-actions .opening-preference-note { margin: 0; font-size: 11px; }
.desk-opening :is(button, input, .opening-static-story):focus-visible { outline: 3px solid var(--opening-accent); outline-offset: 4px; }
.desk-opening button:hover { border-color: var(--opening-accent); }
.opening-progress { position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: #1e40af; transform: scaleX(0); transform-origin: left center; }
@media (max-width: 1100px) {
  .opening-copy h2 { font-size: clamp(38px, 5vw, 55px); }
  .opening-stage { inset: 250px 0 154px; }
  .opening-spiney { width: 155px; height: 180px; left: calc(50% - 230px); }
  .opening-ground { left: calc(50% - 230px); width: 155px; }
  .opening-greeting { left: calc(50% - 35px); width: 340px; bottom: 32px; }
  .opening-greeting strong { font-size: 18px; }
  .opening-greeting span:not(:empty) { font-size: 14px; }
  .opening-page-header { flex-basis: 20px; font-size: 8px; }
  .opening-page-referral { padding: 4px; gap: 3px; font-size: 9px; line-height: 1.15; overflow: hidden; }
  .opening-page-referral svg { width: 14px; height: 14px; }
  .opening-page-referral small { display: none; }
  .opening-static-story { bottom: 195px; }
  .desk-opening[data-reduced="true"] .opening-spiney, .desk-opening[data-reduced="true"] .opening-ground { left: calc(50% - 77px); }
  .desk-opening[data-chapter] .opening-copy { top: 16px; }
  .desk-opening[data-chapter] .opening-byline { margin-bottom: 4px; }
  .desk-opening[data-chapter] .opening-copy h2 { font-size: 20px; }
  .desk-opening[data-chapter] .opening-stage { inset: 84px 0 140px; }
  .desk-opening[data-chapter] .opening-spiney { width: 80px; height: 94px; left: 16px; }
  .desk-opening[data-chapter] .opening-ground { width: 80px; left: 16px; }
}
@media (max-width: 720px) {
  .opening-topline { top: max(16px, env(safe-area-inset-top)); left: 20px; right: 20px; }
  .opening-copy { top: clamp(88px, 12vh, 116px); padding: 0 18px; }
  .opening-byline { font-size: 10px; letter-spacing: .06em; margin-bottom: 14px; }
  .opening-copy h2 { font-size: clamp(32px, 9vw, 48px); letter-spacing: -.055em; }
  .opening-stage { inset: max(220px, 28vh) 0 154px; perspective: 1000px; }
  .opening-chapter { gap: 12px; font-size: 11px; }
  .opening-page { padding: 3px; border-radius: 4px; }
  .opening-page-header { flex-basis: 16px; padding: 0 1px 3px; font-size: 7px; gap: 3px; }
  .opening-page-header span:last-child { font-size: 6px; }
  .opening-page-referral { padding: 5px; font-size: 8px; gap: 3px; }
  .opening-page-referral small { font-size: 6px; }
  .opening-page-referral svg { width: 14px; height: 14px; }
  .opening-spiney { width: 116px; height: 158px; left: 18px; }
  .opening-ground { width: 116px; left: 18px; }
  .opening-greeting { left: 145px; right: 18px; width: auto; bottom: 26px; padding: 13px 14px; border-radius: 13px 13px 13px 4px; }
  .opening-greeting strong { font-size: 15px; line-height: 1.3; }
  .opening-greeting span:not(:empty) { font-size: 12px; line-height: 1.4; margin-top: 6px; }
  .opening-greeting::after { width: 12px; height: 12px; left: -6px; bottom: 18px; }
  .opening-actions { bottom: max(18px, env(safe-area-inset-bottom)); }
  .opening-static-story { bottom: 174px; padding: 15px 17px; font-size: 13px; }
  .desk-opening[data-reduced="true"] .opening-spiney, .desk-opening[data-reduced="true"] .opening-ground { left: calc(50% - 58px); }
  .desk-opening[data-chapter] .opening-copy { top: 12px; }
  .desk-opening[data-chapter] .opening-byline { margin-bottom: 4px; }
  .desk-opening[data-chapter] .opening-copy h2 { font-size: clamp(20px, 5.5vw, 26px); }
  .desk-opening[data-chapter] .opening-stage { inset: 88px 0 150px; }
  .desk-opening[data-chapter] .opening-spiney { width: 72px; height: 84px; left: 12px; }
  .desk-opening[data-chapter] .opening-ground { width: 72px; left: 12px; }
}
@media (max-height: 650px) and (min-width: 721px) {
  .opening-copy { top: 68px; }
  .opening-copy h2 { font-size: 42px; }
  .opening-byline { margin-bottom: 8px; }
  .opening-stage { inset: 195px 0 140px; }
  .opening-spiney { width: 125px; height: 140px; left: calc(50% - 210px); }
  .opening-ground { width: 125px; left: calc(50% - 210px); }
  .opening-greeting { left: calc(50% - 50px); width: 340px; bottom: 20px; padding: 13px 16px; }
  .opening-greeting strong { font-size: 17px; }
  .opening-greeting span:not(:empty) { font-size: 13px; }
  .opening-actions { bottom: 12px; }
  .opening-static-story { bottom: 154px; }
  .desk-opening[data-reduced="true"] .opening-spiney, .desk-opening[data-reduced="true"] .opening-ground { left: calc(50% - 62px); }
  .desk-opening[data-chapter] .opening-copy { top: 12px; }
  .desk-opening[data-chapter] .opening-copy h2 { font-size: 20px; }
  .desk-opening[data-chapter] .opening-stage { inset: 76px 0 132px; }
  .desk-opening[data-chapter] .opening-spiney { width: 80px; height: 94px; left: 16px; }
  .desk-opening[data-chapter] .opening-ground { width: 80px; left: 16px; }
}
@media (max-height: 700px) and (max-width: 720px) {
  .opening-copy { top: 81px; }
  .opening-copy h2 { font-size: 32px; }
  .opening-stage { inset: 185px 0 146px; }
  .opening-spiney { width: 98px; height: 116px; }
  .opening-ground { width: 98px; }
  .opening-greeting { left: 128px; right: 16px; bottom: 20px; padding: 11px 12px; }
  .opening-greeting strong { font-size: 14px; }
  .opening-greeting span:not(:empty) { font-size: 12px; }
  .opening-actions { bottom: 10px; }
  .opening-actions p { font-size: 11px; margin-top: 10px; }
  .opening-static-story { bottom: 128px; }
  .desk-opening[data-reduced="true"] .opening-spiney, .desk-opening[data-reduced="true"] .opening-ground { left: calc(50% - 49px); }
}
@media (prefers-reduced-motion: reduce) {
  .opening-hand-pages { display: none; }
  .opening-spiney { transform: none; }
}

.desk-opening:is([data-phase="arrive"], [data-phase="greeting"], [data-phase="made-by-david"], [data-exit-from="arrive"], [data-exit-from="greeting"], [data-exit-from="made-by-david"]) .opening-greeting { left: 50%; right: auto; bottom: 0; width: min(440px, calc(100% - 48px)); min-height: 108px; margin-left: 0; translate: -50% 0; display: flex; flex-direction: column; justify-content: center; text-align: center; border-radius: 16px; }
.desk-opening:is([data-phase="arrive"], [data-phase="greeting"], [data-phase="made-by-david"], [data-exit-from="arrive"], [data-exit-from="greeting"], [data-exit-from="made-by-david"]) .opening-greeting::after { left: calc(50% - 7px); top: -7px; bottom: auto; transform: rotate(135deg); }
@media (max-height: 700px) and (max-width: 720px) {
  .desk-opening:is([data-phase="arrive"], [data-phase="greeting"], [data-phase="made-by-david"], [data-exit-from="arrive"], [data-exit-from="greeting"], [data-exit-from="made-by-david"]) .opening-greeting { min-height: 96px; }
}

@media (min-width: 721px) and (max-width: 1100px) {
  .desk-opening:is([data-phase="arrive"], [data-phase="greeting"], [data-phase="made-by-david"], [data-exit-from="arrive"], [data-exit-from="greeting"], [data-exit-from="made-by-david"]) .opening-greeting { bottom: 14px; }
}

/* During chapter presentations the narration moves from the speech bubble to a
   subtitle under the chapter label, freeing the whole stage for the card field. */
.desk-opening[data-chapter] .opening-stage .opening-greeting {
  left: 50%; right: auto; bottom: auto; top: 30px; translate: -50% 0;
  width: max-content; max-width: min(660px, calc(100% - 48px));
  min-height: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; text-align: center; display: block;
  transition: top .5s ease, bottom .5s ease;
}
.desk-opening[data-chapter] .opening-stage .opening-greeting::after { display: none; }
.desk-opening[data-chapter] .opening-stage .opening-greeting strong {
  font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--opening-muted); line-height: 1.4;
}
.desk-opening[data-chapter] .opening-stage .opening-greeting span { display: none; }
@media (max-width: 720px) {
  .desk-opening[data-chapter] .opening-stage .opening-greeting { top: 28px; }
  .desk-opening[data-chapter] .opening-stage .opening-greeting strong { font-size: 13px; }
}
