@import url("/font/fonts.css");

/* ===========================================================================
   dhigurahseaplane.com
   Art direction: "The Descent" — the scroll is the flight. The photographs are
   the loudest thing on the page; everything else gets out of their way.
   Palette sampled from the photography itself, then adjusted for contrast only.
   =========================================================================== */

:root {
  /* LIGHT — "day flight" */
  --ink: #10222e;
  --ink-2: #3c5464;
  --ink-3: #6f8390;
  --paper: #f4efe8;
  --paper-2: #ebe3d9;
  --line: #d8cec2;
  --deep: #123f72;
  --reef: #2f93a8;
  --reef-bright: #58c2cc;
  --ember: #c9521f;
  --shadow-ink: 6 26 40;

  /* Altitude surfaces stay dark in BOTH themes: you are over deep water. */
  --surf-alt: #071825;
  --surf-alt-2: #0b2231;
  --surf-alt-ink: #e8e2d8;
  --surf-alt-ink-2: #9fb0ba;
  --surf-alt-line: #1c3747;

  --ground: var(--paper);
  --ground-ink: var(--ink);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);

  --t-display: clamp(2.2rem, 5.8vw, 5.6rem);
  --t-scene: clamp(1.9rem, 4.3vw, 3.6rem);
  --t-h2: clamp(1.5rem, 2.6vw, 2.25rem);
  --t-h3: clamp(1.1875rem, 1.7vw, 1.5rem);
  --t-lead: clamp(1.125rem, 1.45vw, 1.4375rem);
  --t-body: clamp(1rem, 1vw, 1.0625rem);
  --t-small: 0.9375rem;
  --t-cap: 0.8125rem;
  --t-hud: 0.6875rem;

  --rail: 0px;
  --gutter: clamp(1.25rem, 5vw, 5.5rem);
  --measure: 62ch;

  /* Driven by app.js: 0 at cruise, 1 at touchdown. */
  --p: 0;
  --shadow-a: 0.08;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ede6dc;
    --ink-2: #aeb9bf;
    --ink-3: #76868f;
    --paper: #081a26;
    --paper-2: #0e2634;
    --line: #1e3a4a;
    --deep: #a9cce8;
    --reef: #5fc6d3;
    --reef-bright: #8edde2;
    --ember: #e8803c;
    --shadow-ink: 2 12 20;
  }
}

:root[data-theme="dark"] {
  --ink: #ede6dc;
  --ink-2: #aeb9bf;
  --ink-3: #76868f;
  --paper: #081a26;
  --paper-2: #0e2634;
  --line: #1e3a4a;
  --deep: #a9cce8;
  --reef: #5fc6d3;
  --reef-bright: #8edde2;
  --ember: #e8803c;
  --shadow-ink: 2 12 20;
}

/* --------------------------------------------------------------------- base */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ground-ink);
  font-family: Archivo, ui-sans-serif, system-ui, sans-serif;
  font-size: var(--t-body);
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
  text-wrap: balance;
}

p {
  margin: 0 0 1.1em;
  max-width: var(--measure);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--reef);
  outline-offset: 3px;
  border-radius: 1px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  top: -100vh;
  left: 1rem;
  z-index: 99;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font: 500 var(--t-small) / 1 Archivo, sans-serif;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

/* ---------------------------------------------------------------- typography */

.display {
  font-family: "Libre Caslon Display", Georgia, serif;
  font-weight: 400;
  font-size: var(--t-display);
  line-height: 0.98;
  letter-spacing: -0.012em;
}

.scene-title {
  font-family: "Libre Caslon Display", Georgia, serif;
  font-weight: 400;
  font-size: var(--t-scene);
  line-height: 1.08;
  letter-spacing: -0.008em;
  max-width: 18ch;
}

.h2 {
  font-family: "Libre Caslon Display", Georgia, serif;
  font-weight: 400;
  font-size: var(--t-h2);
  line-height: 1.16;
  letter-spacing: -0.006em;
  max-width: 24ch;
}

