/* The flight: a sticky globe on the left, the story scrolling on the right.
   Same system as the rest of the site: black title bars, double borders, no
   rounded corners, no soft shadows, stepped motion, pixels scaled up. */

.flight {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  background: var(--paper);
  border-top: 1px solid var(--ink);
}

/* ------------------------------------------------------------- stage */
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--ink);
  border-right: 1px solid var(--ink);
}
.stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}
.stage.no-land::after {
  content: "The map did not load. The story on the right still works.";
  position: absolute;
  left: 20px;
  top: 20px;
  font-family: var(--pixel);
  font-size: 13px;
  color: var(--yellow);
}

.pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.pin {
  position: absolute;
  left: 0;
  top: 0;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  font-size: 13px;
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
}
.pin.on {
  display: flex;
}
.pin i {
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--coral);
  border: 2px solid var(--paper);
  flex: none;
}
.pin span {
  background: var(--ink);
  border: 1px solid var(--paper);
  padding: 2px 6px;
  transform: translateY(-50%);
  margin-top: -6px;
}
.pin:hover span,
.pin:focus-visible span {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--ink);
}
.pin.net {
  cursor: default;
}
.pin.net i {
  background: var(--yellow);
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
}

.route {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.route button {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--pink);
  cursor: pointer;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.route .n {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 12px;
  border: 1px solid currentColor;
  padding: 1px 5px;
}
.route .c {
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity 0.2s var(--step),
    transform 0.2s var(--step);
}
.route button:hover,
.route button:focus-visible,
.route button.on {
  color: var(--yellow);
}
.route button:hover .c,
.route button:focus-visible .c,
.route button.on .c {
  opacity: 1;
  transform: none;
}
.route button.on .n {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--yellow);
}

.leg {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  margin: 0;
  color: var(--paper);
  font-size: 13px;
}

/* ------------------------------------------------------------- story */
.story {
  padding: 0 clamp(16px, 3.5vw, 56px) 20vh;
  min-width: 0;
}
.stop {
  padding-top: 24vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}
.stop:first-child {
  padding-top: 70vh;
}
/* the two-part divider, "About me" and "What I'm building" */
.stop-head .part {
  border-top: 2px solid var(--ink);
  padding-top: 14px;
  margin: 0 0 56px;
}
.stop-head .part-n {
  margin: 0;
  font-size: 13px;
  color: var(--pink-deep);
}
.stop-head .part-title {
  margin: 6px 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1;
  letter-spacing: -0.04em;
}
.stop-head .part-line {
  margin: 12px 0 0;
  max-width: 44ch;
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.4;
}
.stop-head .meta {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--pink-deep);
}
.stop-head h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(44px, 6vw, 88px);
  line-height: 0.9;
  letter-spacing: -0.06em;
  margin: 0;
}
.stop-head .chapter {
  display: inline-block;
  margin: 14px 0 0;
  background: var(--ink);
  color: var(--yellow);
  padding: 3px 8px;
  font-size: 13px;
}
.stop-head .intro {
  font-family: var(--display);
  font-size: clamp(19px, 1.7vw, 24px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  max-width: 34ch;
  margin: 16px 0 0;
}

/* ------------------------------------------------------------- cards */
.card {
  background: var(--win);
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.4s var(--step),
    transform 0.4s var(--step),
    box-shadow 0.2s var(--step);
}
.card.in,
.stop-head.in {
  opacity: 1;
  transform: none;
}
.stop-head {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.4s var(--step),
    transform 0.4s var(--step);
}
.card:hover {
  box-shadow: 6px 6px 0 var(--coral);
}
.card .win-bar .t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-body {
  padding: 18px 20px 20px;
}
.card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1;
  letter-spacing: -0.045em;
  margin: 0 0 10px;
}
.card .line {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  margin: 0;
}
.card-photo {
  margin: 0;
  border-bottom: 1px solid var(--ink);
}
.card-photo .frame {
  border: 0;
  background: var(--ink);
}
/* Whole photo at its own shape, no taller than 62% of the screen, centred
   on ink when a portrait is narrower than the card. */
