/* The four faces the page uses, Latin only, plus one Greek file for the theta in the notes. Bundled, never fetched from a
   font service (hard rule 2). tools/build.mjs rewrites each url() to the hashed file, or to data: in the offline copy. */
@font-face {
  font-family: 'Marcellus';
  font-weight: 400;
  font-display: swap;
  src: url(marcellus-latin-400-normal-8a539799d1.woff2) format('woff2');
}
@font-face {
  font-family: 'Alegreya';
  font-weight: 400;
  font-display: swap;
  src: url(alegreya-latin-400-normal-7cbcf38a5e.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Alegreya';
  font-weight: 400;
  font-display: swap;
  src: url(alegreya-greek-400-normal-7aac3d3bdf.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Alegreya';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(alegreya-latin-400-italic-9be8976a11.woff2) format('woff2');
}
@font-face {
  font-family: 'Alegreya Sans';
  font-weight: 400;
  font-display: swap;
  src: url(alegreya-sans-latin-400-normal-b2a5a35a25.woff2) format('woff2');
}
@font-face {
  font-family: 'Alegreya Sans';
  font-weight: 500;
  font-display: swap;
  src: url(alegreya-sans-latin-500-normal-55b61d22cc.woff2) format('woff2');
}
/* Layout: one full-bleed canvas; words sit low and centred like film subtitles, instruments sit bottom-left, controls top-right. */
:root {
  --soot: #070504;
  --ash: #b9ada0;
  --bone: #f1e6d6;
  --ember: #ff9a4d;
  --shadowband: #8fa6c4;
  --line: rgba(241, 230, 214, 0.18);
  --display: 'Marcellus', 'Trajan Pro', 'Cormorant SC', Georgia, serif;
  --text: 'Alegreya', 'Iowan Old Style', Palatino, Georgia, serif;
  --ui: 'Alegreya Sans', 'Gill Sans', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}
[hidden] {
  display: none !important;
}
html,
body {
  height: 100%;
  margin: 0;
  background: var(--soot);
  color: var(--bone);
  overflow: hidden;
  font-family: var(--ui);
}
#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  outline: none;
}
#view.drag {
  cursor: grabbing;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 4px;
  border-radius: 2px;
}
.layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
/* title */
#title {
  display: grid;
  place-items: center;
  text-align: center;
  z-index: 5;
  transition: opacity 1.6s;
}
#title > div {
  pointer-events: auto;
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  max-width: 44rem;
  min-width: 0;
}
#title h1 {
  font: 400 clamp(3rem, 8.4vw, 7.6rem) / 1 var(--display);
  letter-spacing: 0.06em;
  margin: 0;
  text-shadow: 0 0 60px rgba(255, 140, 60, 0.35);
}
#title blockquote {
  margin: 0;
  font: italic 400 clamp(1.05rem, 1.5vw, 1.4rem) / 1.45 var(--text);
  color: var(--bone);
  text-wrap: balance;
}
#title blockquote cite {
  display: block;
  font: 400 0.95rem/1.6 var(--ui);
  color: var(--ash);
}
.go {
  font: 500 1.15rem/1 var(--ui);
  letter-spacing: 0.02em;
  padding: 1rem 1.9rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 140, 60, 0.1);
  transition:
    background 0.3s,
    border-color 0.3s;
}
.go:hover {
  background: rgba(255, 140, 60, 0.26);
  border-color: var(--ember);
}
.go[disabled] {
  opacity: 0.55;
  cursor: default;
}
#title p {
  margin: 0;
  color: var(--ash);
  font-size: 1rem;
  line-height: 1.5;
}
/* captions */
#cap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: max(clamp(3.2rem, 8vh, 6.5rem), var(--lift, 0px));
  z-index: 3;
}
#cap div {
  font: 400 clamp(1.25rem, 1.75vw, 2.3rem) / 1.38 var(--text);
  max-width: 38em;
  text-align: center;
  text-wrap: balance;
  opacity: 0;
  transition: opacity 0.9s;
  text-shadow:
    0 0 14px rgba(0, 0, 0, 0.95),
    0 0 3px rgba(0, 0, 0, 0.9);
}
#cap div.on {
  opacity: 1;
}
#cap q {
  font-style: italic;
  quotes: '\201C' '\201D';
}
#cap cite {
  display: block;
  font: 400 1rem/1.7 var(--ui);
  color: var(--ash);
}
#hint {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: clamp(1rem, 2.6vh, 2rem);
  z-index: 3;
}
#hint span {
  font: 400 1.02rem/1 var(--ui);
  color: var(--bone);
  letter-spacing: 0.02em;
  padding: 0.6rem 1.1rem;
  border-radius: 99px;
  background: rgba(8, 5, 3, 0.5);
  border: 1px solid var(--line);
  opacity: 0;
  transition: opacity 0.7s;
}
#hint span.on {
  opacity: 1;
}
.ending #cap {
  padding-bottom: max(clamp(7.5rem, 17vh, 12rem), var(--lift, 0px));
}
/* milestone */
#mile {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(2rem, 9vh, 6rem);
  z-index: 3;
}
#mile div {
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.7s,
    transform 0.7s;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.9);
}
#mile div.on {
  opacity: 1;
  transform: none;
}
#mile b {
  display: block;
  font: 400 clamp(1.5rem, 2.4vw, 2.5rem) / 1.2 var(--display);
  letter-spacing: 0.03em;
}
#mile i {
  font: 400 clamp(1.05rem, 1.25vw, 1.35rem) / 1.4 var(--text);
  font-style: normal;
  color: var(--bone);
}
/* instruments */
#inst {
  z-index: 3;
  display: flex;
  align-items: flex-end;
  padding-bottom: clamp(1rem, 3vh, 2.2rem);
}
#inst dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.18rem 1rem;
  font: 400 clamp(1.02rem, 0.75vw + 0.6rem, 1.35rem) / 1.3 var(--ui);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.8s;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.95);
}
#inst dl.on {
  opacity: 1;
}
#inst dt {
  color: var(--ash);
}
#inst dd {
  margin: 0;
}
/* controls */
#ctl {
  z-index: 6;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding-top: max(14px, env(safe-area-inset-top, 0px));
  height: 0;
  inset: 0 0 auto 0;
}
#ctl div {
  pointer-events: auto;
  display: flex;
  gap: 0.25rem;
  opacity: 0.5;
  transition: opacity 0.3s;
}
#ctl div:hover,
#ctl div:focus-within {
  opacity: 1;
}
#ctl button {
  font: 400 0.98rem/1 var(--ui);
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
}
#ctl button:hover {
  background: rgba(255, 255, 255, 0.08);
}
#chap {
  position: fixed;
  top: 54px;
  right: max(16px, env(safe-area-inset-right, 0px));
  z-index: 7;
  background: rgba(14, 9, 6, 0.94);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.4rem;
  display: grid;
  min-width: 13rem;
}
#chap button {
  text-align: left;
  padding: 0.62rem 0.9rem;
  border-radius: 8px;
  font: 400 1.02rem/1.2 var(--ui);
}
#chap button:hover {
  background: rgba(255, 150, 70, 0.14);
}
#chap button[aria-current='true'] {
  color: var(--ember);
}
/* drive panel */
#panel {
  z-index: 4;
  position: fixed;
  right: max(24px, env(safe-area-inset-right, 0px));
  bottom: clamp(1.2rem, 4vh, 3rem);
  width: min(23rem, calc(100vw - 32px));
  display: grid;
  gap: 0.95rem;
  padding: 1.2rem 1.35rem 1.3rem;
  background: rgba(10, 7, 5, 0.66);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s;
}
#panel.on {
  opacity: 1;
  pointer-events: auto;
}
#panel label {
  display: grid;
  gap: 0.4rem;
  font: 400 1.02rem/1.2 var(--ui);
}
#panel label span {
  display: flex;
  justify-content: space-between;
  color: var(--ash);
}
#panel label b {
  font-weight: 500;
  color: var(--bone);
  font-variant-numeric: tabular-nums;
}
#panel input[type='range'] {
  width: 100%;
  accent-color: var(--ember);
  margin: 0;
}
#panel input[type='date'] {
  font: 400 1.1rem/1.2 var(--ui);
  color: var(--bone);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  color-scheme: dark;
}
#panel .say {
  display: grid;
  gap: 0.35rem;
  font: 400 1.02rem/1.35 var(--ui);
  color: var(--ash);
  min-height: 1.2rem;
}
#panel .say b {
  font-weight: 500;
  color: var(--bone);
}
#panel .row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
#panel .seg {
  display: flex;
  gap: 0.3rem;
}
#panel .seg button {
  flex: 1;
  padding: 0.6rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 400 1rem/1 var(--ui);
  color: var(--ash);
}
#panel .seg button[aria-pressed='true'] {
  color: var(--bone);
  border-color: var(--ember);
  background: rgba(255, 140, 60, 0.14);
}
#panel p {
  margin: 0;
  font: 400 1.04rem/1.42 var(--text);
  color: var(--bone);
}
#panel .hold {
  position: relative;
  overflow: hidden;
  justify-self: stretch;
  text-align: center;
}
#panel .hold i {
  position: absolute;
  inset: 0;
  width: 100%;
  background: rgba(255, 140, 60, 0.45);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
