/* A dark screening room: the work is the page.
   Opening section: copy and a grid of reel thumbnails beside one player.
   Then the carousels in a row, and email. Nothing scrolls sideways.
   One accent: the warm off-white of the email button. */

:root {
  --bg: #11110f;
  --raised: #1b1b18;
  --text: #f1ede4;
  --muted: #a29d91;
  --faint: #6f6b62;
  --line: #2b2a26;
  --accent: #f1ede4;
  --accent-text: #11110f;
  --focus: #f1ede4;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --display: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-color: var(--faint); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 0.3rem; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

.wrap { width: min(100% - 2.5rem, 66rem); margin-inline: auto; }

h1, h2 { font-family: var(--display); font-weight: 400; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.6rem, 1.6rem + 4vw, 4.75rem); line-height: 1; letter-spacing: -0.02em; }
h2 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.01em; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}
.site-header .logo img { width: 5.25rem; filter: invert(1); }
.top-link { color: var(--muted); font-size: 0.95rem; text-decoration: none; transition: color 80ms var(--ease); }
.top-link:hover { color: var(--text); }

/* Opening section: copy and the reel picker on the left, one player on the
   right that stays in view. A tile puts its reel in the player. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21rem;
  grid-template-areas: "copy player" "picker player";
  grid-template-rows: auto 1fr;
  column-gap: 4.5rem;
  padding-block: 2.5rem 5.5rem;
}
.hero-copy { grid-area: copy; padding-top: 1.5rem; }
.hero-copy h1 { max-width: 11ch; }
.hero-copy p { color: var(--muted); font-size: 1.2rem; max-width: 30rem; margin-top: 1.5rem; }

.player { grid-area: player; align-self: start; position: sticky; top: 1.5rem; }
.player .frame { transition: opacity 140ms var(--ease); }
.player .frame.swapping { opacity: 0; transition-timing-function: cubic-bezier(0.4, 0, 1, 1); }

.picker { grid-area: picker; margin-top: 3.5rem; }
.picker h2 { margin-bottom: 0.35rem; }
.hint { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.1rem; }
/* "Click" with a mouse, "Tap" on touch screens. */
.hint .touch { display: none; }
@media (hover: none) {
  .hint .pointer { display: none; }
  .hint .touch { display: inline; }
}
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.tile {
  display: block;
  position: relative;
  border-radius: 0.6rem;
  overflow: hidden;
  background: var(--raised);
  transition: transform 80ms var(--ease);
}
.tile img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; opacity: 0.62; transition: opacity 200ms var(--ease); }
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  transition: box-shadow 200ms var(--ease);
}
.tile:hover img { opacity: 0.9; }
.tile:active { transform: scale(0.97); }
.tile[aria-current] img { opacity: 1; }
.tile[aria-current]::after { box-shadow: inset 0 0 0 2px var(--accent); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }
.button {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 80ms var(--ease), border-color 80ms var(--ease), transform 80ms var(--ease);
}
.button:hover { border-color: var(--muted); }
.button:active { transform: scale(0.98); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button.primary:hover { background: #ffffff; border-color: #ffffff; }

/* Cards: one frame, one caption */
.frame {
  position: relative;
  border-radius: 0.9rem;
  overflow: hidden;
  background: var(--raised);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 18px 40px rgba(0, 0, 0, 0.45);
}
.frame video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; }
.carousel .frame video { aspect-ratio: 4 / 5; }
.js .reel:not(.carousel) video { cursor: pointer; }
.cap { margin-top: 0.75rem; font-size: 0.875rem; line-height: 1.4; font-weight: 600; color: var(--text); }

/* Sound button: shown once the script is running */
.sound {
  display: none;
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 10, 9, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 80ms var(--ease), transform 80ms var(--ease);
}
.js .sound { display: grid; }
.sound:hover { background: rgba(10, 10, 9, 0.8); }
.sound:active { transform: scale(0.94); }
.sound svg { width: 1.1rem; height: 1.1rem; fill: currentColor; grid-area: 1 / 1; }
.sound .on, .sound[aria-pressed="true"] .off { visibility: hidden; }
.sound[aria-pressed="true"] .on { visibility: visible; }
.sound[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }

/* Carousels: one row, same columns as before. */
.work { padding-bottom: 4.5rem; }
.work-head { margin-bottom: 1.25rem; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 1.5rem; }

/* Contact */
.contact { padding-block: 3.5rem 2rem; border-top: 1px solid var(--line); }
.contact h2 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.75rem); margin-bottom: 0.75rem; }
.contact p { font-size: 1.15rem; }

.site-footer { padding-block: 2rem 3rem; color: var(--faint); font-size: 0.875rem; }

/* Simple pages (404) */
.intro { padding-block: 3rem 5rem; max-width: 34rem; }
.intro h1 { font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem); margin-bottom: 1rem; }
.intro p { color: var(--muted); }

@media (max-width: 52rem) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "player" "picker"; padding-block: 1rem 4rem; }
  .hero-copy { padding-top: 0; }
  .player { position: static; width: min(18rem, 76vw); margin-top: 2.5rem; }
  .picker { margin-top: 2.5rem; }
}

@media (max-width: 40rem) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
  .grid .cap { font-size: 0.8rem; }
}

@media (max-width: 34rem) {
  .top-link { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .button:active, .sound:active, .tile:active { transform: none; }
}
