/* Tomato Bird locked player v20 */
:root {
  --paper: #f7f1e3;
  --ink: #1a1a1a;
  --accent: #d4513d;
  --accent-bright: #e8644f;
  --screen: #171411;
  --screen-soft: #211d19;
  --cream: #fff8e9;
  --muted: #9d9282;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Space Mono', monospace;
  min-height: 100%;
  scroll-behavior: auto;
  scroll-snap-type: none;
}

body {
  margin: 0;
  min-height: 100vh;
}

html.is-watching,
html.is-watching body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html.is-watching .watcher {
  height: 100dvh;
  inset: 0;
  min-height: 0;
  overflow: hidden;
  position: fixed;
  z-index: 4;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.site-nav {
  align-items: center;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  display: flex;
  gap: 18px;
  height: 56px;
  justify-content: center;
  padding: 0 clamp(18px, 4vw, 58px);
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  transition: transform .28s ease;
  z-index: 50;
}

body.intro-active .site-nav {
  transform: translateY(-100%);
}

body.library-active .site-nav {
  transform: none;
}

.site-nav a,
.prototype-label {
  color: var(--ink);
  font-family: 'Bungee', cursive;
  font-size: 10px;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}

.intro-hero {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100dvh;
  overflow: hidden;
  padding: 32px 24px;
  position: relative;
  scroll-snap-align: none;
  text-align: center;
}

.intro-glow {
  background: radial-gradient(ellipse at center, #faf5ea 0%, var(--paper) 70%);
  inset: 0;
  position: absolute;
}

.intro-content {
  position: relative;
  z-index: 1;
}

.intro-image {
  display: block;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .12));
  height: auto;
  margin: 0 auto 22px;
  width: clamp(230px, 48vh, 380px);
}

.intro-title {
  font-family: 'Bungee', cursive;
  font-size: clamp(2.5rem, 7vw, 4.8rem);
  letter-spacing: 2px;
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
}

.intro-title span {
  color: var(--accent);
}

.intro-line {
  color: #8a7e6b;
  font-family: 'Special Elite', cursive;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  line-height: 1.45;
  margin: 17px auto 0;
  max-width: 520px;
}

.intro-next {
  animation: intro-bob 2s ease-in-out infinite;
  background: transparent;
  border: 0;
  bottom: max(24px, env(safe-area-inset-bottom));
  color: #8a7e6b;
  cursor: pointer;
  font-size: 28px;
  left: 50%;
  opacity: .62;
  padding: 12px 24px;
  position: absolute;
  transform: translateX(-50%);
  z-index: 2;
}

@keyframes intro-bob {
  0%, 100% { margin-bottom: 0; }
  50% { margin-bottom: -8px; }
}

.site-nav .site-mark {
  color: var(--accent);
  font-size: 16px;
}

.site-links {
  align-items: center;
  display: flex;
  gap: 6px;
}

.site-links a {
  border: 2px solid transparent;
  border-radius: 4px 4px 0 0;
  padding: 8px 9px 7px;
}

.site-links a:hover {
  background: rgba(212, 81, 61, .1);
  border-color: rgba(26, 26, 26, .3);
}

.site-links a.active {
  background: #fff;
  border-color: var(--ink);
  color: var(--accent);
}

.prototype-label {
  border: 1px solid rgba(26, 26, 26, .3);
  border-radius: 99px;
  color: #746a5a;
  padding: 5px 9px 4px;
}

.catalog {
  margin: 0 auto;
  max-width: 1440px;
  padding: calc(56px + clamp(20px, 3vw, 44px)) clamp(18px, 4vw, 58px) 100px;
  scroll-snap-align: none;
}

