/* Townhouse Productions
   Layout: a white page in a thin black frame, after the company's 2008 website; the TV, the tape deck and the cassettes are the objects on it. */

:root {
  --green: #008053;
  --green-hi: #19c07f;
  --green-glow: #3dff9e;
  --ink: #221e1f;
  --grey: #939598;
  --text: #231f20;
  --text-dim: #6d6e71;
  --rule: #c7c8c9;
  --mat: #d1d2d3;
  --page: #e8e8e6;
  --paper: #fff;
  --text-2: #414042;
  --btn: #f4f4f2;
  --btn-line: #9d9fa2;
  --well: #f1f1ef;
  --tv: linear-gradient(180deg, #e9e9e6 0, #d3d3cf 10px, #c8c8c3 85%, #b4b4af);
  --tv-rim: #8f8f8a; --tv-grille: #6f6f6b; --tv-label: #5a5a57;
  --tv-btn: linear-gradient(180deg, #f2f2ef, #cfcfca); --tv-btn-ink: #3a3a38;
  --deck: linear-gradient(180deg, #dcdcd8, #c9c9c4); --deck-line: #a6a6a1; --deck-hi: #f2f2ee; --deck-label: #414042;
  --lcd: #9dffb8;
  --lcd-bg: #07140c;
  --amber: #ffb000;
  --red: #ff3b2f;
  --cream: #f4f0e4;
  --body-font: Verdana, Tahoma, Geneva, sans-serif;
  --ui-font: "Orbitron", "Eurostile", Verdana, sans-serif;
  --lcd-font: "VT323", "Courier New", monospace;
  --logo-font: "Gill Sans", "Gill Sans MT", "Cabin Condensed", "Trebuchet MS", sans-serif;
  --hand-font: "Permanent Marker", "Marker Felt", cursive;
  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green: #2aa774;
    --text: #e6e6e3; --text-2: #c3c4c5; --text-dim: #8f9194;
    --rule: #3b3c3e; --mat: #3b3c3e; --page: #0f1011; --paper: #1c1d1f;
    --btn: #2a2b2d; --btn-line: #5b5c5f; --well: #242527;
    --tv: linear-gradient(180deg, #4b4b4a 0, #2d2d2c 10px, #252524 85%, #1b1b1a); --tv-rim: #4a4a48; --tv-grille: #0b0b0b; --tv-label: #9a9a97; --tv-btn: linear-gradient(180deg, #4a4a49, #2e2e2d); --tv-btn-ink: #d5d5d2; --deck: linear-gradient(180deg, #3a3b3d, #2a2b2d); --deck-line: #18191a; --deck-hi: rgba(255,255,255,.12); --deck-label: #c9cbcd;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --green: #2aa774;
  --text: #e6e6e3; --text-2: #c3c4c5; --text-dim: #8f9194;
  --rule: #3b3c3e; --mat: #3b3c3e; --page: #0f1011; --paper: #1c1d1f;
  --btn: #2a2b2d; --btn-line: #5b5c5f; --well: #242527;
    --tv: linear-gradient(180deg, #4b4b4a 0, #2d2d2c 10px, #252524 85%, #1b1b1a); --tv-rim: #4a4a48; --tv-grille: #0b0b0b; --tv-label: #9a9a97; --tv-btn: linear-gradient(180deg, #4a4a49, #2e2e2d); --tv-btn-ink: #d5d5d2; --deck: linear-gradient(180deg, #3a3b3d, #2a2b2d); --deck-line: #18191a; --deck-hi: rgba(255,255,255,.12); --deck-label: #c9cbcd;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  display: flow-root;
  height: 100vh; height: 100dvh;
  overflow: hidden;
  color: var(--text);
  font: 12px/1.6 var(--body-font);
  background: var(--page);
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
}

a { color: var(--green); }
a:hover { color: #000; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Intro: the logo draws, then two buttons ---------- */

.intro {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; place-content: center;
  background: #000;
  overflow: hidden;
  transition: opacity .7s ease;
}
.intro.is-leaving { opacity: 0; pointer-events: none; }
.intro__panel { position: relative; z-index: 1; display: grid; justify-items: center; gap: 34px; width: min(520px, 88vw); }
.intro__logo { width: 100%; overflow: visible; }
.intro .roof {
  fill: none; stroke: var(--green); stroke-width: 14;
  stroke-dasharray: 520; stroke-dashoffset: 520;
  filter: drop-shadow(0 0 10px rgba(61,255,158,.6));
  animation: draw 1.2s .3s cubic-bezier(.6,0,.2,1) forwards;
}
.intro .word {
  font-family: var(--logo-font); fill: #fff; opacity: 0;
  animation: track-in 1.4s 1s cubic-bezier(.2,.7,.2,1) forwards;
}
.intro .word--sub { fill: var(--grey); animation-delay: 1.5s; }
.intro__enter {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  opacity: 0; animation: fade .6s 2.6s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes track-in {
  0% { opacity: 0; letter-spacing: 1.2em; filter: blur(8px); }
  100% { opacity: 1; letter-spacing: 0; filter: blur(0); }
}
@keyframes fade { to { opacity: 1; } }
.flare {
  position: absolute; top: 30%; left: -40%; width: 700px; height: 300px; max-width: 80vw;
  pointer-events: none; mix-blend-mode: screen; opacity: 0;
  background:
    radial-gradient(circle, rgba(255,255,255,.95) 0 3px, rgba(160,255,210,.45) 8px, transparent 60px),
    linear-gradient(90deg, transparent 15%, rgba(200,255,230,.45) 50%, transparent 85%) center / 100% 2px no-repeat;
  animation: flare 2s 2s ease-in-out forwards;
}
@keyframes flare {
  0% { left: -40%; opacity: 0; }
  25%, 75% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* ---------- Chrome buttons ---------- */

.chrome {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  font: 11px/1 var(--body-font); color: var(--text); text-decoration: none; cursor: pointer;
  border: 1px solid var(--btn-line); border-radius: 0;
  background: var(--btn);
}
.chrome:hover { background: var(--paper); border-color: var(--green); color: var(--text); }
.chrome[aria-current="page"] { background: var(--green); border-color: var(--green); color: #fff; }
.led { width: 6px; height: 6px; flex: none; background: #b5b6b8; }
.chrome:hover .led { background: var(--green); }
.chrome[aria-current="page"] .led { background: #fff; }
.chrome--big { padding: 10px 16px; font-size: 12px; }
.intro .chrome { background: transparent; color: #d6d6d6; border-color: #5f6062; }
.intro .chrome:hover { color: #fff; border-color: var(--green); }

/* ---------- Console ---------- */

.chassis {
  position: relative;
  display: flex; flex-direction: column;
  max-width: 1240px;
  height: calc(100vh - 22px); height: calc(100dvh - 22px);
  margin: 11px auto;
  padding: 14px 22px 10px;
  background: var(--paper);
  border: 1px solid var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.screw { display: none; }

.top { display: flex; flex-direction: row-reverse; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.badge-logo { display: block; }
.badge-logo text:first-of-type { fill: var(--text); }
.badge-logo svg { display: block; width: 140px; height: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; list-style: none; }
.nav li + li::before { content: "|"; color: var(--btn-line); }
.nav .chrome { padding: 4px 9px; border: 0; background: none; font-size: 12px; text-transform: lowercase; color: var(--text-2); }
.nav .chrome .led { display: none; }
.nav .chrome:hover { background: none; color: var(--green); }
.nav .chrome[aria-current="page"] { background: none; color: var(--green); font-weight: bold; }

.stage {
  position: relative;
  flex: 1; min-height: 0;
  padding: 16px 18px;
  overflow: hidden;
}
.scene { height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); animation: scene-in .45s ease both; }
@keyframes scene-in { from { opacity: 0; filter: blur(3px); } }
.wipe {
  position: absolute; inset: 0; z-index: 20; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--green) 0 8%, var(--paper) 8% 10%);
  transform: scaleX(0); transform-origin: left;
}
.wipe.is-going { animation: wipe .55s ease-in-out; }
@keyframes wipe {
  0% { transform: scaleX(0); transform-origin: left; }
  50% { transform: scaleX(1); transform-origin: left; }
  51% { transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

.h1 {
  margin: 0 0 16px; font: 400 30px/1.15 var(--logo-font); color: var(--text);
  text-wrap: balance;
}
.h2 { margin: 0; font: 400 19px/1.2 var(--logo-font); color: var(--text); }
.lede { margin: 0 0 18px; font-size: 13px; color: var(--text-2); max-width: 60ch; }
.muted { color: var(--text-dim); }

/* Home */
.home {
  display: grid; min-height: 0; container-type: size;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "text photo" "films films";
  gap: 20px 32px; align-items: center;
}
.home .h1 { font-size: 32px; }
.home__text { grid-area: text; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-height: 0; }
.home__photo { grid-area: photo; min-height: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
.home__photo img { width: 100%; aspect-ratio: 3 / 2; max-height: calc(100cqh - 170px); object-fit: cover; object-position: 40% 62%; padding: 9px; background: var(--mat); }
.home__photo figcaption { font-size: 10px; color: var(--text-dim); }
.home__films { grid-area: films; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--rule); }
.home__label { margin: 0; }
.home__label span { margin-left: 8px; font: 11px/1 var(--body-font); color: var(--text-dim); }
.home__wall { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 10px; }
.home__wall button { position: relative; display: block; padding: 5px; border: 0; cursor: pointer; background: var(--mat); aspect-ratio: 4 / 3; overflow: hidden; }
.home__wall img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.home__wall button:hover { background: var(--green); }

/* ---------- Deck ---------- */

.deck { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(250px, 1fr); gap: 20px; align-items: stretch; min-height: 0; }
.deck__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.set { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.tube { flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; }
.deck__side { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; overflow: hidden; }

.monitor {
  position: relative;
  width: min(100cqw, calc((100cqh - 70px) * 4 / 3 + 44px));
  padding: 20px 22px 50px;
  border-radius: 16px 16px 10px 10px;
  background: var(--tv);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.16), inset 0 -3px 0 rgba(0,0,0,.45), 0 14px 22px -8px rgba(0,0,0,.45);
}
.monitor .screen { box-shadow: 0 0 0 7px #0d0d0d, 0 0 0 8px var(--tv-rim), inset 0 0 0 3px #0a0b0c; }
/* Speaker grille */
.monitor::before {
  content: ""; position: absolute; left: 24px; bottom: 15px; width: 34%; height: 21px;
  background: repeating-linear-gradient(90deg, var(--tv-grille) 0 3px, transparent 3px 6px);
  border-radius: 2px; opacity: .9;
}
/* Power light */
.monitor::after {
  content: ""; position: absolute; right: 24px; bottom: 22px; width: 7px; height: 7px; border-radius: 50%;
  background: #7a1d16;
}
.monitor:has(.screen:not(.is-standby))::after { background: #4fe07a; box-shadow: 0 0 6px #4fe07a; }
/* Full screen button on the TV, to the left of the power light */
.tv__controls { position: absolute; right: 42px; bottom: 14px; display: flex; align-items: center; gap: 7px; }
.tv__label { font: 700 7px/1 "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: .14em; color: var(--tv-label); }
.tv__btn {
  display: grid; place-items: center; width: 30px; height: 20px; padding: 0; cursor: pointer;
  border: 0; border-radius: 3px;
  background: var(--tv-btn);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 0 #000, 0 2px 3px rgba(0,0,0,.5);
  color: var(--tv-btn-ink);
}
.tv__btn svg { width: 15px; height: 9px; }
.tv__btn:hover { filter: brightness(1.1); }
.tv__btn:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
.tv__btn[aria-pressed="true"] { color: #74f7e4; }
.tv__btn[data-cmd="power"][aria-pressed="true"] { color: #4fe07a; }
.tv__label + .tv__btn + .tv__label { margin-left: 6px; }
.screen {
  position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: 22px / 18px;
  background: #000;
  box-shadow: inset 0 0 0 3px #0a0b0c;
}
.picture { position: absolute; inset: 0; transform-origin: center; }
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.screen__bars {
  position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(90deg, #c0c0c0 0 14.28%, #c0c000 0 28.57%, #00c0c0 0 42.85%, #00c000 0 57.14%, #c000c0 0 71.42%, #c00000 0 85.71%, #0000c0 0) top / 100% 67% no-repeat,
    linear-gradient(90deg, #0000c0 0 14.28%, #131313 0 28.57%, #c000c0 0 42.85%, #131313 0 57.14%, #00c0c0 0 71.42%, #131313 0 85.71%, #c0c0c0 0) 0 67% / 100% 8% no-repeat,
    linear-gradient(90deg, #00214c 0 17.86%, #fff 0 35.71%, #32006a 0 53.57%, #131313 0 71.43%, #090909 0 76.19%, #131313 0 80.95%, #1d1d1d 0 85.71%, #131313 0) bottom / 100% 25% no-repeat;
}
.screen.is-loaded .screen__bars { display: none; }
.screen__scan {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.2) 0 1px, transparent 1px var(--scan, 3px)),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%),
    linear-gradient(160deg, rgba(255,255,255,.12) 0%, transparent 35%);
}
.screen.is-off .picture { background: var(--nosig); }
.screen.is-off .picture > * { visibility: hidden; }
.screen.is-standby .picture, .screen.is-standby .osd, .screen.is-standby .trick { visibility: hidden; }
.screen.is-off .osd { opacity: 0; }
/* No picture from the machine: a VHS recorder's blue screen, black from a broadcast VTR. In standby, dark glass. */
:root { --nosig: #1630c4; }
:root[data-machine="vtr"] { --nosig: #000; }
.screen.is-standby { background: radial-gradient(ellipse at 42% 38%, #343937, #141716 72%); }
:root[data-machine="vhs"] .vtr-only, :root[data-machine="vtr"] .vhs-only { display: none !important; }
:root[data-machine="vhs"] .seg7 .k5, :root[data-machine="vhs"] .vfd__ch:nth-child(n+3) { display: none; }
.vfd__ch b { font-weight: inherit; }


/* Effects off: a plain picture */
.screen.is-clean { border-radius: 4px; }
.screen.is-clean .screen__scan, .screen.is-clean .glow { display: none; }
/* The dot of light left on the phosphor at switch-off */
.glow {
  position: absolute; z-index: 2; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, #fff 0 18%, rgba(200,230,255,.55) 35%, transparent 70%);
}

/* Trick play on a two-head VHS machine. A paused frame shows one band of noise near the bottom and
   bounces a line at field rate. In picture search the noise bars sit at even spacing and drift slowly.
   While the picture locks after PLAY, one tracking bar rolls through and the colour comes in late. */
.trick { position: absolute; inset: 0; z-index: 3; pointer-events: none; display: none; overflow: hidden; }
.trick__bars { position: absolute; inset: 0; }
.trick i {
  position: absolute; left: 0; right: 0; top: 80%; height: 6%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9 .05' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='2.2 0 0 0 -.6 2.2 0 0 0 -.6 2.2 0 0 0 -.6 0 0 0 0 .9'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 160px 60px;
  -webkit-mask: linear-gradient(transparent, #000 35%, #000 65%, transparent);
          mask: linear-gradient(transparent, #000 35%, #000 65%, transparent);
  animation: trick-hiss .2s steps(4) infinite;
}
.screen.is-still .trick, .screen.is-search .trick, .screen.is-lock .trick { display: block; }
.screen.is-still video { animation: still-shake .08s steps(2) infinite; }
.screen.is-search .trick i { top: calc((var(--k) - 1) * 100% / var(--n) - 3%); height: 6%; }
.screen.is-search .trick__bars { animation: bar-drift 4s linear infinite; }
.screen.is-rew .trick__bars { animation-direction: reverse; }
.screen.is-search video { animation: search-tear .12s steps(2) infinite; filter: saturate(.8) contrast(1.1); }
.screen.is-lock:not(.is-still):not(.is-search) .trick i { animation: trick-hiss .2s steps(4) infinite, lock-roll .8s ease-in both; }
.screen.is-lock video { animation: lock-colour 1s steps(5) both; }
@keyframes trick-hiss { 25% { background-position: -47px 13px; } 50% { background-position: 29px -21px; } 75% { background-position: -13px 31px; } 100% { background-position: 41px -7px; } }
@keyframes bar-drift { to { transform: translateY(calc(100% / var(--n))); } }
@keyframes still-shake { 50% { transform: translateY(.3%); } }
@keyframes search-tear { 50% { transform: translateX(-.5%) skewX(.4deg); } }
@keyframes lock-roll { from { top: 100%; } to { top: -8%; } }
@keyframes lock-colour { from { filter: saturate(0) contrast(1.2); transform: translateY(-1%); } 60% { filter: saturate(0); transform: none; } to { filter: none; transform: none; } }

/* The machine's on-screen display: mode in the top corner, white with a hard shadow */
.mode {
  position: absolute; z-index: 4; left: 7%; top: 8%;
  color: #fff; font: 700 clamp(11px, 2.1vw, 20px)/1 "Courier New", monospace; letter-spacing: .06em; white-space: nowrap;
  text-shadow: 2px 2px 0 #000, 0 0 3px #000; pointer-events: none; opacity: 0;
}
.mode.is-on { opacity: .95; }
.screen.is-standby .mode, .screen.is-off .trick,
.screen.is-clean .mode, .screen.is-clean .trick { display: none; }
/* A broadcast VTR: clean stills and search, no consumer mode display */
:root[data-machine="vtr"] .trick, :root[data-machine="vtr"] .mode { display: none !important; }
:root[data-machine="vtr"] .screen video { animation: none !important; filter: none !important; }
@media (prefers-reduced-motion: reduce) {
  .trick i, .trick__bars, .screen video { animation: none !important; }
}

/* Full screen: the set covers the window, the TV grows to fill it and the deck stays underneath */
.set.is-full {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; gap: 10px;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: #000;
}
.set.is-full .tube { display: flex; align-items: stretch; container-type: normal; }
.set.is-full .monitor { flex: 1; width: auto; min-height: 0; display: flex; flex-direction: column; }
.set.is-full .screen { flex: 1; min-height: 0; width: auto; aspect-ratio: auto; border-radius: 2.5vw / 2vw; }
.set.is-full .screen.is-clean { border-radius: 0; }
.set.is-full .controls { width: min(100%, 900px); align-self: center; }
body.has-full .scene { animation: none; filter: none; }

/* The deck panel, after a 1990s broadcast VTR: charcoal panel, a fluorescent display,
   pale rectangular keys with lamps, a jog and shuttle dial. */
.controls {
  --vfd: #74f7e4;
  --vfd-dim: rgba(116, 247, 228, .09);
  --panel-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  flex: none; display: grid; gap: 12px;
  padding: 12px 16px 14px; border-radius: 6px;
  background: var(--deck);
  border: 1px solid var(--deck-line);
  box-shadow: inset 0 1px 0 var(--deck-hi);
}
.panel__top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding-bottom: 8px; }

/* Fluorescent display behind smoked glass */
.vfd {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 16px; row-gap: 6px; align-items: center;
  padding: 10px 14px; border-radius: 3px;
  background: radial-gradient(ellipse at 30% 0%, #0c1a1b, #030708 70%);
  box-shadow: inset 0 0 0 1px #000, inset 0 3px 10px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.08);
  color: var(--vfd);
}
.vfd__flags { grid-column: 1 / -1; display: flex; gap: 12px; font: 700 9px/1 var(--panel-font); letter-spacing: .12em; color: var(--vfd-dim); }
.vfd__flags .on { color: var(--vfd); text-shadow: 0 0 4px var(--vfd); }
.vfd__status { margin-left: auto; color: var(--vfd) !important; text-shadow: 0 0 4px var(--vfd); }
.seg7 { width: clamp(150px, 22vw, 210px); height: auto; display: block; filter: drop-shadow(0 0 3px rgba(116, 247, 228, .5)); }
.seg7 polygon { fill: var(--vfd-dim); }
.seg7 .on { fill: var(--vfd); }
.vfd__meters { display: grid; gap: 3px; min-width: 0; }
.vfd__ch { display: grid; grid-template-columns: 26px repeat(20, minmax(0, 1fr)); gap: 2px; align-items: center; font: 700 8px/1 var(--panel-font); letter-spacing: .06em; }
.vfd__ch span { color: var(--vfd); opacity: .8; }
.vfd__ch i { height: 5px; background: var(--vfd-dim); }
.vfd__ch i.on { background: var(--vfd); box-shadow: 0 0 3px var(--vfd); }
.vfd__ch i:nth-child(n+19).on { background: #ff9b6a; box-shadow: 0 0 3px #ff9b6a; }
.vfd__scale { display: flex; justify-content: space-between; padding-left: 28px; font: 7px/1 var(--panel-font); color: var(--vfd); opacity: .55; }

/* Jog and shuttle dial: an outer ridged ring and an inner wheel with a finger dimple */
.jog { position: relative; width: 96px; aspect-ratio: 1; }
.jog__ring {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, #1d1e20 0 4deg, #3b3d40 4deg 8deg),
    #2a2b2d;
  box-shadow: 0 3px 6px rgba(0,0,0,.6), inset 0 0 0 1px #000;
}
.jog__ring::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #151617; box-shadow: inset 0 1px 2px #000; }
.jog__wheel {
  position: absolute; inset: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #5c5f63, #2f3134 55%, #1f2022);
  box-shadow: 0 2px 4px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.2);
}
.jog__dimple {
  position: absolute; top: 16%; left: 58%; width: 18%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 60% 65%, #4a4d51, #1a1b1d);
  box-shadow: inset 0 2px 3px rgba(0,0,0,.8);
}
.jog__label { position: absolute; left: 0; right: 0; bottom: -14px; text-align: center; font: 700 7px/1 var(--panel-font); letter-spacing: .2em; color: var(--deck-label); }

/* Keys: label printed on the panel above a pale key with a lamp */
.panel__keys { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; justify-content: space-between; }
.transport { display: flex; gap: 8px; align-items: end; }
.key--play .key__face { width: 66px; }
.key__label { font: 700 7px/1 var(--panel-font); letter-spacing: .12em; color: var(--deck-label); white-space: nowrap; }
.key {
  display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 700 8px/1 var(--panel-font); letter-spacing: .1em; color: var(--deck-label);
}
.key__icon { position: absolute; left: 50%; bottom: 4px; width: 18px; height: 11px; transform: translateX(-50%); fill: #2b2c2e; color: #2b2c2e; }
.key--small .key__icon { bottom: 3px; width: 15px; height: 9px; fill: #d5d8da; color: #d5d8da; }
.key:hover .key__icon { fill: #000; color: #000; }
.key--small:hover .key__icon { fill: #fff; color: #fff; }
.key__face {
  position: relative; display: block; width: 46px; height: 26px; border-radius: 2px;
  background: linear-gradient(180deg, #f1f0ea, #d6d5ce);
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 #9e9d97, 0 0 0 1px #8c8b86, 0 2px 2px rgba(0,0,0,.25);
  transition: transform .06s;
}
.key--small .key__face { width: 34px; height: 20px; background: linear-gradient(180deg, #6a6d71, #4d5054); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 0 -2px 0 #2b2d30, 0 2px 0 #111; }
.key--eject .key__face { width: 38px; }
.key__lamp { position: absolute; left: 7px; right: 7px; top: 5px; height: 3px; border-radius: 1px; background: #6d6c66; box-shadow: inset 0 1px 1px rgba(0,0,0,.4); }
.key--small .key__lamp { top: 4px; background: #2e3033; }
.key[aria-pressed="true"] .key__lamp { background: #ffb63c; box-shadow: 0 0 6px #ffb63c; }
.key--play[aria-pressed="true"] .key__lamp { background: #5dff7a; box-shadow: 0 0 6px #5dff7a; }
.key--small[aria-pressed="true"] .key__lamp { background: #74f7e4; box-shadow: 0 0 6px #74f7e4; }
.key:hover { color: #fff; }
.key:active .key__face { transform: translateY(2px); box-shadow: inset 0 1px 0 #f2f1ec, inset 0 -1px 0 #8d8c86, 0 0 0 #111; }
.key:focus-visible { outline: none; }
.key:focus-visible .key__face { outline: 2px solid var(--vfd); outline-offset: 2px; }

/* Tape position */
.scrub { width: 100%; height: 6px; margin: 0; accent-color: #74f7e4; cursor: pointer; }

/* Superimposed timecode, white on a black box, as a VTR's character output puts it on the monitor */
.osd {
  position: absolute; z-index: 4; left: 50%; bottom: 7%; transform: translateX(-50%);
  padding: 3px 7px 2px; background: #000; color: #fff;
  font: clamp(11px, 1.8vw, 16px)/1 "Courier New", monospace; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.screen.is-playing .osd { opacity: .92; }
/* A VHS machine's counter: plain characters with a hard shadow, bottom right */
:root[data-machine="vhs"] .osd { left: auto; right: 7%; transform: none; background: none; text-shadow: 2px 2px 0 #000, 0 0 3px #000; }
.screen.is-clean .osd { display: none; }

@media (max-width: 560px) {
  .panel__top { grid-template-columns: minmax(0, 1fr); }
  .vfd { grid-template-columns: minmax(0, 1fr); }
  .seg7 { width: 100%; max-width: 230px; }
  .jog { display: none; }
  .transport { gap: 5px; flex-wrap: wrap; }
  .key__face { width: 40px; }
}

.info { flex: 0 1 auto; min-height: 0; overflow: hidden; display: grid; align-content: start; gap: 6px; }
.info p { margin: 0; color: var(--text-2); }
.info .info__meta { color: var(--green); font-size: 11px; }

/* Tape rack: a stack of VHS cassettes, spine out */
.rack {
  flex: 1 1 0; min-height: 0; overflow: hidden;
  display: grid; grid-auto-rows: minmax(30px, 50px); align-content: start; gap: 5px; padding: 10px 10px 10px 18px;
  background: var(--well);
  border: 1px solid var(--rule);
}
.tape {
  display: flex; gap: 8px; align-items: stretch;
  width: 100%; min-height: 0; padding: 5px 9px 5px 6px; cursor: pointer; text-align: left;
  border: 0; border-radius: 2px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 1px, transparent 1px 4px) left / 18px 100% no-repeat,
    repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 1px, transparent 1px 4px) right / 18px 100% no-repeat,
    linear-gradient(180deg, #2e2e2d, #161615 70%, #0e0e0d);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.13), 0 1px 0 rgba(0,0,0,.5), 0 2px 3px rgba(0,0,0,.25);
  transition: transform .2s ease, box-shadow .2s;
}
.tape:hover { transform: translateX(-5px); }
.tape[aria-pressed="true"] { transform: translateX(-12px); box-shadow: inset 0 1px 0 rgba(255,255,255,.13), 0 0 0 2px var(--green), 0 2px 4px rgba(0,0,0,.3); }
.tape__thumb { flex: none; width: 46px; height: 100%; object-fit: cover; border: 1px solid #000; display: block; }
.tape__label {
  flex: 1; display: flex; align-items: center; min-width: 0;
  padding: 0 10px; border-radius: 1px;
  background: repeating-linear-gradient(180deg, #f6f3e8 0 9px, #d6dfe8 9px 10px);
  color: #1c1c1c;
}
.tape__title { min-width: 0; font: 15px/1.1 var(--hand-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tape__dur { flex: none; align-self: center; font: 10px/1 var(--body-font); color: #d8d8d6; font-variant-numeric: tabular-nums; }

/* Portrait Films */
.pf-intro { display: grid; gap: 10px; flex: none; }
.pf-intro .lede { margin: 0; font-size: 13px; }
.pf-head { border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px #c9cdd1; }
.pf-head img { display: block; width: 100%; }
.deck--portrait .tape__title { font: italic 13px/1.15 var(--serif); }

/* Alf */
.alf__side { display: grid; gap: 18px; padding-top: 12px; flex: none; }
.quote {
  position: relative; margin: 0; padding: 18px 18px 14px 20px;
  background: #e9dfc6; color: #2b2418; font: italic 14px/1.6 var(--serif);
  box-shadow: 0 4px 10px rgba(0,0,0,.2); transform: rotate(-1deg);
}
.quote::before {
  content: ""; position: absolute; top: -10px; left: 40%; width: 86px; height: 20px;
  background: rgba(255,255,230,.55); transform: rotate(3deg);
}
.quote cite { display: block; margin-top: 10px; font: normal 11px/1.3 var(--body-font); color: #5b5040; }
.alf__bio { margin: -8px 0 0; font-size: 12px; line-height: 1.55; color: var(--text-2); }
.alf__bio cite { font-style: italic; }
.dday { margin: 0; font: 48px/1 var(--serif); color: var(--text); letter-spacing: -.02em; }

/* Clients */
.clients { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: stretch; min-height: 0; }
.clients__pics { display: grid; gap: 12px; align-content: start; min-height: 0; overflow: hidden; }
.credits {
  position: relative; height: 100%; min-height: 0; container-type: size; overflow: hidden; background: var(--well); border: 1px solid var(--rule);
  mask-image: linear-gradient(transparent, #000 15%, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 15%, #000 85%, transparent);
}
.credits__roll { position: absolute; left: 0; right: 0; top: 100%; text-align: center; animation: roll 40s -8s linear infinite; }
.credits:hover .credits__roll { animation-play-state: paused; }
@keyframes roll { to { transform: translateY(calc(-100% - 100cqh)); } }
.credits__roll p { margin: 0 0 14px; font: 16px/1.2 var(--logo-font); color: var(--text); letter-spacing: .05em; }
.credits__roll .role { font: 700 10px/1 var(--body-font); letter-spacing: .15em; color: var(--green); margin: 30px 0 12px; text-transform: uppercase; }
.testimonials { display: grid; gap: 18px; align-content: center; min-height: 0; overflow: hidden; }
.testimonial { margin: 0; }
.testimonial blockquote { margin: 0; font: italic 13px/1.55 var(--serif); color: var(--text); }
.testimonial figcaption { margin-top: 6px; font-size: 11px; color: var(--green); }

/* About */
.viewfinder { position: relative; background: #000; overflow: hidden; }
.viewfinder img { display: block; width: 100%; }
.vf { position: absolute; inset: 0; pointer-events: none; font: 18px/1 var(--lcd-font); color: #fff; text-shadow: 1px 1px 0 #000; }
.vf__corner { position: absolute; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.9); }
.vf__corner--tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.vf__corner--tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.vf__corner--bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.vf__corner--br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
.vf__rec { position: absolute; top: 15px; left: 38px; }
.vf__rec::before { content: "\25CF "; color: var(--red); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.photo-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.photo-strip img { display: block; width: 100%; }
.photo-strip--one { grid-template-columns: 1fr; }
.photo-strip--one img { aspect-ratio: 16 / 7; object-fit: cover; object-position: 50% 45%; }
.photo-strip figcaption { grid-column: 1 / -1; font-size: 11px; color: var(--text-dim); }

/* Archive: the old websites on the monitor */
.screen--web { background: #fff; }
.webpage { position: absolute; inset: 0; overflow: hidden; background: #fff; }
.webpage--scroll { overflow-y: auto; display: grid; align-content: start; }
.webpage--scroll img { display: block; width: 100%; }
.replica {
  position: absolute; left: 0; top: 0; width: 700px; height: 550px;
  transform: translateY(-20px) scale(var(--s, 1)); transform-origin: 0 20px;
  background: url(../img/original/background2.gif) no-repeat left top;
  font-family: Verdana, Arial, Helvetica, sans-serif; color: #000;
}
.replica__nav { position: absolute; left: 25px; top: 66px; font-size: 11px; color: #333; }
.replica__nav span { padding: 0 4px; }
.replica__img { position: absolute; left: 25px; top: 96px; }
.replica__text { position: absolute; left: 25px; top: 392px; width: 475px; margin: 0; font-size: 12px; line-height: 1.4; }
.screen--web .screen__scan { opacity: .45; }
.links { display: grid; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.archive .info .muted { margin-top: 4px; font-size: 12px; }

/* ---------- Footer ---------- */

.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--rule); font-size: 11px; color: var(--text-dim); }
.foot p { margin: 0; }
.foot__switches { display: flex; gap: 6px; }
.sound-toggle {
  background: var(--btn); border: 1px solid var(--btn-line); color: var(--text-2); cursor: pointer;
  font: 10px/1 var(--body-font); padding: 5px 9px;
}
.sound-toggle[aria-pressed="true"] { color: var(--green); border-color: var(--green); }

/* ---------- Small screens ---------- */

@media (max-height: 800px) { .photo-strip--one { display: none; } }

@media (max-height: 760px) { #deck-alf .info p:not(.info__meta) { display: none; } }

/* Short windows: a tighter panel */
@media (max-height: 760px) {
  .controls { gap: 9px; padding: 9px 14px 11px; }
  .panel__top { padding-bottom: 2px; }
  .vfd { padding: 7px 12px; row-gap: 4px; }
  .jog { width: 78px; }
  .key__face { height: 24px; }
}
@media (max-height: 680px) and (min-width: 821px) {
  .chassis { margin: 6px auto; height: calc(100vh - 12px); height: calc(100dvh - 12px); padding-top: 10px; padding-bottom: 6px; }
  .top { margin-bottom: 8px; }
  .badge-logo svg { width: 112px; }
  .stage { padding: 12px 16px; }
  .foot { margin-top: 5px; }
  .jog { display: none; }
  .set { gap: 8px; }
  .rack { grid-auto-rows: minmax(26px, 46px); gap: 4px; padding: 8px 8px 8px 16px; }
  .deck__side { gap: 10px; }
  .pf-intro .lede { display: none; }
  .alf__side { gap: 10px; padding-top: 8px; }
  .quote { font-size: 13px; line-height: 1.5; }
  .dday { font-size: 34px; }
}

@media (max-width: 820px) {
  .chassis { padding: 12px 10px 8px; margin: 6px auto; height: calc(100vh - 12px); height: calc(100dvh - 12px); }
  .screw { display: none; }
  .top { gap: 8px; }
  .badge-logo svg { width: 86px; }
  .nav { gap: 5px; }
  .nav .chrome { padding: 3px 6px; font-size: 11px; }
  .stage { padding: 10px; }
  .home { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; grid-template-areas: "text" "films"; gap: 18px; align-items: start; align-content: start; }
  .home__films { padding-top: 10px; overflow: hidden; }
  .home__label span { display: none; }
  .home .h1 { font-size: 20px; margin-bottom: 8px; }
  .home .lede { font-size: 13px; margin-bottom: 12px; }
  .home__photo { display: none; }
  .home__wall { grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, calc((100cqh - 150px) * 4 / 3)); align-self: center; }
  .deck { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 10px; }
  .deck__side { gap: 8px; }
  .info p:not(.info__meta), .info .links, .pf-intro .lede, .quote cite { display: none; }
  .pf-head { display: none; }
  .rack { flex: none; grid-auto-flow: column; grid-auto-columns: 180px; grid-auto-rows: 42px; overflow-x: auto; padding: 8px; }
  .tape:hover, .tape[aria-pressed="true"] { transform: none; }
  .alf__side { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding-top: 4px; }
  .quote { font-size: 12px; padding: 10px 12px; max-height: 7.5em; overflow: hidden; }
  .dday { font-size: 26px; }
  .alf__bio { display: none; }
  .clients { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
  .clients__pics { grid-column: 1 / -1; grid-template-columns: 1.5fr 2fr; align-items: start; }
  .photo-strip figcaption { display: none; }
  .photo-strip--one { display: none; }
  .testimonials { gap: 10px; align-content: start; }
  .testimonial blockquote { font-size: 11.5px; line-height: 1.45; }
  .controls { gap: 8px; padding: 9px 10px 10px; }
  .vfd__meters, .foot p { display: none; }
  .seg7 { max-width: 200px; }
  .panel__keys { flex-wrap: nowrap; gap: 8px; }
  .transport { gap: 4px; flex-wrap: nowrap; }
  .key__face { width: 33px; }
  .key--play .key__face { width: 46px; }
  .key--small .key__face { width: 30px; }
  .key__label { font-size: 6px; letter-spacing: .06em; }
  .nav li + li::before { content: none; }
  .foot { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .credits__roll { position: static; animation: none; padding: 10px 0; }
  .credits { overflow-y: auto; mask-image: none; -webkit-mask-image: none; }
}
