/* The same room as the app (public/style.css): night map, amber light, Caslon for the voice, Fira for the rest. */

:root {
  --ink: #f4efe6;
  --ink-soft: #bdb7ab;
  --ink-faint: #918c82;
  --night: #0b0d11;
  --panel: #0e1015;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.2);
  --glow: #ffb547;
  --glow-ink: #1a1204;
  --display: "Libre Caslon Display", "Libre Caslon Text", "Iowan Old Style", Georgia, serif;
  --serif: "Libre Caslon Text", "Iowan Old Style", Georgia, serif;
  --sans: "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Fira Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --page: min(1180px, 100vw - 2 * var(--gutter));
  --gutter: clamp(20px, 4vw, 48px);
  --gap: clamp(88px, 12vw, 168px); /* between sections */
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--night);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* The light the whole product is about: one warm source behind the headline, falling off into the night. */
body::before {
  content: "";
  position: absolute;
  inset: -20vh 0 auto 0;
  height: 110vh;
  z-index: -1;
  background:
    radial-gradient(ellipse 50% 42% at 62% 38%, rgba(255, 181, 71, 0.16), transparent 70%),
    radial-gradient(ellipse 34% 30% at 22% 62%, rgba(255, 140, 40, 0.07), transparent 70%);
  pointer-events: none;
}

::selection {
  color: var(--ink);
  background: rgba(255, 181, 71, 0.38);
}

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

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s, color 0.2s;
}

a:hover {
  color: var(--glow);
  text-decoration-color: currentColor;
}

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

p {
  margin: 0;
  text-wrap: pretty;
}

code,
.mono {
  font-family: var(--mono);
  font-feature-settings: "tnum";
}

code {
  padding: 0.1em 0.38em;
  font-size: 0.86em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 5px;
}

q {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
}

/* Top ------------------------------------------------------------------------------------------ */

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  width: var(--page);
  margin: 0 auto;
  padding: 26px 0 0;
}

.wordmark {
  font: italic 400 30px/1 var(--serif);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.top nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 26px;
  font-size: 15px;
}

.top nav a {
  color: var(--ink-soft);
  text-decoration-color: transparent;
}

.top nav a:hover {
  color: var(--ink);
  text-decoration-color: var(--line-strong);
}

.top nav .source {
  color: var(--ink);
  text-decoration-color: var(--glow);
}

/* Hero ----------------------------------------------------------------------------------------- */

.hero {
  width: var(--page);
  margin: clamp(56px, 9vw, 120px) auto 0;
}

.hero h1 {
  max-width: 11ch;
  font: 400 clamp(52px, 9.2vw, 6rem) / 0.98 var(--display);
  letter-spacing: -0.015em;
  animation: arrive 1s var(--ease) both;
}

.hero h1 em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--glow);
}

.lede {
  max-width: 60ch;
  margin-top: clamp(24px, 3vw, 36px);
  color: var(--ink-soft);
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.55;
  animation: arrive 1s 0.12s var(--ease) both;
}

/* Stage: the real interface, in a frame ---------------------------------------------------------- */

.stage {
  width: min(1320px, 100vw - 2 * var(--gutter));
  margin: clamp(48px, 6vw, 80px) auto 0;
  animation: arrive 1.1s 0.24s var(--ease) both;
}

.frame,
.film video {
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  /* Neutral elevation only. The page has one light, behind the headline; the map brings its own. */
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 30px 70px -20px rgba(0, 0, 0, 0.8),
    0 70px 160px -60px rgba(0, 0, 0, 0.9);
}

.frame {
  aspect-ratio: 16 / 10;
}

.frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.caption {
  max-width: 78ch;
  margin: 18px 2px 0;
  color: var(--ink-faint);
  font-size: 15px;
}

.caption span {
  color: var(--ink-soft);
}

/* Sections: a heading column and a content column ---------------------------------------------- */

.film,
.how,
.measured,
.run {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  gap: 32px clamp(32px, 6vw, 96px);
  align-items: start;
  width: var(--page);
  margin: var(--gap) auto 0;
}

.prose {
  position: sticky;
  top: 40px;
}

h2 {
  font: 400 clamp(30px, 3.4vw, 44px) / 1.1 var(--display);
  letter-spacing: -0.01em;
}

.prose p {
  max-width: 44ch;
  margin-top: 18px;
  color: var(--ink-soft);
}

.film video {
  aspect-ratio: 16 / 9;
}

/* How it answers: the app's own timeline, written out */

.rail {
  position: relative;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.rail::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 4px;
  width: 1px;
  background: var(--line-strong);
}

.rail li {
  position: relative;
  padding: 0 0 34px 34px;
}

.rail li:last-child {
  padding-bottom: 0;
}

.rail li::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-faint);
  box-shadow: 0 0 0 5px var(--night);
}

.rail li[data-who="Jev"]::before {
  background: var(--glow);
}

.rail li[data-who="Needle"]::before {
  background: var(--ink);
}

.rail h3 {
  font: 500 22px/1.3 var(--sans); /* a real step above the 16px text under it, not weight alone */
  letter-spacing: -0.005em;
}

.rail p {
  max-width: 62ch;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 16px;
}

.sum {
  grid-column: 2;
  padding-top: 22px;
  color: var(--ink-soft);
  font-size: 14px;
  border-top: 1px solid var(--line);
}

/* What we measured */

.measured dl {
  margin: 0;
}

.measured dl > div {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.measured dl > div:first-child {
  padding-top: 8px;
  border-top: 0;
}

.measured dt {
  font: 400 23px/1.3 var(--serif);
}

.measured dd {
  max-width: 64ch;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
}

/* Run it */

pre {
  margin: 0;
  padding: 22px 24px;
  overflow-x: auto;
  font: 400 14.5px/1.75 var(--mono);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

pre code {
  padding: 0;
  font-size: inherit;
  background: none;
}

.dim {
  color: var(--ink-faint);
}

/* Footer */

footer {
  width: var(--page);
  margin: var(--gap) auto 0;
  padding: 28px 0 56px;
  color: var(--ink-faint);
  font-size: 14px;
  border-top: 1px solid var(--line);
}

footer p + p {
  margin-top: 8px;
}

footer a {
  color: var(--ink-soft);
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(6px);
  }
}

@media (max-width: 860px) {
  .film,
  .how,
  .measured,
  .run {
    grid-template-columns: minmax(0, 1fr);
  }

  .prose {
    position: static;
  }

  .sum {
    grid-column: 1;
  }

  .frame {
    aspect-ratio: 10 / 16; /* the app has its own phone layout */
  }

  .top nav a:not(.source) {
    display: none;
  }
}

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

  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
