/*
 * Stage 1 of the cinematic redesign (A-79), dark only since A-80: the cellar door, log in,
 * forgotten password, the three sign-up chapters, the shared fields, and the shared centred frame
 * (still used by "not found"). Tokens in tokens.css.
 *
 * THE CELLAR DOOR (first visit on a device, about 3.2 s, skippable from frame one)
 *   0.00-0.25  black
 *   0.25-1.35  the winery facade at sunset, fading up from black, slow push-in on the loggia
 *   1.35       hard cut (a blink of black) to the dark arched doorway onto the valley
 *   1.35-2.62  the camera moves through the arch (scale 1 -> --end)
 *   2.25-3.20  the veil settles and the log-in panel rises into the lit frame
 *   then       one light sweep across the crest plate
 * Later visits (.door--quick): under 0.5 s. Re-renders (.door--still): no motion.
 * prefers-reduced-motion: the same order as plain crossfades, nothing moves or scales.
 * Everything is CSS (transform, opacity); login.js only adds .is-run / .is-done.
 *
 * Contrast notes for text placed here are in tokens.css (glass worst case).
 */

/* ======================================================================
   Fields: an engraved underline on a faint ground, label floating inside
   ====================================================================== */
.fl { position: relative; margin-bottom: 10px; text-align: left; }
.fl-in { width: 100%; height: 54px; padding: 22px 14px 6px; font: 400 16px/1.2 var(--font-ui); color: var(--ink); background-color: var(--field-bg); border: 0; border-bottom: 1px solid var(--field-line); border-radius: 10px 10px 3px 3px; appearance: none; -webkit-appearance: none; transition: border-color .25s, background-color .25s, box-shadow .25s; }
select.fl-in { padding-top: 20px; padding-right: 34px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 19px) 58%, calc(100% - 13px) 58%; background-size: 6px 6px; background-repeat: no-repeat; }
.fl-in:hover { background-color: var(--gold-faint); }
.fl-in:focus { outline: none; background-color: var(--gold-faint); border-bottom-color: var(--gold); box-shadow: 0 1px 0 0 var(--gold), 0 10px 24px -18px var(--gold); }
.fl-in[aria-invalid="true"] { border-bottom-color: var(--err); box-shadow: 0 1px 0 0 var(--err); }
.fl-in:-webkit-autofill { -webkit-text-fill-color: var(--ink); transition: background-color 99999s 0s; }
.fl-lb { position: absolute; left: 14px; top: 17px; font-size: 15px; color: var(--ink-3); pointer-events: none; transform-origin: left top; transition: top .2s var(--ease), font-size .2s var(--ease), color .2s, letter-spacing .2s; }
.fl-in:focus + .fl-lb, .fl-in:not(:placeholder-shown) + .fl-lb, .fl-sel .fl-lb { top: 7px; font-size: 11.5px; letter-spacing: .05em; color: var(--ink-3); }
.fl-in:focus + .fl-lb { color: var(--gold); }
.fl-pw .fl-in { padding-right: 72px; }
.fl-eye { position: absolute; right: 6px; top: 9px; height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--gold); font-size: 13px; font-weight: 600; letter-spacing: .04em; cursor: pointer; }
.fl-eye:hover { background: var(--gold-faint); }
.fl-err { color: var(--err); font-size: 13px; line-height: 1.4; margin: 5px 2px 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; }
.rowp { display: grid; grid-template-columns: 124px 1fr; gap: 10px; }
.row2 > .fl, .row3 > .fl, .rowp > .fl { margin-bottom: 10px; }
.dobset { margin: 0 0 4px; }
.dob-lg { font-size: 12.5px; letter-spacing: .04em; color: var(--ink-3); margin: 2px 0 6px 2px; }
.dobset .fl-err { margin-top: -4px; margin-bottom: 8px; }

/* Primary action inside the scenes: crest red with a fine gilt hairline */
.arch .btn, .chap .btn, .center-card .btn {
  min-height: 52px; font-size: 15px; font-weight: 500; letter-spacing: .06em;
  background-color: var(--red);
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--red) 88%, #ffffff 12%), var(--red) 55%, var(--red-deep));
  border-color: var(--red-deep);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 170, .28), inset 0 1px 0 rgba(255, 235, 210, .3), 0 14px 30px -14px rgba(120, 0, 0, .7);
}
.arch .btn:hover, .chap .btn:hover, .center-card .btn:hover { background-image: none; background-color: var(--red-deep); }

