/* Home, 2.8: the opening as one flight into the house (inc/ext/flight.php, assets/js/flight.js).
   The section is as tall as the flight; the stage stays under the header while the scroll moves the camera. */
.flight { --f-ink: #15100d; --f-text: var(--calce); --f-quiet: var(--night-text); --f-accent: var(--cera-2); --f-rule: rgba(237, 236, 232, .22);
	position: relative; isolation: isolate; background: var(--f-ink); color: var(--f-text); }
html.js .flight:not(.is-still) { height: calc(var(--flight-len, 4) * 100svh); }
.flight-stage { position: relative; height: calc(100svh - var(--flight-top, 72px)); min-height: 540px; overflow: hidden; isolation: isolate; background: var(--f-ink); }
html.js .flight:not(.is-still) .flight-stage { position: sticky; top: var(--flight-top, 72px); }
.flight-end { display: block; height: 0; scroll-margin-top: var(--flight-top, 72px); }

/* the picture: a still first, then the canvas that flies */
.flight-poster, .flight-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.flight-poster { object-fit: cover; object-position: 50% 50%; transform: scale(1.04); }
.flight-canvas { opacity: 0; transition: opacity .8s var(--ease); }
.flight.is-ready .flight-canvas { opacity: 1; }
.flight.is-ready.is-settled .flight-poster { visibility: hidden; }
.flight-film { position: absolute; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }

/* the shade that carries the words, and a little grain so the stills read as film */
.flight-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; background:
	linear-gradient(0deg, rgba(21, 16, 13, .82) 0%, rgba(21, 16, 13, .5) 24%, rgba(21, 16, 13, 0) 52%),
	linear-gradient(90deg, rgba(21, 16, 13, .5) 0%, rgba(21, 16, 13, 0) 46%),
	linear-gradient(180deg, rgba(21, 16, 13, .34) 0%, rgba(21, 16, 13, 0) 16%),
	radial-gradient(130% 95% at 50% 46%, rgba(21, 16, 13, 0) 55%, rgba(21, 16, 13, .42) 100%); }
.flight-shade::after { content: ""; position: absolute; inset: -40px; opacity: .07; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); animation: flight-grain 1.2s steps(6) infinite; }
@keyframes flight-grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-18px, 9px); } 40% { transform: translate(11px, -15px); } 60% { transform: translate(-7px, 19px); } 80% { transform: translate(16px, 6px); } 100% { transform: translate(0, 0); } }