.h3 {
  font-family: Archivo, sans-serif;
  font-weight: 600;
  font-size: var(--t-h3);
  line-height: 1.3;
  letter-spacing: -0.005em;
  max-width: 36ch;
}

.lead {
  font-size: var(--t-lead);
  line-height: 1.45;
  letter-spacing: -0.009em;
  max-width: 48ch;
}

.mono,
.eyebrow,
.cap,
.hud {
  font-family: "Azeret Mono", ui-monospace, monospace;
  font-variant-ligatures: none;
}

.eyebrow {
  font-size: var(--t-hud);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 1.5rem;
}

.cap {
  font-size: var(--t-cap);
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  max-width: 58ch;
}

.small {
  font-size: var(--t-small);
  color: var(--ink-2);
}

.tnum {
  font-variant-numeric: tabular-nums lining-nums;
}

/* Prose links get a wiping underline rather than a default one. */
.lnk {
  text-decoration: none;
  color: var(--deep);
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size 0.32s var(--ease-out);
}

.lnk:hover {
  background-size: 0 1px;
}

/* ------------------------------------------------------------------ scenes */

.scene {
  position: relative;
  padding: clamp(5rem, 14vh, 11rem) var(--gutter);
  padding-left: calc(var(--gutter) + var(--rail));
}

.scene--alt {
  background: var(--surf-alt);
  color: var(--surf-alt-ink);
}

.scene--alt .eyebrow,
.scene--alt .cap {
  color: var(--surf-alt-ink-2);
}

.scene--bleed {
  padding: 0;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: clip;
}

.scene--bleed > .frame {
  grid-area: 1 / 1;
}

.scene--bleed > .scene-copy {
  grid-area: 1 / 1;
  position: relative;
  z-index: 4;
  padding: clamp(2.5rem, 8vh, 6rem) var(--gutter) clamp(3rem, 9vh, 7rem);
  padding-left: calc(var(--gutter) + var(--rail));
}

/* The frame is the photograph plus its scrim and caption. */
.frame {
  position: relative;
  margin: 0;
  overflow: clip;
  background: var(--surf-alt-2);
}

/* In a bleed scene the frame is the ground: it must fill the grid cell. */
.scene--bleed > .frame {
  align-self: stretch;
  justify-self: stretch;
}

.frame > picture,
.frame > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene--bleed .frame > picture > img {
  min-height: 100svh;
}

/* A portrait crop of a landscape frame centres on the sandbank and loses the
   aircraft entirely, so the hero biases its crop toward it. */
@media (max-width: 820px) {
  .frame--hero > picture > img {
    object-position: 72% 50%;
  }
}

.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      to top,
      rgb(var(--shadow-ink) / 0.66) 0%,
      rgb(var(--shadow-ink) / 0.28) 34%,
      transparent 62%
    ),
    linear-gradient(
      to bottom,
      rgb(var(--shadow-ink) / 0.42) 0%,
      rgb(var(--shadow-ink) / 0.14) 9%,
      transparent 18%
    ),
    linear-gradient(
      to right,
      rgb(var(--shadow-ink) / 0.58) 0%,
      rgb(var(--shadow-ink) / 0.34) 32%,
      rgb(var(--shadow-ink) / 0.08) 62%,
      transparent 80%
    );
}

.frame--plain::after {
  display: none;
}

.frame figcaption {
  position: absolute;
  left: var(--gutter);
  bottom: 1rem;
  z-index: 5;
  margin: 0;
  color: #cfd8dd;
  mix-blend-mode: normal;
  text-shadow: 0 1px 3px rgb(var(--shadow-ink) / 0.8);
}

.scene--bleed .frame figcaption {
  left: calc(var(--gutter) + var(--rail));
}

/* Text sitting over photography is always light, in both themes. */
.scene--bleed .scene-copy,
.scene--bleed .scene-copy .eyebrow,
.scene--bleed .scene-copy .cap {
  color: #f1ebe2;
}

.scene--bleed .scene-copy .eyebrow {
  color: #b9c6cd;
}

