/* Dmitry Orlov
   A CRT in a night garage. Sections are TV channels. Numbers glow like the
   vacuum fluorescent cluster of an 80s Japanese car. */

@font-face { font-family: "Druk Wide"; src: url("fonts/DrukWideCyr-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/IBMPlexMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/IBMPlexMono-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }

:root {
  --bg: #0c0b0a;
  --t1: #efe9df;
  --t2: #a39b8f;
  --t3: #6a645b;
  --line: rgba(239, 233, 223, .1);
  --line-2: rgba(239, 233, 223, .2);
  --vfd: #5cf6c6;
  --vfd-ghost: rgba(92, 246, 198, .08);
  --amber: #ffb54a;
  --red: #ff4b3a;
  --paper: #ece6da;
  --ink: #1b1916;
  --ink-2: #514b42;
  --wide: "Druk Wide", "Arial Black", sans-serif;
  --mono: "Plex Mono", "Consolas", monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: #000; color: var(--t1); font-family: var(--mono); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
.defs { position: absolute; width: 0; height: 0; }
.cap { font-size: 11px; line-height: 1; color: var(--t3); letter-spacing: .02em; }
:focus-visible { outline: 2px solid var(--vfd); outline-offset: 3px; }

/* ---------- the TV ---------- */
.tv { position: fixed; inset: 0; background: #000; }
.screen { position: absolute; inset: 0; background: #050505; overflow: hidden; }
.screen.curved { filter: url(#crt); }
/* on the curved glass the pointer is tracked by site.js (class .h), so native cursors would sit in the wrong place */
.screen.curved * { cursor: inherit !important; }
.picture { position: absolute; inset: 0; background: var(--bg); transform-origin: 50% 50%; opacity: 0; }
.picture.live { opacity: 1; }
.scroller { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; outline: none; scroll-snap-type: y proximity; }
.scroller::-webkit-scrollbar { display: none; }

.scan { position: absolute; inset: 0; pointer-events: none; z-index: 20; background: repeating-linear-gradient(180deg, rgba(0, 0, 0, .24) 0 1px, transparent 1px 3px); }
.grain { position: absolute; inset: 0; pointer-events: none; z-index: 21; opacity: .08; mix-blend-mode: screen; background-size: 256px 256px; transition: opacity .06s linear; }
.screen.static .grain { opacity: .7; mix-blend-mode: normal; }
.screen.static .picture { animation: roll .18s steps(3) 1; }
@keyframes roll { 0% { transform: translateY(0); } 33% { transform: translateY(-3%); } 66% { transform: translateY(2%); } 100% { transform: none; } }

.glass {
  position: absolute; inset: 0; pointer-events: none; z-index: 40;
  box-shadow: inset 0 0 160px rgba(0, 0, 0, .5);
  background: radial-gradient(120% 70% at 30% 0%, rgba(255, 255, 255, .045), transparent 50%);
}

/* ---------- power on ---------- */
/* The TV is off: dark glass with a faint warm afterglow, and the set's front panel —
   a real push button, a red standby LED and a small mute key.
   Colours from the CRT kit: asphalt #0B0B0D, slate #16161B, paper #EAE6DF, acid lime #CCFF00, MTA red #FF3B30. */
.standby {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 50% 46%, rgba(234, 230, 223, .05) 0, rgba(234, 230, 223, .015) 18%, transparent 42%),
    #0b0b0d;
}
.standby.gone { display: none; }
.panel {
  display: flex; align-items: flex-end; gap: 40px;
  padding: 28px 40px 22px;
  background: linear-gradient(180deg, #1c1c22 0%, #16161b 55%, #121216 100%);
  border-radius: 10px;
  box-shadow:
    inset 0 1px 0 rgba(234, 230, 223, .08),
    inset 0 -1px 0 rgba(0, 0, 0, .6),
    0 0 0 1px #050506,
    0 18px 40px rgba(0, 0, 0, .7);
}
.pwr { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.mark {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; line-height: 1; letter-spacing: .14em; text-transform: uppercase; color: #6f6c67;
}
.led {
  width: 6px; height: 6px; border-radius: 50%;
  background: #ff3b30; box-shadow: 0 0 6px 1px rgba(255, 59, 48, .7);
  animation: standby-blink 2.4s ease-in-out infinite;
}
@keyframes standby-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.standby.waking .led { animation: none; background: #ccff00; box-shadow: 0 0 8px 2px rgba(204, 255, 0, .7); }
@media (max-width: 800px) { .panel { gap: 32px; padding: 24px 32px 20px; } }

/* the power button: a round plastic cap sunk into a ring */
.power {
  position: relative; width: 76px; height: 76px; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #2a2a31 0%, #1a1a1f 60%, #121216 100%);
  color: #eae6df;
  box-shadow:
    0 0 0 6px #0b0b0d,
    0 0 0 7px rgba(234, 230, 223, .07),
    inset 0 1px 0 rgba(234, 230, 223, .14),
    inset 0 -3px 6px rgba(0, 0, 0, .55),
    0 6px 0 #070709,
    0 10px 18px rgba(0, 0, 0, .6);
  transition: transform .08s ease, box-shadow .08s ease, color .16s var(--ease);
}
.power svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.power.h { color: #ccff00; }
.power.h svg { filter: drop-shadow(0 0 4px rgba(204, 255, 0, .55)); }
.power:active, .power.down {
  transform: translateY(5px);
  box-shadow:
    0 0 0 6px #0b0b0d,
    0 0 0 7px rgba(234, 230, 223, .07),
    inset 0 2px 6px rgba(0, 0, 0, .6),
    0 1px 0 #070709,
    0 3px 8px rgba(0, 0, 0, .5);
}

/* the mute key: a small rectangular rocker */
.mute {
  width: 40px; height: 22px; padding: 0; cursor: pointer; margin-bottom: 27px;
  border: 0; border-radius: 4px;
  background: linear-gradient(180deg, #2a2a31, #17171c);
  box-shadow:
    0 0 0 4px #0b0b0d,
    0 0 0 5px rgba(234, 230, 223, .07),
    inset 0 1px 0 rgba(234, 230, 223, .12),
    0 3px 0 #070709;
  transition: transform .08s ease, box-shadow .08s ease;
}
.mute.h { background: linear-gradient(180deg, #33333b, #1c1c22); }
.mute:active, .mute.down { transform: translateY(3px); box-shadow: 0 0 0 4px #0b0b0d, 0 0 0 5px rgba(234, 230, 223, .07), inset 0 2px 4px rgba(0, 0, 0, .6), 0 0 0 #070709; }
.standby .power:focus-visible, .standby .mute:focus-visible { outline: 2px solid #ccff00; outline-offset: 10px; }

.picture.boot { animation: boot .9s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes boot {
  0%   { opacity: 1; transform: scale(1, .003); filter: brightness(8) saturate(0); }
  25%  { transform: scale(1, .003); filter: brightness(8) saturate(0); }
  55%  { transform: scale(1, 1.03); filter: brightness(2.2) saturate(.4); }
  100% { opacity: 1; transform: none; filter: none; }
}


/* seven-segment digits drawn by site.js */
.vfd { display: inline-flex; height: 30px; color: var(--vfd); filter: drop-shadow(0 0 4px rgba(92, 246, 198, .55)); }
.vfd.dim { opacity: .5; }
.vfd svg { height: 100%; width: auto; }
.vfd .s { fill: currentColor; }
.vfd .s.off { opacity: .08; }

/* ---------- channels ---------- */
.ch { position: relative; scroll-snap-align: start; }
.ch.hero { min-height: 100%; }

/* CH 1: name split around the reel */
.hero {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: clamp(20px, 2.4vw, 40px);
  align-content: center;
  padding: 72px clamp(36px, 4vw, 64px) 48px;
}
.split { display: contents; }
.split span {
  font-family: var(--wide); font-weight: 700; text-transform: uppercase;
  font-size: min(4.4vw, 9vh); line-height: .9; letter-spacing: -.01em;
  grid-row: 1; white-space: nowrap;
}
.split .l { grid-column: 1; justify-self: end; }
.split .r { grid-column: 3; justify-self: start; }

/* video frame: plain, slightly rounded, one soft shadow.
   z-index lifts videos above the scanlines and grain, so the CRT layer does not colour them */
.reel, .work .frame {
  position: relative; z-index: 25;
  border-radius: 3px; overflow: hidden; background: #000; cursor: pointer;
  box-shadow: 0 24px 48px rgba(0, 0, 0, .6);
}
.reel video, .work video { border-radius: 3px; }

/* Work videos: the .frame is an empty placeholder, the video sits on a flat layer above the glass */
.screen.curved .work .frame { background: transparent; box-shadow: none; }
.vlayer { position: absolute; inset: 0; z-index: 35; overflow: hidden; pointer-events: none; }
.vbox {
  position: absolute; left: 0; top: 0; pointer-events: none;
  border-radius: 3px; overflow: hidden; background: #000;
  box-shadow: 0 24px 48px rgba(0, 0, 0, .6);
  will-change: transform;
}
.vbox video { width: 100%; height: 100%; object-fit: cover; }
.vbox .fs { pointer-events: auto; }
.vbox.h .fs { opacity: 1; }

/* small full-screen button in the corner of every video */
.fs {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  width: 28px; height: 28px; padding: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, .45); border: 0; border-radius: 3px; color: rgba(255, 255, 255, .8);
  cursor: pointer; opacity: .7; transition: opacity .16s var(--ease), background .16s var(--ease);
}
.fs svg { width: 14px; height: 14px; }
.reel.h .fs, .reel .fs.h, .fs:focus-visible { opacity: 1; }
.fs:hover, .fs.h { background: rgba(0, 0, 0, .7); color: #fff; }
.reel { grid-column: 2; grid-row: 1; height: min(calc(100vh - 200px), 53vw); aspect-ratio: 9 / 16; }
.reel video { width: 100%; height: 100%; object-fit: cover; }
.reel-hint { grid-column: 2; grid-row: 2; justify-self: center; margin: 20px 0 0; font-size: 12px; color: var(--t3); }

/* CH 2: two tapes, centred */
.work-ch { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 96px 48px 48px; }
.works { display: flex; justify-content: center; gap: clamp(32px, 5vw, 80px); }
.work { position: relative; height: min(calc(100vh - 260px), calc((100vw - 280px) / 3 * 16 / 9)); aspect-ratio: 9 / 16; }
.work .frame { width: 100%; height: 100%; }
.work video { width: 100%; height: 100%; object-fit: cover; }
.tape { position: absolute; width: 96px; height: 36px; top: -20px; left: 50%; margin-left: -48px; background: url("tex/tape.png") center / contain no-repeat; opacity: .9; }
.hint { margin: 0; font-size: 12px; color: var(--t3); }
.hint .on-phone { display: none; }

/* CH 3: about, a taped b/w print next to a few plain lines */
.about { display: flex; align-items: center; justify-content: center; padding: 72px 48px; }
.about-in { display: flex; align-items: center; justify-content: center; gap: clamp(40px, 6vw, 96px); width: min(1080px, 100%); }
.print {
  position: relative; flex: none; margin: 0;
  width: min(420px, 34vw, calc(100vh - 260px));
  padding: 14px 14px 48px;
  background: var(--paper) url("tex/paper.jpg") center / cover;
  background-blend-mode: multiply;
  border-radius: 2px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .65);
  transform: rotate(-2deg);
}
.print img { width: 100%; height: auto; filter: contrast(1.05); }
.about-text { max-width: 30ch; font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-size: clamp(17px, 1.6vw, 21px); line-height: 1.5; color: var(--t2); }
.about-text p { margin: 0 0 20px; }
.about-text .hi { font-family: var(--wide); font-weight: 700; font-size: clamp(22px, 2.6vw, 36px); line-height: 1.05; text-transform: uppercase; color: var(--t1); margin-bottom: 24px; }
.about-text .call { margin: 32px 0 0; color: var(--t1); }

/* CH 4: contact */
.contact { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 36px; padding: 72px 48px 40px; text-align: center; }
.big { font-family: var(--wide); font-weight: 700; text-transform: uppercase; font-size: min(9vw, 15vh); line-height: .9; transition: color .16s var(--ease); }
.big.h { color: var(--vfd); }
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.links a { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 4px; font-size: 14px; color: var(--t2); transition: color .16s var(--ease), border-color .16s var(--ease); }
.links a.h { color: var(--t1); border-color: var(--line-2); }
.fine { margin: 48px 0 0; font-size: 12px; color: var(--t3); }

/* ---------- small screens ---------- */
@media (max-width: 800px) {
  .scroller { scroll-snap-type: none; }
  .hero { grid-template-columns: 1fr; grid-template-rows: auto auto auto; row-gap: 20px; align-content: center; justify-items: center; padding: 80px 24px 40px; }
  .split { display: block; grid-column: 1; grid-row: 1; text-align: center; }
  .split span { display: block; font-size: 12.5vw; }
  .reel { grid-column: 1; grid-row: 2; height: auto; width: min(64vw, calc(52vh * 9 / 16)); }
  .reel-hint { grid-column: 1; grid-row: 3; margin: 0; }
  /* Work on a phone: one video at a time, swipe sideways, the next one peeks in */
  .work-ch { padding: 80px 0 40px; gap: 20px; }
  .works {
    width: 100%; justify-content: flex-start; gap: 16px;
    padding: 0 calc((100% - min(76vw, 360px)) / 2);
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .works::-webkit-scrollbar { display: none; }
  .hint .on-desk { display: none; }
  .hint .on-phone { display: inline; }
  .work { flex: none; height: auto; width: min(76vw, 360px); scroll-snap-align: center; }
  .about { padding: 80px 24px 48px; }
  .contact { padding: 56px 24px 32px; }
  .about-in { flex-direction: column; gap: 40px; text-align: center; }
  .print { width: min(72vw, 340px); padding: 10px 10px 36px; }
  .about-text { max-width: 34ch; }
}
@media (prefers-reduced-motion: reduce) {
  .picture.boot { animation: none; }
  .screen.static .picture { animation: none; }
  .grain { display: none; }
}