/* the words of each room, one at a time, at the foot of the picture */
.flight-copy { position: absolute; inset: auto 0 calc(clamp(30px, 6.5svh, 68px) + var(--flight-cut, 0px)) 0; z-index: 2; pointer-events: none; }
.flight-scene { position: absolute; left: var(--gutter); bottom: 0; width: min(34rem, calc(100% - 2 * var(--gutter))); --v: 0; opacity: var(--v); transform: translate3d(0, calc((1 - var(--v)) * 22px), 0); }
.flight-scene.is-on { pointer-events: auto; }
.flight-scene--first { --v: 1; }
html.js .flight:not(.is-still) .flight-scene--first { --v: 1; }
.flight-kicker { margin: 0 0 14px; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--f-accent); font-variant-numeric: tabular-nums lining-nums; text-shadow: 0 1px 14px rgba(15, 11, 9, .5); }
.flight-scene--first .flight-kicker { letter-spacing: .08em; text-transform: none; font-size: 15px; }
.flight .flight-title, .flight .flight-line { margin: 0; font-size: clamp(40px, 4.5vw, 72px); line-height: 1.02; letter-spacing: -.015em; max-width: 10.5em; color: var(--f-text); text-wrap: balance; text-shadow: 0 2px 30px rgba(15, 11, 9, .45); }
.flight .flight-line { font-size: clamp(34px, 3.6vw, 58px); max-width: 11em; }
.flight-note { margin: 16px 0 0; max-width: 30em; font-size: clamp(17px, 1.25vw, 19px); font-style: italic; line-height: 1.45; color: var(--f-quiet); text-shadow: 0 1px 16px rgba(15, 11, 9, .6); }
.flight-lead { margin: 18px 0 0; max-width: 32em; font-size: clamp(17px, 1.3vw, 19.5px); line-height: 1.55; color: var(--f-quiet); text-wrap: pretty; text-shadow: 0 1px 16px rgba(15, 11, 9, .6); }
.flight-small { margin: 14px 0 0; font-size: 14.5px; color: var(--night-quiet); }
.flight-actions { margin-top: 26px; gap: 14px 22px; }
.flight .btn--go { background: var(--calce); color: var(--noce); border-color: var(--calce); }
.flight .btn--go:hover, .flight .btn--go:focus-visible { background: var(--cera); color: var(--noce); border-color: var(--cera); }
.flight .btn--ghost { color: var(--calce); border-color: rgba(237, 236, 232, .42); background: rgba(21, 16, 13, .18); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.flight .btn--ghost:hover, .flight .btn--ghost:focus-visible { background: var(--calce); color: var(--noce); border-color: var(--calce); }

/* the hour, the six moments, play and skip */
.flight-hud { position: absolute; right: var(--gutter); bottom: calc(clamp(30px, 6.5svh, 68px) + var(--flight-cut, 0px)); z-index: 3; display: grid; justify-items: end; gap: 18px; }
.flight-clock { margin: 0; display: grid; justify-items: end; gap: 6px; line-height: 1; text-shadow: 0 2px 24px rgba(15, 11, 9, .5); }
.flight-clock-time { font-size: clamp(44px, 4.2vw, 68px); font-weight: 300; letter-spacing: -.01em; font-variant-numeric: tabular-nums lining-nums; color: var(--f-text); }
.flight-clock-place { font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--f-accent); }
.flight-steps { --fill: 0; position: relative; display: flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.flight-steps::before, .flight-steps::after { content: ""; position: absolute; left: 7px; right: 7px; top: 7px; height: 1px; background: var(--f-rule); }
.flight-steps::after { right: auto; width: calc((100% - 14px) * var(--fill)); background: var(--f-accent); }
.flight-steps li { display: flex; }
.flight-step { position: relative; z-index: 1; display: grid; justify-items: center; gap: 9px; width: 54px; min-height: 44px; margin: 0; padding: 0; border: 0; background: none; color: var(--f-quiet); font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: .04em; cursor: pointer; }
.flight-steps li:first-child .flight-step { justify-items: start; width: 34px; }
.flight-steps li:last-child .flight-step { justify-items: end; width: 34px; }
.flight-step::before { content: ""; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--f-rule); background: var(--f-ink); box-sizing: border-box; transition: background-color .4s var(--ease), border-color .4s var(--ease), transform .4s var(--ease); }
.flight-step.is-past::before { background: var(--f-accent); border-color: var(--f-accent); transform: scale(.6); }
.flight-step.is-on::before { background: var(--f-accent); border-color: var(--f-accent); transform: scale(1); }
.flight-step.is-on { color: var(--f-text); }
.flight-step:hover { color: var(--f-text); }
.flight-step:focus-visible { outline: 2px solid var(--f-accent); outline-offset: 2px; border-radius: 4px; }
.flight-row { display: flex; align-items: center; gap: 18px; }
.flight-play { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 18px 0 14px; border: 1px solid var(--f-rule); border-radius: 20px 20px 3px 3px; background: rgba(21, 16, 13, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--f-text); font: inherit; font-size: 14.5px; cursor: pointer; transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease); }
.flight-play:hover, .flight-play:focus-visible { background: var(--calce); color: var(--noce); border-color: var(--calce); }
.flight-play .flight-pause-i, .flight-play[aria-pressed="true"] .flight-play-i { display: none; }
.flight-play[aria-pressed="true"] .flight-pause-i { display: inline; }
.flight-skip { font-size: 14.5px; color: var(--f-quiet); text-decoration: underline; text-decoration-color: rgba(207, 198, 186, .4); text-underline-offset: 4px; }
.flight-skip:hover { color: var(--f-text); }

