/* JOY storefront. Palette: cream paper, dark-brown ink, navy, antique gold. */

:root {
  --paper: #f4ede0;
  --ivory: #fbf7ee;
  --ink: #432116;
  --ink-soft: #6b4a3d;
  --navy: #1b2740;
  --gold: #b4975a;
  --line: rgba(67, 33, 22, 0.2);
  --display: "Cormorant Garamond", "Times New Roman", serif;
  --text: "EB Garamond", Georgia, serif;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.1875rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5.4vw, 4.75rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }

p { margin: 0 0 1em; max-width: 34em; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--gold); }

:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }

.skip {
  position: absolute;
  left: -999px;
  background: var(--ink);
  color: var(--ivory);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

.fine { font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- buttons and links ---------- */

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--ivory);
  border: 1px solid var(--ink);
  padding: 0.8rem 1.9rem;
  font: inherit;
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.btn:hover { background: transparent; color: var(--ink); }

.text-link { font-style: italic; }

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem var(--gutter);
  min-height: 4.6rem;
  border-bottom: 1px solid var(--line);
}
.brand img { width: 40px; height: auto; }
.site-header nav { display: flex; gap: clamp(1.1rem, 3vw, 2.5rem); }
.site-header nav a { text-decoration: none; font-size: 1.0625rem; white-space: nowrap; }
.site-header nav a:hover { text-decoration: underline; text-decoration-color: var(--gold); }

/* ---------- home: hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  min-height: min(calc(100vh - 4.6rem), 54rem);
}
.hero-text {
  align-self: center;
  padding: 3rem var(--gutter);
}
.hero-text p { max-width: 27em; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2rem;
}
.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 6%; /* keep the head in frame when the window is short */
}

/* ---------- home: collection ---------- */

.collection { padding: clamp(4rem, 9vw, 8rem) var(--gutter); }
.collection h2 { margin-bottom: 0.4em; }
.collection .gift-offer { margin-bottom: 2.5rem; }
.gift-offer { font-style: italic; color: var(--ink-soft); }
.product-info .gift-offer { margin: -0.6rem 0 1.2rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: clamp(2rem, 5vw, 5rem);
  max-width: 72rem;
}
.tile { display: block; text-decoration: none; }
.tile img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--ivory);
}
.tile-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 1rem;
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1.2;
}
.tile:hover .tile-name { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--gold); text-underline-offset: 0.2em; }
.tile-price { white-space: nowrap; }
.tile-color { color: var(--ink-soft); }
.soon-note { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0.9rem 0; margin: 1.5rem 0; font-style: italic; }

/* ---------- home: lookbook carousel ---------- */

.lookbook { padding: 0 0 clamp(4rem, 9vw, 8rem); }
.lookbook h2,
.lookbook > p { padding: 0 var(--gutter); }
.lookbook > p { color: var(--ink-soft); }
.lookbook-stage { height: clamp(19rem, 62vw, 36rem); position: relative; }
.lookbook .circular-carousel:focus-visible { box-shadow: inset 0 0 0 2px var(--navy); }
.lookbook .circular-carousel__title { font-family: var(--display); font-size: 1.35rem; font-weight: 400; }
.lookbook .circular-carousel__subtitle { font-family: var(--text); font-size: 1.05rem; opacity: 1; color: var(--ink-soft); }
.lookbook .circular-carousel__count { display: none; } /* photos repeat, so a count would mislead */

/* ---------- home: 3D embroidery ---------- */

