@font-face {
  font-family: "STF Eggleston Mono";
  src: url("../assets/fonts/STFEgglestonMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --pad: 32px;
  --padTop: 36px;

  /* video layout knobs */
  --video-gap: 18px;
  --video-min: 360px;
  --video-max: 520px;

  /* site tint (RGB only, JS swaps this) */
  --tint-rgb: 0, 255, 0;

  /* clearance so fixed dock never blocks footer/content */
  --dock-safe: 96px; /* desktop default; overridden on mobile below */
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  min-height: 100vh;
  font-family: "STF Eggleston Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Base page: keep TOP white (prevents black band above content) */
body {
  position: relative;
  z-index: 1;

  padding: var(--padTop) var(--pad);
  padding-bottom: calc(var(--padTop) + var(--dock-safe)); /* scroll room above dock */
  background: #fff;
  color: #000;
}

/* Always-black “floor” behind the fixed player + end-of-page area
   (kills the bottom white chasm on desktop + mobile) */
html::before{
  content:"";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 260px; /* enough to cover dock + breathing room */
  background: #000;
  z-index: 0;
  pointer-events: none;
}

/* IMPORTANT: keep main above grain layer */
main {
  position: relative;
  z-index: 70; /* above vignette (50) + grain (60) */
}

h1 {
  margin: 0 0 14px 0;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.92;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  opacity: 0.9;
}

/* --------------------------
   Origin badge (top-right)
-------------------------- */
.origin {
  position: absolute;
  top: var(--padTop);
  right: var(--pad);
  text-align: right;
  z-index: 90; /* above everything in main */
  display: grid;
  justify-items: end;
  gap: 6px;
  pointer-events: none; /* purely informational */
}

.origin-texas {
  width: 24px;
  height: auto;
  display: block;
  opacity: 0.9;
}

.origin-text {
  font-size: 12px;
  line-height: 1.1;
  letter-spacing: 0.01em;
  opacity: 0.85;
}

/* mobile inline origin line (hidden on desktop by default) */
.origin-inline {
  display: none;
  margin: 8px 0 14px 0;
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.85;
  letter-spacing: 0.01em;
  gap: 8px;
  align-items: center;
}

.origin-inline img {
  width: 16px;
  height: auto;
  display: block;
  opacity: 0.9;
}

/* --------------------------
   Videos (nestled + wrapping)
-------------------------- */
.video-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--video-gap);
  align-items: flex-start;
  justify-content: flex-start;
  margin-top: 22px;
}

/* old-school browser frame around each video */
.video-frame {
  flex: 1 1 var(--video-min);
  max-width: var(--video-max);
  margin: 0;

  padding: 8px;
  background: #ddd;
  border: 2px solid #888;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* title bar */
.video-title {
  display: block;
  background: #eee;
  padding: 8px;
  font-size: 14px;
  font-family: monospace;
  color: #333;
  border-bottom: 2px solid #bbb;
  border-radius: 4px 4px 0 0;
  margin: -8px -8px 8px -8px;
}

/* responsive iframe */
.video-frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: none;
  border-radius: 2px;
}

/* --------------------------
   Invert section (black)
-------------------------- */
.invert {
  margin-top: 42px;
  padding: 44px var(--pad);
  margin-left: calc(var(--pad) * -1);
  margin-right: calc(var(--pad) * -1);

  background: #000;
  color: rgba(0, 255, 0, 0.92);

  position: relative;
  z-index: 80; /* above grain */
}

