@font-face { font-family: "Instrument Serif"; src: url("vendor/fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Instrument Serif"; font-style: italic; src: url("vendor/fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; src: url("vendor/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; src: url("vendor/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-display: swap; }

:root {
  --accent: #b79cff;
  --ink: #f4f1ea;
  --dim: rgba(244, 241, 234, 0.62);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --pad: clamp(1.25rem, 4.2vw, 4.5rem);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; background: #02030a; color: var(--ink); overflow: hidden; }
body { font-family: var(--serif); -webkit-font-smoothing: antialiased; }
body.idle { cursor: none; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#shade {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 0% 100%, rgba(2, 3, 10, 0.82) 0%, rgba(2, 3, 10, 0.45) 32%, transparent 60%),
    radial-gradient(140% 120% at 58% 50%, transparent 55%, rgba(2, 3, 10, 0.7) 100%);
}

.kicker {
  font-family: var(--mono); font-size: clamp(0.72rem, 0.95vw, 1rem); letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--dim);
}
.kicker b { color: var(--accent); font-weight: 500; transition: color 1s; }

#brand {
  position: fixed; top: var(--pad); left: var(--pad);
  font-family: var(--mono); font-size: clamp(0.68rem, 0.85vw, 0.9rem); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--dim); transition: opacity 1.2s;
}
.on-title #brand { opacity: 0; }

/* ----- the title page ----- */
#title {
  position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: center;
  padding: var(--pad); padding-right: 22vw; gap: clamp(0.8rem, 2vh, 1.6rem);
  transition: opacity 1.1s var(--ease), transform 1.4s var(--ease), filter 1.1s;
}
#title h1 {
  font-weight: 400; font-size: clamp(2.8rem, 8.2vw, 9.5rem); line-height: 0.95; letter-spacing: -0.02em;
  max-width: 11em; text-wrap: balance;
}
#t-sub { font-style: italic; font-size: clamp(1.2rem, 2.3vw, 2.4rem); color: var(--dim); }
.hint {
  position: absolute; left: var(--pad); bottom: var(--pad);
  font-family: var(--mono); font-size: clamp(0.66rem, 0.85vw, 0.9rem); color: var(--dim); letter-spacing: 0.04em;
}
.hint span { margin: 0 0.5em; opacity: 0.5; }
kbd {
  font: inherit; color: var(--ink); border: 1px solid rgba(244, 241, 234, 0.3); border-radius: 0.35em;
  padding: 0.12em 0.5em; margin-right: 0.3em;
}
#title.hide { opacity: 0; transform: scale(1.12); filter: blur(10px); pointer-events: none; }
@media (hover: none) { .hint { display: none; } }

/* ----- the words of each stop ----- */
#panel {
  position: fixed; left: var(--pad); bottom: var(--pad); width: min(46rem, 62vw);
  display: flex; flex-direction: column; gap: clamp(0.5rem, 1.3vh, 1rem);
}
#panel > * { transition: opacity 0.9s var(--ease), transform 1.1s var(--ease), filter 0.9s; }
#panel > :nth-child(2) { transition-delay: 0.08s; }
#panel > :nth-child(3) { transition-delay: 0.16s; }
#panel > :nth-child(4) { transition-delay: 0.26s; }
#panel.hide > * { opacity: 0; transform: translateY(1.6rem); filter: blur(6px); transition-duration: 0.45s; transition-delay: 0s; }
#p-title {
  font-weight: 400; font-size: clamp(3rem, 8.4vw, 9rem); line-height: 0.92; letter-spacing: -0.02em;
  text-wrap: balance; text-shadow: 0 0 60px rgba(2, 3, 10, 0.9);
}
#p-size {
  font-family: var(--mono); font-weight: 500; font-size: clamp(0.8rem, 1.25vw, 1.35rem); letter-spacing: 0.06em;
  color: var(--accent); transition: color 1s;
}
#p-fact {
  font-size: clamp(1.25rem, 2.15vw, 2.3rem); line-height: 1.22; color: var(--ink); max-width: 26em;
  text-wrap: pretty; text-shadow: 0 0 30px rgba(2, 3, 10, 1), 0 0 8px rgba(2, 3, 10, 0.8);
}

