/* ============================================================
   KEVIN $AVAGE — stark, high-contrast, surveillance-feed
   ============================================================ */

:root {
  --bg: #000;
  --fg: #e8e8e8;
  --dim: #6a6a6a;
  --line: #1c1c1c;
  --red: #ff1e1e;
  --mono: "SF Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
  --chrome-h: 104px;
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.08em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--red); color: #000; }

/* Global film grain over everything — keeps the whole site feeling like tape */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  animation: grainshift 0.6s steps(1) infinite;
}

@keyframes grainshift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -4%); }
  60%  { transform: translate(-2%, -2%); }
  80%  { transform: translate(4%, 1%); }
  100% { transform: translate(0, 0); }
}

/* ============================================================
   FIXED CHROME — logo + nav
   ============================================================ */

.chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  height: var(--chrome-h);
  display: flex;
  align-items: center;
  padding: 0 28px;
  pointer-events: none;
  transition: background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}

.chrome.is-stuck {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

/* Logo is hidden over the hero, cuts in once you scroll past it */
.logo {
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  filter: blur(6px);
  transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease;
}

.logo img {
  height: 62px;
  width: auto;
}

.chrome.is-revealed .logo {
  pointer-events: auto;
  opacity: 1;
  transform: none;
  filter: none;
  animation: logo-cut-in 0.5s steps(2) 1;
}

@keyframes logo-cut-in {
  0%   { opacity: 0; transform: translateX(-14px) scaleX(1.06); }
  35%  { opacity: 1; transform: translateX(6px) scaleX(0.97); }
  55%  { opacity: 0.2; transform: translateX(-3px); }
  100% { opacity: 1; transform: none; }
}

/* Nav is absent over the hero — it arrives with the logo */
.nav {
  margin-left: auto;
  display: flex;
  gap: 30px;
  font-size: 11px;
  letter-spacing: 0.24em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
}

.chrome.is-revealed .nav {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.nav a {
  position: relative;
  color: var(--dim);
  padding: 4px 0;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--red);
  transition: width 0.25s ease;
}

.nav a:hover { color: var(--fg); }
.nav a:hover::after { width: 100%; }

.menu-btn { display: none; }

/* Same on mobile: the trigger only exists once you're past the hero */
.chrome:not(.is-revealed) .menu-btn {
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  position: relative;
  /* No min-height: the viewfinder frame is drawn at the hero's edges, so any
     floor here would push its bottom edge below the fold on a short window. */
  height: 100svh;
  overflow: hidden;
  background: #000;
}

.hero__canvas,
.hero__fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__canvas { z-index: 2; }

/* Only shown if WebGL is unavailable — CSS carries the effect instead */
.hero__fallback {
  z-index: 1;
  display: none;
  filter: grayscale(0.35) contrast(1.15) brightness(0.85);
}

.hero.no-webgl .hero__canvas { display: none; }
.hero.no-webgl .hero__fallback { display: block; animation: fallback-drift 22s ease-in-out infinite; }

@keyframes fallback-drift {
  0%, 100% { transform: scale(1.04) translate(0, 0); }
  50%      { transform: scale(1.09) translate(-1%, 1%); }
}

.hero.no-webgl::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.45) 3px,
    rgba(0, 0, 0, 0.45) 4px
  );
}

/* --- CCTV overlay --- */

/* Full-bleed: the nav doesn't exist over the hero, so nothing collides */
.cctv {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.cctv__corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.cctv__corner--tl { top: 26px; left: 26px; border-right: 0; border-bottom: 0; }
.cctv__corner--tr { top: 26px; right: 26px; border-left: 0; border-bottom: 0; }
.cctv__corner--bl { bottom: 26px; left: 26px; border-right: 0; border-top: 0; }
.cctv__corner--br { bottom: 26px; right: 26px; border-left: 0; border-top: 0; }

.cctv__meta {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
}
.cctv__meta--tl { top: 68px; left: 30px; }
.cctv__meta--tr { top: 68px; right: 30px; text-align: right; align-items: flex-end; }
.cctv__meta--bl { bottom: 66px; left: 30px; }
.cctv__meta--br { bottom: 66px; right: 30px; text-align: right; align-items: flex-end; }

.rec {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--red);
}
.rec i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  animation: rec-blink 1.6s steps(1) infinite;
}
@keyframes rec-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0.1; } }

.cctv__reticle {
  position: absolute;
  top: 50%; left: 50%;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  opacity: 0.35;
  background:
    linear-gradient(var(--fg), var(--fg)) center / 1px 100% no-repeat,
    linear-gradient(var(--fg), var(--fg)) center / 100% 1px no-repeat;
}

/* --- Hero wordmark --- */