.scene-copy > * + * {
  margin-top: 1.5rem;
}

.scene > .scene-title,
.scene > .h2,
.spread .scene-title,
.spread .h2 {
  margin-bottom: 1.6rem;
}

.band {
  position: relative;
  overflow: clip;
  margin: 0;
}

.band img {
  width: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------- scroll cue */

.cue {
  width: 1px;
  height: 64px;
  background: currentColor;
  opacity: 0.5;
  transform-origin: top;
  animation: cue 2s var(--ease-inout) infinite;
}

@keyframes cue {
  0% {
    transform: scaleY(0);
    opacity: 0;
  }
  40% {
    transform: scaleY(1);
    opacity: 0.6;
  }
  100% {
    transform: scaleY(1);
    opacity: 0;
    transform-origin: bottom;
  }
}

/* ------------------------------------------------------------- the top rail */

.toprail {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem var(--gutter);
  color: #f1ebe2;
  text-shadow: 0 1px 10px rgb(6 22 34 / 0.55);
  pointer-events: none;
  transition: color 0.35s linear, text-shadow 0.35s linear;
}

body[data-surface="light"] .toprail {
  color: var(--ink);
  text-shadow: none;
}

/* Content passes beneath the fixed rail, so it carries a scrim that takes
   the colour of whichever surface is currently under it. */
.toprail::before {
  content: "";
  position: absolute;
  inset: 0 0 -64px 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgb(7 24 37 / 0.92) 0%,
    rgb(7 24 37 / 0.78) 42%,
    rgb(7 24 37 / 0) 100%
  );
  transition: opacity 0.35s linear;
}

body[data-surface="light"] .toprail::before {
  background: linear-gradient(
    to bottom,
    rgb(244 239 232 / 0.94) 0%,
    rgb(244 239 232 / 0.8) 42%,
    rgb(244 239 232 / 0) 100%
  );
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[data-surface="light"] .toprail::before {
    background: linear-gradient(
      to bottom,
      rgb(8 26 38 / 0.94) 0%,
      rgb(8 26 38 / 0.8) 42%,
      rgb(8 26 38 / 0) 100%
    );
  }
}

.toprail a {
  pointer-events: auto;
}

.toprail__cta {
  pointer-events: auto;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  min-width: 0;
}

.brand__name {
  font-family: "Libre Caslon Display", Georgia, serif;
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  line-height: 1;
  letter-spacing: -0.005em;
}

.brand__tag {
  font-family: "Azeret Mono", monospace;
  font-size: 0.625rem;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0.72;
}

.toprail__cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

/* Square-cornered, hairline-ruled: the rail is an instrument, not a landing page. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.95rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: "Azeret Mono", monospace;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s var(--ease-soft), color 0.18s var(--ease-soft);
}

.pill:hover {
  background: currentColor;
}

.pill:hover > * {
  mix-blend-mode: difference;
  filter: invert(1) grayscale(1) contrast(9);
}

.pill svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex: 0 0 auto;
}

.pill--wa {
  background: #f1ebe2;
  color: var(--surf-alt);
  border-color: #f1ebe2;
}

body[data-surface="light"] .pill--wa {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.pill--wa:hover {
  background: var(--reef-bright);
  border-color: var(--reef-bright);
  color: var(--surf-alt);
}

.pill--wa:hover > * {
  mix-blend-mode: normal;
  filter: none;
}

@media (max-width: 900px) {
  .brand__tag {
    display: none;
  }
}

@media (max-width: 680px) {
  .pill span {
    display: none;
  }

  .pill--wa {
    padding: 0.6rem 0.7rem;
  }
}

@media (max-width: 460px) {
  .toprail {
    padding-inline: 1rem;
  }

  .pill {
    padding: 0.55rem 0.6rem;
    font-size: 0.625rem;
    letter-spacing: 0.06em;
  }
}

/* ------------------------------------------------------------ the altimeter */