/* the first invitation to scroll */
.flight-hint { position: absolute; left: 50%; bottom: calc(14px + var(--flight-cut, 0px)); z-index: 3; display: grid; justify-items: center; gap: 8px; margin: 0; transform: translateX(-50%); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--f-quiet); pointer-events: none; transition: opacity .6s var(--ease); white-space: nowrap; }
.flight-hint-line { width: 1px; height: 34px; background: linear-gradient(180deg, rgba(243, 227, 194, 0), var(--f-accent)); transform-origin: top; animation: flight-hint 2.4s var(--ease) infinite; order: 2; }
@keyframes flight-hint { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.flight-hint-touch { display: none; }
@media (hover: none) { .flight-hint-mouse { display: none; } .flight-hint-touch { display: inline; } }
.flight.is-moving .flight-hint { opacity: 0; }

/* without script, or with reduced motion: one still picture and the words of the first room */
html:not(.js) .flight-scene:not(.flight-scene--first), .flight.is-still .flight-scene:not(.flight-scene--first) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
html:not(.js) .flight-hud, html:not(.js) .flight-hint, .flight.is-still .flight-hud, .flight.is-still .flight-hint, .flight.is-still .flight-canvas, html:not(.js) .flight-canvas { display: none; }
.flight.is-still .flight-poster { transform: none; }

@media (max-width: 1020px) {
	.flight-hud { top: 18px; bottom: auto; right: var(--gutter); gap: 12px; }
	.flight-clock-time { font-size: 40px; }
	.flight-steps { display: none; }
}
@media (max-width: 720px) {
	.flight-stage { min-height: 500px; }
	.flight-hud { left: var(--gutter); right: var(--gutter); top: 14px; grid-template-columns: 1fr auto; align-items: start; justify-items: stretch; }
	.flight-clock { grid-column: 2; grid-row: 1; }
	.flight-clock-time { font-size: 34px; }
	.flight-clock-place { font-size: 11px; letter-spacing: .14em; }
	.flight-hud .flight-row { grid-column: 1; grid-row: 1; align-self: start; gap: 14px; }
	.flight-play { min-height: 36px; padding: 0 14px 0 11px; font-size: 13.5px; white-space: nowrap; }
	.flight-skip { display: none; }
	.flight .flight-title { font-size: clamp(34px, 9.6vw, 44px); }
	.flight .flight-line { font-size: clamp(31px, 8.6vw, 40px); }
	.flight-kicker { font-size: 11.5px; margin-bottom: 10px; }
	.flight-scene--first .flight-kicker { font-size: 13.5px; }
	.flight-note, .flight-lead { font-size: 16px; }
	.flight-lead { margin-top: 12px; }
	.flight-actions { margin-top: 18px; gap: 10px 12px; }
	.flight-actions .btn { min-height: 46px; padding: 0 20px; font-size: 16px; }
	.flight-small, .flight-scene--first .btn--ghost { display: none; }
	.flight-copy { bottom: calc(58px + var(--flight-cut, 0px)); }
	.flight-hint { bottom: calc(10px + var(--flight-cut, 0px)); gap: 6px; font-size: 11px; }
	.flight-hint-line { height: 18px; }
	.flight-shade { background:
		linear-gradient(0deg, rgba(21, 16, 13, .9) 0%, rgba(21, 16, 13, .66) 30%, rgba(21, 16, 13, 0) 66%),
		linear-gradient(180deg, rgba(21, 16, 13, .42) 0%, rgba(21, 16, 13, 0) 20%),
		radial-gradient(130% 95% at 50% 46%, rgba(21, 16, 13, 0) 55%, rgba(21, 16, 13, .38) 100%); }
}
@media (prefers-reduced-motion: reduce) {
	.flight-shade::after, .flight-hint-line { animation: none; }
}
