@property --glow {
  syntax: "<color>";
  inherits: true;
  initial-value: #3a4a26;
}

:root {
  --bg: #0b0c0a;
  --panel: #121310;
  --line: rgba(255, 255, 255, 0.09);
  --text: #efede4;
  --muted: #8d8b80;
  --accent: #ff4a1c;
  --glow: #3a4a26;
  --bar: 64px;
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
  --display: "Anton", "Impact", sans-serif;   /* film-poster titles: the slate name + the email */
  --ease: cubic-bezier(.2, .8, .2, 1);
  transition: --glow 1.4s ease;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
body.locked { overflow: hidden; }

/* ── top bar ───────────────────────────── */
.bar {
  position: sticky; top: 0; z-index: 20;
  height: var(--bar);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 24px;
  background: linear-gradient(var(--bg), color-mix(in srgb, var(--bg) 70%, transparent));
}
.name { font-weight: 600; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
@media (max-width: 1180px) { .name span { display: none; } }   /* no room beside the filters */
.name span { font: 400 11px var(--mono); color: var(--muted); letter-spacing: .04em; }
.filters { display: flex; gap: 4px; }
.filters button {
  font-family: var(--mono); font-size: 12px;
  padding: 7px 12px; border-radius: 999px;
  color: var(--muted);
  transition: color .2s, background .2s;
}
.filters button:hover { color: var(--text); }
.filters button[aria-pressed="true"] { color: var(--bg); background: var(--text); }
.filters sup { font-size: 9px; margin-left: 3px; opacity: .6; }
.bar-right { justify-self: end; display: flex; align-items: center; gap: 22px; }
.contact-link { font-size: 14px; }
.contact-link:hover { color: var(--accent); }

/* ── the curved wall ───────────────────── */
.stage {
  position: relative;
  height: calc(100svh - var(--bar));
  overflow: hidden;
  perspective: 1200px;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
}
.stage.dragging, .stage.dragging .tile { cursor: grabbing; }
.glow {
  position: absolute; inset: -15%;
  background:
    radial-gradient(ellipse 45% 40% at 50% 55%, var(--glow), transparent 70%),
    radial-gradient(ellipse 30% 25% at 18% 30%, color-mix(in srgb, var(--glow) 40%, transparent), transparent 70%);
  opacity: .5; filter: blur(30px);
  pointer-events: none;
}
.ring {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.tile {
  position: absolute;
  left: calc(var(--w) / -2); top: calc(var(--h) / -2);
  width: var(--w); height: var(--h);
  overflow: hidden; border-radius: 14px;
  background: #171814;
  /* each tile sits on the inside of a sphere, facing you */
  transform: rotateY(var(--a)) rotateX(var(--b)) translateZ(calc(var(--z, 0px) - var(--R))) scale(var(--s, 1));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 30px 60px -30px rgba(0, 0, 0, .9);
  backface-visibility: hidden;
  cursor: pointer;
  animation: in 1.1s var(--ease) var(--d, 0s) backwards;
  transition: transform .6s var(--ease), opacity .45s, filter .45s, box-shadow .5s;
}
@keyframes in { from { opacity: 0; scale: .82; } }
.tile:hover, .tile:focus-visible {
  --z: 80px; --s: 1.05;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .22), 0 40px 80px -24px rgba(0, 0, 0, .95);
}
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tile img, .tile video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.tile img { filter: contrast(1.05) saturate(.92); }
.tile video { opacity: 0; transition: opacity .25s; }
.tile.playing video { opacity: 1; }
.tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent 55%);
  opacity: 0; transition: opacity .25s;
}
.tile .idx {
  position: absolute; top: 9px; left: 11px; z-index: 2;
  font: 500 10px var(--mono); color: rgba(255, 255, 255, .85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
  opacity: 0; transition: opacity .25s;
}
.tile .label {
  position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 2;
  text-align: left;
  transform: translateY(6px); opacity: 0;
  transition: transform .3s var(--ease), opacity .25s;
}
.tile .label strong { display: block; font-size: 14px; font-weight: 550; line-height: 1.25; }
.tile .label span { font: 11px var(--mono); color: rgba(255, 255, 255, .7); }
.tile:hover::after, .tile:focus-visible::after,
.tile:hover .label, .tile:focus-visible .label,
.tile:hover .idx, .tile:focus-visible .idx { opacity: 1; transform: none; }

/* one tile in focus: the rest of the wall sinks back */
.ring:has(.tile:hover) .tile:not(:hover) { opacity: .42; filter: saturate(.45) brightness(.8); }
/* a filter turns the wall to its group and lets the others fade */
.tile.off { opacity: .12 !important; filter: grayscale(1) brightness(.6) !important; pointer-events: none; }

/* events sit a step back and a little dimmer: there to find, not the first thing you see */
.tile.quiet { --z: -90px; opacity: .62; filter: saturate(.45) brightness(.78); }
.tile.quiet:hover, .tile.quiet:focus-visible { --z: 80px; opacity: 1; filter: none; }
.ring.show-quiet .tile.quiet:not(.off) { --z: 0px; opacity: 1; filter: none; }
.ring.show-quiet .tile.quiet:hover { --z: 80px; }

/* group labels: the quiet separation between kinds of work */
.glabel {
  position: absolute; left: -160px; top: 0; width: 320px;
  text-align: center; pointer-events: none;
  transform: rotateY(var(--a)) rotateX(var(--b)) translateZ(calc(var(--R) * -1)) translateY(calc(var(--h) / -2 - 34px));
  font: 500 11px var(--mono); letter-spacing: .22em; text-transform: uppercase;
  color: rgba(239, 237, 228, .3);
  transition: color .4s;
}
.glabel span { color: var(--accent); opacity: .7; margin-right: 6px; }
.glabel em { font-style: normal; opacity: .6; margin-left: 4px; }
.glabel.on { color: rgba(239, 237, 228, .75); }
.glabel.quiet:not(.on) { color: rgba(239, 237, 228, .18); }

/* vertical videos: the frame sits in the tile over a blurred fill of itself */
.tile .fill { filter: blur(16px) brightness(.5) saturate(1.3); transform: scale(1.25); }
.tile.tall .poster, .tile.tall video { object-fit: contain; }

/* a quick tape glitch as a tile wakes up */
.tile:hover .poster, .tile:focus-visible .poster { animation: glitch .3s steps(1) 1; }
@keyframes glitch {
  0% { transform: translate(4px, -1px); filter: contrast(1.5) saturate(2.2) hue-rotate(-25deg); }
  30% { transform: translate(-3px, 2px); filter: contrast(1.3) saturate(1.8) hue-rotate(30deg); clip-path: inset(18% 0 34% 0); }
  60% { transform: translate(2px, 0); filter: contrast(1.2) brightness(1.2); clip-path: none; }
  100% { transform: none; }
}

/* ── the edit timeline under the wall ─── */
.scrub {
  position: absolute; left: 50%; bottom: 20px; z-index: 5;
  width: min(760px, calc(100% - 48px)); height: 40px;
  translate: -50% 0;
  cursor: ew-resize; touch-action: none; outline: none;
}
.scrub:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.scrub-track {
  position: absolute; left: 0; right: 0; bottom: 0; height: 26px;
  border-top: 1px solid rgba(239, 237, 228, .14);
  /* ruler ticks, every 10th one longer */
  background:
    repeating-linear-gradient(90deg, rgba(239, 237, 228, .22) 0 1px, transparent 1px 10%) top / 100% 7px no-repeat,
    repeating-linear-gradient(90deg, rgba(239, 237, 228, .12) 0 1px, transparent 1px 1%) top / 100% 4px no-repeat;
}
.seg {
  position: absolute; bottom: 3px; height: 13px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--c) 30%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  transition: background .25s, opacity .25s;
}
.seg span {
  position: absolute; left: 5px; bottom: 15px; white-space: nowrap;
  font: 500 9px var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: rgba(239, 237, 228, .5);
  transition: color .25s;
}
.seg.quiet { opacity: .45; }
.scrub:hover .seg { background: color-mix(in srgb, var(--c) 42%, transparent); }
.seg.on { background: color-mix(in srgb, var(--c) 60%, transparent); opacity: 1; }
.seg.on span, .seg:hover span { color: var(--text); }
.playhead {
  position: absolute; top: -4px; bottom: 0; left: 0; width: 1px;
  background: var(--accent); pointer-events: none;
  box-shadow: 0 0 10px var(--accent);
}
.playhead::before {
  content: ""; position: absolute; left: -5px; top: 0;
  border: 5px solid transparent; border-top: 7px solid var(--accent);
}
.playhead span {
  position: absolute; left: 8px; top: -6px;
  font: 500 9px var(--mono); color: var(--accent); letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}