.altimeter {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 15;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 7rem 0 2.75rem;
  pointer-events: none;
  font-family: "Azeret Mono", monospace;
  font-size: var(--t-hud);
  letter-spacing: 0.06em;
  color: #9fb0ba;
  text-align: center;
  opacity: 1;
  transition: opacity 0.5s linear;
}

/* It belongs to the flight, and the flight includes the landing — so this
   retires only when the page leaves the photography. */
body[data-surface="light"] .altimeter {
  opacity: 0;
}

@media (min-width: 1100px) {
  :root {
    --rail: 100px;
  }

  .altimeter {
    display: flex;
  }
}

/* The rail is a flight-profile plate: x is altitude, y is progress. The dot
   rides the plan, and the leg already flown is drawn over it. */
.altimeter__profile {
  flex: 1 1 auto;
  width: 60px;
  min-height: 4rem;
  overflow: visible;
}

.altimeter__plan {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-opacity: 0.3;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}

.altimeter__flown {
  fill: none;
  stroke: var(--reef-bright);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* The marker is a plan-form aircraft, counter-scaled out of the rail's
   non-uniform stretch so it stays the right shape. */
.altimeter__ship {
  fill: var(--reef-bright);
}

.altimeter__phase,
.altimeter__togo {
  writing-mode: vertical-rl;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.75;
  flex: 0 0 auto;
  max-height: 7rem;
  overflow: hidden;
}

/* Mobile fallback: a 2px progress hairline, never a floating widget. */
.progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 21;
  height: 2px;
  width: calc(var(--p) * 100%);
  background: var(--reef-bright);
  pointer-events: none;
}

@media (min-width: 1100px) {
  .progress {
    display: none;
  }
}

/* --------------------------------------------------------- aircraft shadow */

.shadow {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: multiply;
  overflow: hidden;
}

.shadow svg {
  position: absolute;
  width: var(--sw, 42vw);
  height: auto;
  left: var(--sx, 63%);
  top: var(--sy, 76%);
  /* --sx / --sy are viewport pixels once app.js takes over. */
  translate: -50% -50%;
  rotate: var(--sr, 21deg);
  filter: blur(var(--sb, 9px));
  opacity: var(--so, 1);
  transition: opacity 0.45s linear;
  will-change: transform, filter;
}

.shadow .hull {
  fill: rgb(var(--shadow-ink) / var(--shadow-a));
}

/* Over a dark photograph a dark shadow is invisible, so it inverts: a light
   fill in screen rather than a dark fill in multiply. */
.shadow[data-tone="dark"] {
  mix-blend-mode: screen;
}

.shadow[data-tone="dark"] .hull {
  fill: rgb(226 240 246 / calc(var(--shadow-a) * 1.5));
}

.shadow[data-off-photo="1"] .hull {
  fill: rgb(var(--shadow-ink) / calc(var(--shadow-a) * 0.62));
}

.shadow[data-off-photo="1"][data-tone="dark"] .hull {
  fill: rgb(226 240 246 / calc(var(--shadow-a) * 0.95));
}

@media (prefers-reduced-motion: reduce) {
  .shadow svg {
    transition: none;
  }
}

/* ------------------------------------------------------------------- grain */

.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
}

/* ------------------------------------------------------------------ tables */

.data {
  width: 100%;
  max-width: 42rem;
  border-collapse: collapse;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 2rem 0 1rem;
  text-align: left;
}

.scene--alt .data {
  border-color: var(--surf-alt-line);
}

.data th,
.data td {
  padding: 1.05rem 0;
  vertical-align: baseline;
  font-weight: 400;
}

.data th {
  font-size: var(--t-body);
  color: var(--ink-2);
  padding-right: 2rem;
}

.scene--alt .data th {
  color: var(--surf-alt-ink-2);
}

.scene--bleed .data th,
.scene--bleed .data td {
  color: #f1ebe2;
}

.scene--bleed .data,
.scene--bleed .data tr + tr th,
.scene--bleed .data tr + tr td {
  border-color: rgb(255 255 255 / 0.28);
}