.invert h2 {
  margin: 0 0 14px 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.invert a {
  color: rgba(0, 255, 0, 0.92);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* layout */
.invert-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 1px minmax(260px, 0.8fr);
  gap: 22px;
  align-items: start;
}

/* thin vertical divider */
.invert-divider {
  width: 1px;
  background: rgba(0, 255, 0, 0.18);
  align-self: stretch;
  opacity: 0.9;
}

/* stack on smaller screens (unified at 768) */
@media (max-width: 768px) {
  .invert-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .invert-divider {
    display: none;
  }
}

/* --------------------------
   Shows list
-------------------------- */
.shows {
  list-style: none;
  padding: 0;
  margin: 0 0 26px 0;
}

.shows li {
  padding: 10px 0;
  border-top: 1px solid rgba(0,255,0,0.18);
}

.show-meta {
  opacity: 0.85;
  font-size: 14px;
}

/* --------------------------
   Availability checker (single source of truth)
-------------------------- */
.availability {
  margin: 10px 0 18px 0;
  max-width: 560px;
  display: grid;
  gap: 10px;
}

.availability-label {
  font-size: 14px;
  opacity: 0.9;
  text-transform: lowercase;
}

.availability-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.availability-row input[type="date"] {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(0, 0, 0, 0.4);
  color: rgba(0, 255, 0, 0.92);
  border: 1px solid rgba(0,255,0,0.25);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
}

.availability-row button {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid rgba(0,255,0,0.35);
  background: rgba(0,255,0,0.10);
  color: rgba(0, 255, 0, 0.92);
  font: inherit;
  text-transform: lowercase;
}

.availability-row button:hover {
  background: rgba(0,255,0,0.16);
}

.availability-result {
  font-size: 14px;
  opacity: 0.9;
  min-height: 1.3em; /* avoids layout jump */
}

.availability-result .ok,
.availability-result .no {
  display: inline-block;
  padding: 8px 10px;
  border: 1px solid rgba(0,255,0,0.30);
  background: rgba(0,255,0,0.06);
}

.availability-result .no {
  border-color: rgba(255,0,0,0.35);
  background: rgba(255,0,0,0.06);
}

/* --------------------------
   Booking form
-------------------------- */
.booking {
  display: grid;
  gap: 12px;
  max-width: 560px;
  margin-top: 10px;
}

.booking label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  opacity: 0.9;
  text-transform: lowercase;
}

.booking input,
.booking textarea {
  background: rgba(0, 0, 0, 0.4);
  color: rgba(0, 255, 0, 0.92);
  border: 1px solid rgba(0,255,0,0.25);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
}

.booking-submit {
  display: flex;
  align-items: center;
  gap: 10px;
}

.booking button {
  justify-self: start;
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid rgba(0,255,0,0.35);
  background: rgba(0,255,0,0.10);
  color: rgba(0, 255, 0, 0.92);
  font: inherit;
  text-transform: lowercase;
}

.booking button:hover {
  background: rgba(0,255,0,0.16);
}

.small {
  margin-top: 16px;
  font-size: 14px;
  opacity: 0.85;
}

/* booking inline status */
.booking-success {
  display: inline-block;
  padding: 10px 12px;
  border: 1px solid rgba(0, 255, 0, 0.45);
  border-radius: 0; /* square corners */
  background: rgba(0, 0, 0, 0.35);
  color: rgba(0, 255, 0, 0.92);
  font-size: 14px;
  letter-spacing: 0.01em;
}

.booking-error {
  display: inline-block;
  padding: 8px 10px;
  border: 1px solid rgba(0, 255, 0, 0.25);
  border-radius: 0;
  opacity: 0.85;
  font-size: 13px;
}

/* --------------------------
   Photo frame (video-like)
-------------------------- */
.photo-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.photo-frame {
  margin: 0;
  padding: 8px;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(0,255,0,0.28);
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}

.photo-title {
  display: block;
  background: rgba(255,255,255,0.10);
  padding: 8px;
  font-size: 14px;
  font-family: monospace;
  color: rgba(0, 255, 0, 0.92);
  border-bottom: 2px solid rgba(0,255,0,0.18);
  border-radius: 4px 4px 0 0;
  margin: -8px -8px 8px -8px;
}

.photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  border: none;
  border-radius: 2px;
}

.photo-link:hover .photo-frame {
  border-color: rgba(0, 255, 0, 0.45);
}
.photo-link:hover .photo-title {
  background: rgba(255,255,255,0.16);
}

