/* film.css — shared look for the paper films (/films/*.html).
   Everything inside .stage is laid out on a fixed 1920×1080 canvas in px;
   film.js scales the canvas to fit, so a film looks identical in a lightbox,
   an inline embed, or full screen. */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: block;
  src: url("/fonts/manrope-latin.woff2") format("woff2");
}

:root {
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --ink-3: #6e6e73;
  --line: rgba(255, 255, 255, 0.12);
  --panel: rgba(255, 255, 255, 0.05);
  --gold: #ffc904;
  --gold-2: #ffe27a;
  /* Per-film accent; a film overrides these two on .film. */
  --a1: #ffc904;
  --a2: #ff8a3d;
  --display: "Manrope", -apple-system, "SF Pro Display", system-ui, sans-serif;
  --text: -apple-system, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: #000;
  color: var(--ink);
  overflow: hidden;
}

.film {
  position: fixed;
  inset: 0;
  background: #000;
  font-family: var(--text);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  cursor: default;
}

/* Portrait phone: film.js turns the film to fill the long side (see fit()).
   The box is laid out at viewport-height × viewport-width, then rotated
   clockwise about its top-left corner and shifted back into view. */
.film.is-rotated {
  inset: 0 auto auto 0;
  width: 100vh;
  height: 100vw;
  transform-origin: 0 0;
  transform: rotate(90deg) translateY(-100%);
}

/* Lite mode (film.js sets .is-lite on touch devices): no glass. */
.film.is-lite .panel,
.film.is-lite .film-btn {
  backdrop-filter: none;
}
.film.is-lite .panel {
  background: rgba(255, 255, 255, 0.07);
}

.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  transform-origin: 50% 50%;
  background: #000;
  /* The stage is zoomed to fit (film.js), so on a phone its type is a few
     CSS px tall. Without this, the system font switches to its small optical
     size there, body copy runs wider than designed and wraps differently. */
  font-optical-sizing: none;
}

/* A scene is a full-canvas layer; scripts animate it (or its children). */
.scene {
  position: absolute;
  inset: 0;
}
.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Elements start hidden; their first film.in() owns the reveal. Anything a
   script never animates stays invisible, which surfaces mistakes quickly. */
.stage [data-a] {
  opacity: 0;
}

/* --- Type ----------------------------------------------------------------- */
.eyebrow {
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.h-xl {
  font-family: var(--display);
  font-weight: 700;
  font-size: 132px;
  line-height: 1.02;
  letter-spacing: -0.045em;
  margin: 0;
}
.h-l {
  font-family: var(--display);
  font-weight: 700;
  font-size: 96px;
  line-height: 1.04;
  letter-spacing: -0.04em;
  margin: 0;
}
.h-m {
  font-family: var(--display);
  font-weight: 700;
  font-size: 64px;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0;
}
.sub {
  font-size: 34px;
  line-height: 1.4;
  color: var(--ink-2);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}
.muted {
  color: var(--ink-3);
}
.grad {
  background: linear-gradient(100deg, var(--a1), var(--a2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Inline word spans for word-by-word reveals. */
.w {
  display: inline-block;
  white-space: pre;
}

/* Big stat number (count-ups). Tabular so digits don't jitter while counting. */
.stat-num {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat-label {
  font-size: 30px;
  color: var(--ink-2);
  font-weight: 500;
  margin-top: 14px;
}

/* Soft colored glow behind a scene. */
.glow {
  position: absolute;
  width: 1400px;
  height: 1400px;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  margin: -700px 0 0 -700px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--a1) 22%, transparent), transparent 70%);
  pointer-events: none;
}

/* Glass panel, chips. */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  backdrop-filter: blur(20px);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.01em;
}

/* --- Phone mock ----------------------------------------------------------- */
.phone {
  position: absolute;
  width: 400px;
  height: 820px;
  border-radius: 64px;
  background: #0b0b0c;
  padding: 16px;
  box-shadow:
    0 0 0 2px #2a2a2d,
    0 0 0 9px #111113,
    0 0 0 10px #3a3a3e,
    0 50px 120px rgba(0, 0, 0, 0.6);
}
.phone .screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50px;
  overflow: hidden;
  background: #f2f2f7;
}
.phone .notch {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 110px;
  height: 30px;
  margin-left: -55px;
  border-radius: 20px;
  background: #000;
  z-index: 5;
}

/* --- End card ----------------------------------------------------------------- */
.award {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  color: var(--gold);
  letter-spacing: 0.01em;
}
.award svg {
  width: 52px;
  height: 52px;
  fill: var(--gold);
}
.paper-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 68px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 1500px;
  margin: 0;
}
.authors {
  font-size: 30px;
  color: var(--ink-2);
  line-height: 1.5;
  max-width: 1500px;
}
.authors span {
  white-space: nowrap;
}
.authors .me {
  color: var(--ink);
  font-weight: 700;
}
.venue {
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
  color: var(--ink);
}
.links {
  display: flex;
  gap: 20px;
  justify-content: center;
}
.links a {
  color: #000;
  background: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  padding: 14px 34px;
  border-radius: 999px;
  cursor: pointer;
}
.links a.ghost {
  color: var(--ink);
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--line);
}
.links a:hover {
  background: var(--gold);
  color: #000;
}

/* --- Controls ------------------------------------------------------------- */
.film-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 18px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  font: 600 12px/1 var(--text);
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 10;
}
.film:not(.is-playing) .film-ui,
.film.is-awake .film-ui,
.film-ui:focus-within {
  opacity: 1;
}
.film-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.film-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}
.film-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: none;
}
.film:not(.is-playing):not(.is-ended) .i-play,
.film.is-playing .i-pause,
.film.is-ended:not(.is-playing) .i-replay {
  display: block;
}
.film-track {
  flex: 1;
  display: flex;
  gap: 4px;
  height: 30px;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.film-seg {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
  overflow: visible;
}
.film-seg i {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: var(--ink);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.film-seg b {
  position: absolute;
  left: 0;
  bottom: 10px;
  font-weight: 600;
  font-size: 11px;
  color: var(--ink-2);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.film-time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  min-width: 76px;
  text-align: right;
}
@media (max-width: 520px) {
  .film-seg b {
    display: none;
  }
}