.scene--bleed .scene-copy .note {
  color: #cdd8dd;
}

.data td {
  text-align: right;
  font-family: "Libre Caslon Display", Georgia, serif;
  font-weight: 500;
  font-size: var(--t-h2);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.1;
  white-space: nowrap;
}

.data td.t {
  font-family: Archivo, sans-serif;
  font-size: var(--t-body);
  font-weight: 400;
  white-space: normal;
  text-align: left;
}

.data tr + tr th,
.data tr + tr td {
  border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}

.scene--alt .data tr + tr th,
.scene--alt .data tr + tr td {
  border-top: 1px solid color-mix(in srgb, var(--surf-alt-line) 70%, transparent);
}

.note {
  font-family: "Azeret Mono", monospace;
  font-size: var(--t-hud);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.7;
  max-width: 54ch;
}

.scene--alt .note {
  color: var(--surf-alt-ink-2);
}

/* ------------------------------------------------------------- the day sheet */

.spread {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

@media (min-width: 900px) {
  .spread {
    grid-template-columns: 7fr 5fr;
  }
  .spread--half {
    grid-template-columns: 1fr 1fr;
  }
  .spread--plate {
    grid-template-columns: 1fr 1.05fr;
    align-items: start;
  }
  .spread--clock {
    grid-template-columns: 1.6fr 1fr;
  }
}

.sheet {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: "Azeret Mono", monospace;
  font-size: var(--t-small);
}

.sheet li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.scene--alt .sheet li {
  border-color: var(--surf-alt-line);
}

.sheet li:last-child {
  border-bottom: 1px solid var(--line);
}

.scene--alt .sheet li:last-child {
  border-color: var(--surf-alt-line);
}

.sheet b {
  font-weight: 400;
  color: var(--reef);
  font-variant-numeric: tabular-nums;
}

.sheet span {
  color: var(--ink-2);
  font-family: Archivo, sans-serif;
}

.scene--alt .sheet span {
  color: var(--surf-alt-ink-2);
}

/* The handover steps: hanging numerals, no cards. */
.steps {
  list-style: none;
  counter-reset: s;
  margin: 2rem 0 0;
  padding: 0;
  max-width: 46ch;
}

.steps li {
  counter-increment: s;
  position: relative;
  padding-left: 3.25rem;
  margin-bottom: 1.6rem;
  font-size: var(--t-lead);
  line-height: 1.42;
}

.steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.35em;
  font-family: "Azeret Mono", monospace;
  font-size: var(--t-hud);
  letter-spacing: 0.1em;
  opacity: 0.65;
}

/* ------------------------------------------------------- the arrival clock */

.clock {
  border: 1px solid var(--surf-alt-line);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  margin-top: 2.5rem;
}

.clock__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.25rem 2rem;
}

