/* Site layer on top of folio.css: boarding gate, the flight (sky, cabin, chapters), reveals. */
:root {
  --local-theme-progress: 0;
  --stop-gap: 26px;
  --mono-label: 500 10px/1.4 var(--folio-mono);
}

h1.fs-name {
  font: inherit;
  letter-spacing: inherit;
  color: var(--folio-ink);
}

/* ---------- Gate ---------- */

html.local-gated,
html.local-gated body {
  overflow: hidden;
  height: 100%;
}
html.local-gated .folio {
  visibility: hidden;
  pointer-events: none;
}

.pass-stage {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  background: var(--folio-bg, #faf5f5);
  font-family: var(--folio-sans);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity .62s var(--ease-out);
  --lcd: #7d857c;
  --led: #b3aea1;
  --led-glow: 0px;
}
.pass-stage.is-leaving {
  opacity: 0;
  pointer-events: none;
}
.pass-stage[data-state="near"] { --lcd: #e0a818; --led: #e0a818; --led-glow: 14px; }
.pass-stage[data-state="error"] { --lcd: #ef5646; --led: #e0483a; --led-glow: 14px; }
.pass-stage[data-state="ok"] { --lcd: #43d27a; --led: #1e9e52; --led-glow: 16px; }

/* Stacking: reader top (behind the slot) < pass < reader front (in front of the slot). */
.gate {
  position: absolute;
  inset: 0;
  perspective: 1400px;
  perspective-origin: var(--sx) calc(var(--sy) - var(--ph));
}
.rd-back,
.rd-front {
  position: absolute;
  left: calc(var(--sx) - var(--rw) / 2);
  width: var(--rw);
}
.rd-back {
  z-index: 1;
  top: calc(var(--sy) - var(--bh));
  height: var(--bh);
  border-radius: calc(var(--rw) * .018) calc(var(--rw) * .018) 0 0;
  background: linear-gradient(#f4eee2, #e5dbca);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.rd-slot {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -1px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(#17140f, #3b342a);
}
.gate-shadow {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: var(--pw);
  height: var(--ph);
  border-radius: 14px;
  background: rgba(46, 34, 18, .55);
  filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.gate-pass {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: var(--pw);
  height: var(--ph);
  opacity: 0;
  cursor: grab;
  touch-action: none;
  will-change: transform, opacity;
}
.pass-stage.is-dragging,
.pass-stage.is-dragging .gate-pass {
  cursor: grabbing;
}
.gate-card {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 2.24% / 4.58%;
  box-shadow: 0 1px 1px rgba(46, 34, 18, .1), 0 3px 8px rgba(46, 34, 18, .06);
}
.gate-sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 300%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.26) 47%, rgba(255,255,255,.1) 51%, transparent 60%);
  will-change: transform;
}

/* Boarding pass artwork (inline SVG, 984 × 480 user units) */
.bp {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.bp text {
  font-family: var(--folio-mono), ui-monospace, monospace;
  font-weight: 500;
  fill: #1f1e1b;
}
.bp .lab   { font-size: 10.5px; letter-spacing: 1.2px; fill: #3a53ed; }
.bp .lab-s { font-size: 9px; letter-spacing: 1px; fill: #3a53ed; }
.bp .air   { font-size: 14px; letter-spacing: 3.4px; }
.bp .air-s { font-size: 9.5px; letter-spacing: 2.2px; }
.bp .big   { font-size: 32px; letter-spacing: 2px; }
.bp .val   { font-size: 22px; letter-spacing: 1.4px; }
.bp .code  { font-size: 34px; letter-spacing: 3px; }
.bp .sval  { font-size: 14px; letter-spacing: 1px; }
.bp .sval-s { font-size: 11px; letter-spacing: .4px; }
.bp .scode { font-size: 16px; letter-spacing: 1.5px; }
.bp .small { font-size: 9.5px; letter-spacing: 1.5px; }
.bp .sub   { font-size: 9px; letter-spacing: 1.3px; fill: #8a877f; }
.bp .tiny  { font-size: 8px; letter-spacing: 1.2px; fill: #7a776f; }
.bp .stamp { font-size: 7.5px; letter-spacing: 1px; fill: #aaa69d; }
.bp .blue  { fill: #3a53ed; }

.rd-front {
  z-index: 4;
  top: var(--sy);
  height: var(--fh);
  display: flex;
  flex-direction: column;
  filter: drop-shadow(0 18px 24px rgba(46, 34, 18, .16)) drop-shadow(0 2px 3px rgba(46, 34, 18, .1));
}
.rd-lip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--rw) * .034);
  padding: 0 5%;
  background: linear-gradient(#efe6d6, #ddd2bf);
  border-top: 1px solid rgba(255,255,255,.7);
}
.rd-vents {
  display: flex;
  gap: calc(var(--rw) * .0085);
}
.rd-vents i {
  width: calc(var(--rw) * .0055);
  height: calc(var(--rw) * .016);
  border-radius: 1px;
  background: linear-gradient(#4f483d, #8b8274);
  box-shadow: 0 1px 0 rgba(255,255,255,.45);
}
.rd-face {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 0 calc(var(--rw) * .03) calc(var(--rw) * .03);
  background: linear-gradient(180deg, #e2d7c4 0%, #d6cab5 55%, #c9bca6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -8px 14px rgba(90, 70, 40, .12),
    inset 1px 0 0 rgba(255,255,255,.25),
    inset -1px 0 0 rgba(90, 70, 40, .12);
}
.rd-groove {
  position: absolute;
  left: 0;
  right: 0;
  top: 16%;
  height: 1px;
  background: rgba(90, 74, 50, .2);
  box-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.rd-lcd {
  position: relative;
  display: grid;
  place-items: center;
  width: 46%;
  height: 40%;
  margin-top: 7%;
  overflow: hidden;
  border-radius: calc(var(--rw) * .008);
  background: linear-gradient(180deg, #0a0c0a, #141915 45%, #0d100e);
  box-shadow:
    0 0 0 calc(var(--rw) * .007) #b6aa94,
    0 0 0 calc(var(--rw) * .01) rgba(255,255,255,.4),
    inset 0 6px 14px rgba(0,0,0,.65);
}
.rd-lcd:after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.rd-lcd-glow {
  filter: drop-shadow(0 0 calc(var(--rw) * .012) var(--lcd));
  transition: filter .25s ease;
}
/* Dot-matrix: the glyphs are masked to a 2px pixel grid. */
.rd-lcd-text {
  display: block;
  font-family: var(--folio-mono), ui-monospace, monospace;
  font-weight: 500;
  font-size: calc(var(--rw) * .046);
  line-height: 1;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--lcd);
  transition: color .2s ease;
  -webkit-mask: radial-gradient(circle, #000 .62px, transparent 1px) 0 0 / 2px 2px;
  mask: radial-gradient(circle, #000 .62px, transparent 1px) 0 0 / 2px 2px;
}
.rd-led {
  position: absolute;
  right: 7%;
  top: 57%;
  width: calc(var(--rw) * .026);
  height: calc(var(--rw) * .026);
  border-radius: 50%;
  transform: translateY(-50%);
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.7), transparent 45%), var(--led);
  box-shadow: 0 0 0 calc(var(--rw) * .004) rgba(60, 50, 35, .35), 0 0 var(--led-glow) var(--led);
  transition: background-color .2s ease, box-shadow .25s ease;
}

.pass-hint {
  position: absolute;
  left: 50%;
  top: calc(var(--sy) + var(--fh) + 40px);
  transform: translate(-50%);
  color: var(--ink-hint, #757575);
  font-size: 1.05rem;
  pointer-events: none;
  font-family: var(--folio-sans);
  font-weight: 500;
  letter-spacing: -.006em;
  text-align: center;
  white-space: nowrap;
  opacity: .85;
}
.pass-hint.shimmer {
  color: transparent;
  background-image: linear-gradient(90deg, var(--ink-hint, #757575) 0%, var(--ink-hint, #757575) 42%, var(--folio-ink, #17160f) 50%, var(--ink-hint, #757575) 58%, var(--ink-hint, #757575) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: hint-shimmer 2.2s linear infinite;
}
.pass-stage[data-state="error"] .pass-hint {
  color: #c2473b;
}
.skip-link {
  position: absolute;
  right: 24px;
  bottom: 22px;
  z-index: 5;
  padding: 4px 6px;
  color: var(--ink-faint, #6c6c6c);
  font-size: .9rem;
  font-family: var(--folio-sans);
  font-weight: 500;
  letter-spacing: -.015em;
  background: none;
  border: none;
  cursor: pointer;
}
.skip-link:hover {
  color: var(--ink-faint-hover, #6c6c6c);
}


/* ---------- Window shade ---------- */

.cabin [data-shade] {
  will-change: transform;
}
.cabin .local-window-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(ellipse at 50% 42%, rgb(8 8 8 / .08), rgb(6 6 6 / .78) 72%);
  opacity: var(--local-window-veil, 0);
  clip-path: inset(19.6667% 19.5% 27.2222% 19.3333% round 50.6667px);
}
.cabin button[data-shade-control]:focus-visible {
  outline: 2px solid var(--folio-blue) !important;
  outline-offset: 3px;
}

/* ---------- The flight: scene, cabin, chapters ---------- */

html {
  background: var(--folio-bg);
}
body {
  background: transparent;
}
.folio.flight {
  position: relative;
  z-index: 2;
  background: transparent;
  display: block;
  text-shadow: 0 1px 14px rgba(8, 10, 30, calc(var(--local-theme-progress) * .35));
}

/* The view outside. Every layer moves with transform/opacity only. */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #d6e4f2;
  --night: 0;
  --flare: 0;
  --spoilers: 0;
  will-change: transform;
}
.scene > *,
.ground > *,
.city > * {
  position: absolute;
}
.sky {
  inset: 0;
  will-change: opacity;
}
.stars {
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

/* A few brighter stars that twinkle, and a crescent moon. */
.twinkles {
  inset: 0;
  opacity: 0;
}
.twinkles i {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, .8);
  animation: twinkle var(--d, 3s) ease-in-out var(--delay, 0s) infinite alternate;
}
@keyframes twinkle {
  from { opacity: .15; transform: scale(.7); }
  to { opacity: 1; transform: scale(1.15); }
}
.moon {
  left: 82%;
  top: 13%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  box-shadow: inset -12px 7px 0 0 #f3eedb, 0 0 34px rgba(243, 238, 219, .18);
  opacity: 0;
  will-change: opacity;
}

.sun {
  left: 0;
  top: 0;
  width: 90vmax;
  height: 90vmax;
  margin: -45vmax 0 0 -45vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 252, 240, .98) 0 1.1%, rgba(255, 238, 205, .6) 2%, rgba(255, 224, 176, .2) 8%, rgba(255, 214, 160, .06) 22%, rgba(255, 210, 160, 0) 45%);
  will-change: transform, opacity;
}
/* A thin anamorphic streak through the sun at golden hour and sunset. */
.sun-streak {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  background: linear-gradient(90deg, transparent, rgba(255, 214, 160, .55) 30%, rgba(255, 244, 222, .9) 50%, rgba(255, 214, 160, .55) 70%, transparent);
  filter: blur(1px);
  opacity: var(--flare);
}

/* High cirrus and the odd airliner crossing far away. */
.cirrus {
  inset: 0;
  will-change: opacity;
}
.cirrus img {
  position: absolute;
  left: 0;
  top: 0;
  opacity: .32;
  will-change: transform;
  transition: filter 1.2s ease;
}
.cirrus img:first-child {
  width: 62vw;
  top: 7vh;
}
.cirrus img:last-child {
  width: 44vw;
  top: 17vh;
  opacity: .22;
}
.traffic {
  left: 0;
  top: 0;
  opacity: .8;
  color: rgba(52, 58, 76, .7);
  will-change: transform;
}
.traffic-plane {
  position: absolute;
  left: -7px;
  top: -6px;
  width: 11px;
  height: 10px;
  transform: rotate(-90deg);
}
.traffic-trail {
  position: absolute;
  left: 4px;
  top: -3px;
  width: 38vw;
  height: 6px;
  transform-origin: 0 50%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0)) 0 0 / 100% 1.5px no-repeat,
    linear-gradient(90deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0)) 0 3.5px / 100% 1.5px no-repeat;
  filter: blur(.6px);
  transition: filter 1.2s ease;
}

.ground {
  inset: 0;
  transform-origin: 72% 52%;
  will-change: transform, opacity;
  /* The horizon sits just below the centre of the window glass. */
  --horizon: calc(var(--win-y) + 12px);
}
.land {
  left: -30%;
  right: -30%;
  top: var(--horizon);
  bottom: -60%;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .035) 0 10px, rgba(0, 0, 0, .03) 10px 22px),
    linear-gradient(#c4c6b8 0%, #9ea493 6%, #7f8874 24%, #69725f 60%, #5a6252 100%);
}
.skyline-day {
  left: 0;
  width: 100%;
  height: 24vh;
  top: calc(var(--horizon) - 24vh + 1px);
}
.airport {
  left: 0;
  width: 210%;
  height: 12vh;
  top: calc(var(--horizon) - 10vh);
  will-change: transform;
}
.taxiway {
  left: -30%;
  right: -30%;
  top: calc(var(--horizon) + (76vh - var(--horizon)) * .42);
  height: 2.4vh;
  background: linear-gradient(#8a8d93, #74777e);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .2);
}
.taxiway:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(236, 196, 72, .8);
}
.taxi-lights {
  position: absolute;
  left: 0;
  top: -2px;
  width: 400%;
  height: 5px;
  background: radial-gradient(circle, #9ec0ff 0 1.3px, rgba(120, 160, 255, .35) 2px, transparent 3.5px) 0 0 / 90px 5px repeat-x;
  will-change: transform;
}
.signs {
  left: 0;
  top: calc(var(--horizon) + (76vh - var(--horizon)) * .72);
  width: 0;
  height: 0;
}
.signs i {
  position: absolute;
  left: 0;
  top: -22px;
  width: 22px;
  height: 16px;
  border-radius: 1px;
  background: #16171a;
  color: #fff;
  font: 600 11px/16px var(--folio-mono);
  font-style: normal;
  text-align: center;
  will-change: transform;
}
.signs i:after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 16px;
  height: 6px;
  border-left: 1px solid #2b2c30;
  border-right: 1px solid #2b2c30;
}
.runway {
  left: -30%;
  right: -30%;
  top: 76%;
  height: 16%;
  background:
    linear-gradient(transparent 0 10px, rgba(255, 255, 255, .5) 10px 12px, transparent 12px),
    linear-gradient(#7d8087 0%, #63666d 45%, #56595f 100%);
  box-shadow: 0 -2px 0 rgba(255, 255, 255, .25);
}
.runway-lights {
  position: absolute;
  left: 0;
  top: -3px;
  width: 400%;
  height: 8px;
  background: radial-gradient(circle, #fffaf0 0 2px, rgba(255, 240, 210, .4) 3px, transparent 5px) 0 0 / 150px 8px repeat-x;
  will-change: transform;
}

.sea {
  left: 0;
  right: 0;
  top: 0;
  height: 160vh;
  will-change: transform, opacity;
  /* Texture height and period (the sprite is 3.75:1); the drift in JS uses the same period. */
  --sea-h: 46vh;
  --sea-tile: 172.5vh;
}
.sea-far {
  --sea-h: 20vh;
  --sea-tile: 75vh;
}
.sea-layer {
  position: absolute;
  left: 0;
  top: 0;
  /* Exactly one texture period wider than the screen: never a gap while drifting. */
  width: calc(100% + var(--sea-tile) + 8px);
  height: 100%;
  opacity: 0;
  /* The fill sits over the texture: it dissolves the texture's lower edge into
     the deck's own colour (no line where the texture ends), then deepens. */
  background-repeat: no-repeat, repeat-x;
  background-size: 100% 100%, auto var(--sea-h);
  will-change: transform, opacity;
}
.sea-layer[data-tint="day"] { background-image: linear-gradient(transparent calc(var(--sea-h) - 11vh), #f0f3f8 calc(var(--sea-h) - 1vh), #dfe6f1 calc(var(--sea-h) + 30vh)), url(sky/sea-day.webp); }
.sea-layer[data-tint="gold"] { background-image: linear-gradient(transparent calc(var(--sea-h) - 11vh), #f0ddc9 calc(var(--sea-h) - 1vh), #dcc3b4 calc(var(--sea-h) + 30vh)), url(sky/sea-gold.webp); }
.sea-layer[data-tint="dusk"] { background-image: linear-gradient(transparent calc(var(--sea-h) - 11vh), #caa0a2 calc(var(--sea-h) - 1vh), #7c6b96 calc(var(--sea-h) + 30vh)), url(sky/sea-dusk.webp); }
.sea-layer[data-tint="night"] { background-image: linear-gradient(transparent calc(var(--sea-h) - 11vh), #2d3450 calc(var(--sea-h) - 1vh), #181c30 calc(var(--sea-h) + 30vh)), url(sky/sea-night.webp); }
/* The far deck: smaller, slower and hazier, for depth. */
.sea-far .sea-layer {
  filter: saturate(.85) brightness(1.03);
}
.sea-far .sea-layer[data-tint="day"] { background-image: linear-gradient(transparent calc(var(--sea-h) - 6vh), #f0f3f8 calc(var(--sea-h) - .5vh), #e3e9f3 calc(var(--sea-h) + 14vh)), url(sky/sea-day.webp); }
.sea-far .sea-layer[data-tint="gold"] { background-image: linear-gradient(transparent calc(var(--sea-h) - 6vh), #f0ddc9 calc(var(--sea-h) - .5vh), #e2c9b9 calc(var(--sea-h) + 14vh)), url(sky/sea-gold.webp); }
.sea-far .sea-layer[data-tint="dusk"] { background-image: linear-gradient(transparent calc(var(--sea-h) - 6vh), #caa0a2 calc(var(--sea-h) - .5vh), #85739d calc(var(--sea-h) + 14vh)), url(sky/sea-dusk.webp); }
.sea-far .sea-layer[data-tint="night"] { background-image: linear-gradient(transparent calc(var(--sea-h) - 6vh), #2d3450 calc(var(--sea-h) - .5vh), #1b1f34 calc(var(--sea-h) + 14vh)), url(sky/sea-night.webp); }

/* After sunset the lower sky and the deck fall into shadow, so light text
   reads against them. */
.dusk {
  inset: 0;
  opacity: 0;
  background: linear-gradient(180deg, rgba(30, 22, 56, 0) 30%, rgba(30, 22, 56, .42) 62%, rgba(24, 18, 46, .62) 100%);
  will-change: opacity;
}

/* Cumulus drifting above the deck, tinted with the time of day. */
.cumulus {
  inset: 0;
}
.cumulus img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100px;
  height: 50px;
  transform-origin: 0 0;
  will-change: transform;
  transition: filter 1.2s ease;
}
.scene[data-tod="gold"] .cumulus img,
.scene[data-tod="gold"] .cirrus img {
  filter: sepia(.35) saturate(1.5) hue-rotate(-10deg) brightness(1.02);
}
.scene[data-tod="dusk"] .cumulus img,
.scene[data-tod="dusk"] .cirrus img {
  filter: sepia(.55) saturate(1.9) hue-rotate(-32deg) brightness(.8);
}
.scene[data-tod="night"] .cumulus img,
.scene[data-tod="night"] .cirrus img {
  filter: brightness(.3) sepia(.8) hue-rotate(185deg) saturate(1.5);
}
.scene[data-tod="gold"] .traffic-trail {
  filter: blur(.6px) sepia(.8) saturate(2) hue-rotate(-15deg);
}

.city {
  inset: 0;
  opacity: 0;
  transform-origin: 50% 70%;
  will-change: transform, opacity;
}
.city-glow {
  left: -20%;
  right: -20%;
  top: 38%;
  height: 80%;
  background: radial-gradient(ellipse 60% 40% at 50% 30%, rgba(255, 168, 92, .32), rgba(255, 140, 70, .1) 45%, transparent 75%);
}
.skyline-night {
  left: 0;
  width: 100%;
  height: 34vh;
  top: calc(62% - 34vh + 1px);
}
.city-lights {
  left: 0;
  width: 100%;
  top: 62%;
  height: 38%;
}
/* Cars on the expressways: tail lights heading away, headlights coming in. */
.cars {
  left: 0;
  top: 62%;
  width: 100%;
  height: 38%;
}
.cars i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 3px;
  height: 3px;
  margin: -1.5px;
  border-radius: 50%;
  background: #ff5a44;
  box-shadow: 0 0 5px rgba(255, 90, 68, .9);
  opacity: 0;
  animation: drive var(--d, 9s) linear var(--delay, 0s) infinite;
}
.cars i.is-head {
  background: #fff4dc;
  box-shadow: 0 0 6px rgba(255, 244, 220, .9);
  animation-direction: reverse;
}
@keyframes drive {
  0% { transform: translate3d(0, 0, 0) scale(1.3); opacity: 0; }
  6% { opacity: 1; }
  88% { opacity: .9; }
  100% { transform: translate3d(var(--dx), var(--dy), 0) scale(.35); opacity: 0; }
}
/* Approach lights: the sequenced flash runs toward the runway on final. */
.approach {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  will-change: opacity;
}
.approach i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 5px;
  height: 5px;
  margin: -2.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 2px rgba(210, 225, 255, .8);
  opacity: .12;
  animation: rabbit 1.1s linear var(--delay, 0s) infinite;
}
@keyframes rabbit {
  0%, 12% { opacity: 1; }
  24%, 100% { opacity: .12; }
}

.fly {
  inset: 0;
}
.fly img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100px;
  height: 100px;
  opacity: 0;
  will-change: transform, opacity;
}
.fly.is-night {
  /* Moonlit slate blue (a plain grey reads olive against the night sky). */
  filter: brightness(.32) sepia(.8) hue-rotate(185deg) saturate(1.7);
}
.veil {
  inset: 0;
  opacity: 0;
  background: #f3f6fa;
  will-change: opacity;
}
.veil.is-night {
  background: #10142a;
}

.wing {
  right: 0;
  bottom: 0;
  width: min(64vw, 900px);
  aspect-ratio: 940 / 400;
  will-change: transform;
}
.wing-art {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: scaleX(-1);
}
.wing-flap {
  fill: #a9b1bd;
  transform: translate(calc(var(--flaps, 0) * -2.4px), calc(var(--flaps, 0) * 26px));
}
.wing-fairings {
  fill: #9ea7b4;
}
.wing-under {
  filter: brightness(calc(1 - var(--night) * .78));
}
.wing-lines,
.wing-lines-night {
  fill: none;
  stroke-width: 1;
}
.wing-lines {
  stroke: rgba(120, 130, 146, .45);
}
.wing-lines-night {
  stroke: rgba(160, 170, 210, .12);
}
.wing-spoilers {
  fill: rgba(255, 255, 255, .12);
  stroke: rgba(120, 130, 146, .5);
  stroke-width: 1;
}
.wing-spoilers-up {
  fill: rgba(240, 244, 250, .95);
  stroke: rgba(70, 78, 92, .7);
  stroke-width: 1.2;
  opacity: var(--spoilers);
  filter: brightness(calc(1 - var(--night) * .75));
}
.wing-livery {
  fill: #3a53ed;
}
.wing-glint {
  opacity: var(--flare);
  mix-blend-mode: screen;
}
.wing-night {
  opacity: var(--night);
}
.wing-nav-halo {
  fill: rgba(255, 84, 72, .22);
  opacity: var(--night);
}
.wing-nav {
  fill: #ff5448;
  opacity: calc(.35 + var(--night) * .65);
}
.wing-strobe {
  fill: #fff;
  opacity: 0;
  animation: wingStrobe 2.6s linear infinite;
}
@keyframes wingStrobe {
  0%, 84%, 100% { opacity: 0; }
  86% { opacity: 1; }
  88% { opacity: 0; }
  91% { opacity: 1; }
  93% { opacity: 0; }
}

/* The cabin wall is the spread shadow of the window hole; scaling it flies you out. */
:root {
  --win-k: 1.35;
  --win-y: 45vh;
}
.cabin {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  --cabin-wall: #faf5f5;
}
.cabin.is-gone {
  visibility: hidden;
}
.cabin-window {
  position: absolute;
  left: 50%;
  top: var(--win-y);
  width: 200px;
  height: 300px;
  margin: -150px 0 0 -100px;
  transform-origin: 100px 138.67px;
  transform: scale(var(--win-k));
  isolation: isolate;
  user-select: none;
  will-change: transform;
}
/* Cabin wall panel seams either side of the window (they zoom with it). */
.cabin-window:before,
.cabin-window:after {
  content: "";
  position: absolute;
  top: -200%;
  bottom: -200%;
  width: 1px;
  background: linear-gradient(transparent, rgba(60, 50, 40, .06) 30%, rgba(60, 50, 40, .06) 70%, transparent);
  z-index: 1;
}
.cabin-window:before {
  left: -118px;
}
.cabin-window:after {
  right: -118px;
}
.cabin-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, transparent 55%, rgba(70, 58, 44, .07) 100%);
}
/* The wall: a plain full-screen layer with the glass cut out of it (the cut
   follows the window's zoom from JS, see cutWall in runtime.js). */
.cabin-wall {
  position: absolute;
  inset: 0;
  background: var(--cabin-wall);
}
.cabin button[data-shade-control] {
  pointer-events: auto;
}
.cabin.is-flying button[data-shade-control] {
  pointer-events: none;
}

/* Header + HUD */
.fs-hud {
  color: var(--folio-blue);
}

/* Hero: the intro sits under the window on the cabin wall. */
.flight .hero {
  position: relative;
  height: 100vh;
}
.hero-intro {
  position: absolute;
  left: 50%;
  top: calc(var(--win-y) + 150px * var(--win-k) - 4px);
  width: min(480px, calc(100% - 48px));
  margin-left: calc(min(480px, calc(100% - 48px)) / -2);
  text-align: center;
  --reveal-opacity: 1;
  will-change: transform, opacity;
}
/* "Scroll for takeoff": sits just above the window frame. */
.takeoff-cue-wrap {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--win-y) - 11.33px - 108.67px * var(--win-k) - 24px);
  translate: 0 -100%;
  display: flex;
  justify-content: center;
  will-change: transform, opacity;
}
.takeoff-cue {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 13px 18px;
  border: 1px solid rgba(58, 83, 237, .26);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 12px 32px rgba(36, 48, 120, .1), 0 1px 2px rgba(36, 48, 120, .08);
  font: 500 13px/1 var(--folio-mono);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--folio-ink);
  cursor: pointer;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), background-color .3s var(--ease-out);
}
.takeoff-cue:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: 0 16px 38px rgba(36, 48, 120, .14), 0 1px 2px rgba(36, 48, 120, .08);
}
.takeoff-cue:focus-visible {
  outline: 2px solid var(--folio-blue);
  outline-offset: 3px;
}
/* A soft ring breathes out from the pill to draw the eye. */
.takeoff-cue:after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(58, 83, 237, .45);
  pointer-events: none;
  animation: cuePulse 2.6s var(--ease-out) infinite;
}
@keyframes cuePulse {
  0% { transform: scale(1); opacity: .8; }
  70%, 100% { transform: scale(1.12, 1.45); opacity: 0; }
}
.takeoff-plane {
  width: 15px;
  height: 14px;
  color: var(--folio-blue);
}
.takeoff-arrow {
  width: 11px;
  height: 15px;
  fill: none;
  stroke: var(--folio-blue);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: cueBob 1.8s var(--ease-out) infinite;
}
@keyframes cueBob {
  0%, 100% { transform: translateY(-2px); opacity: .55; }
  50% { transform: translateY(3px); opacity: 1; }
}
.beat-takeoff {
  height: 100vh;
}
.beat-climb {
  height: 110vh;
}

/* Chapters */
.chapter {
  width: min(100% - 3rem, var(--folio-col-w));
  margin: 0 auto;
  padding: 26vh 0 14vh;
}
.chapter:first-child {
  padding-top: 10vh;
}
.chapter-head {
  margin-bottom: 44px;
}
.chapter-meta {
  font: 500 11px/1 var(--folio-mono);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--folio-blue);
}
.chapter-title {
  margin-top: 16px;
  font-family: var(--folio-sans);
  font-weight: 500;
  font-size: clamp(48px, 8.4vw, 92px);
  line-height: .92;
  letter-spacing: -.045em;
  color: var(--folio-ink);
}
.chapter-note {
  margin-top: 14px;
  font: 500 12px/1.4 var(--folio-mono);
  letter-spacing: 1.84px;
  text-transform: uppercase;
  color: var(--folio-mute);
}
.flight .folio-timeline {
  gap: 40px;
}
.flight .tl-desc,
.flight .stop-desc {
  opacity: .88;
}

/* Arrival */
.descent {
  position: relative;
  height: 250vh;
}
.descent-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: start center;
  padding-top: 19vh;
}
.arrival {
  width: min(100% - 3rem, 980px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.arrival-title {
  font-family: var(--folio-sans);
  font-weight: 500;
  font-size: clamp(44px, 6.4vw, 88px);
  line-height: .95;
  letter-spacing: -.045em;
  text-wrap: balance;
  color: var(--folio-ink);
}
.arrival-sub {
  margin-top: 16px;
  font-size: 18px;
  line-height: 1.5;
  color: var(--folio-body);
}
.arrival-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}
.arrival-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px 11px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font: 500 12px/1 var(--folio-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--folio-ink);
  text-decoration: none;
  transition: background-color .25s var(--ease-out), border-color .25s var(--ease-out), transform .25s var(--ease-out);
}
.arrival-link.is-email {
  letter-spacing: .04em;
  text-transform: none;
}
.arrival-link:hover {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .55);
  transform: translateY(-1px);
}
.arrival-link .ico-out {
  width: 9px;
  height: 9px;
}
.ico-mail {
  width: 14px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

@media (max-width: 1219px) {
  .flight .folio-sticky {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    justify-content: center;
    padding-top: 32px;
  }
}
@media (max-width: 760px) {
  :root {
    --win-k: 1.05;
    --win-y: max(50vh, 356px);
  }
  .fs-lines p[aria-hidden="true"]:not(.fs-hud) {
    display: none;
  }
  .takeoff-cue {
    font-size: 12px;
    padding: 13px 18px 12px 16px;
  }
  .arrival-sub {
    font-size: 16px;
  }
  .chapter {
    padding: 22vh 0 10vh;
  }
  .flight .tl-entry {
    padding-left: 0;
  }
  .wing {
    width: 92vw;
  }
}

@media (max-width: 760px) and (max-height: 700px) {
  :root {
    --win-k: .86;
    --win-y: max(46vh, 300px);
  }
  /* Short phones: the footer waits until takeoff so the intro has room. */
  .folio-footer,
  .folio-footer-fx {
    transition: opacity .5s var(--ease-out);
  }
  html.at-gate .folio-footer,
  html.at-gate .folio-footer-fx {
    opacity: 0;
    pointer-events: none;
  }
}
@media (max-width: 760px) and (max-height: 600px) {
  .hero-intro .folio-sub {
    display: none;
  }
}

/* Tablets and small laptops: the header is centred on top, so the window
   sits low enough for the cue to clear it. */
@media (min-width: 761px) and (max-width: 1219px) {
  :root {
    --win-y: max(45vh, 384px);
  }
}
@media (min-width: 761px) and (max-width: 1219px) and (max-height: 740px) {
  :root {
    --win-k: 1;
    --win-y: max(47vh, 346px);
  }
}
@media (min-width: 1220px) and (max-height: 640px) {
  :root {
    --win-k: 1.1;
    --win-y: 47vh;
  }
}
@media (min-width: 761px) and (max-height: 600px) {
  .hero-intro .folio-sub {
    display: none;
  }
}

/* Phones held sideways (and other wide, very short screens): a compact
   cabin. Name and flight readout top-left, the cue pinned to the top, a
   smaller window below it. */
@media (min-width: 480px) and (max-height: 520px) {
  :root {
    --win-k: .8;
    --win-y: 160px;
  }
  .flight .folio-sticky {
    position: absolute;
    top: 0;
    left: 0;
    right: auto;
    justify-content: flex-start;
    padding: 14px 0 0 max(20px, env(safe-area-inset-left));
  }
  .flight .fs-rail {
    display: none;
  }
  .flight .fs-lines {
    padding: 0;
    text-align: left;
  }
  .flight .fs-lines p:not(.fs-hud) {
    display: none;
  }
  .takeoff-cue-wrap {
    top: 12px;
    translate: none;
  }
  .takeoff-cue {
    font-size: 11px;
    gap: 10px;
    padding: 11px 16px 10px 14px;
  }
  .hero-intro .folio-sub {
    display: none;
  }
  /* The footer waits until takeoff so the intro has room. */
  .folio-footer,
  .folio-footer-fx {
    transition: opacity .5s var(--ease-out);
  }
  html.at-gate .folio-footer,
  html.at-gate .folio-footer-fx {
    opacity: 0;
    pointer-events: none;
  }
}
@media (min-width: 480px) and (max-height: 420px) {
  :root {
    --win-k: .7;
    --win-y: 148px;
  }
}
@media (min-width: 480px) and (max-height: 350px) {
  :root {
    --win-k: .62;
    --win-y: 138px;
  }
}
/* Reduced motion: no fly-through. The window scrolls away with the hero. */
html.rm .cabin {
  position: absolute;
  height: 100vh;
  /* The wall is a huge shadow around the glass; keep it to the hero. */
  overflow: hidden;
}
html.rm .wing-strobe,
html.rm .twinkles i,
html.rm .cars i,
html.rm .approach i,
html.rm .takeoff-arrow,
html.rm .takeoff-cue:after {
  animation: none;
}


/* ---------- Experience ---------- */

.tl-entry {
  animation: none !important;
}
.folio .tl-logo {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(var(--shadow-rgb), .07), 0 1px 2px rgba(var(--shadow-rgb), .05);
}
.folio .tl-logo img {
  transform: none;
  object-fit: contain;
  padding: 3px;
}
.folio .tl-logo.is-bleed img {
  padding: 0;
  object-fit: cover;
}
.t-avatar {
  transition: transform var(--avatar-dur) var(--avatar-ease-out);
}
.t-avatar:hover,
.t-avatar:focus-within {
  --shift: var(--avatar-lift);
  --scale-active: var(--avatar-scale);
  transition-timing-function: var(--avatar-ease-in);
}


/* ---------- Content blocks ---------- */

.stops {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--stop-gap);
}
.stop-head {
  position: relative;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 10px;
}
.stop-name {
  font-family: var(--folio-sans);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: -.12px;
  color: var(--folio-ink);
}
.stop-tag {
  font: var(--mono-label);
  letter-spacing: .96px;
  text-transform: uppercase;
  color: var(--folio-blue);
}
.stop-links {
  display: inline-flex;
  gap: 14px;
  margin-left: auto;
}
.stop-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: var(--mono-label);
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--folio-mute);
  text-decoration: none;
  transition: color .2s var(--ease-out);
}
.stop-link:hover {
  color: var(--folio-ink);
}
.ico-out {
  width: 8px;
  height: 8px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s var(--ease-out);
}
.stop-link:hover .ico-out {
  transform: translate(1px, -1px);
}
.stop-desc {
  max-width: 34em;
  margin-top: 1px;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -.1px;
  color: var(--folio-body);
  opacity: .8;
}

.medal,
.medal-tag:before {
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--medal);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 2px rgba(0,0,0,.18), 0 .5px 1.5px rgba(0,0,0,.18);
}
.medal.gold,
.medal-tag.gold {
  --medal: radial-gradient(circle at 32% 28%, #fff4c8, #e4b322 52%, #9a6a08 100%);
}
.medal.silver,
.medal-tag.silver {
  --medal: radial-gradient(circle at 32% 28%, #f7f7f7, #c5c5c5 52%, #7d7d7d 100%);
}
.medal.bronze,
.medal-tag.bronze {
  --medal: radial-gradient(circle at 32% 28%, #ffe2c6, #c8874a 52%, #7a4a1f 100%);
}
.medal {
  width: 11px;
  height: 11px;
}
.medal-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: var(--mono-label);
  letter-spacing: .96px;
  text-transform: uppercase;
  color: var(--folio-mute);
}
.medal-tag:before {
  content: "";
  width: 8px;
  height: 8px;
}

/* Kaggle standing, set like the field box on the boarding pass */
.fare-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 18px;
  margin-bottom: 28px;
  padding: 15px 8px 13px;
  border: 1px solid var(--folio-rule);
  border-radius: 3px;
  background: var(--surface-hover);
}
.fb-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}
.fb-label {
  font: var(--mono-label);
  line-height: 1;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--folio-blue);
}
.fb-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--folio-mono);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--folio-ink);
}
.fb-sub {
  font: var(--mono-label);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--folio-mute);
}

/* Kaggle: the rest of the record, and a link out */
.kaggle-more {
  margin-top: 36px;
}
.kaggle-profile {
  margin-top: 18px;
}
.stops .stop-link {
  font-variant-numeric: tabular-nums;
}

/* Skills manifest */
.manifest {
  display: flex;
  flex-direction: column;
}
.mf-row {
  display: grid;
  grid-template-columns: 124px 1fr;
  column-gap: 16px;
  padding: 13px 0 12px;
  background-image: radial-gradient(circle at 1px 1px, var(--folio-rule) .8px, transparent 1px);
  background-size: 4px 2px;
  background-repeat: repeat-x;
}
.mf-row:first-child {
  padding-top: 0;
  background-image: none;
}
.mf-label {
  padding-top: 6px;
  font: var(--mono-label);
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--folio-mute);
  transition: color .25s var(--ease-out);
}
.mf-row:hover .mf-label {
  color: var(--folio-blue);
}
.mf-items {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  font-size: 15px;
  line-height: 1.75;
  letter-spacing: -.1px;
  color: var(--folio-body);
}
.mf-items li {
  white-space: nowrap;
}
.mf-items li:not(:last-child):after {
  content: "·";
  padding: 0 .5em;
  color: var(--folio-mute);
}


/* Once the text turns light at dusk, a faint shadow keeps it legible where
   it crosses the sunlit cloud deck. */
html.ink-light .flight .chapter,
html.ink-light .flight .arrival {
  text-shadow: 0 0 18px rgba(22, 16, 46, calc(var(--local-theme-progress) * .42)), 0 1px 2px rgba(22, 16, 46, calc(var(--local-theme-progress) * .22));
}

/* ---------- Scroll reveals ---------- */

html.rv-on [data-rv] {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  filter: blur(5px);
  transition:
    opacity .7s var(--ease-out),
    transform .9s var(--ease-out),
    filter .7s var(--ease-out);
  transition-delay: var(--rv-delay, 0ms);
}
html.rv-on [data-rv].is-in {
  opacity: var(--reveal-opacity, 1);
  transform: none;
  filter: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .stop-desc,
  .mf-items {
    font-size: 15px;
  }
  .mf-row {
    grid-template-columns: 1fr;
    row-gap: 2px;
  }
  .mf-label {
    padding-top: 0;
  }
  .fare-box {
    grid-template-columns: repeat(2, 1fr);
    padding: 14px 4px 12px;
  }
  .fb-value {
    font-size: 17px;
  }
  .pass-hint { font-size: .95rem; }
  .skip-link { font-size: .85rem; right: 12px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html.rv-on [data-rv] {
    opacity: var(--reveal-opacity, 1);
    transform: none;
    filter: none;
    transition: none;
  }
  .pass-hint.shimmer {
    animation: none;
  }
}