/* Small copy shared by every panel */
.c-title { font-family: var(--font-display); font-weight: 400; font-size: 2rem; line-height: 1.06; letter-spacing: -.005em; text-align: center; margin: 0 0 16px; }
.c-sub { color: var(--ink-2); text-align: center; font-size: 15px; line-height: 1.5; }
.c-kicker { text-align: center; color: var(--gold); font-family: var(--font-display); font-style: italic; font-size: var(--fs-lg); margin: 0; }
.c-notice { font-size: 14px; padding: 9px 12px; border-radius: 10px; margin: 0 0 12px; background: var(--gold-faint); text-align: left; }
.c-err, .c-declined { font-size: 14px; line-height: 1.45; padding: 6px 12px; margin: 0 0 12px; border-left: 2px solid var(--err); color: var(--err); text-align: left; }
.c-mock { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); border-left: 2px solid var(--open-ink); padding: 4px 10px; margin: 10px 0; text-align: left; }
.c-sim { font-size: 12px; color: #f0b862; background: repeating-linear-gradient(135deg, #2b2100 0 8px, #241b00 8px 16px); padding: 6px 10px; border-radius: 8px; margin: 0 0 12px; }
.c-form { margin: 0; }
.c-hint { font-size: 13px; color: var(--ink-3); margin: 0 2px 8px; line-height: 1.45; text-align: left; }
.c-hint.is-warn { color: var(--err); }
.c-alt, .c-links { text-align: center; font-size: 14px; margin: 14px 0 0; color: var(--ink-2); }
.c-alt a, .c-links a { color: var(--ink); font-weight: 500; text-decoration-color: var(--gold-line); }
.c-alt a:hover, .c-links a:hover { color: var(--gold); }
.c-fine { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 0; text-align: center; }
.c-static { font-size: 14px; color: var(--ink-2); margin: 2px 2px 12px; }
.c-static strong { color: var(--ink); }
.c-chosen { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; border: 1px solid var(--gold-line); border-radius: 12px; padding: 9px 12px; margin: 0 0 14px; }
.c-chosen-name { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .14em; }
.c-chosen-fee { font-family: var(--font-display); }
.c-chosen-fee > span { font-family: var(--font-ui); font-size: 12px; color: var(--ink-2); }
.c-chosen a { margin-left: auto; font-size: 12.5px; }
.c-review { margin: 0 0 6px; }
.c-review > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.c-review dt { grid-column: 1 / -1; color: var(--gold); font-size: 12.5px; }
.c-review dd { margin: 0; }
.c-review a { font-size: 12.5px; align-self: start; }
.c-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; text-align: center; }
.c-mini dt { font-size: 12.5px; color: var(--gold); }
.c-mini dd { margin: 0; font-weight: 600; }
.cchk { display: grid; grid-template-columns: 22px 1fr; gap: 2px 10px; align-items: start; font-size: 14px; margin: 8px 0; text-align: left; }
.cchk input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--red); }
.cchk .linkish, .cchk .fl-err { grid-column: 2; }
.demo { margin: 14px auto 0; max-width: 400px; width: 100%; font-size: 12.5px; color: var(--ink-2); text-align: center; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--glass-line); border-radius: 14px; padding: 2px 14px; }
.demo summary { cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; }
.demo ul { list-style: none; display: grid; gap: 8px; margin: 2px 0 12px; text-align: left; }

/* ======================================================================
   The cellar door: scene, sequence, arched panel
   ====================================================================== */
.door { --T: 3.2s; --end: 1.75; --origin: 50% 47%; position: relative; min-height: 100vh; min-height: 100dvh; isolation: isolate; }
.door-stage { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #050403; }
.door-shot { position: absolute; inset: 0; will-change: transform, opacity; }
.door-shot img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }

/* the facade at sunset: framed on the lit loggia; the road below sinks into the night */
.door-facade { opacity: 0; transform-origin: 37% 46%; transform: scale(1.1); }
.door-facade img { object-position: 37% 34%; filter: saturate(1.05) contrast(1.04); }
.door-facade::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(5,4,3,.2) 0%, rgba(5,4,3,0) 26%, rgba(5,4,3,.5) 58%, #050403 86%),
  radial-gradient(ellipse 80% 70% at 37% 44%, transparent 35%, rgba(5,4,3,.6) 100%); }