.card-photo .frame canvas {
  width: min(100%, calc(62vh * var(--ar)));
  height: auto;
  aspect-ratio: var(--ar);
  margin-inline: auto;
}
.card-photo figcaption {
  font-size: 12px;
  padding: 5px 20px;
  background: var(--paper);
  border-top: 1px solid var(--ink);
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.pills .pill-px {
  font-size: 12px;
  background: var(--paper);
}
.pills .pill-px b {
  font-weight: 400;
  background: var(--gold);
  padding: 0 3px;
}
.more {
  margin-top: 16px;
  border-top: 1px dashed var(--ink);
  padding-top: 12px;
}
.more summary {
  cursor: pointer;
  font-size: 13px;
  list-style: none;
}
.more summary::-webkit-details-marker {
  display: none;
}
.more summary::before {
  content: "+ ";
}
.more[open] summary::before {
  content: "- ";
}
.more summary:hover {
  color: var(--pink-deep);
}
.more .rows {
  margin-top: 12px;
}
.fact {
  margin: 14px 0 0;
  padding: 10px 12px;
  background: var(--yellow);
  border: 1px solid var(--ink);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.4;
}

/* the article */
.press .card-body {
  background: var(--paper);
}
.press blockquote {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(28px, 2.8vw, 40px);
  line-height: 1.02;
  letter-spacing: -0.05em;
  margin: 0 0 14px;
}
.press blockquote::before {
  content: "\201C";
  color: var(--coral);
}
.press blockquote::after {
  content: "\201D";
  color: var(--coral);
}
.press .by {
  margin: 14px 0 0;
  font-size: 12px;
}
.press .by a,
.story a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-underline-offset: 3px;
}
.press .by a:hover,
.story a:hover {
  background: var(--gold);
}

/* now */
.now .card-body {
  background: var(--yellow);
}
.now ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.now li {
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.015em;
  padding-left: 22px;
  position: relative;
}
.now li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 10px;
  height: 10px;
  background: var(--coral);
  border: 1px solid var(--ink);
}

/* the Kyber demo: the pill, the way it sits over the screen on his Mac */
.kyber .card-body {
  background: var(--ink);
  color: var(--paper);
}
.kpill {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--paper);
  box-shadow:
    inset 0 0 0 2px var(--ink),
    inset 0 0 0 3px var(--paper);
  padding: 14px 16px;
  min-height: 92px;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.35;
}
.kmark {
  color: var(--coral);
  font-size: 22px;
  line-height: 1;
  flex: none;
}
.kpill.thinking .kmark {
  animation: kspin 0.8s steps(8, end) infinite;
  color: var(--gold);
}
@keyframes kspin {
  to {
    transform: rotate(180deg);
  }
}
.kasks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.kasks .chip {
  font-family: var(--pixel);
  cursor: pointer;
}
.kyber .note {
  font-size: 12px;
  color: var(--pink);
  margin: 14px 0 0;
}

/* off the clock */
.off .loop {
  margin: 8px 0 18px;
}
.off .interests {
  margin-bottom: 18px;
}

/* ------------------------------------------------------------- boarding */
.pass {
  width: min(420px, calc(100vw - 32px));
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow:
    inset 0 0 0 2px var(--paper),
    inset 0 0 0 3px var(--ink),
    6px 6px 0 var(--coral);
  animation: pop-box 0.3s var(--step);
}
.pass-top,
.pass-foot {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 13px;
}
.pass-top {
  background: var(--ink);
  color: var(--paper);
}
.pass-foot {
  border-top: 1px dashed var(--ink);
}
.pass-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
}
.pass-route b {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 54px;
  line-height: 1;
  letter-spacing: -0.05em;
}
.pass-route span {
  font-size: 12px;
}
.pass-route .plane {
  color: var(--coral);
  font-size: 14px;
}
.pass .startup-bar {
  width: auto;
  margin: 0 14px 14px;
}

