

:root {
  --rail-width: clamp(52px, 10.42vw, 200px);
  --page-background: #e0c8bb;
  --page-accent: #e9ff54;
  --ink: #090909;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  overflow-x: hidden;
  background: var(--page-background);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}
button { color: inherit; font: inherit; }

.site-shell {
  min-height: 100vh;
  min-height: 100svh;
  padding-inline: var(--rail-width);
  background: var(--page-background);
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 4px;
  background: var(--page-background);
}

.media-row {
  display: flex;
  gap: 4px;
  width: 100%;
  height: clamp(190px, 24vw, 340px);
  overflow: hidden;
}

.media-tile {
  position: relative;
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #080808;
  transition: flex-grow 520ms cubic-bezier(.22,.72,.13,1), filter 240ms ease, opacity 240ms ease;
}

.media-tile img,
.media-tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-tile .crop-contain { object-fit: contain; }
.media-tile .crop-tight { object-fit: cover; transform: scale(1.08); }

.film-tile { cursor: none; }
.film-tile:hover,
.film-tile:focus-visible { flex-grow: 2.35; }
.film-tile:focus-visible { outline: 3px solid var(--page-accent); outline-offset: -3px; }
.media-row:has(.film-tile:hover) .media-tile:not(:hover),
.media-row:has(.film-tile:focus-visible) .media-tile:not(:focus-visible) {
  filter: brightness(.68) saturate(.7);
}

.film-tile.is-active {
  flex-grow: 3;
  background: #000;
}
.media-row.has-active-film .media-tile:not(.is-active) {
  filter: brightness(.62) saturate(.72);
}
.film-player { object-fit: contain !important; background: #000; }

.play-symbol {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: clamp(36px, 4.4vw, 62px);
  height: clamp(36px, 4.4vw, 62px);
  place-items: center;
  border-radius: 50%;
  background: var(--page-background);
  transform: translate(-50%, -50%);
  transition: transform 220ms ease;
}
.play-symbol span {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid var(--ink);
}
.film-tile:hover .play-symbol { transform: translate(-50%, -50%) scale(1.08); }

.close-film {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: 10px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--page-background);
  color: var(--ink);
  cursor: pointer;
}
.close-film span { font-size: 28px; font-weight: 400; line-height: 1; transform: translateY(-1px); }
.close-film:focus-visible { outline: 3px solid var(--page-accent); outline-offset: 2px; }

.left-rail,
.right-rail {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  width: var(--rail-width);
  overflow: hidden;
  background: var(--page-background);
  pointer-events: none;
}
.left-rail { left: 0; }
.right-rail { right: 0; }

.ticker-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: max-content;
  flex: none;
  gap: 0;
  will-change: transform;
}
.ticker-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: none;
}
.ticker-group span {
  display: block;
  flex: none;
  margin-block: 0;
  margin-inline: .45em;
  color: var(--page-accent);
  font-family: 'Andale Mono', AndaleMono, 'Lucida Console', Monaco, monospace;
  font-size: clamp(15px, 1.32vw, 25px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: .03em;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}


.rail-logo-anchor {
  position: absolute;
  right: 0;
  bottom: clamp(18px, 2vw, 38px);
  left: 0;
  height: clamp(190px, 17vw, 326px);
}
.rail-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: clamp(190px, 17vw, 326px);
  height: auto;
  max-width: none;
  object-fit: initial;
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center;
}

.custom-cursor {
  position: fixed;
  z-index: 100;
  width: 42px;
  height: auto;
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px, -4px);
  transform-origin: 20% 20%;
  user-select: none;
  will-change: transform;
}
.custom-cursor.is-visible { opacity: 1; }
.custom-cursor.is-wobbling { animation: cursor-wobble 480ms steps(6, end) both; }
@keyframes cursor-wobble {
  0%, 100% { transform: translate(-4px, -4px) rotate(0deg); }
  17% { transform: translate(-4px, -4px) rotate(-12deg); }
  34% { transform: translate(-4px, -4px) rotate(10.8deg); }
  51% { transform: translate(-4px, -4px) rotate(-8.4deg); }
  68% { transform: translate(-4px, -4px) rotate(6deg); }
  85% { transform: translate(-4px, -4px) rotate(-2.4deg); }
}

@media (hover: hover) and (pointer: fine) {
  html, body, button, a, video { cursor: none !important; }
}

@media (max-width: 720px), (hover: none), (pointer: coarse) {

  .gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .media-row { display: contents; }
  .media-tile {
    width: 100%;
    aspect-ratio: 4 / 5;
    height: auto;
    flex: none;
    transition: none;
  }
  .film-tile:hover, .film-tile:focus-visible { flex-basis: auto; }
  .media-row:has(.film-tile:hover) .media-tile:not(:hover),
  .media-row:has(.film-tile:focus-visible) .media-tile:not(:focus-visible),
  .media-row.has-active-film .media-tile:not(.is-active) { filter: none; }
  .film-tile.is-active {
    grid-column: 1 / -1;
    width: 100%;
    aspect-ratio: 16 / 9;
  }


  .custom-cursor { display: none; }
  .film-tile { cursor: pointer; }
}

@media (prefers-reduced-motion: reduce) {
  .media-tile { transition-duration: 1ms; }
  .ticker-track { transform: none !important; }
  .custom-cursor.is-wobbling { animation: none; }
}

.media-row:last-child:not(:has(> :nth-child(4)))::after { content: ''; flex: 1 1 0; }
.close-film { width: 44px; height: 44px; z-index: 10; touch-action: manipulation; pointer-events: auto; }
.film-tile.is-active { filter: none !important; }
@media (max-width:720px), (hover:none), (pointer:coarse) { .media-row::after { display:none; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important; transition:none !important; } }
.film-tile:has(.tile-trigger:focus-visible) { flex-grow:2.35; outline:3px solid var(--page-accent);outline-offset:-3px; }
.tile-trigger:focus-visible {outline:3px solid var(--page-accent);outline-offset:-3px;}
.media-row:has(.tile-trigger:focus-visible) .media-tile:not(:has(.tile-trigger:focus-visible)) {filter:brightness(.68) saturate(.7);}
@media (max-width:720px), (hover:none), (pointer:coarse) { .media-row:has(.tile-trigger:focus-visible) .media-tile {filter:none;} }

@media (max-width:720px), (pointer:coarse) { html,body,button,a,video {cursor:auto !important;} button {cursor:pointer !important;} }

.media-row:last-child:not(:has(> :nth-child(3)))::after {flex-grow:2;}
.media-row:last-child:not(:has(> :nth-child(2)))::after {flex-grow:3;}

/* Decorative, single-cell car animations. */
.animation-tile {background:#7F8773;isolation:isolate;contain:layout paint;}
.animation-tile .animation-backdrop {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none;}
.animation-tile .ambient-car {position:absolute;top:0;left:0;object-fit:contain;pointer-events:none;user-select:none;will-change:transform;}
