/* Nietzschean Fly. The plate's palette, one serif, nothing on the page that is not a
   picture, a live plane or text. */

@font-face {
  font-family: "EB Garamond";
  src: url("assets/fonts/EBGaramond.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --snow: #b3c3e7;
  --snow-deep: #a6b7de;
  --ink: #324a71;
  --ink-soft: #4a5f82;
  --paper-ink: #2b2f35;
  --serif: "EB Garamond", "Garamond", "Georgia", "Times New Roman", serif;
  --gutter: clamp(20px, 4vw, 64px);
  --tag: 72px;
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--snow);
  color: var(--ink);
  font-family: var(--serif);
  font-synthesis: none;
  font-feature-settings: "kern", "liga", "onum", "pnum";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: url("assets/img/cursor.png") 16 16, auto;
  cursor: -webkit-image-set(url("assets/img/cursor.png") 1x, url("assets/img/cursor@2x.png") 2x) 16 16, auto;
  cursor: image-set(url("assets/img/cursor.png") 1x, url("assets/img/cursor@2x.png") 2x) 16 16, auto;
}

a, button { cursor: inherit; }

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

/* ---- the plain, the film, her ---------------------------------------------------- */

.frames, .opening {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block;
}
.frames { z-index: 0; background: var(--snow); }
.opening {
  z-index: 1; object-fit: cover; object-position: 50% 50%;
  background: var(--snow);
  transition: opacity 0.9s ease;
}
body.is-walking .opening { opacity: 0; pointer-events: none; }
body.no-frames .opening { opacity: 1 !important; }


/* ---- type ---------------------------------------------------------------------- */

.mast {
  position: fixed; z-index: 3;
  left: var(--gutter); top: clamp(24px, 9vh, 88px);
  margin: 0;
  pointer-events: none;
}
.mark {
  margin: 0;
  font-weight: 600;
  font-size: clamp(42px, 7vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.mark span { display: block; }
.ticker {
  margin: 0.55em 0 0 0.06em;
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.hint {
  position: fixed; z-index: 3;
  left: 50%; bottom: clamp(18px, 4vh, 40px);
  transform: translateX(-50%);
  margin: 0;
  font-size: 17px; font-weight: 500; letter-spacing: 0.04em;
  color: var(--ink-soft);
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.hint.is-gone { opacity: 0; }

.skip {
  position: fixed; z-index: 4;
  right: var(--gutter); bottom: clamp(18px, 4vh, 40px);
  font-size: 16px; font-weight: 500; letter-spacing: 0.03em;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.skip:hover, .skip:focus-visible { color: var(--ink); border-bottom-color: var(--ink); outline: none; }
.skip:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
body.is-there .skip { opacity: 0; pointer-events: none; }

/* ---- tags: specimen paper carrying the official marks --------------------------- */

.tags {
  position: fixed; z-index: 4;
  right: var(--gutter); top: clamp(18px, 3.5vh, 36px);
  display: flex; align-items: flex-start; gap: 12px;
}
.tag {
  position: relative;
  width: var(--tag); height: var(--tag);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 0; margin: 0;
  border: 0; background: transparent;
  background-image: url("assets/img/tag.webp");
  background-size: 100% 100%;
  color: var(--paper-ink);
  font-family: inherit;
  font-size: 14px; font-weight: 500; letter-spacing: 0.02em; line-height: 1;
  text-decoration: none;
  filter: drop-shadow(0 1px 1px rgba(40, 55, 90, 0.18));
  transition: transform 0.18s ease;
}
.tag:hover { transform: translateY(-1px) rotate(-0.6deg); }
.tag:active { transform: translateY(0) scale(0.985); }
.tag:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.tag[aria-disabled="true"] { opacity: 0.55; }
.tag[hidden] { display: none; }
.tag-mark { display: block; height: 26px; width: auto; }
.tag-x { height: 22px; }
.tag-pons { height: 30px; }
.tag-text { font-size: 15px; font-weight: 600; }
.tag-word { font-size: 13px; }

.vol-wrap { display: flex; align-items: center; height: var(--tag); }
.vol-wrap[hidden] { display: none; }
.vol-wrap input[type="range"] {
  width: 84px; accent-color: var(--ink); margin: 0;
}

/* ---- stations ------------------------------------------------------------------- */

.walk { position: relative; }

.station {
  position: fixed; z-index: 3;
  left: var(--gutter); top: clamp(300px, 44vh, 480px);
  max-width: min(34ch, calc(100vw - 2 * var(--gutter)));
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.station p {
  margin: 0;
  font-size: clamp(22px, 2.3vw, 32px);
  font-weight: 500;
  line-height: 1.32;
  color: var(--ink);
  text-wrap: pretty;
}
.station.is-on { pointer-events: auto; }

/* ---- the end: her last line and the contract, plain type on the snow ------------ */

.station.end { max-width: min(38ch, calc(100vw - 2 * var(--gutter))); }
.contract { margin-top: 1.4em; }
.contract-key {
  margin: 0 0 0.25em;
  font-size: clamp(15px, 1.4vw, 18px);
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.ca {
  margin: 0;
  font-size: clamp(17px, 1.65vw, 24px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--ink);
  word-break: break-all;
  user-select: all;
}
.ca.is-empty { font-weight: 500; font-style: italic; user-select: none; }
.copy {
  display: inline-block;
  margin-top: 0.55em;
  padding: 0.15em 0.05em;
  border: 0;
  border-bottom: 1.5px solid var(--ink-soft);
  background: transparent;
  color: var(--ink);
  font: inherit; font-size: clamp(16px, 1.5vw, 20px); font-weight: 600; letter-spacing: 0.04em;
}
.copy:hover:not(:disabled) { border-bottom-color: var(--ink); }
.copy:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.copy:disabled { opacity: 0.45; }
.copy.is-ok { color: #2f6b3f; border-bottom-color: #2f6b3f; }
.copy.is-bad { color: #8a2e2e; border-bottom-color: #8a2e2e; }

/* ---- phones ---------------------------------------------------------------------- */

@media (max-width: 720px) {
  :root { --tag: 60px; }
  .tags { gap: 8px; }
  .tag-mark { height: 22px; }
  .tag-x { height: 19px; }
  .tag-pons { height: 26px; }
  .tag-text { font-size: 14px; }
  .tag-word { font-size: 12px; }
  .vol-wrap input[type="range"] { width: 64px; }
  .mast { top: clamp(96px, 16vh, 140px); }
  .mark { font-size: clamp(40px, 12vw, 64px); }
  .station { top: clamp(280px, 42vh, 400px); }
  .station p { font-size: clamp(20px, 5.6vw, 26px); }
}

@media (max-height: 560px) {
  .mast { top: 14px; }
  .mark { font-size: 36px; }
  .ticker { font-size: 18px; margin-top: 0.3em; }
}

@media (prefers-reduced-motion: reduce) {
  .opening, .hint, .tag { transition: none; }
  .tag:hover { transform: none; }
}