.eyebrow,
.watch-kicker {
  color: var(--accent);
  font-family: 'Bungee', cursive;
  font-size: 11px;
  letter-spacing: .13em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.section-heading h1 {
  font-family: 'Bungee', cursive;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: .02em;
  line-height: 1;
  margin: 0;
}

.section-heading {
  align-items: baseline;
  border-bottom: 2px solid var(--ink);
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 10px;
}

.section-heading span {
  color: #655d51;
  font-size: 11px;
  text-transform: uppercase;
}

.video-grid {
  display: grid;
  gap: clamp(12px, 1.8vw, 24px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  position: static;
  z-index: auto;
}

.video-card {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.card-image {
  aspect-ratio: auto;
  background: #cfc7b7;
  border: 2px solid var(--ink);
  border-radius: 7px;
  box-shadow: 0 3px 0 var(--ink);
  display: block;
  overflow: hidden;
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease;
  width: 100%;
}

.video-card:hover .card-image,
.video-card:focus-visible .card-image {
  box-shadow: 0 7px 0 var(--ink);
  transform: translateY(-4px);
}

.video-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}

.card-image img {
  aspect-ratio: 16 / 9;
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.card-title {
  display: block;
  font-family: 'Bungee', cursive;
  font-size: clamp(10px, 1vw, 13px);
  line-height: 1.2;
  margin-top: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.load-error {
  border: 2px solid var(--ink);
  padding: 20px;
}

body.is-watching {
  overflow-x: hidden;
}

.watcher {
  background: var(--paper);
  color: var(--ink);
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) 92px;
  min-height: 100dvh;
  padding-top: 56px;
  position: relative;
  scroll-snap-align: none;
  width: 100%;
}

.watcher[hidden] {
  display: none;
}

.watch-topbar {
  align-items: center;
  border-bottom: 2px solid rgba(26, 26, 26, .16);
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0 clamp(14px, 2vw, 30px);
}

.watch-button,
.footer-control,
.side-control,
.up-next {
  color: inherit;
  cursor: pointer;
}

.watch-button {
  background: transparent;
  border: 0;
  font-family: 'Bungee', cursive;
  font-size: 10px;
  letter-spacing: .07em;
  padding: 12px 0;
  text-transform: uppercase;
}

.close-button {
  background: var(--accent);
  border: 2px solid var(--ink);
  border-radius: 5px;
  box-shadow: 0 2px 0 var(--ink);
  color: var(--cream);
  justify-self: start;
  padding: 9px 12px 8px;
  transition: box-shadow .18s ease, transform .18s ease;
}

.close-button:hover,
.close-button:focus-visible {
  box-shadow: 0 4px 0 var(--ink);
  transform: translateY(-2px);
}

.fullscreen-button {
  justify-self: end;
}

.watch-main {
  align-items: center;
  display: grid;
  gap: clamp(12px, 2vw, 34px);
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  min-height: 0;
  overflow: hidden;
  padding: 12px clamp(18px, 3vw, 50px);
}

.player-column {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  min-height: 0;
  min-width: 0;
}

.player-frame {
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--ink);
  border-radius: 7px;
  box-shadow: none;
  max-height: calc(100dvh - 290px);
  max-width: 1200px;
  overflow: hidden;
  width: min(100%, calc((100dvh - 290px) * 16 / 9));
}

.player-frame video {
  aspect-ratio: 16 / 9;
  background: #000;
  display: block;
  height: 100%;
  max-height: calc(100dvh - 290px);
  object-fit: contain;
  width: 100%;
}

.player-frame:fullscreen,
.player-frame:-webkit-full-screen {
  border: 0;
  border-radius: 0;
  height: 100%;
  max-height: none;
  max-width: none;
  width: 100%;
}

.player-frame:fullscreen video,
.player-frame:-webkit-full-screen video {
  height: 100%;
  max-height: none;
  width: 100%;
}

.player-details {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-top: 12px;
  max-width: 1200px;
  width: min(100%, calc((100dvh - 290px) * 16 / 9));
}

.watch-title-block {
  min-width: 0;
}

.player-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
}

.restart-icon {
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 25px;
  line-height: 1;
  opacity: .7;
  padding: 8px;
  transition: opacity .18s ease, transform .18s ease;
}

.restart-icon:hover,
.restart-icon:focus-visible {
  opacity: 1;
  transform: scale(1.14);
}

.restart-icon:active {
  transform: scale(.92);
}

.sound-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  height: 40px;
  justify-content: center;
  line-height: 1;
  opacity: .7;
  padding: 8px;
  transition: opacity .18s ease, transform .18s ease;
  width: 40px;
}

.sound-icon {
  display: block;
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 22px;
}

.sound-waves {
  display: none;
}

.sound-toggle.is-sounding .sound-waves {
  display: block;
}

.sound-toggle.is-sounding .sound-muted {
  display: none;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
  opacity: 1;
  transform: scale(1.06);
}

.side-control {
  align-items: center;
  align-self: stretch;
  background: transparent;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  opacity: .72;
  transition: opacity .18s ease, transform .18s ease;
}

.side-control:hover,
.side-control:focus-visible {
  opacity: 1;
  transform: scale(1.06);
}

.side-control:disabled,
.footer-control:disabled {
  cursor: default;
  opacity: .22;
  transform: none;
}

.side-control span {
  font-size: 38px;
  line-height: 1;
}