.clock__field {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.field label {
  font-family: "Azeret Mono", monospace;
  font-size: var(--t-hud);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Hour and minute pickers, set as display numerals rather than form controls. */
.clock__field {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.clock__field legend,
.clock__legend {
  padding: 0;
  margin-bottom: 0.6rem;
  font-family: "Azeret Mono", monospace;
  font-size: var(--t-hud);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--surf-alt-ink-2);
  display: block;
}

.clock__time {
  display: inline-flex;
  align-items: baseline;
  gap: 0.1em;
  border-bottom: 1px solid var(--surf-alt-line);
  padding-bottom: 0.1em;
}

.clock__time i {
  font-family: "Libre Caslon Display", Georgia, serif;
  font-style: normal;
  font-size: clamp(2rem, 4.5vw, 3rem);
  opacity: 0.4;
}

/* The value is drawn as text; the select sits transparently on top at a
   normal size, because a native dropdown inherits the control's font size
   and a display-sized one opens an enormous list. */
.pick {
  position: relative;
  display: inline-grid;
}

.pick__v,
.pick__sel {
  grid-area: 1 / 1;
}

.pick__v {
  font-family: "Libre Caslon Display", Georgia, serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.1;
  padding: 0 0.08em;
  pointer-events: none;
}

.pick__sel {
  appearance: none;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: transparent;
  font-family: Archivo, sans-serif;
  font-size: 1rem;
  cursor: pointer;
}

.pick__sel:focus-visible + .pick__v,
.pick:has(.pick__sel:focus-visible) .pick__v {
  outline: 2px solid var(--reef);
  outline-offset: 2px;
}

.pick__sel option {
  background: var(--surf-alt);
  color: var(--surf-alt-ink);
  font-size: 1rem;
}

.clock__dir {
  display: inline-flex;
  border: 1px solid var(--surf-alt-line);
}

.clock__dir button {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  font-family: "Azeret Mono", monospace;
  font-size: var(--t-hud);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  transition: background 0.18s var(--ease-soft);
}

.clock__dir button[aria-pressed="true"] {
  background: var(--surf-alt-ink);
  color: var(--surf-alt);
}

.clock__out {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--surf-alt-line);
}

.clock__verdict {
  font-family: "Libre Caslon Display", Georgia, serif;
  font-size: var(--t-h2);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.9rem;
  max-width: 26ch;
}

.clock__verdict[data-v="go"] {
  color: var(--reef-bright);
}

.clock__verdict[data-v="tight"] {
  color: #e3b23c;
}

.clock__verdict[data-v="no"] {
  color: var(--ember);
}

.clock__detail {
  max-width: 54ch;
  color: var(--surf-alt-ink-2);
}

/* --------------------------------------------------------------- the form */

/* The one section that is light in both themes. Everything above it is an
   evening-dark flight; this is the paperwork, and it should read like paper
   whichever theme you are in. */
.form-scene {
  --fg: #16262f;
  --fg-2: #4a6270;
  --fg-3: #7d919c;
  --fg-line: #cfc5b8;
  --fg-paper: #f3eee7;
  background: var(--fg-paper);
  color: var(--fg);
  padding-block: clamp(3.5rem, 8vh, 6rem);
}

.ask {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
  max-width: 68rem;
}

@media (min-width: 900px) {
  .ask {
    grid-template-columns: 5fr 7fr;
  }
}

.ask__head .eyebrow,
.ask__fine,
.ask__alt {
  color: var(--fg-2);
}

.ask__head .scene-title {
  color: var(--fg);
  max-width: 14ch;
  margin-bottom: 0;
}

.ask__head .lead {
  color: var(--fg-2);
  max-width: 34ch;
  margin-top: 1.4rem;
}

.ask__alt {
  margin-top: 1.25rem;
  font-size: var(--t-small);
}

.ask__alt .lnk {
  color: var(--fg);
}

.ask__fine {
  margin-top: 1rem;
  font-family: "Azeret Mono", monospace;
  font-size: var(--t-hud);
  line-height: 1.7;
  letter-spacing: 0.04em;
  max-width: 46ch;
}

/* Fields: compact, bottom-ruled, two to a row where they pair naturally. */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
  min-width: 0;
}

.field label {
  font-family: "Azeret Mono", monospace;
  font-size: var(--t-hud);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.field .opt {
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--fg-3);
}

.field input,
.field textarea {
  appearance: none;
  width: 100%;
  background: #fbf8f4;
  border: 1px solid var(--fg-line);
  border-radius: 3px;
  color: var(--fg);
  font: 400 1rem/1.4 Archivo, sans-serif;
  padding: 0.6rem 0.7rem;
  transition: border-color 0.14s linear, box-shadow 0.14s linear;
}

.field textarea {
  resize: vertical;
  min-height: 3.4rem;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: #1d6f82;
  box-shadow: 0 0 0 3px rgb(29 111 130 / 0.16);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--fg-3);
}

.field__err {
  font-family: "Azeret Mono", monospace;
  font-size: var(--t-cap);
  color: #a8371a;
  min-height: 0;
}

.field__err:empty {
  display: none;
}

.row2 {
  display: grid;
  gap: 0 1rem;
}