/* ------------------------------------------------------------- phones
   The globe becomes a band pinned across the top and the story scrolls under
   it. Same route, same pins, same camera. */
@media (max-width: 860px) {
  .flight {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage {
    height: 42vh;
    height: 42svh;
    z-index: 2;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }
  .route {
    top: auto;
    bottom: 40px;
    left: 12px;
    transform: none;
    display: flex;
    gap: 4px;
  }
  .route .c {
    display: none;
  }
  .leg {
    left: 12px;
    bottom: 12px;
    font-size: 12px;
  }
  .stop {
    padding-top: 14vh;
  }
  .stop:first-child {
    padding-top: 30vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .stop-head {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .kpill.thinking .kmark {
    animation: none;
  }
}

.pin.here span {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--ink);
}

/* On a 390x844 phone the 420px cloud band filled the first screen and pushed
   the headline below the fold, which fails the ten-second test in SCOPE.md. */
@media (max-width: 640px) {
  .clouds {
    height: 34svh;
    min-height: 240px;
  }
}

/* ------------------------------------------------------------- the drive
   In London the globe dives into the city and the Supra takes the stage. */
/* A hard cut, no fade: the globe has dived until it is one dithered field
   and the drive opens overhead on the same ramp, so the frames match. */
#supra {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.driving #supra {
  opacity: 1;
}
.scene #globe,
.scene .pins {
  opacity: 0;
}
.scene-block {
  display: grid;
}
/* 70vh left half the story column as blank paper between cards */
.beat {
  min-height: 50vh;
  display: flex;
  align-items: center;
}
.beat-card {
  width: 100%;
}
.beat-card p {
  margin: 0;
  padding: 16px 18px 18px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
@media (max-width: 860px) {
  .beat {
    min-height: 60vh;
  }
}

/* ------------------------------------------------------------- the desk
   Dallas: a trading screen that takes the stage. Clear of the route rail on
   the left and the leg readout at the bottom. */
.desk {
  position: absolute;
  inset: 56px 24px 52px 120px;
  display: none;
  flex-direction: column;
  gap: 10px;
  color: var(--paper);
}
.trading .desk {
  display: flex;
}
.desk-hook {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(22px, 2.6vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--paper);
}
.desk-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--pink);
}
.desk-top b {
  font-weight: 400;
  color: var(--paper);
}
.desk-chart {
  flex: 1;
  min-height: 0;
  width: 100%;
  image-rendering: pixelated;
  border: 1px solid var(--paper);
  box-shadow:
    inset 0 0 0 2px var(--ink),
    inset 0 0 0 3px var(--paper);
}
.desk-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.desk-btn {
  min-height: 48px;
  min-width: 120px;
  padding: 0 18px;
  border: 1px solid var(--paper);
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition:
    transform 0.1s var(--step),
    box-shadow 0.1s var(--step);
}
.desk-btn .px {
  font-size: 12px;
  border: 1px solid currentColor;
  padding: 0 4px;
}
.desk-btn.buy {
  background: var(--gold);
  color: var(--ink);
}
.desk-btn.sell {
  background: var(--ink);
  color: var(--paper);
}
.desk-btn:hover {
  box-shadow: 4px 4px 0 var(--coral);
  transform: translate(-2px, -2px);
}
.desk-btn:active {
  box-shadow: none;
  transform: none;
}
.desk-note {
  margin: 0;
  font-size: 13px;
  color: var(--yellow);
}
@media (max-width: 860px) {
  /* 36px clears the menu bar, which sat over the numbers row at 10 */
  .desk {
    inset: 36px 12px 70px;
    gap: 6px;
  }
  .desk-hook {
    font-size: 20px;
  }
  .desk-top {
    font-size: 11px;
    gap: 2px 10px;
  }
  .desk-btn {
    min-height: 44px;
    min-width: 96px;
    font-size: 17px;
  }
  .desk-note {
    display: none;
  }
}