/* ----- the ruler on the right ----- */
#ruler {
  position: fixed; right: var(--pad); top: 15vh; bottom: 15vh; width: 1px;
  background: linear-gradient(rgba(244, 241, 234, 0.05), rgba(244, 241, 234, 0.3) 15%, rgba(244, 241, 234, 0.3) 85%, rgba(244, 241, 234, 0.05));
  transition: opacity 1.4s;
}
.on-title #ruler { opacity: 0; }
#ticks { position: absolute; inset: 0; }
.tick { position: absolute; right: 0; transform: translateY(-50%); display: flex; align-items: center; flex-direction: row-reverse; gap: 0.7rem; }
.tick i { width: 9px; height: 1px; background: rgba(244, 241, 234, 0.45); margin-right: -4px; transition: width 0.6s, background 0.6s; }
.tick span {
  font-family: var(--mono); font-size: clamp(0.62rem, 0.78vw, 0.85rem); color: rgba(244, 241, 234, 0.34);
  transition: opacity 0.6s; white-space: nowrap;
}
.tick.now span { opacity: 0; }
.tick.now i { width: 17px; background: var(--accent); margin-right: -8px; }
#marker {
  position: absolute; right: -4px; width: 9px; height: 9px; border-radius: 50%; transform: translateY(-50%);
  background: var(--accent); box-shadow: 0 0 14px 3px var(--accent); transition: background 1s, box-shadow 1s;
}
#marker span {
  position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); white-space: nowrap;
  font-family: var(--mono); font-size: clamp(0.95rem, 1.5vw, 1.6rem); color: var(--ink);
  background: rgba(2, 3, 10, 0.72); padding: 0.1em 0.45em; border-radius: 0.3em;
}
#marker b { font-weight: 500; }

/* ----- the phone remote card ----- */
#qr {
  position: fixed; right: var(--pad); bottom: var(--pad); display: flex; gap: 1.1rem; align-items: center;
  padding: 1rem 1.2rem 1rem 1rem; border-radius: 1.1rem; max-width: min(27rem, calc(100vw - 2 * var(--pad)));
  background: rgba(10, 12, 26, 0.72); border: 1px solid rgba(244, 241, 234, 0.14);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transform: translateY(1rem); pointer-events: none;
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.on-title #qr, .show-qr #qr { opacity: 1; transform: none; }
.on-title.show-qr #qr { opacity: 0; }
#qr-img { flex: none; width: clamp(6.5rem, 11vw, 9.5rem); aspect-ratio: 1; background: #fff; padding: 0.55rem; border-radius: 0.6rem; }
#qr-img svg { display: block; width: 100%; height: 100%; }
.qr-text { display: flex; flex-direction: column; gap: 0.35rem; font-family: var(--mono); font-size: clamp(0.68rem, 0.82vw, 0.86rem); color: var(--dim); line-height: 1.45; }
.qr-text strong { font-family: var(--serif); font-weight: 400; font-size: clamp(1.3rem, 1.7vw, 1.8rem); color: var(--ink); }
.qr-text em { font-style: normal; color: var(--ink); }
#qr-code { letter-spacing: 0.22em; color: var(--accent); font-weight: 500; }

#pill {
  position: fixed; top: var(--pad); left: 50%; transform: translate(-50%, -1rem); opacity: 0;
  font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.06em; padding: 0.55em 1.1em; border-radius: 99px;
  background: rgba(10, 12, 26, 0.8); border: 1px solid rgba(244, 241, 234, 0.18);
  transition: opacity 0.5s, transform 0.5s var(--ease); pointer-events: none;
}
#pill::before { content: ""; display: inline-block; width: 0.55em; height: 0.55em; border-radius: 50%; background: #6dffa8; margin-right: 0.6em; box-shadow: 0 0 8px #6dffa8; }
#pill.show { opacity: 1; transform: translate(-50%, 0); }

#tap-back, #tap-next { position: fixed; top: 18vh; bottom: 30vh; width: 22vw; background: none; border: 0; cursor: inherit; -webkit-tap-highlight-color: transparent; }
#tap-back { left: 0; }
#tap-next { right: 0; }
#tap-back:focus, #tap-next:focus { outline: none; }

/* ----- tall screens (a phone that shows the big-screen page) ----- */
@media (max-aspect-ratio: 1/1) {
  #panel { width: calc(100vw - 2 * var(--pad) - 3.5rem); }
  #title { padding-right: var(--pad); justify-content: flex-start; padding-top: 16vh; }
  #ruler { top: 12vh; bottom: 46vh; }
  .tick span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #panel > *, #title { transition-duration: 0.01s !important; }
}

sup { font-size: 0.62em; line-height: 0; vertical-align: 0.55em; letter-spacing: 0; margin-left: 0.05em; }

#credit {
  position: fixed; right: var(--pad); bottom: calc(var(--pad) * 0.45); font-family: var(--mono);
  font-size: clamp(0.56rem, 0.68vw, 0.74rem); color: rgba(244, 241, 234, 0.42); letter-spacing: 0.04em;
}
.on-title #credit { display: none; }
