/* ============================================================
   cemwebstudio — TV showcase
   Scroll-pinned CRT showcasing 3 works
   ============================================================ */

/* the section keeps overflow visible so pin works */
#work { overflow: visible; }

/* total scroll height: 3 channels × ~140vh worth of scroll */
.tv-stage {
  position: relative;
  height: 380vh;          /* total scroll budget for the pinned scene */
  margin-top: 2rem;
}

.tv-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 700px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(45,98,255,0.07), transparent 60%),
    var(--bg);
}

.tv-stage-inner {
  width: 100%;
  max-width: var(--maxw);
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 2rem;
  align-items: center;
}

/* ============================================================
   left rail — channel list + counter
   ============================================================ */
.tv-rail-l {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tv-counter {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  font-feature-settings: 'tnum' 1;
}
.tv-counter .now {
  font-size: 4.5rem;
  font-weight: 500;
  letter-spacing: -0.05em;
  color: var(--accent);
  line-height: 1;
  display: inline-block;
  min-width: 1.4em;
  text-align: right;
}
.tv-counter .sep {
  font-size: 2rem;
  color: var(--text-faint);
  line-height: 1;
}
.tv-counter .total {
  font-size: 1.5rem;
  color: var(--text-dim);
  letter-spacing: -0.02em;
}

.tv-ch-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-left: 0;
  border-left: 1px solid var(--border);
}
.tv-ch-list li {
  padding: 0.4rem 0 0.4rem 1rem;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  position: relative;
  transition: color 0.25s, padding-left 0.3s;
  cursor: pointer;
}
.tv-ch-list li::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 50%;
  width: 2px;
  height: 0%;
  background: var(--accent);
  transform: translateY(-50%);
  transition: height 0.3s;
}
.tv-ch-list li.active {
  color: var(--text);
  padding-left: 1.3rem;
}
.tv-ch-list li.active::before {
  height: 80%;
}
.tv-ch-list li .ch-no {
  color: var(--text-faint);
  margin-right: 0.5rem;
}
.tv-ch-list li.active .ch-no { color: var(--accent); }

.tv-rail-l .label {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tv-rail-l .label::before {
  content: '';
  width: 14px;
  height: 1px;
  background: var(--accent);
}

/* ============================================================
   The TV set
   ============================================================ */
.tv-set {
  position: relative;
  width: 100%;
  max-width: 920px;
  aspect-ratio: 16 / 11;
  margin: 0 auto;
  filter: drop-shadow(0 40px 60px rgba(0,0,0,0.5));
}

/* the bezel */
.tv-bezel {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 30% 0%, #2a2a35, #1a1a22 50%, #0e0e14 100%);
  padding: 38px 44px 56px 44px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 0 0 1px rgba(255,255,255,0.02),
    inset 0 -2px 8px rgba(0,0,0,0.5),
    0 0 0 1px var(--border);
}

/* perforated speaker grille on the bottom of the bezel */
.tv-bezel::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: 56%;
  height: 12px;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1.5px);
  background-size: 6px 6px;
  background-position: center;
  opacity: 0.8;
}

/* power LED bottom right */
.tv-bezel::after {
  content: '';
  position: absolute;
  right: 24px;
  bottom: 18px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulse 2s ease-in-out infinite;
}

/* brand label on bezel top-left */
.tv-label {
  position: absolute;
  top: 14px;
  left: 24px;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  gap: 0.8rem;
  align-items: center;
}
.tv-label .lcd {
  color: var(--accent);
  font-family: var(--mono);
  letter-spacing: 0.15em;
}

/* small physical knob on bezel */
.tv-knob {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #4a4a55, #1a1a22 70%);
  box-shadow:
    inset 0 -1px 1px rgba(0,0,0,0.6),
    inset 0 1px 1px rgba(255,255,255,0.06),
    0 0 0 1px rgba(0,0,0,0.5);
}
.tv-knob.k1 { top: 16px; right: 24px; }
.tv-knob.k2 { top: 16px; right: 48px; }

/* the screen window */
.tv-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow:
    inset 0 0 0 2px #050507,
    inset 0 0 30px rgba(0,0,0,0.9),
    inset 0 0 80px rgba(0,0,0,0.6);
  /* very subtle CRT curvature illusion via gradient */
  isolation: isolate;
}

/* channels stack — only one visible at a time */
.tv-channel {
  position: absolute;
  inset: 0;
  opacity: 0;
  display: grid;
  place-items: center;
  transform: scale(1.04);
  transition: filter 0.3s;
  z-index: 1;
}
.tv-channel.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}