/* --------------------------
   Film grain overlay (CSS-only)
-------------------------- */
body::before {
  content: "";
  position: fixed;
  inset: -35%;
  pointer-events: none;
  z-index: 60; /* below main (70), below invert (80) */

  background-image:
    /* tint wash */
    linear-gradient(
      rgba(var(--tint-rgb), 0.11),
      rgba(var(--tint-rgb), 0.11)
    ),

    /* ultra-fine grain layers */
    radial-gradient(circle, rgba(0,0,0,0.18) 0 0.45px, transparent 0.55px),
    radial-gradient(circle, rgba(0,0,0,0.14) 0 0.40px, transparent 0.52px),
    radial-gradient(circle, rgba(0,0,0,0.12) 0 0.38px, transparent 0.50px),
    radial-gradient(circle, rgba(255,255,255,0.10) 0 0.38px, transparent 0.50px),
    radial-gradient(circle, rgba(255,255,255,0.08) 0 0.34px, transparent 0.48px);

  background-size:
    auto,
    12px 11px,
    16px 14px,
    20px 17px,
    26px 22px,
    32px 28px;

  background-position:
    0 0,
    0 0,
    7px 3px,
    13px 9px,
    19px 14px,
    27px 21px;

  filter: contrast(260%) brightness(112%);
  opacity: 0.95;

  animation: grainJitter 0.55s steps(10) infinite;
}

@keyframes grainJitter {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-0.7%, -0.4%); }
  20%  { transform: translate(-1.1%, 0.6%); }
  30%  { transform: translate(0.8%, -0.9%); }
  40%  { transform: translate(-0.5%, 1.1%); }
  50%  { transform: translate(1.0%, -0.4%); }
  60%  { transform: translate(0.2%, 0.9%); }
  70%  { transform: translate(-0.9%, 0.1%); }
  80%  { transform: translate(0.8%, -0.8%); }
  90%  { transform: translate(-0.4%, 0.5%); }
  100% { transform: translate(0, 0); }
}

/* vignette */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50; /* under grain */

  background: radial-gradient(
    circle at 50% 50%,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.09) 100%
  );

  mix-blend-mode: multiply;
  opacity: 0.55;
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

/* --------------------------
   Cursor system (24px)
-------------------------- */
html, body {
  cursor: url("../assets/cursor/cursor-default-24.png") 3 3, auto;
}

a:hover,
button:hover,
.hover-target:hover {
  cursor: url("../assets/cursor/cursor-hover-24.png") 3 3, auto;
}

a:active,
button:active,
.active-target:active {
  cursor: url("../assets/cursor/cursor-active-24.png") 3 3, auto;
}

/* --------------------------
   Star burst (optional; kept)
-------------------------- */
.starburst {
  position: fixed;
  pointer-events: none;
  z-index: 100001;
  font-size: 14px;
  line-height: 1;
  will-change: transform, opacity;
  animation: starPop 420ms ease-out forwards;
}

@keyframes starPop {
  0%   { transform: translate(0, 0) scale(0.6); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.15); opacity: 0; }
}

/* --------------------------
   Color toggle pill (bottom-right)
-------------------------- */
.color-toggle {
  position: fixed;
  right: 16px;
  bottom: 86px;
  z-index: 100000;

  display: inline-flex;
  align-items: center;
  gap: 10px;

  /* uniform padding around dots */
  padding: 10px;
  border-radius: 999px;

  border: 1px solid rgba(0,0,0,0.25);
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(8px);

  user-select: none;
}

/* label is hidden until hover/focus-within */
.color-toggle .label {
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: lowercase;

  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;

  margin-right: 2px;
  transition: max-width 180ms ease, opacity 180ms ease;
}

.color-toggle:hover .label,
.color-toggle:focus-within .label {
  max-width: 140px;
  opacity: 0.92;
}

.dot {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.25);
  padding: 0;
  background: transparent;
  display: inline-block;
  cursor: inherit;
}