/* ------------------------------------------------------------- the decks
   Scoped to .stage: `.stage canvas` sets display:block and outranks a bare
   class, which left the warehouse over London, Dallas and Anywhere. */
.stage .decks-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  image-rendering: pixelated;
}
.stage.djing .decks-canvas {
  display: block;
}
/* Footage at its own shape, sized so it is never taller than 62% of the
   screen. A 9:16 clip in a fixed-height box cropped it to a near square. */
.beat-card .clip {
  display: block;
  width: min(100%, calc(62vh * var(--ar, 0.5625)));
  aspect-ratio: var(--ar, 0.5625);
  margin-inline: auto;
  object-fit: cover;
  background: var(--ink);
}
.clip-frame {
  background: var(--ink);
  border-bottom: 1px solid var(--ink);
}

/* ------------------------------------------------------------- the court */
.stage .court-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  image-rendering: pixelated;
}
.stage.balling .court-canvas {
  display: block;
}

/* ------------------------------------------------------------- surfaces
   Each stop's side of the page takes its city's colour, flat, from the
   sunset: Southlake yellow, Austin pink, London night, Dallas gold, the
   ending coral. A dithered seam at the top of each stop steps from the last
   colour into this one (drawn in site.js). Cards sit on it as paper windows
   with a hard drop, the same chrome as the stage. */
.story {
  padding: 0;
}
.stop {
  --tint: var(--paper);
  --on: var(--ink);
  --drop: var(--ink);
  position: relative;
  background: var(--tint);
  color: var(--on);
  padding-inline: clamp(16px, 3.5vw, 56px);
}
.stop:last-child {
  padding-bottom: 20vh;
}
.stop::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 32px;
  background-image: var(--edge, none);
  background-size: 16px 32px;
}
#stop-southlake {
  --tint: var(--yellow);
}
#stop-austin {
  --tint: var(--pink);
}
#stop-london {
  --tint: var(--ink-warm);
  --on: var(--paper);
  --drop: var(--plum);
}
#stop-dallas {
  --tint: var(--gold);
}
#stop-anywhere {
  --tint: var(--coral);
}
.stop-head .meta,
.stop-head .part-n {
  color: var(--on);
  opacity: 0.72;
}
.stop-head .part {
  border-top-color: var(--on);
}
#stop-london .stop-head .chapter {
  background: var(--yellow);
  color: var(--ink);
}
.stop .card,
.stop .beat-card {
  background: var(--paper);
  box-shadow:
    inset 0 0 0 2px var(--paper),
    inset 0 0 0 3px var(--ink),
    5px 5px 0 var(--drop);
}
.stop .card:hover {
  box-shadow:
    inset 0 0 0 2px var(--paper),
    inset 0 0 0 3px var(--ink),
    7px 7px 0 var(--coral);
}

/* ------------------------------------------------------------- phones
   The stage fills the screen and the story scrolls over it, the way phone
   scrollytelling is done at the Pudding and the Times: at 42svh the dunk,
   the warehouse and the drift played in a letterbox. Only the cards take
   taps, so the desk's Buy and Sell still work between them. */
@media (max-width: 860px) {
  .stage,
  .story {
    grid-area: 1 / 1;
  }
  .stage {
    align-self: start;
    height: 100vh;
    height: 100svh;
    z-index: 1;
    border-bottom: 0;
  }
  .story {
    position: relative;
    z-index: 2;
    pointer-events: none;
  }
  .story .card,
  .story .beat-card,
  .story .stop-head {
    pointer-events: auto;
  }
  .stop {
    background: transparent;
    padding-inline: 14px;
    padding-top: 70svh;
  }
  .stop:first-child {
    padding-top: 80svh;
  }
  .stop::before {
    display: none;
  }
  .stop-head {
    background: var(--tint);
    color: var(--on);
    padding: 16px;
    border: 1px solid var(--ink);
    box-shadow: 5px 5px 0 var(--ink);
  }
  .stop-head .part {
    margin-bottom: 28px;
  }
  .beat {
    min-height: 85svh;
  }
}

