/* ─── RESET ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── VARS ─── */
:root {
  /* Colour */
  --bg:        #0b0805;
  --warm:      #c4a87a;
  --cream:     #e8d5b0;
  --accent:    #eda31b;
  --tv-body:   #1c1812;
  --tv-trim:   #2c2419;
  --tv-deep:   #100e0a;
  --screen-bg: #030303;

  /* Type — Pacifico headings */
  --heading-home: clamp(2.8rem, 9vw, 5.5rem);  /* homepage logo only */
  --heading-page: clamp(2rem, 6vw, 3.5rem);     /* subpage titles */

  /* Type — Courier New scale */
  --text-lg:   1.2rem;   /* strapline, section intros */
  --text-base: 1rem;     /* body copy, nav links */
  --text-sm:   0.8rem;   /* secondary, labels */
  --text-xs:   0.65rem;  /* footer, meta, tiny UI */

  /* Letter spacing */
  --tracking-base:   0.08em;
  --tracking-wide:   0.1em;
  --tracking-wider:  0.2em;
}

/* ─── BASE ─── */
html {
  height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--cream);
  font-family: 'Courier New', Courier, monospace;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  /* subtle warm paper texture via radial gradients */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(100, 70, 20, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(80, 50, 10, 0.08) 0%, transparent 60%);
}

/* ─── FILM GRAIN (TV screen only) ─── */
.grain-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  opacity: 0.22;
  border-radius: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  animation: grain 0.35s steps(1) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  15%  { transform: translate(-4%, 3%); }
  30%  { transform: translate(3%, -4%); }
  45%  { transform: translate(-2%, -3%); }
  60%  { transform: translate(4%, 1%); }
  75%  { transform: translate(-1%, 4%); }
  90%  { transform: translate(3%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ─── HEADER ─── */
.site-header {
  width: 100%;
  padding: 2.5rem 2rem 0.5rem;
  text-align: center;
}

.logo {
  font-family: 'Pacifico', cursive;
  font-size: var(--heading-home);
  color: var(--cream);
  display: inline-block;
  transform: rotate(-2.5deg);
  text-shadow:
    3px 3px 0 #eda31b,
    6px 6px 0 rgba(237, 163, 27, 0.4),
    8px 8px 0 rgba(0, 0, 0, 0.5),
    0 0 40px rgba(237, 163, 27, 0.1);
  animation: logo-drift 10s ease-in-out infinite;
  /* rough polaroid-style border on logo text */
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.8));
}

@keyframes logo-drift {
  0%, 100% { transform: rotate(-2.5deg) translateY(0); }
  35%       { transform: rotate(-2deg) translateY(-3px); }
  65%       { transform: rotate(-3deg) translateY(2px); }
}

.strapline {
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-wide);
  color: var(--warm);
  margin-top: 1.25rem;
  text-transform: lowercase;
}

/* ─── MAIN ─── */
.site-main {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 2rem 1rem;
  width: 100%;
}

/* ─── TV FLOAT ─── */
.tv-wrap {}

/* ─── TV ─── */
.tv {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.8));
}

/* ─── ANTENNA ─── */
.tv-antenna {
  display: flex;
  justify-content: center;
  gap: 70px;
  margin-bottom: -6px;
  position: relative;
  z-index: 1;
}

.antenna {
  width: 5px;
  height: 75px;
  background: linear-gradient(to top, var(--tv-trim), #4a3e30);
  border-radius: 3px 3px 0 0;
}

.antenna-l { transform: rotate(-22deg); transform-origin: bottom center; }
.antenna-r { transform: rotate(22deg);  transform-origin: bottom center; }

/* ─── TV BODY ─── */
.tv-body {
  background: linear-gradient(160deg, #252018 0%, var(--tv-body) 40%, #141008 100%);
  border-radius: 20px 20px 16px 16px;
  padding: 22px 26px 18px;
  border: 3px solid var(--tv-trim);
  box-shadow:
    inset 0 3px 5px rgba(255, 255, 255, 0.04),
    inset 0 -5px 10px rgba(0, 0, 0, 0.5),
    0 6px 0 var(--tv-deep),
    0 8px 30px rgba(0, 0, 0, 0.7);
  width: clamp(280px, 48vw, 520px);
}

/* ─── SCREEN BEZEL ─── */
.tv-screen-bezel {
  background: var(--tv-deep);
  border-radius: 12px;
  padding: 10px;
  box-shadow:
    inset 0 0 25px rgba(0, 0, 0, 0.9),
    inset 0 2px 4px rgba(255,255,255,0.02);
}

/* ─── SCREEN ─── */
.tv-screen {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 4 / 3;
  background: var(--screen-bg);
  box-shadow:
    inset 0 0 50px rgba(0, 0, 0, 0.8),
    0 0 25px rgba(180, 155, 100, 0.08);
}

.tv-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.15) brightness(0.85) saturate(0.75) sepia(0.1);
  animation: flicker 9s ease-in-out infinite;
}