/* channel content visuals */
.tv-shot {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* AYSA: warm cream/orange */
.tv-shot.aysa {
  background:
    radial-gradient(circle at 25% 30%, rgba(255,170,90,0.45), transparent 55%),
    radial-gradient(circle at 80% 75%, rgba(225,60,90,0.4), transparent 50%),
    linear-gradient(160deg, #2a1a14 0%, #1a1018 100%);
}
.tv-shot.aysa .word-mark {
  font-family: var(--mono);
  font-size: clamp(2.2rem, 5.5vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  color: #f4e6d4;
  text-align: center;
  line-height: 0.9;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 2rem;
}
.tv-shot.aysa .word-mark .sub {
  display: block;
  font-size: 0.28em;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(244,230,212,0.55);
  margin-top: 0.5em;
}

/* BLUEKIM: deep electric blue */
.tv-shot.bluekim {
  background:
    radial-gradient(circle at 75% 25%, rgba(80,180,255,0.5), transparent 55%),
    radial-gradient(circle at 15% 80%, rgba(20,80,220,0.6), transparent 55%),
    linear-gradient(160deg, #04102a 0%, #0a1638 100%);
}
.tv-shot.bluekim .word-mark {
  font-family: var(--mono);
  font-size: clamp(2.5rem, 6.5vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  color: #d8ecff;
  text-align: center;
  line-height: 0.9;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 2rem;
}
.tv-shot.bluekim .word-mark .sub {
  display: block;
  font-size: 0.28em;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(216,236,255,0.55);
  margin-top: 0.5em;
}

/* DR NEKİN: clean clinical light */
.tv-shot.drneki {
  background:
    radial-gradient(circle at 50% 30%, rgba(220,235,255,0.7), transparent 60%),
    linear-gradient(180deg, #e9eff5 0%, #f6f8fb 100%);
}
.tv-shot.drneki .word-mark {
  font-family: var(--mono);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #1a3a66;
  text-align: center;
  line-height: 0.95;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 2rem;
}
.tv-shot.drneki .word-mark .sub {
  display: block;
  font-size: 0.28em;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(26,58,102,0.55);
  margin-top: 0.5em;
}

/* tiny corner numbers within the shot */
.tv-shot .corner {
  position: absolute;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.55;
}
.tv-shot .corner.tl { top: 12px; left: 14px; }
.tv-shot .corner.tr { top: 12px; right: 14px; }
.tv-shot .corner.bl { bottom: 12px; left: 14px; }
.tv-shot .corner.br { bottom: 12px; right: 14px; }
.tv-shot.drneki .corner { color: #1a3a66; }
.tv-shot.aysa .corner   { color: #f4e6d4; }
.tv-shot.bluekim .corner{ color: #d8ecff; }

/* CRT overlays on top of the screen */
.tv-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* scanlines */
.tv-scanlines {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.0) 0,
    rgba(0,0,0,0.0) 2px,
    rgba(0,0,0,0.18) 3px,
    rgba(0,0,0,0.0) 4px
  );
  mix-blend-mode: multiply;
}

/* horizontal scan sweep */
.tv-scansweep {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.18), transparent);
  filter: blur(2px);
  animation: tvsweep 6s linear infinite;
}
@keyframes tvsweep {
  0%   { top: -5%;  opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { top: 110%; opacity: 0; }
}

/* vignette + glass curvature illusion */
.tv-vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,0,0,0.55) 100%),
    radial-gradient(ellipse at 30% 0%, rgba(255,255,255,0.06), transparent 40%);
}

/* glow halo around the screen */
.tv-glow {
  position: absolute;
  inset: -10px;
  border-radius: 18px;
  background: var(--accent);
  filter: blur(40px);
  opacity: 0.18;
  z-index: -1;
}

/* HUD overlay top of screen (channel/rec/time) */
.tv-hud {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  z-index: 6;
  color: rgba(255,255,255,0.78);
  text-shadow: 0 0 6px rgba(0,0,0,0.4);
  font-feature-settings: 'tnum' 1;
}
.tv-hud .rec {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.tv-hud .rec .dot {
  width: 7px; height: 7px;
  background: #ff3b3b;
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(255,59,59,0.7);
}
.tv-hud .ch-now { color: #ffffff; font-weight: 500; }
.tv-hud .time { color: var(--accent); }

/* bottom HUD: signal bars / volume */
.tv-hud-b {
  position: absolute;
  bottom: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  z-index: 6;
  color: rgba(255,255,255,0.7);
  text-shadow: 0 0 6px rgba(0,0,0,0.4);
}
.tv-hud-b .bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.tv-hud-b .bars span {
  width: 3px;
  background: rgba(255,255,255,0.8);
}
.tv-hud-b .bars span:nth-child(1) { height: 30%; }
.tv-hud-b .bars span:nth-child(2) { height: 55%; }
.tv-hud-b .bars span:nth-child(3) { height: 75%; }
.tv-hud-b .bars span:nth-child(4) { height: 100%; background: var(--accent); }
.tv-hud-b .bars span:nth-child(5) { height: 100%; background: var(--accent); }

/* TV static — only visible briefly during channel change */
.tv-static {
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0;
  background-image:
    /* generated noise via radial points */
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,0.15) 0deg 1deg, transparent 1deg 2deg);
  background-size: 3px 3px;
  mix-blend-mode: screen;
  pointer-events: none;
}
.tv-static.on { opacity: 0.85; }

/* fake static via SVG-like CSS noise */
.tv-static::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 13% 27%, rgba(255,255,255,0.9) 0.5px, transparent 1px),
    radial-gradient(circle at 71% 14%, rgba(255,255,255,0.7) 0.5px, transparent 1px),
    radial-gradient(circle at 44% 81%, rgba(255,255,255,0.8) 0.5px, transparent 1px),
    radial-gradient(circle at 88% 64%, rgba(255,255,255,0.5) 0.5px, transparent 1px),
    radial-gradient(circle at 26% 56%, rgba(255,255,255,0.7) 0.5px, transparent 1px),
    radial-gradient(circle at 92% 92%, rgba(255,255,255,0.9) 0.5px, transparent 1px);
  background-size: 24px 24px;
  animation: jitter 0.08s steps(2) infinite;
}
@keyframes jitter {
  0%   { transform: translate(0,0); }
  50%  { transform: translate(2px, -1px); }
  100% { transform: translate(-1px, 2px); }
}

/* horizontal tearing band during glitch */
.tv-tear {
  position: absolute;
  left: 0; right: 0;
  height: 24px;
  background: rgba(255,255,255,0.06);
  border-top: 1px solid rgba(255,255,255,0.18);
  border-bottom: 1px solid rgba(0,0,0,0.4);
  mix-blend-mode: overlay;
  z-index: 7;
  opacity: 0;
  pointer-events: none;
}

/* power-on / off animation */
.tv-poweroff {
  position: absolute;
  inset: 0;
  z-index: 9;
  background: #000;
  transform-origin: center;
  opacity: 0;
  pointer-events: none;
}

/* TV stand legs (decorative) */
.tv-stand {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  height: 22px;
  background:
    linear-gradient(180deg, #1a1a22, #0a0a0d);
  border-radius: 0 0 8px 8px;
  border: 1px solid var(--border);
  border-top: 0;
}

/* ============================================================
   right rail — info panel
   ============================================================ */
.tv-rail-r {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-left: 1px solid var(--border);
  padding-left: 1.5rem;
}

.tv-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.tv-info .label {
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.tv-info .val {
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.tv-info .val.lg {
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}
.tv-info .val.accent { color: var(--accent); }

.tv-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}
.tv-tech .chip {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  color: var(--text-dim);
}

.tv-visit {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 0.9rem;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  border-radius: 2px;
  transition: transform 0.2s, box-shadow 0.2s;
  align-self: flex-start;
}
.tv-visit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(45,98,255,0.4);
}
.tv-visit::after { content: '↗'; }

/* progress bar at the very bottom of the section */
.tv-progress {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(70%, 800px);
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  z-index: 8;
}
.tv-progress .bar {
  flex: 1;
  height: 1px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.tv-progress .bar .fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}
.tv-progress .pct { color: var(--text); font-feature-settings: 'tnum' 1; }

/* scroll hint */
.tv-scroll-hint {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 8;
}
.tv-scroll-hint::before,
.tv-scroll-hint::after {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 1100px) {
  .tv-stage-inner {
    grid-template-columns: 160px 1fr 200px;
    gap: 1.5rem;
  }
  .tv-counter .now { font-size: 3.5rem; }
}

@media (max-width: 840px) {
  .tv-stage {
    height: 320vh;
  }
  .tv-stage-inner {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .tv-rail-l { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .tv-ch-list { display: none; }
  .tv-rail-r {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
  }
  .tv-set {
    max-width: 100%;
  }
  .tv-bezel { padding: 26px 24px 36px 24px; border-radius: 16px; }
  .tv-set { aspect-ratio: 16 / 11; }
  .tv-progress { width: 90%; bottom: 14px; }
  .tv-scroll-hint { top: 14px; font-size: 9.5px; }
}