.dot--green { background: rgba(0,255,0,0.55); }
.dot--red   { background: rgba(255,0,0,0.55); }
.dot--blue  { background: rgba(0,120,255,0.55); }

.color-toggle:hover,
.color-toggle:focus-within {
  border-color: rgba(0,0,0,0.42);
}

.dot:hover {
  border-color: rgba(0,0,0,0.45);
}

.dot:active {
  transform: translateY(1px);
}

.dot:focus-visible {
  outline: 2px solid rgba(0,0,0,0.55);
  outline-offset: 2px;
}

/* =========================================
   Floating mini-player footer (finalized)
========================================= */

.player-dock{
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 100050;

  border: 1px solid rgba(var(--tint-rgb), 0.35);
  border-radius: 10px;

  background:
    linear-gradient(rgba(var(--tint-rgb), 0.14), rgba(var(--tint-rgb), 0.14)),
    rgba(0,0,0,0.86);

  backdrop-filter: blur(10px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.45);

  padding: 10px 12px;
}

.player-dock-inner{
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;

  /* reserve space for the top-right dismiss X (desktop only) */
  padding-right: 34px;
  position: relative;
}

/* Dismiss X (desktop) */
.player-close{
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;

  width: 26px;
  height: 26px;
  border-radius: 0;
  border: 1px solid rgba(var(--tint-rgb), 0.45);
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.85);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font: inherit;
  line-height: 1;
  padding: 0;
}

.player-close:hover{
  background: rgba(0,0,0,0.75);
  border-color: rgba(var(--tint-rgb), 0.7);
}

/* Transport buttons */
.player-transport{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.player-btn{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(var(--tint-rgb), 0.45);
  background: rgba(0,0,0,0.35);
  color: rgba(var(--tint-rgb), 0.95);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.player-btn:hover{ background: rgba(0,0,0,0.55); }

.player-btn .icon{
  width: 18px;
  height: 18px;
}

/* Play/Pause icon swap via .is-playing on #playerDock */
#playerPlay .icon-pause{ display: none; }
.player-dock.is-playing #playerPlay .icon-play{ display: none; }
.player-dock.is-playing #playerPlay .icon-pause{ display: block; }

/* Text row */
.player-text{
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  color: rgba(255,255,255,0.9);
  font-family: monospace;
  font-size: 14px;
}

.player-label{
  white-space: nowrap;
  opacity: 0.85;
}

.player-note{
  color: rgba(var(--tint-rgb), 0.95);
  opacity: 0.95;
}

/* Track title wrapper (JS will manage marquee only when overset) */
.player-track{
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

/* inner span that animates */
.player-track .track-marquee{
  display: inline-block;
  white-space: nowrap;
  padding-right: 28px;
  will-change: transform;
  transform: translateX(0);
}

/* only animate when JS adds .is-marquee and sets vars */
.player-track.is-marquee .track-marquee{
  animation: trackMarquee var(--marquee-dur, 10s) ease-in-out infinite alternate;
}

@keyframes trackMarquee{
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-1 * var(--marquee-dist, 0px))); }
}

@media (prefers-reduced-motion: reduce){
  .player-track.is-marquee .track-marquee{ animation: none; }
}

/* Progress (scrubbable) */
.player-progress{
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-width: 140px;
  max-width: 520px;
}

.player-bar{
  position: relative;
  width: 100%;
  height: 14px;
  cursor: pointer;
}

.player-bar::before{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: rgba(var(--tint-rgb), 0.25);
  border-radius: 999px;
}

.player-played{
  position: absolute;
  left: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  width: calc(var(--p, 0) * 1%);
  background: rgba(var(--tint-rgb), 0.85);
  border-radius: 999px;
}

.player-knob{
  position: absolute;
  top: 50%;
  left: calc(var(--p, 0) * 1%);
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: transparent;
  border: 2px solid rgba(var(--tint-rgb), 0.85);
  box-sizing: border-box;
  pointer-events: none;
}