.side-control small {
  color: var(--muted);
  font-family: 'Bungee', cursive;
  font-size: 8px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.mobile-controls {
  display: none;
}

.watch-footer {
  align-items: center;
  border-top: 2px solid rgba(26, 26, 26, .16);
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr 1fr;
  height: 92px;
  min-height: 0;
  padding: 10px clamp(18px, 3vw, 50px) calc(10px + env(safe-area-inset-bottom));
}

.watch-kicker {
  color: var(--accent-bright);
  font-size: 8px;
  margin-bottom: 6px;
}

.watch-title-block h2 {
  font-family: 'Bungee', cursive;
  font-size: clamp(18px, 2.2vw, 32px);
  line-height: 1;
  margin: 0;
}

.watch-counter {
  color: var(--muted);
  font-family: 'Bungee', cursive;
  font-size: 9px;
  letter-spacing: .1em;
  justify-self: start;
  text-align: center;
  text-transform: uppercase;
}

.up-next {
  align-items: center;
  background: transparent;
  border: 0;
  display: flex;
  gap: 12px;
  justify-self: end;
  max-width: 330px;
  padding: 0;
  text-align: left;
}

.up-next img {
  aspect-ratio: 16 / 9;
  border: 2px solid var(--ink);
  display: block;
  object-fit: cover;
  width: 112px;
}

.up-next span {
  min-width: 0;
}

.up-next small {
  color: var(--accent-bright);
  display: block;
  font-family: 'Bungee', cursive;
  font-size: 8px;
  letter-spacing: .08em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.up-next strong {
  display: block;
  font-family: 'Bungee', cursive;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-note {
  background: var(--ink);
  bottom: 126px;
  color: var(--cream);
  font-size: 11px;
  left: 50%;
  margin: 0;
  opacity: 0;
  padding: 8px 11px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 8px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 2;
}

.share-note.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1040px) {
  .video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .watch-main {
    grid-template-columns: 54px minmax(0, 1fr) 54px;
  }

  .up-next img {
    width: 92px;
  }
}

@media (max-width: 700px) {
  .site-nav {
    gap: 5px;
    justify-content: flex-start;
    overflow: hidden;
    padding: 0 8px;
  }

  .prototype-label {
    display: none;
  }

  .site-mark {
    display: none;
  }

  .site-links {
    gap: 3px;
    overflow-x: auto;
    scrollbar-width: none;
    width: 100%;
  }

  .site-links::-webkit-scrollbar {
    display: none;
  }

  .site-links a {
    flex: 0 0 auto;
    font-size: 9px;
    letter-spacing: .04em;
    padding: 8px 7px 7px;
  }

  .intro-hero {
    padding: 24px 18px;
  }

  .intro-image {
    margin-bottom: 18px;
    width: clamp(220px, 46vh, 330px);
  }

  .intro-title {
    font-size: clamp(2.2rem, 13vw, 3.4rem);
  }

  .catalog {
    padding: 72px 16px 72px;
  }

  .video-grid {
    gap: 18px 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-image {
    border-radius: 5px;
    box-shadow: 0 2px 0 var(--ink);
  }

  .watcher {
    grid-template-rows: 48px minmax(0, 1fr) auto;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .watch-topbar {
    grid-template-columns: 1fr 1fr;
  }

  .watch-main {
    align-items: center;
    display: flex;
    min-height: 0;
    overflow: hidden;
    padding: 8px 0;
  }

  .player-column {
    justify-content: center;
    min-height: 0;
    width: 100%;
  }

  .player-frame,
  .player-frame video {
    max-height: none;
    width: 100%;
  }

  .player-frame {
    aspect-ratio: 16 / 9;
    height: auto;
  }

  .player-frame video {
    height: 100%;
    object-fit: contain;
  }

  .side-control {
    display: none;
  }

  .watch-footer {
    align-items: center;
    gap: 0;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    padding: 4px 16px calc(4px + env(safe-area-inset-bottom));
  }

  .watch-title-block {
    text-align: left;
  }

  .player-details {
    margin-top: 10px;
    padding: 0 16px;
    width: 100%;
  }

  .watch-title-block h2 {
    font-size: clamp(18px, 7vw, 28px);
  }

  .watch-counter {
    display: none;
  }

  .mobile-controls {
    align-items: center;
    display: flex;
    gap: 42px;
    justify-content: center;
  }

  .footer-control {
    background: transparent;
    border: 0;
    font-size: 25px;
    line-height: 1;
    padding: 8px 13px;
    transition: opacity .18s ease, transform .18s ease;
  }

  .footer-control:hover,
  .footer-control:focus-visible {
    transform: scale(1.18);
  }

  .footer-control:active {
    transform: scale(.92);
  }

  .up-next {
    display: none;
  }

  .share-note {
    bottom: 178px;
  }
}

@media (max-height: 680px) and (min-width: 701px) {
  .watcher {
    grid-template-rows: 48px minmax(0, 1fr) 80px;
  }

  .watch-main {
    padding-bottom: 8px;
    padding-top: 8px;
  }

  .player-frame,
  .player-frame video {
    max-height: calc(100dvh - 258px);
  }

  .player-frame,
  .player-details {
    width: min(100%, calc((100dvh - 258px) * 16 / 9));
  }

  .player-details {
    margin-top: 8px;
  }

  .watch-footer {
    height: 80px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    padding-top: 8px;
  }

  .up-next img {
    width: 88px;
  }
}

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