/* Layout: a contact sheet. Each slide is a film strip of the same frame at every tier, with a loupe above it. */
:root {
  --paper: #ffffff;
  --ink: #0a0a0a;
  --muted: #5c5c5c;
  --rule: #d9d9d9;
  --film: #0a0a0a;
  --film-ink: #f0f0f0;
  --film-dim: #8a8a8a;
  --hole: #3a3a3a;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a0a0a;
    --ink: #f2f2f2;
    --muted: #9a9a9a;
    --rule: #2a2a2a;
    --film: #171717;
    --hole: #333333;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0a0a0a;
  --ink: #f2f2f2;
  --muted: #9a9a9a;
  --rule: #2a2a2a;
  --film: #171717;
  --hole: #333333;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
}
img { max-width: 100%; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 48px 72px;
  display: grid;
  gap: 72px;
}

/* Type */
.eyebrow, .edge, .tierbtn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow { color: var(--muted); }
h1 {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  /* The title is 7.6em wide on one line, so this fills the header exactly. */
  font-size: 13cqw;
  white-space: nowrap;
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
h1 {
  color: transparent;
  -webkit-text-stroke: 0.022em var(--ink);
}

/* Title blocks: compression blocks lit by a spotlight following the cursor. */
h1[data-text] { position: relative; cursor: default; }
h1[data-text]::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--ink);
  pointer-events: none;
  -webkit-mask-image: var(--blocks);
  mask-image: var(--blocks);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: var(--blocks-w) var(--blocks-h);
  mask-size: var(--blocks-w) var(--blocks-h);
}
h2 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 0.95;
  margin: 0;
  text-wrap: balance;
}
h3 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 28px;
  line-height: 1;
  margin: 8px 0 0;
}
p { margin: 0; max-width: 65ch; }
.lede { font-size: 19px; margin-top: 24px; }
.muted { color: var(--muted); }

/* Header */
header { display: grid; container-type: inline-size; }

/* Sections */
section { display: grid; gap: 28px; }
.sechead { display: grid; gap: 12px; }