@media (min-width: 520px) {
  .row2 {
    grid-template-columns: 1fr 1fr;
  }
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0 1.75rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font: 500 var(--t-small) / 1 Archivo, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.16s var(--ease-soft), background 0.16s var(--ease-soft),
    opacity 0.16s linear;
}

.btn--go {
  width: auto;
  margin-top: 0.4rem;
  background: #16262f;
  color: #f6f2ec;
}

.btn--go:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #1d6f82;
}

.btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

.form-ok {
  font-family: "Libre Caslon Display", Georgia, serif;
  font-size: var(--t-h2);
  line-height: 1.16;
  letter-spacing: -0.006em;
  max-width: 26ch;
  color: var(--fg);
}

/* ------------------------------------------------------------- whatsapp cta */

.wa {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 14px 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font: 500 var(--t-small) / 1 Archivo, sans-serif;
  text-decoration: none;
  box-shadow: 0 6px 24px rgb(6 22 34 / 0.28);
  transition: transform 0.16s var(--ease-soft), border-color 0.16s var(--ease-soft);
}

.wa:hover {
  transform: translateY(-1px);
  border-color: var(--reef-bright);
}

.wa svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

@media (max-width: 420px) {
  .toprail {
    gap: 0.5rem;
  }

  .toprail .hud {
    font-size: 0.625rem;
    letter-spacing: 0.1em;
  }
}

@media (max-width: 768px) {
  .wa {
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 0;
    justify-content: center;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  }
}

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

.footer {
  position: relative;
  overflow: clip;
  min-height: 60svh;
  display: grid;
  align-items: end;
}

.footer > .frame,
.footer > .footer__in {
  grid-area: 1 / 1;
}

.footer > .frame figcaption {
  top: 1.25rem;
  bottom: auto;
}

.footer__in {
  position: relative;
  z-index: 4;
  padding: clamp(3rem, 10vh, 7rem) var(--gutter) 2rem;
  padding-left: calc(var(--gutter) + var(--rail));
  color: #f1ebe2;
}

.footer__in .eyebrow {
  color: #b9c6cd;
}

.footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgb(255 255 255 / 0.18);
  font-family: "Azeret Mono", monospace;
  font-size: var(--t-hud);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b9c6cd;
}

.footer__meta a {
  color: inherit;
}

/* ------------------------------------------------------- daylight window */

.daylight {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 2.25rem;
  color: var(--reef-bright);
  overflow: visible;
}

.daylight text {
  font-family: "Azeret Mono", monospace;
}

.dl-shut rect {
  fill: color-mix(in srgb, var(--surf-alt-ink) 7%, transparent);
  stroke: var(--surf-alt-line);
  stroke-width: 1;
}

.dl-shut-tx text {
  font-size: 26px;
  letter-spacing: 3.4;
  fill: var(--surf-alt-ink-2);
  opacity: 0.85;
}

.dl-win {
  fill: url(#dayfill);
  stroke: currentColor;
  stroke-width: 1.5;
}

.dl-win-tx {
  font-size: 31px;
  letter-spacing: 5;
  fill: #eaf6f8;
}

.dl-win-sub {
  font-size: 22px;
  letter-spacing: 1.2;
  fill: var(--surf-alt-ink-2);
}

.dl-axis path {
  stroke: var(--surf-alt-line);
  stroke-width: 1.5;
  fill: none;
}

.dl-hr text {
  font-size: 24px;
  letter-spacing: 1.6;
  fill: var(--surf-alt-ink);
}

.dl-edge {
  font-size: 20px;
  letter-spacing: 1.2;
  fill: var(--surf-alt-ink-2);
  opacity: 0.7;
}

.dl-cut path {
  stroke: var(--ember);
  stroke-width: 2;
  stroke-dasharray: 7 5;
  fill: none;
}

.dl-cut circle {
  fill: var(--ember);
}

.dl-cut text {
  font-size: 24px;
  letter-spacing: 2.2;
  fill: var(--ember);
}

@media (max-width: 560px) {
  .dl-cut text {
    font-size: 22px;
    letter-spacing: 1;
  }
  .dl-shut-tx text,
  .dl-win-sub {
    font-size: 21px;
  }
}

/* --------------------------------------------------------- map and specs */

.mapwrap {
  margin: 0;
}

/* Aspect pinned to the bounding box's own, so the plotted endpoints line up
   with the tiles underneath them. See ROUTE_MAP in scripts/build.mjs. */
.map {
  position: relative;
  aspect-ratio: 0.8531;
  border: 1px solid var(--surf-alt-line);
  border-radius: 2px;
  overflow: hidden;
  background: var(--surf-alt-2);
}

.map__tiles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  /* Inert: it must never capture the scroll or be panned out of alignment. */
  pointer-events: none;
  filter: saturate(0.9) brightness(0.96);
}