/* the doorway onto the valley: the end framing is the camera already through the arch */
.door-arch { transform-origin: var(--origin); transform: scale(var(--end)); }
.door-arch img { object-position: 50% 47%; filter: var(--photo-filter); }
/* a low warm grade so the midday doorway follows the sunset facade (proposal; see README) */
.door-arch::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 168, 82, .32), rgba(150, 70, 24, .22)); mix-blend-mode: soft-light; }
.door-veil { position: absolute; inset: 0; background: var(--scene-veil), var(--scene-floor); }
.door-black { position: absolute; inset: 0; background: #050403; opacity: 0; pointer-events: none; }

/* chrome that must read over black or photo */
.door-prefs { position: fixed; top: 12px; right: 12px; z-index: 20; }
.door-prefs .lang { background: var(--glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-color: var(--glass-line); }
.door-skip { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 20; display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid rgba(232, 211, 160, .5); background: rgba(5, 4, 3, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #f6efdf; font: 500 14px/1 var(--font-ui); letter-spacing: .08em; cursor: pointer; }
.door-skip:hover { border-color: #e8d3a0; }
.door-skip:focus-visible { outline-color: #e8d3a0; }
.door-skip-bar { position: relative; width: 34px; height: 1px; background: rgba(232, 211, 160, .3); overflow: hidden; }
.door-skip-bar::after { content: ""; position: absolute; inset: 0; background: #e8d3a0; transform-origin: left center; transform: scaleX(0); }
.door.is-run .door-skip-bar::after { animation: dBar var(--T) linear forwards; }
.door.is-done .door-skip { opacity: 0; visibility: hidden; transition: opacity .35s, visibility 0s .35s; }

.door-frame { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 14px 28px; }

/* The arched panel: glass shaped like the doorway, with an engraved inner rule */
.arch { position: relative; width: 100%; max-width: 400px; padding: 30px 22px 22px; text-align: center; border-radius: 200px 200px 20px 20px; background: var(--glass); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.1); backdrop-filter: blur(var(--blur)) saturate(1.1); border: 1px solid var(--glass-line); box-shadow: var(--shadow-panel); }
.arch::before { content: ""; position: absolute; inset: 7px; border-radius: 193px 193px 14px 14px; border: 1px solid var(--gold-line); pointer-events: none; }
.arch-crown { display: flex; justify-content: center; margin: 0 0 14px; }
.arch .c-title { font-size: var(--fd-lg); margin-bottom: 18px; }
.arch .c-sub { margin-bottom: 14px; }

/* The light sweep across the crest plate. No isolation on the plate, so the logo's
   mix-blend-mode: multiply still melts its white into the ivory plate. */
.arch-crown .logo-plate { position: relative; overflow: hidden; }
.arch-crown .logo-plate::after { content: ""; position: absolute; inset: -20% -60%; z-index: 1; pointer-events: none; background: linear-gradient(105deg, transparent 42%, rgba(255, 238, 196, .85) 50%, transparent 58%); mix-blend-mode: screen; transform: translateX(-70%); }
.door--play.is-run .arch-crown .logo-plate::after { animation: sweep 1.5s calc(var(--T) - .25s) var(--ease) both; }
.door--quick .arch-crown .logo-plate::after { animation: sweep 1.4s .35s var(--ease) both; }
.arch-crown .logo-plate:hover::after { animation: sweep 1.4s var(--ease) both; }

/* --- sequence: waiting for the photos (black, skip visible) --- */
.door--play:not(.is-run):not(.is-done) .door-black { opacity: 1; }
.door--play:not(.is-run):not(.is-done) .door-arch,
.door--play:not(.is-run):not(.is-done) .door-veil,
.door--play:not(.is-run):not(.is-done) .arch { opacity: 0; }
.door--play:not(.is-run):not(.is-done) .door-facade { opacity: 1; }
/* --- sequence: running --- */
.door--play.is-run:not(.is-done) .door-black { animation: dBlack var(--T) linear both; }
.door--play.is-run:not(.is-done) .door-facade { animation: dFacade var(--T) both; }
.door--play.is-run:not(.is-done) .door-arch { animation: dArch var(--T) both; }
.door--play.is-run:not(.is-done) .door-veil { animation: dVeil var(--T) both; }
.door--play.is-run:not(.is-done) .arch { animation: dPanel var(--T) both; }
/* --- sequence: finished or skipped --- */
.door.is-done .door-facade, .door.is-done .door-black, .door--still .door-facade { display: none; }
.door.is-skipped .door-stage, .door.is-skipped .arch { animation: dFade .4s var(--ease-out) both; }
/* --- later visits: under half a second --- */
.door--quick .door-black { animation: dOut .38s ease-out both; }
.door--quick .door-arch { animation: dQuickArch .46s var(--ease-out) both; }
.door--quick .arch { animation: dQuickPanel .42s .04s var(--ease-out) both; }

@keyframes dBlack { 0%, 8% { opacity: 1; } 22% { opacity: 0; } 41.6% { opacity: 0; } 42.2% { opacity: .92; } 45% { opacity: 0; } 100% { opacity: 0; } }
@keyframes dFacade {
  0% { opacity: 1; transform: scale(1.1); animation-timing-function: cubic-bezier(.3, .1, .55, 1); }
  42% { opacity: 1; transform: scale(1.3); }
  42.3%, 100% { opacity: 0; transform: scale(1.3); }
}
@keyframes dArch {
  0%, 42% { opacity: 0; transform: scale(1); }
  42.3% { opacity: 1; transform: scale(1); animation-timing-function: cubic-bezier(.55, 0, .2, 1); }
  82%, 100% { opacity: 1; transform: scale(var(--end)); }
}
@keyframes dVeil { 0%, 66% { opacity: 0; } 100% { opacity: 1; } }
@keyframes dPanel {
  0%, 74% { opacity: 0; transform: translateY(56px) scale(.97); animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
  100% { opacity: 1; transform: none; }
}
@keyframes dFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes dQuickArch { from { transform: scale(calc(var(--end) * 1.05)); } to { transform: scale(var(--end)); } }
@keyframes dQuickPanel { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes dBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sweep { from { transform: translateX(-70%); } to { transform: translateX(70%); } }

/* ======================================================================
   Sign-up chapters: I Who you are, II How we reach you, III Where you live
   ====================================================================== */
.chap { --chap-veil: linear-gradient(180deg, rgba(11,10,9,.8) 0%, rgba(11,10,9,.66) 45%, rgba(11,10,9,.9) 100%); position: relative; min-height: 100vh; min-height: 100dvh; isolation: isolate; }
.chap-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #050403; }
.chap-bg .ph { position: absolute; inset: 0; background: transparent; }
.chap-bg .ph img { filter: var(--photo-filter); }
.chap-bg::after { content: ""; position: absolute; inset: 0; background: var(--chap-veil); }
html.motion .chap-bg .ph img { animation: kenburns 28s ease-in-out infinite alternate; }
.chap-1 .chap-bg .ph img { object-position: 50% 42% !important; transform-origin: 50% 40%; }
.chap-2 .chap-bg .ph img { object-position: 36% 50% !important; transform-origin: 36% 45%; }
.chap-3 .chap-bg .ph img { transform-origin: 50% 20%; }

.chap-layout { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 8px 14px 24px; }
.chap-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 54px; }
.chap-back { justify-self: start; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px 0 2px; color: var(--ink-2); text-decoration: none; font-size: 14px; border-radius: 10px; }
.chap-back:hover { color: var(--gold); }
.chap-back .ico { width: 20px; height: 20px; }
.chap-top .logo-plate { display: inline-flex; }
.chap-prefs { justify-self: end; }

.chap-head { text-align: center; margin: 4px auto 16px; max-width: 30rem; width: 100%; }
.chap-num { display: none; margin: 0; font-family: var(--font-display); font-weight: 400; line-height: .8; letter-spacing: .02em; color: var(--gold); font-variant-numeric: lining-nums; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .chap-num { background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 46%, var(--gold-deep) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .6)) drop-shadow(0 -1px 0 rgba(255, 240, 200, .14)); }
}
.chap-prog { list-style: none; display: flex; align-items: center; justify-content: center; margin: 0 0 10px; }
.chap-prog li { display: flex; align-items: center; }
.chap-prog li + li::before { content: ""; width: 26px; height: 1px; background: var(--gold-line); margin: 0 6px; }
.chap-prog a { text-decoration: none; color: inherit; border-radius: 50%; }
.chap-prog-n { position: relative; display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; font-family: var(--font-display); font-size: 1.5rem; line-height: 1; color: var(--ink-3); text-shadow: 0 1px 0 rgba(0, 0, 0, .55); }
.chap-prog .is-done .chap-prog-n { color: var(--ink-2); }
.chap-prog a:hover .chap-prog-n { color: var(--gold); }
.chap-prog li[aria-current="step"] .chap-prog-n { color: var(--gold); }
.chap-prog li[aria-current="step"] .chap-prog-n::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 20px; height: 1px; margin-left: -10px; background: var(--gold); }
.chap-title { font-family: var(--font-display); font-weight: 400; font-size: var(--fd-lg); line-height: 1.04; letter-spacing: -.01em; margin: 0 0 8px; }
.chap-title:focus { outline: none; }
.chap-title:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
.chap-lead { color: var(--ink-2); font-size: 15px; line-height: 1.5; margin: 0 auto; max-width: 31ch; }

.chap-panel { position: relative; width: 100%; max-width: 440px; margin: 0 auto; padding: 22px 20px 18px; background: var(--glass); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.1); backdrop-filter: blur(var(--blur)) saturate(1.1); border: 1px solid var(--glass-line); border-radius: 20px; box-shadow: var(--shadow-panel); }
.chap-panel::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--gold-line); border-radius: 15px; pointer-events: none; opacity: .65; }
.chap-panel .btn-block { margin-top: 8px; }
.chap-notes { width: 100%; max-width: 440px; margin: 0 auto; }

/* where you live: the zone line under the country */
.c-zone { margin: 2px 0 4px; padding: 12px 14px; border-radius: 12px; background: var(--gold-faint); border: 1px solid var(--gold-line); font-size: 14px; line-height: 1.45; color: var(--ink-2); text-align: left; }
.c-zone p { margin: 0; }
.c-zone strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; line-height: 1.2; color: var(--ink); margin-bottom: 2px; }
.c-zone.is-away { background: transparent; border-style: dashed; }