.stitch {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  padding: 0 var(--gutter) clamp(4rem, 9vw, 8rem);
  max-width: 82rem;
  overflow: hidden; /* the tilting swatch must never widen the page */
}
.stitch-ways { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.stitch-ways button {
  font: inherit;
  color: var(--ink);
  background: none;
  border: 1px solid var(--line);
  padding: 0.4rem 1rem;
  cursor: pointer;
}
.stitch-ways button[aria-pressed="true"] { background: var(--ink); color: var(--ivory); border-color: var(--ink); }

/* 3D embroidery (goes with js/stitch3d.js). Thread and fabric colours per colourway: */
.stitch-stage {
  --fab: #1b2740; --fab-2: #141d31; --weave: 0.08;                       /* navy fabric */
  --th: #b8964f; --th-dark: #6f5626; --th-light: #f3e2b0;  /* gold thread: body, side, highlight */
  perspective: 1100px;
  display: grid;
  place-items: center;
  padding: 3.5rem 0;
}
.stitch-stage[data-way="cream"] {
  --fab: #ebe2ce; --fab-2: #ddd2ba;
  --th: #4a2619; --th-dark: #24100a; --th-light: #7d4f3b; --weave: 0.035;
}
.st {
  position: relative;
  width: min(74vw, 400px);
  aspect-ratio: 4 / 5;
  transform-style: preserve-3d;
  will-change: transform;
  transform: rotateX(8deg) rotateY(-14deg);
  --sheen: 50%; --lx: 50%; --ly: 42%;
}
.st > i { position: absolute; inset: 0; display: block; }
/* the fabric: a fine woven texture, a soft highlight that follows the tilt, a deep shadow underneath */
.st-fabric {
  background:
    radial-gradient(circle at var(--lx) var(--ly), rgba(255, 255, 255, 0.13), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, var(--weave)) 0 1px, transparent 1px 4px),
    linear-gradient(160deg, var(--fab), var(--fab-2));
  box-shadow: 0 30px 50px -22px rgba(30, 15, 8, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  transition: background-color 0.4s;
}
/* every thread layer is the logo shape, cut out with a mask */
.st-shadow, .st-l, .st-top {
  -webkit-mask: var(--logo) center / 58% auto no-repeat;
          mask: var(--logo) center / 58% auto no-repeat;
}
.st-shadow { background: rgba(0, 0, 0, 0.5); transform: translate3d(3px, 5px, 0.2px); filter: blur(3px); }
.st-l { background: var(--th-dark); }
.st-top {
  background:
    repeating-linear-gradient(62deg, rgba(0, 0, 0, 0.26) 0 1px, transparent 1px 3px),            /* single threads */
    linear-gradient(100deg, transparent 30%, var(--th-light) 50%, transparent 70%) var(--sheen) 0 / 320% 100% no-repeat, /* light */
    var(--th);
}
@media (max-width: 760px) { .stitch { grid-template-columns: 1fr; } .stitch-stage { padding: 2.5rem 0; } }

/* ---------- home: story teaser ---------- */

.story-teaser {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  padding: 0 var(--gutter) clamp(4rem, 9vw, 8rem);
  max-width: 82rem;
}
.story-teaser img { width: 100%; aspect-ratio: 1; object-fit: cover; }

/* ---------- home: pledge ---------- */

.pledge {
  background: var(--navy);
  color: var(--ivory);
  display: flex;
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(4rem, 9vw, 7.5rem) var(--gutter);
}
.pledge img { width: clamp(80px, 11vw, 150px); flex: none; }
.pledge h2 { max-width: 16em; }
.pledge p { color: #d9d3c4; margin-bottom: 0; }

/* ---------- product ---------- */

.product {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(1.5rem, 4vw, 3.5rem) var(--gutter) clamp(4rem, 8vw, 7rem);
  max-width: 84rem;
  margin: 0 auto;
  min-height: 60vh;
}
.gallery > img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--ivory);
}
.thumbs { display: flex; gap: 0.75rem; margin-top: 0.75rem; }
.thumbs button {
  width: 4.5rem;
  padding: 0;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  opacity: 0.65;
}
.thumbs button[aria-current] { opacity: 1; border-color: var(--ink); }
.thumbs img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* "Turn it": the piece seen from several sides (goes with the turn code in app.js) */
.gallery { overflow: hidden; } /* the photo swings while it turns */
.gallery > img { touch-action: pan-y; -webkit-user-drag: none; user-select: none; }
.turn { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.turn button {
  font: inherit;
  color: var(--ink);
  background: var(--ivory);
  border: 1px solid var(--line);
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 0.9rem;
  cursor: pointer;
}
.turn button:hover { border-color: var(--ink); }
.turn [data-turn="-1"], .turn [data-turn="1"], .turn-view { display: none; }
.turn.on [data-turn="-1"], .turn.on [data-turn="1"] { display: block; font-size: 1.4rem; line-height: 1; padding: 0; }
.turn.on .turn-view { display: block; min-width: 6.5rem; text-align: center; color: var(--ink-soft); }
.turn.on .turn-start { display: none; }
.turn.on ~ * { cursor: default; }

.product-info h1 { font-size: clamp(2.1rem, 3.6vw, 3.25rem); margin-bottom: 0.3em; }
.product-info h2 { font-size: 1.6rem; margin-top: 2.2rem; }
.price { font-family: var(--display); font-size: 1.75rem; margin-bottom: 1.2rem; }

.sizes { border: 0; padding: 0; margin: 1.75rem 0 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sizes legend { padding: 0; margin-bottom: 0.6rem; }
.sizes label { position: relative; }
.sizes input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sizes span {
  display: grid;
  place-items: center;
  min-width: 3.25rem;
  height: 3rem;
  padding: 0 0.6rem;
  border: 1px solid var(--line);
  background: var(--ivory);
}
.sizes input:checked + span { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.sizes input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: 3px; }

.size-guide { margin-bottom: 1.5rem; }
.size-guide summary { cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; width: fit-content; }
.size-guide p { margin: 0.6rem 0 0; color: var(--ink-soft); }

#buy .btn { width: 100%; padding-block: 1rem; }
.form-status { min-height: 1.6em; margin: 0.6rem 0 0; }
.pledge-note {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0;
  margin: 1rem 0 1.5rem;
  font-style: italic;
}
.details { padding-left: 1.1rem; margin: 0 0 1em; }
.details li::marker { color: var(--gold); }

/* ---------- story ---------- */

.story {
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 6rem) var(--gutter) clamp(4rem, 8vw, 7rem);
}
.story-mark { width: clamp(96px, 14vw, 150px); margin-bottom: 2.5rem; }
.lede { font-family: var(--display); font-size: clamp(1.5rem, 2.4vw, 1.9rem); line-height: 1.3; }
.coming { font-style: italic; color: var(--ink-soft); margin-top: 2rem; }
.support-box {
  background: var(--ivory);
  border-left: 2px solid var(--gold);
  padding: 1.5rem 1.75rem;
  margin: 2.5rem 0;
}
.support-box h2 { font-size: 1.6rem; }
.support-box p { margin: 0; }

/* ---------- cart ---------- */

.narrow {
  max-width: 50rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) clamp(4rem, 8vw, 7rem);
  min-height: 60vh;
}
.empty { padding: 2rem 0; }
.product > .empty { grid-column: 1 / -1; }