/* ------------------------------------------------------------- title cards */
.title-card {
  position: absolute;
  left: 50%;
  top: 16%;
  transform: translateX(-50%);
  display: none;
  padding: 14px 22px 18px;
  background: var(--ink);
  border: 1px solid var(--paper);
  box-shadow: 6px 6px 0 var(--coral);
  color: var(--paper);
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}
.title-card.on {
  display: block;
}
.scene .title-card {
  display: none;
}
.title-card .px {
  margin: 0;
  font-size: 13px;
  color: var(--yellow);
}
.title-card .tc-title {
  margin: 6px 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(32px, 3.6vw, 56px);
  line-height: 1;
  letter-spacing: -0.045em;
}
@media (max-width: 860px) {
  .title-card.on {
    display: none;
  }
}

/* a stop's own photo, a polaroid under its intro */
.head-snap {
  width: min(200px, 46%);
  margin: 22px 0 0;
}

/* a logo, not a photo: small, on paper */
.card-photo.mark .frame {
  background: var(--paper);
  padding: 20px 0;
}
.card-photo.mark .frame canvas {
  width: min(200px, 55%);
}

/* ------------------------------------------------------------- exhibits */
.exhibit {
  position: absolute;
  left: 50%;
  top: 47%;
  margin: 0;
  width: min(62%, calc(66vh * var(--ar, 0.75)));
  transform: translate(-50%, -50%) rotate(var(--r, -1deg));
  padding: 10px 10px 8px;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 8px 8px 0 var(--coral);
  display: none;
  pointer-events: none;
}
.stage.exhibiting .exhibit {
  display: block;
}
.stage.scene .exhibit {
  display: none;
}
.exhibit canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--ar, 0.75);
  image-rendering: pixelated;
  border: 1px solid var(--ink);
}
.exhibit figcaption {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink);
}
.stage.exhibiting:not(.scene) #globe,
.stage.exhibiting:not(.scene) .pins {
  opacity: 0.35;
}

/* Only headings arrive with motion. Every card fading in was the listed
   anti-pattern: when everything animates, nothing is emphasised. */
.stop .card {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------- the leg
   The stage readout is the boarding pass the flight started with: the flight
   number on a torn stub, then where you are. */
.leg {
  left: auto;
  right: 20px;
  bottom: 18px;
  max-width: calc(100% - 40px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 0;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 4px 4px 0 var(--coral);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
}
.leg::before {
  content: "GM 20";
  padding: 6px 10px;
  background: var(--ink);
  color: var(--yellow);
  border-right: 2px dashed var(--paper);
}
@media (max-width: 860px) {
  .leg {
    right: 12px;
    left: 12px;
    bottom: 12px;
    font-size: 11px;
  }
  .route {
    bottom: 52px;
  }
}

/* part three heads the numbers band like parts one and two */
.done-head {
  border-top: 2px solid var(--ink);
  padding-top: 14px;
  margin: 0 0 40px;
}
.done-head .part-n {
  margin: 0;
  font-size: 13px;
  opacity: 0.72;
}
.done-head .part-title {
  margin: 6px 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1;
  letter-spacing: -0.04em;
}

/* On a laptop the stage shows the photo, so the card does not repeat it:
   the same Ignatius twice, side by side, was the first thing that read as
   unfinished. Phones keep it in the card. */
@media (min-width: 861px) {
  .stop .card-photo:not(.mark) {
    display: none;
  }
}