.hero__wordmark {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(72vw, 820px);
  margin: 0;
  pointer-events: none;
}

.hero__wordmark img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 40px rgba(0, 0, 0, 0.9));
  animation: wordmark-flicker 7s steps(1) infinite;
}

@keyframes wordmark-flicker {
  0%, 100%      { opacity: 1;    transform: none; }
  47%           { opacity: 1;    transform: none; }
  48%           { opacity: 0.25; transform: translateX(-5px); }
  48.6%         { opacity: 1;    transform: translateX(4px); }
  49.2%         { opacity: 0.6;  transform: none; }
  50%           { opacity: 1;    transform: none; }
  82%           { opacity: 1; }
  82.5%         { opacity: 0.15; }
  83%           { opacity: 1; }
}

/* Wordmark dissolves as you scroll away (driven by JS var) */
.hero__wordmark { opacity: var(--wm-opacity, 1); }

.scroll-cue {
  position: absolute;
  z-index: 12;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 0.4em;
  color: rgba(255, 255, 255, 0.55);
  opacity: var(--wm-opacity, 1);
}

.scroll-cue i {
  width: 1px;
  height: 42px;
  background: linear-gradient(rgba(255, 255, 255, 0.6), transparent);
  animation: cue-pulse 2.2s ease-in-out infinite;
}
@keyframes cue-pulse {
  0%, 100% { transform: scaleY(0.4); opacity: 0.3; transform-origin: top; }
  50%      { transform: scaleY(1);   opacity: 1;   transform-origin: top; }
}

/* ============================================================
   CONTENT
   ============================================================ */

.content {
  position: relative;
  z-index: 20;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.sect {
  max-width: 1180px;
  margin: 0 auto;
  padding: 120px 30px;
  border-bottom: 1px solid var(--line);
}

.sect__head {
  display: flex;
  align-items: baseline;
  margin-bottom: 56px;
}

.sect__title {
  margin: 0;
  font-size: clamp(32px, 6vw, 68px);
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* --- Embed + platforms --- */

.embed {
  border: 1px solid var(--line);
  background: #050505;
  filter: grayscale(0.25);
  transition: filter 0.4s ease;
}
.embed:hover { filter: none; }

/* --- Player tabs --- */

.tabs {
  display: flex;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-bottom: 0;
}

.tab {
  flex: 1;
  padding: 20px 16px;
  background: var(--bg);
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.tab:hover { color: var(--fg); }

.tab.is-active {
  color: var(--fg);
  background: #0a0a0a;
  border-bottom-color: var(--red);
}

/* The tab strip supplies the top edge, so the panel must not double it.
   Both players are the same height, so switching tabs never shifts the page. */
.player__panel {
  border-top: 0;
  min-height: 640px;
}

/* Third-party players paint a white shell while they boot. Hold them at
   zero opacity over the dark container until their load event fires. */
.embed iframe {
  display: block;
  width: 100%;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.embed iframe.is-loaded { opacity: 1; }

/* 16:9 for video embeds */
.embed--video { position: relative; aspect-ratio: 16 / 9; }
.embed--video iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Stand-in until a real player URL is wired up */
.embed--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 320px;
  filter: none;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.022) 0 1px, transparent 1px 3px),
    #050505;
}

.embed__line {
  font-size: 22px;
  letter-spacing: 0.4em;
  color: #2f2f2f;
  animation: noSignal 4s steps(1) infinite;
}
@keyframes noSignal {
  0%, 88%, 100% { opacity: 1; }
  90%           { opacity: 0.25; }
  92%           { opacity: 1; }
}

.embed__hint {
  font-size: 9px;
  letter-spacing: 0.32em;
  color: #2a2a2a;
}

.platforms {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.platforms li { flex: 1 1 180px; }

.platforms a {
  display: block;
  padding: 22px 18px;
  background: var(--bg);
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--dim);
  transition: background 0.2s ease, color 0.2s ease;
}
.platforms a:hover { background: var(--red); color: #000; }

/* --- Mailing list --- */

.sect--list { text-align: center; }
.sect--list .sect__head { justify-content: center; }

.signup__form {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  border: 1px solid #2e2e2e;
}

.signup__form input {
  flex: 1;
  min-width: 0;
  padding: 18px 20px;
  background: transparent;
  border: 0;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
}
.signup__form input::placeholder { color: #464646; }
.signup__form input:focus { outline: none; background: #070707; }

.signup__form button {
  padding: 18px 28px;
  background: var(--fg);
  border: 0;
  color: #000;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  cursor: pointer;
  transition: background 0.2s ease;
}
.signup__form button:hover { background: var(--red); }

/* Honeypot — off-screen rather than display:none, which some bots skip */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.signup__form button[disabled] {
  opacity: 0.45;
  cursor: default;
}

.signup__status {
  min-height: 20px;
  margin: 16px 0 0;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--red);
}

/* --- Contact --- */

.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
}

.contact__label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--red);
  margin-bottom: 10px;
}

