@font-face {
  font-family: 'Instrument Serif';
  src: url(fonts/instrument-serif-regular.woff2) format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url(fonts/instrument-serif-italic.woff2) format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url(fonts/instrument-sans-regular.woff2) format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

/* A night photograph in both colour schemes: the page is always dark. */
:root {
  --bg: #05070c;
  --panel: #0c111b;
  --line: rgba(255, 255, 255, 0.14);
  --ink: #f3efe8;
  --muted: #a7adb9;
  --amber: #f3b25e;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bar-h: 56px;
  --exploration-footer-bg: var(--bg);
  --exploration-footer-ink: var(--ink);
  --exploration-footer-border: var(--line);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Header */
.bar {
  flex-shrink: 0;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: relative;
  z-index: 3;
}
.bar-home { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; min-height: 44px; }
.bar-logo { width: 20px; height: 20px; }
.bar-slash { color: var(--muted); }
.bar-section { color: var(--muted); font-weight: 500; }
.bar-title {
  margin: 0;
  flex: 1;
  text-align: center;
  font: 400 22px/1 var(--serif);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.bar-title em { color: var(--amber); }
.bar-actions { display: flex; align-items: center; gap: 8px; }
.bar-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.bar-action:hover { border-color: rgba(255, 255, 255, 0.35); }
.bar-make { background: var(--ink); color: #12100c; border-color: var(--ink); }
.bar-make:hover { background: #fff; }

/* Stage: the photograph fills everything between header and footer. */
.stage {
  position: relative;
  flex: 1 0 auto;
  height: calc(100dvh - var(--bar-h) - 52px);
  min-height: 300px;
  overflow: hidden;
  background: var(--bg);
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  -webkit-user-select: none;
}
.zoom { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: ns-resize; }
.zoom:focus-visible { outline-offset: -4px; }
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(to top, rgba(3, 4, 8, 0.72), transparent 34%);
}

.caption {
  position: absolute;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  width: min(92%, 760px);
  margin: 0;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.65);
  transition: opacity 0.12s linear;
}
.caption-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
}
.caption-line { margin: 0; font: 400 clamp(26px, 4.2vw, 46px)/1.08 var(--serif); text-wrap: balance; }

.readout {
  position: absolute;
  top: 16px;
  left: max(16px, env(safe-area-inset-left));
  margin: 0;
  pointer-events: none;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}
.mag { margin: 0; font: 400 30px/1 var(--serif); font-variant-numeric: tabular-nums; }
.loop { margin: 4px 0 0; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

.rail {
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail-stop {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 32px;
  min-width: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}
.rail-label {
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}
.rail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, background 0.2s;
}
.rail-stop:hover .rail-label,
.rail-stop:focus-visible .rail-label,
.rail-stop[aria-current] .rail-label { opacity: 1; transform: none; }
.rail-stop[aria-current] { color: var(--ink); }
.rail-stop[aria-current] .rail-dot { background: var(--amber); transform: scale(1.5); }

.controls {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 10, 16, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.ctl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
}
.ctl:hover { background: rgba(255, 255, 255, 0.1); }
.ctl-drift { padding: 0 18px; background: rgba(255, 255, 255, 0.08); }
.ctl-drift .i-play { fill: currentColor; stroke: none; }
.ctl-drift .i-pause,
.ctl-drift[aria-pressed='true'] .i-play { display: none; }
.ctl-drift[aria-pressed='true'] .i-pause { display: inline; }

.hint {
  position: absolute;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(8, 10, 16, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.6s, transform 0.6s;
}
.hint.is-gone { opacity: 0; transform: translate(-50%, -8px); }
.hint-touch { display: none; }
@media (pointer: coarse) {
  .hint-fine { display: none; }
  .hint-touch { display: inline; }
}
.hint-wheel {
  width: 14px;
  height: 22px;
  border: 1.6px solid currentColor;
  border-radius: 8px;
  position: relative;
}
.hint-wheel::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 4px;
  width: 2px;
  height: 5px;
  margin-left: -1px;
  border-radius: 1px;
  background: currentColor;
  animation: wheel 1.6s ease-in-out infinite;
}
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(7px); opacity: 0; } 100% { opacity: 0; } }

.notice {
  position: absolute;
  inset: auto 16px 90px;
  margin: 0 auto;
  max-width: 460px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  text-align: center;
}
.notice p { margin: 0; }
.noscript { position: absolute; inset: 0; display: grid; place-items: center; }
.noscript img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.noscript p { position: relative; margin: 16px; padding: 14px 18px; border-radius: 14px; background: rgba(5, 7, 12, 0.8); max-width: 460px; text-align: center; }

/* How it's made */
.how {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 22px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--ink);
}
.how::backdrop { background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); }
.how-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kicker { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--amber); }
.how-close { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; }
.how-title { margin: 14px 0 8px; font: 400 clamp(28px, 4vw, 40px)/1.05 var(--serif); }
.how-title em { color: var(--amber); }
.how-lede { margin: 0 0 18px; color: var(--muted); }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.how-steps li { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; }
.how-steps figure { margin: 0; }
.how-steps img { display: block; width: 132px; height: 132px; object-fit: cover; border-radius: 10px; }
.how-steps h3 { margin: 0 0 4px; font: 400 22px/1.15 var(--serif); }
.how-steps p { margin: 0; color: var(--muted); }
.step-n { display: inline-block; min-width: 1.4em; color: var(--amber); }
.how-downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 20px 0 14px; }
.card { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; }
.card:hover { border-color: rgba(255, 255, 255, 0.35); }
.card-type { margin: 0 0 4px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.card h3 { margin: 0 0 8px; font: 400 21px/1.15 var(--serif); }
.card b { font-weight: 600; font-size: 14px; }
.card-make { background: var(--ink); color: #12100c; border-color: var(--ink); }
.card-make .card-type { color: #5a5248; }
.how-note { margin: 0; font-size: 13px; color: var(--muted); }

/* Footer reserved for the shared exploration navigation. */
.site-footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: var(--bg);
  font-size: 14px;
}
.footer-resources { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-resources a { color: var(--muted); text-underline-offset: 3px; }
.footer-resources a:hover { color: var(--ink); }

@media (max-width: 760px) {
  .bar-title { display: none; }
  .bar-home { flex: 1; }
  .bar-section, .bar-slash { display: none; }
  .bar-action span:not([aria-hidden]) { display: none; }
  #open-how { padding: 0 11px; }
  .rail-label { display: none; }
  .caption { bottom: 86px; }
  .hint { top: 70px; font-size: 12px; white-space: normal; width: max-content; max-width: calc(100% - 32px); }
  .how-steps li { grid-template-columns: 88px 1fr; }
  .how-steps img { width: 88px; height: 88px; }
}
@media (max-width: 760px) {
  .bar-make span[aria-hidden] { display: inline; }
}
@media (max-height: 520px) {
  .caption { bottom: 74px; }
  .caption-line { font-size: 24px; }
  .readout { top: 10px; }
  .mag { font-size: 24px; }
  .hint { top: 10px; }
  .rail { gap: 0; }
  .rail-stop { min-height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .hint-wheel::after { animation: none; }
  .hint, .rail-label, .rail-dot, .caption { transition: none; }
}