#panel .hold span {
  position: relative;
}
#panel table {
  border-collapse: collapse;
  width: 100%;
  font: 400 1rem/1.3 var(--ui);
  font-variant-numeric: tabular-nums;
}
#panel td {
  padding: 0.22rem 0;
  vertical-align: top;
}
#panel td:first-child {
  color: var(--ash);
}
#panel td:last-child {
  text-align: right;
}
/* end + notes */
#end {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: clamp(2rem, 6vh, 4.5rem);
  z-index: 5;
  opacity: 0;
  transition: opacity 1.5s;
}
#end.on {
  opacity: 1;
}
#end.on > div {
  pointer-events: auto;
}
#end > div {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}
#jam {
  z-index: 3;
  pointer-events: none;
  font: 400 0.95rem/1 var(--ui);
  color: var(--ash);
  opacity: 0.55;
}
#jam i {
  position: fixed;
  font-style: normal;
  letter-spacing: 0.08em;
}
#jam .o {
  left: max(20px, env(safe-area-inset-left, 0px));
  top: 50%;
}
#jam .t {
  right: max(20px, env(safe-area-inset-right, 0px));
  top: 50%;
}
#jam .s {
  top: clamp(4rem, 9vh, 6rem);
  left: 50%;
  transform: translateX(-50%);
}
#jam .q {
  bottom: clamp(1.2rem, 4vh, 2.4rem);
  left: 50%;
  transform: translateX(-50%);
}
#jam b {
  position: fixed;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 1px solid var(--bone);
  border-radius: 50%;
  transition: left 0.4s, top 0.4s;
}
#notes {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(7, 5, 4, 0.985);
  overflow: auto;
  padding-block: clamp(2rem, 7vh, 5rem);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