.contact__block a {
  font-size: clamp(16px, 2.4vw, 26px);
  letter-spacing: 0.1em;
  color: var(--fg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.contact__block a:hover { color: var(--red); border-bottom-color: var(--red); }

/* --- Footer --- */

.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 30px 60px;
  text-align: center;
}

/* Flex-wrap so a narrow screen breaks between credits rather than
   splitting a name down the middle. */
.footer__line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 2px 8px;
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.24em;
  line-height: 2;
  color: #3a3a3a;
}

/* Separators sit dimmer so the names read as the content */
.footer__sep { color: #262626; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 760px) {
  :root { --chrome-h: 72px; }

  .chrome { padding: 0 18px; }
  .logo img { height: 30px; }

  .menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding: 8px 0;
    background: none;
    border: 0;
    color: var(--fg);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.3em;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.5s ease 0.1s;
  }
  .menu-btn__bars { display: flex; flex-direction: column; gap: 4px; }
  .menu-btn__bars i { display: block; width: 20px; height: 1px; background: currentColor; }

  /* The overlay is driven purely by .is-open here, so it must out-specify
     the desktop `.chrome.is-revealed .nav` reveal rule above. */
  .nav,
  .chrome.is-revealed .nav {
    position: fixed;
    inset: 0;
    margin: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 34px;
    background: rgba(0, 0, 0, 0.96);
    font-size: 15px;
    opacity: 0;
    visibility: hidden;
    pointer-events: auto;
    transform: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  .nav.is-open,
  .chrome.is-revealed .nav.is-open { opacity: 1; visibility: visible; }
  .nav a { color: var(--fg); }

  .cctv__corner { width: 20px; height: 20px; }
  .cctv__corner--tl { top: 14px; left: 14px; }
  .cctv__corner--tr { top: 14px; right: 14px; }
  .cctv__corner--bl { bottom: 14px; left: 14px; }
  .cctv__corner--br { bottom: 14px; right: 14px; }
  .cctv__meta { font-size: 8px; letter-spacing: 0.15em; }
  .cctv__meta--tl { top: 44px; left: 18px; }
  .cctv__meta--tr { top: 44px; right: 18px; }
  .cctv__meta--bl { bottom: 46px; left: 18px; }
  .cctv__meta--br { bottom: 46px; right: 18px; }

  .hero__wordmark { width: 84vw; }

  .sect { padding: 80px 20px; }
  .sect__head { margin-bottom: 38px; }

  .signup__form { flex-direction: column; }

  .footer { padding: 30px 20px 44px; }
  .footer__line { letter-spacing: 0.16em; gap: 0 6px; }
}

/* Short viewports (landscape phone, split screen, shallow window).
   The frame must always fit, so its insets pull in rather than overflow. */
@media (max-height: 620px) {
  .cctv__corner { width: 20px; height: 20px; }
  .cctv__corner--tl { top: 14px; left: 16px; }
  .cctv__corner--tr { top: 14px; right: 16px; }
  .cctv__corner--bl { bottom: 14px; left: 16px; }
  .cctv__corner--br { bottom: 14px; right: 16px; }

  .cctv__meta--tl { top: 42px; left: 20px; }
  .cctv__meta--tr { top: 42px; right: 20px; }
  .cctv__meta--bl { bottom: 40px; left: 20px; }
  .cctv__meta--br { bottom: 40px; right: 20px; }

  .hero__wordmark { width: min(62vw, 620px); }

  .scroll-cue { bottom: 14px; gap: 5px; }
  .scroll-cue i { height: 20px; }
}

/* Shallower still — the cue is the first thing to go, then the reticle. */
@media (max-height: 440px) {
  .scroll-cue { display: none; }
  .cctv__meta { font-size: 9px; }
  .cctv__meta--tl, .cctv__meta--tr { top: 38px; }
  .cctv__meta--bl, .cctv__meta--br { bottom: 30px; }
  .hero__wordmark { width: min(56vw, 520px); }
}

@media (max-height: 340px) {
  .cctv__reticle { display: none; }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  body::after,
  .rec i,
  .scroll-cue i,
  .hero__wordmark img,
  .hero__fallback { animation: none !important; }

  .reveal { opacity: 1; transform: none; transition: none; }
  .chrome.is-revealed .logo { animation: none; }
}

:focus-visible {
  outline: 1px solid var(--red);
  outline-offset: 3px;
}