.cart-lines { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.cart-lines li {
  display: grid;
  grid-template-columns: 6rem 1fr auto;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.cart-lines img { width: 6rem; aspect-ratio: 4 / 5; object-fit: cover; }
.cart-line-text { display: flex; flex-direction: column; gap: 0.2rem; }
.cart-line-text > span { color: var(--ink-soft); }
.cart-line-text > .cart-line-name { color: var(--ink); }
.cart-line-name { font-family: var(--display); font-size: 1.45rem; line-height: 1.2; text-decoration: none; }
.cart-line-price { font-family: var(--display); font-size: 1.45rem; }
.qty { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.6rem; }
.qty button {
  font: inherit;
  color: var(--ink);
  background: var(--ivory);
  border: 1px solid var(--line);
  width: 2.4rem;
  height: 2.4rem;
  cursor: pointer;
}
.qty .remove { width: auto; border: 0; background: none; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; padding: 0 0.25rem; }

.gift-line .cart-line-price { color: var(--ink-soft); }
.qty select {
  font: inherit;
  color: var(--ink);
  background: var(--ivory);
  border: 1px solid var(--line);
  height: 2.4rem;
  padding: 0 0.5rem;
}
.gift-note { font-style: italic; margin: 1.25rem 0 0; max-width: none; }
.gift-note .remove { font: inherit; color: inherit; background: none; border: 0; padding: 0 0.25rem; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.cart-summary { margin: 2rem 0 0 auto; max-width: 24rem; }
.cart-total { display: flex; justify-content: space-between; font-family: var(--display); font-size: 1.7rem; margin-bottom: 0.4rem; }
.cart-pledge { font-style: italic; margin-bottom: 0.3rem; }
.cart-summary .btn { width: 100%; margin-top: 0.8rem; padding-block: 1rem; }
.notice {
  margin-top: 1.5rem;
  background: var(--ivory);
  border-left: 2px solid var(--gold);
  padding: 1.25rem 1.5rem;
}
.notice h2 { font-size: 1.6rem; }
.notice p { margin: 0; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 3.5rem var(--gutter) 2.5rem; }
.footer-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.4rem; }
.footer-inner img { width: 56px; margin-bottom: 1rem; }
.footer-inner p { margin: 0; }
.footer-inner .support { font-size: 1rem; color: var(--ink-soft); }
.footer-inner nav { display: flex; gap: 1.75rem; margin: 1.25rem 0 0.75rem; }

/* ---------- phone and small tablet ---------- */

@media (max-width: 760px) {
  body { font-size: 1.125rem; }

  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-photo { order: -1; aspect-ratio: 4 / 5; max-height: 68vh; }
  .hero-text { padding: 2.5rem var(--gutter) 1rem; }

  .story-teaser { grid-template-columns: 1fr; }
  .pledge { flex-direction: column; align-items: flex-start; }
  .product { grid-template-columns: 1fr; }

  .cart-lines li { grid-template-columns: 4.5rem 1fr; }
  .cart-lines img { width: 4.5rem; }
  .cart-line-price { grid-column: 2; }
  .cart-summary { max-width: none; }
}

/* ---------- flight.html: a walk through the collection (goes with js/flight.js) ---------- */

.flight { position: relative; height: calc(var(--stops, 8) * 115vh + 100vh); }
.flight-view { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.flight-title {
  position: absolute;
  top: 1.25rem;
  left: var(--gutter);
  z-index: 2000;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  margin: 0;
  color: var(--ink-soft);
}
.flight-stations img {
  position: absolute;
  left: 50%;
  top: 50%;
  height: min(66vh, 132vw);
  width: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  max-width: none;
  will-change: transform, opacity;
  box-shadow: 0 40px 60px -30px rgba(30, 15, 8, 0.5);
  visibility: hidden;
}
.flight-card {
  position: absolute;
  top: 50%;
  z-index: 2000;
  width: min(17rem, 22vw);
  transform: translateY(-40%);
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}
.flight-card.on { opacity: 1; transform: translateY(-50%); pointer-events: auto; }
.flight-card[data-side="left"] { left: var(--gutter); }
.flight-card[data-side="right"] { right: var(--gutter); }
.flight-card p { margin: 0; }
.flight-card-title { font-family: var(--display); font-size: clamp(1.9rem, 3vw, 2.7rem); line-height: 1.05; }
.flight-card-line { color: var(--ink-soft); margin: 0.5rem 0 1.1rem !important; }
.flight-card-line:has(+ .flight-card-extra) { margin-bottom: 0.1rem !important; }
.flight-card-extra { font-style: italic; margin: 0 0 1.1rem !important; }
.flight-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.25rem;
  margin: 0;
  max-width: none;
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  z-index: 2000;
  transition: opacity 0.4s;
}
.flight-hint.off { opacity: 0; }
.flight-list { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.flight-end { padding: clamp(4rem, 9vw, 8rem) var(--gutter); text-align: center; }
.flight-end h2 { margin-bottom: 1.5rem; }
.flight-end-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem 1.75rem; max-width: none; }

@media (max-width: 899px) {
  /* phones: the photo sits in the upper part, the card in a band at the bottom */
  .flight-stations img { height: min(58vh, 112vw); }
  .flight-card,
  .flight-card.on {
    top: auto;
    bottom: 0;
    left: 0 !important;
    right: 0 !important;
    width: auto;
    padding: 1.1rem var(--gutter) 1.4rem;
    background: var(--paper);
    border-top: 1px solid var(--line);
    transform: none;
  }
  .flight-card { transform: translateY(12px); }
  .flight-card-title { font-size: 1.7rem; }
  .flight-card-line { margin: 0.25rem 0 0.6rem !important; }
  .flight-hint { bottom: 9.5rem; }
}

/* reduced motion: no camera, a plain list of the same stops */
.flight-static { height: auto; }
.flight-static .flight-view { position: static; height: auto; overflow: visible; padding: 4.5rem var(--gutter) 2rem; }
.flight-static .flight-title { position: static; margin-bottom: 2rem; }
.flight-static .flight-stations { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 3rem; }
.flight-static .flight-stations img { position: static; visibility: visible; width: 100%; height: auto; box-shadow: none; margin-bottom: 1rem; }

/* film version of the flight: one drone film that the scroll plays (see FILM in js/flight.js) */
.flight-film { height: calc(var(--stops, 2) * 215vh + 100vh); } /* bigger number = slower flight */
.flight-film .flight-view { background: var(--navy); }
.flight-film .flight-stations :is(video, .flight-still) {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: auto;
  aspect-ratio: 9 / 16;
  max-width: none;
  transform: translateX(-50%);
  object-fit: cover;
  display: block;
}
.flight-film .flight-title, .flight-film .flight-hint { color: var(--ivory); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55); }
.flight-film .flight-card { color: var(--ivory); }
.flight-film .flight-card .flight-card-line { color: #d9d3c4; }
@media (max-width: 899px) {
  /* phones: the film fills the screen */
  .flight-film .flight-stations :is(video, .flight-still) { width: 100%; height: 100%; aspect-ratio: auto; left: 0; transform: none; }
  .flight-film .flight-card, .flight-film .flight-card.on { background: rgba(27, 39, 64, 0.88); border-top-color: rgba(255, 255, 255, 0.18); }
}

/* wide screens: the landscape film fills the whole window, with the card over a soft shadow on the left */
.flight-wide .flight-stations :is(video, .flight-still) { left: 0; width: 100%; height: 100%; aspect-ratio: auto; transform: none; object-fit: cover; }
.flight-wide .flight-view::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1500;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(12, 17, 30, 0.62), rgba(12, 17, 30, 0.18) 32%, transparent 52%),
              linear-gradient(180deg, rgba(12, 17, 30, 0.35), transparent 22%);
}
.flight-wide .flight-card { width: min(24rem, 30vw); text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5); }
.flight-wide .flight-card-title { font-size: clamp(2.4rem, 3.6vw, 3.6rem); }
.flight-wide .flight-card .flight-card-line, .flight-wide .flight-card-extra, .flight-wide .flight-card .text-link { font-size: 1.3rem; color: var(--ivory); }

/* Keep the whole model in frame at every stop. On windows wider than the film (16:9) the film is
   shown complete, with soft navy at the sides, rather than cropped top and bottom. On narrower
   windows it fills the screen and only the sides are trimmed; the model stands in the middle. */
@media (min-aspect-ratio: 16/9) {
  .flight-wide .flight-stations :is(video, .flight-still) { object-fit: contain; }
  .flight-wide .flight-view::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1400;
    pointer-events: none;
    --film: calc(100vh * 16 / 9);
    --bar: calc((100vw - var(--film)) / 2);
    background: linear-gradient(90deg, var(--navy) calc(var(--bar) - 1px), transparent calc(var(--bar) + 5vw), transparent calc(100vw - var(--bar) - 5vw), var(--navy) calc(100vw - var(--bar) + 1px));
  }
}

/* the exact photo of each stop, faded in over the film while the camera is standing still */
/* two films, one running each way; only the one in use is seen */
.flight-film .flight-stations video { opacity: 0; }
.flight-film .flight-stations video.on { opacity: 1; }
.flight-still { opacity: 0; transition: opacity 0.7s ease; pointer-events: none; }
.flight-still.on { opacity: 1; }
.flight-film .flight-stations .flight-still { visibility: visible; box-shadow: none; }