.hint {
  position: absolute; left: 0; right: 0; bottom: 88px; margin: 0;   /* clear of the playhead's timecode */
  text-align: center; pointer-events: none;
  font: 11px var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: rgba(239, 237, 228, .45);
  transition: opacity .8s;
}
.hint.gone { opacity: 0; }

/* ── dirt: grain, vignette, light leaks, scratches ── */
.grain {
  position: fixed; inset: -50%; z-index: 35; pointer-events: none;
  opacity: .16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .7s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 17% { transform: translate(-4%, 3%); } 33% { transform: translate(3%, -5%); }
  50% { transform: translate(-6%, -2%); } 67% { transform: translate(5%, 4%); } 83% { transform: translate(-2%, 6%); }
  100% { transform: translate(0, 0); }
}
.vignette {
  position: fixed; inset: 0; z-index: 34; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, rgba(0, 0, 0, .7));
}
.leak {
  position: fixed; z-index: 33; pointer-events: none;
  width: 70vmax; height: 50vmax; border-radius: 50%;
  background: radial-gradient(closest-side, var(--c), transparent);
  mix-blend-mode: screen; filter: blur(50px);
  opacity: 0;
  animation: leak var(--t, 3.6s) ease-in-out forwards;
}
@keyframes leak {
  0% { opacity: 0; transform: translate(0, 0) scale(.8); }
  35% { opacity: var(--o, .3); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.15); }
}
.scratch {
  position: fixed; top: 0; bottom: 0; z-index: 36; width: 1px; pointer-events: none;
  background: linear-gradient(transparent, rgba(255, 255, 255, .35) 20%, rgba(255, 255, 255, .15) 70%, transparent);
  animation: scratch .32s steps(3) forwards;
}
@keyframes scratch { 0% { opacity: .9; } 50% { opacity: .2; translate: 3px 0; } 100% { opacity: 0; translate: -2px 0; } }