/* transitions between chapters: forward moves left, back moves right; the photo cuts through black */
.chap.is-enter-fwd .chap-head { animation: chInFwd .8s var(--ease-out) both; }
.chap.is-enter-fwd .chap-panel { animation: chInFwdP .8s .08s var(--ease-out) both; }
.chap.is-enter-back .chap-head { animation: chInBack .8s var(--ease-out) both; }
.chap.is-enter-back .chap-panel { animation: chInBackP .8s .08s var(--ease-out) both; }
.chap.is-enter-fwd .chap-bg, .chap.is-enter-back .chap-bg { animation: bgIn 1.1s ease-out both; }
.chap.is-enter-fwd .chap-num, .chap.is-enter-back .chap-num { animation: numIn 1.2s .05s var(--ease-out) both; }
.chap.is-leave-fwd .chap-head, .chap.is-leave-fwd .chap-panel { animation: chOutFwd .38s ease-in both; }
.chap.is-leave-back .chap-head, .chap.is-leave-back .chap-panel { animation: chOutBack .38s ease-in both; }
.chap.is-leave-fwd .chap-bg, .chap.is-leave-back .chap-bg { animation: bgOut .38s ease-in both; }

@keyframes chInFwd { from { opacity: 0; transform: translateX(48px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes chInBack { from { opacity: 0; transform: translateX(-48px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes chInFwdP { from { opacity: 0; transform: translateX(64px); } to { opacity: 1; transform: none; } }
@keyframes chInBackP { from { opacity: 0; transform: translateX(-64px); } to { opacity: 1; transform: none; } }
@keyframes chOutFwd { to { opacity: 0; transform: translateX(-40px); } }
@keyframes chOutBack { to { opacity: 0; transform: translateX(40px); } }
@keyframes bgIn { from { opacity: 0; transform: scale(1.05); } to { opacity: 1; transform: none; } }
@keyframes bgOut { to { opacity: .2; } }
@keyframes numIn { from { opacity: 0; transform: translateY(28px) scale(1.06); } to { opacity: 1; transform: none; } }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.07); } }

/* ======================================================================
   Shared centred frame (not found)
   ====================================================================== */
.center { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 64px 14px 24px; isolation: isolate; }
.center-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #050403; }
.center-bg .ph { position: absolute; inset: 0; }
.center-bg .ph img { filter: var(--photo-filter); }
.center-bg::after { content: ""; position: absolute; inset: 0; background: var(--veil); }
.center-prefs { position: fixed; top: 12px; right: 12px; z-index: 4; }
.center-prefs .lang { background: var(--glass); border-color: var(--glass-line); }
.center-col { position: relative; width: 100%; max-width: 420px; }
.center-wide .center-col { max-width: 480px; }
.center-logo { display: flex; justify-content: center; margin: 0 auto 14px; }
.center-card { position: relative; background: var(--glass); -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); border: 1px solid var(--glass-line); border-radius: var(--r-panel); padding: 24px 20px 20px; box-shadow: var(--shadow-panel); }
.center-card::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--gold-line); border-radius: 16px; pointer-events: none; opacity: .6; }