#notes > div {
  max-width: 74rem;
  margin: 0 auto;
  display: grid;
  gap: 2.2rem;
}
#notes h2 {
  font: 400 clamp(2rem, 3.6vw, 3.2rem) / 1.1 var(--display);
  margin: 0;
  text-wrap: balance;
}
#notes .cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
  gap: 2.4rem;
}
#notes h3 {
  font: 400 1.35rem/1.2 var(--display);
  margin: 0 0 0.8rem;
  color: var(--ember);
}
#notes ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.8rem;
}
#notes li {
  font: 400 1.08rem/1.46 var(--text);
}
#notes a {
  color: var(--shadowband);
}
#nogl {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
  font: 400 1.3rem/1.5 var(--text);
  z-index: 20;
  background: var(--soot);
}
@media (max-width: 640px) {
  #panel {
    left: 16px;
    right: 16px;
    width: auto;
  }
  #inst dl {
    font-size: 0.92rem;
  }
}
/* A phone, upright or on its side, or any short window (OL-007): the milestone stays below the controls, which wrap to two lines
   when narrow, and a panel taller than the screen scrolls rather than running under them. The caption keeps clear of what is
   below it by --lift. */
@media (max-width: 640px), (max-height: 600px) {
  #mile {
    padding-top: max(clamp(2rem, 9vh, 6rem), calc(max(14px, env(safe-area-inset-top, 0px)) + 3.9rem));
  }
  #panel {
    /* its padding (1.2rem and 1.3rem) and border (2px) are outside max-height */
    max-height: calc(100vh - clamp(1.2rem, 4vh, 3rem) - max(14px, env(safe-area-inset-top, 0px)) - 3.9rem - 2.5rem - 2px);
    overflow-y: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01s !important;
  }
}