/* ── contact ───────────────────────────── */
.contact {
  position: relative; z-index: 1;
  min-height: 70vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 80px 24px 120px; text-align: center;
}
.contact .kicker { color: var(--muted); text-transform: uppercase; letter-spacing: .2em; margin: 0; }
.email {
  /* sized to sit on one line, even on a phone */
  /* in Anton the address is ~12.5× its font size wide, so this keeps it on one line at any width */
  font: 400 clamp(22px, calc((100vw - 80px) / 12.6), 96px)/1.05 var(--display);
  letter-spacing: .01em;
  overflow-wrap: anywhere;
  text-shadow: -2px 0 rgba(255, 40, 90, .55), 2px 0 rgba(0, 210, 255, .5);
  transition: text-shadow .3s, color .3s;
}
.email:hover { color: #fff; text-shadow: -4px 0 rgba(255, 40, 90, .7), 4px 0 rgba(0, 210, 255, .65); }
.copy {
  font-size: 12px; color: var(--muted);
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  transition: color .2s, border-color .2s;
}
.copy:hover { color: var(--text); border-color: rgba(255, 255, 255, .3); }

/* ── viewer ────────────────────────────── */
.viewer {
  position: fixed; inset: 0; z-index: 40;
  display: grid; grid-template-columns: 1fr 400px;
  background:
    radial-gradient(ellipse 60% 60% at 35% 50%, color-mix(in srgb, var(--glow) 22%, transparent), transparent 70%),
    rgba(7, 8, 6, .97);
  opacity: 0; transition: opacity .3s;
}
.viewer[hidden] { display: none; }
.viewer.open { opacity: 1; }
.viewer-stage { display: grid; place-items: center; padding: 40px; min-width: 0; min-height: 0; }
.player {
  position: relative; background: #000; border-radius: 8px; overflow: hidden;
  aspect-ratio: 16 / 9;
  width: min(100%, calc((100vh - 80px) * 16 / 9));
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .9);
}
.player.square { aspect-ratio: 1; width: min(100%, calc(100vh - 80px)); }
.player.standard { aspect-ratio: 4 / 3; width: min(100%, calc((100vh - 80px) * 4 / 3)); }
.player.tall { aspect-ratio: 9 / 16; width: min(100%, calc((100vh - 80px) * 9 / 16)); }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.player video:not(.ready) { opacity: 0; }