@keyframes flicker {
  0%, 88%, 90%, 92%, 100% { opacity: 1; }
  89%                      { opacity: 0.88; }
  91%                      { opacity: 0.94; }
}

/* Scanlines */
.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.2) 3px,
    rgba(0, 0, 0, 0.2) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* Slow-moving tracking line (VHS effect) */
.tracking-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  z-index: 3;
  pointer-events: none;
  animation: track-sweep 14s linear infinite;
}

@keyframes track-sweep {
  0%   { top: -3px; opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* CRT glass reflection */
.screen-reflection {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 60% at 30% 20%,
    rgba(255, 255, 255, 0.04) 0%,
    transparent 65%
  );
  z-index: 4;
  pointer-events: none;
  border-radius: 8px;
}

/* Static noise canvas */
.static-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.06;
  pointer-events: none;
  z-index: 5;
  mix-blend-mode: screen;
}

/* ─── TV CONTROLS ─── */
.tv-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 0 6px;
}

/* Speaker dots grid */
.tv-speaker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 66px;
}

.speaker-dot {
  width: 7px;
  height: 7px;
  background: var(--tv-deep);
  border-radius: 50%;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 1px rgba(255,255,255,0.03);
}

/* Knobs */
.tv-speaker-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tv-knobs {
  display: flex;
  gap: 14px;
}

.tv-knob {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #3e3426, #121008);
  border: 2px solid #3a3028;
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.7),
    inset 0 1px 2px rgba(255,255,255,0.04);
  cursor: pointer;
  transition: transform 0.1s;
}

.tv-knob:hover {
  transform: rotate(30deg);
}

.volume-knob {
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.volume-knob:hover {
  transform: none;
}

.volume-note {
  font-family: 'Courier New', monospace;
  font-size: 20px; /* decorative UI icon — not part of text scale */
  line-height: 1;
  color: var(--warm);
  display: block;
  transition: color 0.2s, text-shadow 0.2s, transform 0.15s;
}

.volume-knob:hover .volume-note {
  transform: scale(1.3);
  color: #e8d5b0;
}

.volume-knob.on .volume-note {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(237, 163, 27, 0.6);
}

.volume-knob.on {
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.7),
    inset 0 1px 2px rgba(255,255,255,0.04),
    0 0 8px rgba(237, 163, 27, 0.7),
    0 0 16px rgba(237, 163, 27, 0.3);
}

/* ─── TV LEGS ─── */
.tv-legs {
  display: flex;
  justify-content: space-between;
  width: 55%;
}

.tv-leg {
  width: 16px;
  height: 30px;
  background: linear-gradient(to bottom, var(--tv-trim), #0f0c08);
  border-radius: 0 0 5px 5px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
}

/* ─── FOOTER ─── */
.site-footer {
  width: 100%;
  padding: 1.2rem 2rem 1.5rem;
  margin-top: 2rem;
  text-align: center;
  border-top: 1px solid rgba(196, 168, 122, 0.08);
}

.site-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 1.2rem 2rem 0;
}

.site-links a {
  color: var(--warm);
  text-decoration: none;
  font-size: var(--text-base);
  font-weight: bold;
  letter-spacing: var(--tracking-wider);
  text-transform: lowercase;
  transition: color 0.2s, text-shadow 0.2s;
}

.site-links a:hover {
  color: var(--cream);
  text-shadow: 0 0 14px rgba(196, 168, 122, 0.5);
}

.sep {
  color: var(--warm);
  opacity: 0.35;
  font-size: var(--text-xs);
}

.footer-copy {
  font-size: var(--text-xs);
  color: rgba(196, 168, 122, 0.6);
  letter-spacing: var(--tracking-base);
  text-transform: lowercase;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
  .tv-body {
    width: 90vw;
  }

  .strapline {
    font-size: 1.5rem;
  }

  .site-main {
    padding-top: 0.5rem;
  }

  .site-links {
    flex-direction: column;
    gap: 0.6rem;
  }

  .site-links a {
    font-size: 1.2rem;
  }
}