/* Configurations: one card per tier. */
.configs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.config {
  display: grid;
  gap: 20px;
  align-content: start;
  padding: 20px;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--ink) 4%, var(--paper));
}
.config .name { padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.config.current { border-color: var(--ink); }
.config .name { font-family: var(--display); font-weight: 700; font-size: 34px; text-transform: uppercase; line-height: 1; }
.config dt, .config .flag {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.config dl { display: grid; gap: 18px; margin: 0; }
.config dd {
  margin: 4px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.config .flag { justify-self: start; border: 1px solid var(--muted); padding: 2px 6px; }

/* Showcase */
.slide { display: grid; gap: 18px; }
.slide.loading .strip, .slide.loading .thumb { opacity: 0.5; }
.slidehead { display: grid; }
.picker { display: grid; gap: 8px; justify-items: start; }
.picker > span:first-child { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.picker select {
  appearance: none;
  -webkit-appearance: none;
  font: 500 15px/1.2 var(--body);
  color: var(--ink);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239a9a9a' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 9px 36px 9px 12px;
  min-width: 240px;
  max-width: 100%;
  cursor: pointer;
}
.picker select:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.map {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 22%;
  min-width: 140px;
  background: rgba(0, 0, 0, 0.7);
  outline: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  cursor: default;
}
.thumb { all: unset; cursor: grab; touch-action: none; position: relative; display: block; aspect-ratio: 16 / 9; background: var(--film); }
.thumb:active { cursor: grabbing; }
.thumb img { pointer-events: none; -webkit-user-drag: none; }
.zoom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 2.5em;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f0f0f0;
}
.zoom input { width: 100%; margin: 0; accent-color: #f0f0f0; cursor: pointer; }
.zoom output { text-align: right; font-variant-numeric: tabular-nums; }
.thumb:focus-visible { outline: 2px solid #ffffff; outline-offset: 3px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .box { position: absolute; outline: 1px solid #ffffff; box-shadow: 0 0 0 1px #000000; pointer-events: none; }

/* Film strip */
.strip { background: var(--film); color: var(--film-ink); display: grid; }
.holes {
  height: 22px;
  background: repeating-linear-gradient(90deg, transparent 0 10px, var(--hole) 10px 22px, transparent 22px 30px) 0 50% / 100% 9px no-repeat;
}
.loupe { position: relative; margin: 0 14px; background: #000000; aspect-ratio: 16 / 9; overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none; }
.loupe canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.loupe .edge {
  position: absolute;
  top: 0;
  right: 0;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #f0f0f0;
}
.frames {
  display: grid;
  grid-template-columns: repeat(var(--count, 6), minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
}
.tierbtn[hidden] { display: none; }
.tierbtn { all: unset; cursor: pointer; display: grid; gap: 6px; color: var(--film-dim); font-size: 11px; min-width: 0; }
.tierbtn canvas { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; opacity: 0.55; transition: opacity 0.15s; }
.tierbtn .k { display: flex; justify-content: space-between; gap: 6px; }
.tierbtn[aria-pressed="true"] { color: var(--film-ink); }
.tierbtn[aria-pressed="true"] canvas { opacity: 1; outline: 2px solid var(--film-ink); outline-offset: 2px; }
.tierbtn:hover canvas { opacity: 0.9; }
.tierbtn:focus-visible { outline: 2px solid var(--film-ink); outline-offset: 4px; }

/* Hero at site size: the /films hero box, full width, 16:9 between 560 and 700 px tall,
   covered from the top, with the site's scrim. */
body { overflow-x: clip; }
.hero { display: grid; gap: 18px; }
.herobar { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: end; }
.levels { display: flex; flex-wrap: wrap; }
.levels button {
  all: unset;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--rule);
  margin-left: -1px;
  padding: 10px 14px;
}
.levels button[aria-pressed="true"] { position: relative; color: var(--paper); background: var(--ink); border-color: var(--ink); }
.levels button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.keys { margin: 0 0 10px auto; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.herostage {
  position: relative;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  aspect-ratio: 16 / 9;
  min-height: 560px;
  max-height: 700px;
  background: #000000;
  overflow: hidden;
  outline: none;
}
.herostage:focus-visible { box-shadow: inset 0 0 0 2px #ffffff; }
.herostage img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.herostage .scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 25%, rgba(0, 0, 0, 0.15) 45%, rgba(0, 0, 0, 0) 60%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.15) 35%, rgba(0, 0, 0, 0) 60%);
}
.herostage h3 {
  position: absolute;
  left: clamp(16px, 4vw, 64px);
  right: clamp(16px, 4vw, 64px);
  bottom: clamp(24px, 4vw, 40px);
  margin: 0;
  font: 600 clamp(24px, 3vw, 40px) / 1.1 var(--body);
  text-transform: none;
  letter-spacing: normal;
  color: #ffffff;
}
.herostage .edge { position: absolute; top: 0; right: 0; padding: 10px 12px; background: rgba(0, 0, 0, 0.6); color: #f0f0f0; font-family: var(--mono); font-size: 12px; }

footer { border-top: 1px solid var(--rule); padding-top: 20px; display: grid; gap: 8px; font-size: 13px; color: var(--muted); }

@media (max-width: 760px) {
  .wrap { gap: 56px; padding-block: 32px 56px; }
  .configs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .config { padding: 16px; }
  .map { left: 8px; bottom: 8px; width: 34%; }
  /* Phones drop the Original frame (pressing the frame shows it) so the tiers sit two by two. */
  .frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tierbtn[data-key="original"] { display: none; }
  .loupe { margin: 0 8px; }
  .frames { padding-left: 8px; padding-right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .tierbtn canvas { transition: none; }
}

/* The flowers under the footer. */
:root {
  --stem: #3d7a36;
  --leaf: #2f9a4a;
  --heart: #d39b00;
  --p1: #d1457a;
  --p2: #e07a1f;
  --p3: #7a55c9;
  --p4: #2f7fbf;
  --p5: #c8323c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --stem: #74b05a;
    --leaf: #5fcf7a;
    --heart: #f2c94c;
    --p1: #f27aa4;
    --p2: #f5a55b;
    --p3: #a98cf2;
    --p4: #6fb3ec;
    --p5: #f06b72;
  }
}
:root[data-theme="dark"] {
  --stem: #74b05a;
  --leaf: #5fcf7a;
  --heart: #f2c94c;
  --p1: #f27aa4;
  --p2: #f5a55b;
  --p3: #a98cf2;
  --p4: #6fb3ec;
  --p5: #f06b72;
}
.garden {
  font: 400 14px/1.25 var(--mono);
  margin: 0;
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.garden .stem { color: var(--stem); }
.garden .leaf { color: var(--leaf); }
.garden .heart { color: var(--heart); }
.garden .p1 { color: var(--p1); }
.garden .p2 { color: var(--p2); }
.garden .p3 { color: var(--p3); }
.garden .p4 { color: var(--p4); }
.garden .p5 { color: var(--p5); }
@media (max-width: 760px) {
  .garden { font-size: 12px; }
}