.notes {
  border-left: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; min-height: 0;
  transform: translateX(24px); transition: transform .45s var(--ease);
}
.viewer.open .notes { transform: none; }
.notes-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; border-bottom: 1px solid var(--line); color: var(--muted);
}
.close { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.close kbd { font: 10px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; }
.close:hover { color: var(--accent); }
.notes-body { padding: 28px 24px; overflow-y: auto; flex: 1; }
.notes-body > * { animation: rise .5s var(--ease) both; }
.notes-body > :nth-child(2) { animation-delay: .04s; }
.notes-body > :nth-child(3) { animation-delay: .08s; }
.notes-body > :nth-child(n+4) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.notes .kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }
.notes h2 { font-size: 28px; line-height: 1.12; letter-spacing: -.02em; font-weight: 600; margin: 0 0 6px; text-wrap: balance; }
.client { color: var(--muted); margin: 0 0 22px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; margin: 0 0 26px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts dt { font: 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.facts dd { margin: 0; font-size: 14px; }
.notes h3 { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 6px; }
.notes p { margin: 0 0 20px; }
.tags { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font: 11px var(--mono); padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.notes-nav { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.notes-nav button { text-align: left; padding: 16px 24px; display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: background .2s; }
.notes-nav button + button { border-left: 1px solid var(--line); text-align: right; }
.notes-nav button:hover { background: rgba(255, 255, 255, .04); }
.notes-nav .mono { color: var(--muted); font-size: 11px; }
/* when a video ends, Next counts down and rolls on */
.notes-nav button { position: relative; overflow: hidden; }
.notes-nav button.counting .mono { color: var(--accent); }
.notes-nav button.counting::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--accent); transform-origin: left;
  animation: countdown 4s linear forwards;
}
@keyframes countdown { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.nav-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── the slate: a one-second roll-in, once per visit ── */
.slate {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: #070806;
  cursor: pointer;
}
.slate[hidden] { display: none; }
.slate.out { animation: slate-out .55s var(--ease) forwards; }
@keyframes slate-out {
  0% { background: #f4f2ea; }
  12% { background: #070806; }
  100% { opacity: 0; visibility: hidden; }
}
.slate-inner { text-align: center; display: grid; gap: 18px; padding: 24px; }
.slate-name {
  margin: 0;
  /* the name is ~8× its font size wide in Anton: sized to stay on one line, phone to desktop */
  font: 400 clamp(28px, calc((100vw - 72px) / 8), 150px)/.92 var(--display);
  letter-spacing: .01em;
  white-space: nowrap;
  text-shadow: -3px 0 rgba(255, 40, 90, .5), 3px 0 rgba(0, 210, 255, .45);
  animation: slate-in .7s var(--ease) both;
}
@keyframes slate-in { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
.slate-meta {
  margin: 0; display: flex; gap: 22px; justify-content: center;
  color: var(--muted); text-transform: uppercase; letter-spacing: .18em; font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.slate-meta b { color: var(--accent); font-weight: 500; }
/* the wall waits behind the slate, then assembles */
.ring.hold .tile, .ring.hold .glabel { animation-play-state: paused; }
.glabel { animation: fade-in 1.2s ease .5s backwards; }
@keyframes fade-in { from { opacity: 0; } }

/* the poster that flies from the tile into the player */
.fly { position: fixed; z-index: 50; object-fit: cover; border-radius: 14px; pointer-events: none; will-change: left, top, width, height; }

/* ── small screens ─────────────────────── */
@media (max-width: 900px) {
  :root { --bar: 104px; }
  .bar { grid-template-columns: 1fr auto; height: var(--bar); padding: 12px 16px 10px; gap: 8px; align-content: center; }
  .name span { display: none; }
  .filters { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .filters button { flex: none; }
  .glabel { font-size: 10px; letter-spacing: .16em; }
  .viewer { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow: hidden; }
  .viewer-stage { padding: 0; background: #000; }
  .player, .player.square, .player.standard { width: 100%; max-height: 56vh; border-radius: 0; }
  .player.square, .player.standard, .player.tall { width: auto; height: 56vh; max-width: 100%; }
  .scrub { bottom: 14px; }
  .seg span { font-size: 8px; letter-spacing: .08em; }
  .hint { bottom: 80px; }
  .notes { border-left: 0; transform: translateY(24px); }
  .notes h2 { font-size: 24px; }
  .notes-body { padding: 22px 16px; }
  .notes-top { padding: 14px 16px; }
  .notes-nav button { padding: 14px 16px; }
}

/* touch screens: no hover, so labels are always on */
@media (hover: none) {
  .ring:has(.tile:hover) .tile:not(:hover) { opacity: 1; filter: none; }
  .tile:hover { --z: 0px; --s: 1; }
  .tile .label, .tile::after { opacity: 1; transform: none; }
  .tile .label span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .grain { animation: none; }
}