/* ======================================================================
   Desktop compositions
   ====================================================================== */
@media (min-width: 700px) {
  .c-title { font-size: 2.25rem; }
  .center-card { padding: 30px 28px 24px; }
}
@media (min-width: 900px) {
  .door { --end: 1.32; }
  .door-frame { padding: 56px 24px 40px; }
  .arch { max-width: 440px; padding: 42px 36px 30px; border-radius: 220px 220px 22px 22px; }
  .arch::before { border-radius: 213px 213px 15px 15px; }
  .arch .c-title { font-size: var(--fd-xl); }
  .door-skip { right: 24px; bottom: 24px; }

  .chap { --chap-veil: linear-gradient(90deg, rgba(11,10,9,.88) 0%, rgba(11,10,9,.72) 40%, rgba(11,10,9,.46) 62%, rgba(11,10,9,.64) 100%); }
  .chap-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 440px); grid-template-rows: auto 1fr auto; grid-template-areas: "top top" "head panel" ". notes"; column-gap: clamp(48px, 7vw, 120px); max-width: 1220px; margin: 0 auto; padding: 14px clamp(28px, 5vw, 64px) 36px; }
  .chap-top { grid-area: top; }
  .chap-head { grid-area: head; align-self: center; text-align: left; margin: 0; max-width: 36rem; }
  .chap-num { display: block; font-size: clamp(7rem, 12vw, 10.5rem); margin: 0 0 22px -4px; }
  .chap-prog { justify-content: flex-start; margin: 0 0 18px -8px; }
  .chap-title { font-size: clamp(3rem, 4.6vw, 4.5rem); margin-bottom: 14px; }
  .chap-lead { font-size: 17px; margin: 0; max-width: 34ch; }
  .chap-panel { grid-area: panel; align-self: center; margin: 0; padding: 32px 30px 24px; }
  .chap-notes { grid-area: notes; margin: 0; }
}
@media (max-height: 700px) and (max-width: 699px) {
  .door-frame, .center { padding-top: 56px; justify-content: flex-start; place-items: start center; }
  .arch { padding-top: 22px; }
  .arch .c-title, .chap-title { font-size: 1.9rem; }
  .fl-in { height: 50px; padding-top: 20px; }
  .fl-lb { top: 15px; }
  .chap-lead { font-size: 14px; }
  .chap-head { margin-bottom: 12px; }
}

