:root {
  --cream: rgb(243, 239, 233);
  --osd-font: 'VT323', ui-monospace, 'Courier New', monospace;
}

html {
  height: 100%;
  background: #000;
}
/* main content centers via margin:auto, so tall pages scroll instead of clipping */
body {
  margin: 0;
  min-height: 100%;
  display: flex;
  overflow-x: hidden;
  background: #000;
  color: var(--cream);
}
body > main {
  margin: auto;
}

/* ---------- VCR on-screen-display navbar ---------- */
.osd {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(14px, 2.4vw, 28px) clamp(16px, 4vw, 48px);
  font-family: var(--osd-font);
  font-size: clamp(20px, 2vw, 28px);
  letter-spacing: .08em;
  text-shadow: 0 0 6px rgba(243, 239, 233, .35);
  background: linear-gradient(to bottom, #000 60%, transparent);
  filter: url(#vhs);
}
.osd ul {
  display: flex;
  gap: clamp(0px, 1.4vw, 20px);
  margin: 0 0 0 -.75em;
  padding: 0;
  list-style: none;
}
.osd a {
  position: relative;
  display: block;
  padding: .05em .35em 0 .75em;
  color: inherit;
  text-decoration: none;
}
.osd a[aria-current="page"]::before {
  content: '';
  position: absolute;
  left: .2em;
  top: 50%;
  width: .38em;
  height: .5em;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transform: translateY(-50%);
  animation: blink 1.1s steps(1) infinite;
}
.osd a:hover,
.osd a:focus-visible {
  background: var(--cream);
  color: #000;
  text-shadow: none;
  outline: none;
  animation: jitter .24s steps(1) infinite;
}
.osd .counter {
  white-space: nowrap;
  opacity: .85;
}
@media (max-width: 600px) {
  .osd { justify-content: center; }
  .osd .counter { display: none; }
}

/* ---------- VCR footer: copyright, tracking meter, camcorder date stamp ---------- */
.osd-foot {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding: clamp(12px, 2vw, 24px) clamp(16px, 4vw, 48px);
  font-family: var(--osd-font);
  font-size: clamp(17px, 1.5vw, 22px);
  letter-spacing: .12em;
  white-space: nowrap;
  color: rgba(243, 239, 233, .75);
  text-shadow: 0 0 6px rgba(243, 239, 233, .2);
  background: linear-gradient(to top, #000 55%, transparent);
  filter: url(#vhs-soft);
  pointer-events: none;
}
.osd-foot .meter {
  display: flex;
  align-items: center;
  gap: .6em;
}
.osd-foot .bars {
  display: inline-flex;
  gap: 3px;
}
.osd-foot .bars i {
  width: .3em;
  height: .75em;
  background: currentColor;
  opacity: .2;
}
.osd-foot .bars i.on {
  opacity: 1;
}
@media (max-width: 760px) {
  .osd-foot .meter,
  .osd-foot .stamp .time { display: none; }
}

/* ---------- logo screen (home) ---------- */
.screen {
  position: relative;
  line-height: 0;
}
.screen img {
  display: block;
  max-width: min(100vw, 1448px);
  max-height: 100vh;
  max-height: 100dvh;
  width: auto;
  height: auto;
  filter: url(#vhs);
}
.screen .tear {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  visibility: hidden;
}

/* ---------- "no signal" placeholder pages ---------- */
.nosignal {
  font-family: var(--osd-font);
  text-align: center;
  text-shadow: 0 0 10px rgba(243, 239, 233, .35);
  padding: 0 16px;
}
.nosignal h1 { filter: url(#vhs); }
.nosignal p {
  text-shadow: 0 0 8px rgba(243, 239, 233, .15);
  filter: url(#vhs-soft);
}
.nosignal h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(56px, 13vw, 160px);
  line-height: 1;
  letter-spacing: .08em;
  animation: fade 3.2s ease-in-out infinite;
}
.nosignal p {
  margin: .6em 0 0;
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: .2em;
  opacity: .7;
}

/* ---------- text pages (about) ---------- */
/* two columns on wide screens: headline left, body right, split by a thin rule */
.transmission {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 6vw, 110px);
  width: 100%;
  max-width: 1400px;
  padding: clamp(110px, 15vh, 170px) clamp(16px, 5vw, 72px) clamp(64px, 11vh, 120px);
  font-family: var(--osd-font);
  text-shadow: 0 0 8px rgba(243, 239, 233, .25);
}
/* full VHS on the headline side, half strength on reading text */
.transmission .head {
  filter: url(#vhs);
}
.transmission .body {
  padding-left: clamp(24px, 3vw, 56px);
  border-left: 1px solid rgba(243, 239, 233, .35);
  text-shadow: 0 0 8px rgba(243, 239, 233, .12);
  filter: url(#vhs-soft);
}
.transmission .label {
  display: flex;
  align-items: center;
  gap: .5em;
  margin: 0 0 1em;
  font-size: clamp(22px, 1.9vw, 30px);
  letter-spacing: .2em;
  color: rgba(243, 239, 233, .8);
}
.transmission .label::before {
  content: '';
  width: .55em;
  height: .55em;
  border-radius: 50%;
  background: #e0241b;
  box-shadow: 0 0 8px rgba(224, 36, 27, .8);
  animation: blink 1.6s steps(1) infinite;
}
.transmission .lede {
  margin: 0;
  font-weight: 400;
  font-size: clamp(42px, 5vw, 76px);
  line-height: 1;
  letter-spacing: .02em;
}
.transmission p {
  margin: 0 0 1em;
  font-size: clamp(25px, 2.3vw, 38px);
  line-height: 1.25;
  letter-spacing: .03em;
  color: rgba(243, 239, 233, .85);
}
/* closing line gets the short rule from the logo's "— STUDIOS —" */
.transmission .signoff {
  margin: 1.4em 0 0;
  color: var(--cream);
}
.transmission .signoff::before {
  content: '';
  display: block;
  width: 2.4em;
  height: 2px;
  margin-bottom: .7em;
  background: var(--cream);
}
@media (max-width: 900px) {
  .transmission {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6em;
  }
  .transmission .body {
    padding-left: 1em;
  }
}

/* ---------- contact form ---------- */
.contact-form {
  display: grid;
  gap: 1.1em;
  font-size: clamp(22px, 1.9vw, 28px);
}
.contact-form label {
  display: block;
  margin-bottom: .3em;
  font-size: .8em;
  letter-spacing: .2em;
  color: rgba(243, 239, 233, .7);
}
.contact-form input,
.contact-form textarea {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: .3em .5em;
  font: inherit;
  letter-spacing: .03em;
  color: var(--cream);
  caret-color: var(--cream);
  background: rgba(243, 239, 233, .03);
  border: 1px solid rgba(243, 239, 233, .35);
  border-radius: 0;
  outline: none;
  text-shadow: inherit;
}
.contact-form textarea {
  min-height: 6.5em;
  line-height: 1.2;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--cream);
  background: rgba(243, 239, 233, .07);
}
.contact-form input:-webkit-autofill {
  -webkit-text-fill-color: var(--cream);
  box-shadow: 0 0 0 100px #0d0d0c inset;
}
.contact-form .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.contact-form .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6em 1.2em;
}
.contact-form button {
  position: relative;
  padding: .1em .8em .05em 1.3em;
  font: inherit;
  letter-spacing: .15em;
  color: var(--cream);
  background: transparent;
  border: 1px solid var(--cream);
  border-radius: 0;
  cursor: pointer;
  text-shadow: inherit;
}
.contact-form button::before {
  content: '';
  position: absolute;
  left: .45em;
  top: 50%;
  width: .38em;
  height: .5em;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transform: translateY(-50%);
}
.contact-form button:hover,
.contact-form button:focus-visible {
  color: #000;
  background: var(--cream);
  text-shadow: none;
  outline: none;
}
.contact-form button:disabled {
  opacity: .5;
  cursor: progress;
}
.contact-form .status {
  font-size: .85em;
  letter-spacing: .08em;
}
.contact-form .status.busy { animation: blink 1s steps(1) infinite; }
.contact-form .status.err  { color: #ff5a4f; }

.acquire .ln {
  animation: acquire .9s steps(6) both;
  animation-delay: calc(var(--i, 0) * .35s + .2s);
}
@keyframes acquire {
  0%   { opacity: 0; transform: translateX(-6px); }
  30%  { opacity: .6; transform: translateX(3px); }
  45%  { opacity: .1; }
  70%  { opacity: .9; transform: translateX(0); }
  100% { opacity: 1; }
}

/* ---------- full-viewport overlays ---------- */
.fx {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.vignette {
  z-index: 1;
  background: radial-gradient(ellipse at center,
    transparent 50%, rgba(0, 0, 0, .65) 100%);
}
#grain {
  width: 100%;
  height: 100%;
  opacity: .07;
  mix-blend-mode: screen;
}
.scanlines {
  background: repeating-linear-gradient(to bottom,
    transparent 0, transparent 2px, rgba(0, 0, 0, .3) 3px);
}
.tracking {
  height: 14vh;
  top: -14vh;
  bottom: auto;
  background: linear-gradient(to bottom,
    transparent, rgba(255, 255, 255, .035) 45%, rgba(255, 255, 255, .06) 50%,
    rgba(255, 255, 255, .035) 55%, transparent);
  mix-blend-mode: screen;
  animation: roll 13s linear infinite;
}
.flicker {
  background: #000;
  opacity: 0;
  animation: flicker 5s steps(1) infinite;
}

@keyframes roll {
  0%, 55% { transform: translateY(0); }
  100%    { transform: translateY(128vh); }
}
@keyframes flicker {
  0%   { opacity: 0; }
  7%   { opacity: .04; }
  9%   { opacity: 0; }
  38%  { opacity: .025; }
  40%  { opacity: 0; }
  71%  { opacity: .05; }
  72%  { opacity: .01; }
  74%  { opacity: 0; }
}
@keyframes blink {
  0%  { opacity: 1; }
  60% { opacity: 0; }
}
@keyframes jitter {
  0%  { transform: translateX(0); }
  50% { transform: translateX(1px); }
}
@keyframes fade {
  0%, 100% { opacity: 1; }
  50%      { opacity: .75; }
}

@media (prefers-reduced-motion: reduce) {
  .tracking, .flicker { display: none; }
  .osd a[aria-current="page"]::before,
  .osd a:hover,
  .osd a:focus-visible,
  .nosignal h1,
  .transmission .label::before,
  .acquire .ln { animation: none; }
}