.map__plot,
.map__label {
  position: absolute;
  pointer-events: none;
}

.map__plot {
  inset: 0;
  width: 100%;
  height: 100%;
}

.map__leg {
  stroke: var(--ember);
  stroke-width: 3;
  stroke-dasharray: 16 11;
  vector-effect: non-scaling-stroke;
}

.map__pt circle {
  fill: var(--ember);
}

.map__pt .map__ring {
  fill: none;
  stroke: var(--ember);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  opacity: 0.55;
}

.map__label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-family: "Azeret Mono", monospace;
  font-size: var(--t-hud);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f2ece3;
  text-shadow: 0 1px 6px rgb(6 22 34 / 0.9), 0 0 2px rgb(6 22 34 / 0.9);
  line-height: 1.2;
}

.map__label small {
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
  opacity: 0.85;
  text-transform: none;
}

/* Offsets place each label clear of its own marker ring. */
.map__label--a {
  left: 80.5%;
  top: 13%;
}

.map__label--b {
  left: 13.5%;
  top: 76.5%;
}

.mapwrap figcaption {
  margin-top: 0.85rem;
}

.specs {
  margin: 2rem 0 1.5rem;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--surf-alt-line);
  max-width: 34rem;
}

.specs > div {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--surf-alt-line);
}

.specs dt {
  font-family: "Azeret Mono", monospace;
  font-size: var(--t-hud);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--surf-alt-ink-2);
}

.specs dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.8rem;
  font-size: var(--t-h3);
  font-variant-numeric: tabular-nums;
}

.specs dd span {
  font-family: "Azeret Mono", monospace;
  font-size: var(--t-hud);
  letter-spacing: 0.06em;
  color: var(--surf-alt-ink-2);
}

/* --------------------------------------------------------------- entrances */

/* --------------------------------------------------------------- entrances */

[data-rise] {
  opacity: 0;
  translate: 0 14px;
  transition: opacity 0.6s var(--ease-out), translate 0.6s var(--ease-out);
}

[data-rise].in {
  opacity: 1;
  translate: 0 0;
}

[data-rise-line] > * {
  display: block;
  opacity: 0;
  translate: 0 0.6em;
  transition: opacity 0.7s var(--ease-out), translate 0.7s var(--ease-out);
}

[data-rise-line].in > * {
  opacity: 1;
  translate: 0 0;
}

[data-rise-line].in > *:nth-child(2) {
  transition-delay: 90ms;
}

[data-rise-line].in > *:nth-child(3) {
  transition-delay: 180ms;
}

.frame picture img {
  scale: 1.06;
  transition: scale 1.2s var(--ease-out);
}

.frame.in picture img {
  scale: 1;
}

/* ------------------------------------------------------- reduced motion */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.2s !important;
    transition-property: opacity !important;
  }

  [data-rise],
  [data-rise-line] > * {
    translate: none;
  }

  .frame picture img,
  .frame.in picture img {
    scale: 1;
  }

  .cue {
    animation: none;
    opacity: 0.4;
  }

  .shadow svg {
    filter: blur(3px);
  }
}

@media print {
  .altimeter,
  .shadow,
  .grain,
  .wa,
  .toprail,
  .progress {
    display: none !important;
  }
}