/* ======================================================================
   Reduced motion: the same story as crossfades only. Elements carrying .rmf are exempt from the
   global stop in app.css; here their movement is replaced by opacity alone.
   ====================================================================== */
@media (prefers-reduced-motion: reduce) {
  .door-facade { transform: none; }
  .door--play.is-run:not(.is-done) .door-black { animation-name: rmBlack; }
  .door--play.is-run:not(.is-done) .door-facade { animation-name: rmFacade; }
  .door--play.is-run:not(.is-done) .door-arch { animation-name: rmArch; }
  .door--play.is-run:not(.is-done) .arch { animation-name: rmPanel; }
  .door--quick .door-arch, .door--quick .arch { animation-name: dFade; }
  .chap[class*="is-enter"] .chap-head, .chap[class*="is-enter"] .chap-panel, .chap[class*="is-enter"] .chap-bg { animation: dFade .35s ease-out both; }
  .chap[class*="is-leave"] .chap-head, .chap[class*="is-leave"] .chap-panel { animation: dOut .18s ease-in both; }
  .chap[class*="is-leave"] .chap-bg { animation: none; }
}
@keyframes rmBlack { 0%, 8% { opacity: 1; } 24%, 100% { opacity: 0; } }
@keyframes rmFacade { 0%, 40% { opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes rmArch { 0%, 40% { opacity: 0; } 56%, 100% { opacity: 1; } }
@keyframes rmPanel { 0%, 70% { opacity: 0; } 100% { opacity: 1; } }