/* Menu button (desktop only) */
.player-menu{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(var(--tint-rgb), 0.45);
  background: rgba(0,0,0,0.35);
  color: rgba(var(--tint-rgb), 0.95);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 auto;

  position: relative;
  z-index: 3;
}

.player-menu:hover{ background: rgba(0,0,0,0.55); }

.player-menu .icon{ width: 18px; height: 18px; }

.menu-desktop{ display: inline-flex; }
.menu-mobile{ display: none; }

/* Tray: desktop popover that blooms upward */
.player-tray{
  position: absolute;
  right: 12px;
  bottom: calc(100% + 10px);

  width: max-content;
  min-width: 260px;
  max-width: min(520px, calc(100vw - 28px));

  border: 1px solid rgba(var(--tint-rgb), 0.45);
  border-radius: 12px;

  background:
    linear-gradient(rgba(var(--tint-rgb), 0.10), rgba(var(--tint-rgb), 0.10)),
    rgba(0,0,0,0.92);

  box-shadow: 0 16px 30px rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);

  opacity: 0;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;

  z-index: 2;

  transition: opacity 140ms ease, transform 180ms ease;
}

.player-dock.is-tray-open .player-tray{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.player-dock.is-tray-open .player-menu{
  background: rgba(0,0,0,0.65);
  border-color: rgba(var(--tint-rgb), 0.75);
}

.player-tray-inner{
  padding: 10px;
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
}

.player-tray-inner .track-item{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 8px 10px;
  border-radius: 8px;

  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);

  color: rgba(255,255,255,0.90);
  font: inherit;
  text-align: left;
}

.player-tray-inner .track-item:hover{
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
}

.player-tray-inner .track-item.is-current{
  border-color: rgba(var(--tint-rgb), 0.65);
  color: rgba(var(--tint-rgb), 0.95);
  background: rgba(var(--tint-rgb), 0.10);
}

/* Footer: black band; readable; always clears the fixed player */
.site-footer{
  margin-left: calc(var(--pad) * -1);
  margin-right: calc(var(--pad) * -1);

  padding: 18px var(--pad);
  padding-bottom: calc(18px + var(--dock-safe));

  background: #000;
  color: rgba(var(--tint-rgb), 0.92);
  border-top: 1px solid rgba(var(--tint-rgb), 0.22);

  font-size: 12px;
  letter-spacing: 0.01em;
  opacity: 0.92;
}

/* ------------------------------------
   Mobile: simplify visuals
------------------------------------ */
@media (max-width: 768px) {
  /* keep grain/vignette off on mobile */
  body::before,
  body::after {
    display: none;
  }

  /* IMPORTANT: do NOT override --tint-rgb on mobile (keeps green accents) */

  body {
    background: #fff; /* keep top clean + readable */
    color: #000;
    padding: 28px 18px;
    padding-bottom: calc(28px + var(--dock-safe));
  }

  .invert {
    background: #000;
    color: #e6ffe6;
  }

  .color-toggle {
    display: none !important;
  }

  .origin {
    display: none;
  }

  .origin-inline {
    display: inline-flex;
  }

  /* Mobile player: remove "Now Playing" label + note entirely */
  .player-label,
  .player-note {
    display: none;
  }

  .player-text {
    gap: 0;
  }

  :root{
    --dock-safe: 104px; /* mobile clearance above dock */
  }

  .player-dock{
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 10px 10px;
  }

  .player-dock-inner{
    padding-right: 0; /* no X on mobile */
  }

  /* Mobile player: remove caret/menu + tray; remove dismiss X */
  #playerClose,
  #playerMenu,
  #playerTray{
    display: none !important;
  }

  .player-text{
    font-size: 13px;
  }

  .player-progress{
    min-width: 120px;
    max-width: 360px;
  }

  .site-footer{
    margin-left: -18px;
    margin-right: -18px;

    padding: 16px 18px;
    padding-bottom: calc(16px + var(--dock-safe));
  }
}