/* Hero: the bright studio of ref 159. Huge headline top left, a stack of silver CRTs on the right,
   black cables on the floor. hero.js builds the TVs inside #crt-stack; this file styles them.
   Inside the rig, sizes scale with --u (one rig unit, set by hero.js). Page spacing is from the ladder. */

.hero {
  --case-hi: #f4f3f0;
  --case: #d6d5d1;
  --case-lo: #a8a7a2;
  --cove: #cfcec9;
  --cta: #242424;
  --cta-hover: #0f0f0f;
  position: relative;
  isolation: isolate;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  overflow: clip;
  background:
    radial-gradient(80% 70% at 66% 30%, #f6f5f2 0%, rgba(246, 245, 242, 0) 70%),
    linear-gradient(180deg, #e1e0dc 0%, var(--wall) 45%, #dddcd7 100%);
}

/* faint plaster grain on the wall */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .3 0 0 0 0 .28 0 0 0 .14 0'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- copy ---------- */

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(50%, 760px);
  padding: 64px 0 0 64px;
}

.hero-kicker {
  margin: 0 0 16px;
  font: 500 16px/1.25 var(--font-sans);
  color: var(--ink);
}

.hero-h {
  margin: 0;
  max-width: 5em;
  font: 600 clamp(56px, min(8.6vw, 14.5svh), 152px)/.9 var(--font-sans);
  letter-spacing: -.045em;
  color: var(--ink);
}

.hero-sub {
  margin: 24px 0 0;
  max-width: 21em;
  font: 500 clamp(17px, 1.35vw, 21px)/1.4 var(--font-sans);
  letter-spacing: -.01em;
  color: var(--ink);
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin-top: 32px;
  padding: 16px 48px;
  border: 0;
  border-radius: 999px;
  background: var(--cta);
  color: #fff;
  font: 600 18px/1 var(--font-sans);
  letter-spacing: -.01em;
  cursor: pointer;
  box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .55);
  transition: transform .3s ease, background-color .3s ease;
}
@media (hover: hover) {
  .cta:hover { transform: scale(1.02); background: var(--cta-hover); }
}
.cta:active { transform: scale(.98); transition-duration: .1s; }
.cta:focus-visible { outline: 2px solid var(--hud-blue); outline-offset: 4px; }
.cta:disabled { cursor: progress; }

.hero-note {
  min-height: 24px;
  margin: 16px 0 0;
  max-width: 28em;
  font: 500 15px/1.5 var(--font-sans);
  color: var(--ink);
}
.hero-note:empty { margin-top: 0; }

.hero-foot {
  position: absolute;
  z-index: 2;
  left: 64px;
  bottom: 24px;
  margin: 0;
  font: 400 14px/1.4 var(--font-mono);
  letter-spacing: .01em;
  color: var(--ink);
}

/* ---------- the stack ---------- */

.crt-stack {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  width: 56%;
  padding: 48px 32px; /* hero.js fits the rig inside this padding */
  pointer-events: none;
}

.crt-rig { position: absolute; }

/* the floor and the soft cove where it meets the wall, run far past the rig and clipped by the hero */
.crt-floor {
  position: absolute;
  left: -900%;
  right: -900%;
  top: 79%;
  height: 200%;
  background: linear-gradient(180deg, rgba(207, 206, 201, 0) 0%, var(--cove) 1.4%, var(--floor) 5%, #e3e2de 24%, #dad9d4 60%);
}

.crt-shadow {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .34), rgba(0, 0, 0, 0));
}

.crt-cables {
  position: absolute;
  left: -300%;
  top: 74%;
  width: 420%;
  height: 30%;
  overflow: visible;
}

.crt { position: absolute; transform: rotate(var(--rot, 0deg)); }

/* silver plastic casing */
.crt-face {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--u) * 18);
  background:
    radial-gradient(120% 60% at 30% 0%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, var(--case-hi) 0%, var(--case) 42%, var(--case-lo) 100%);
  box-shadow:
    inset 0 calc(var(--u) * 2) 0 rgba(255, 255, 255, .85),
    inset calc(var(--u) * 2) 0 calc(var(--u) * 2) rgba(255, 255, 255, .4),
    inset calc(var(--u) * -3) 0 calc(var(--u) * 3) rgba(0, 0, 0, .12),
    inset 0 calc(var(--u) * -4) calc(var(--u) * 3) rgba(0, 0, 0, .2),
    0 calc(var(--u) * 10) calc(var(--u) * 16) calc(var(--u) * -6) rgba(0, 0, 0, .3);
}
.crt--round .crt-face { border-radius: calc(var(--u) * 30); }
.crt--turned .crt-face { border-radius: calc(var(--u) * 12); }

/* the recessed bezel around the tube */
.crt-well {
  position: absolute;
  top: 7%;
  left: 7%;
  right: 7%;
  bottom: 22%;
  border-radius: calc(var(--u) * 20);
  background: linear-gradient(180deg, #82817d 0%, #b5b4af 55%, #dbdad6 100%);
  box-shadow:
    inset 0 calc(var(--u) * 3) calc(var(--u) * 6) rgba(0, 0, 0, .5),
    inset 0 calc(var(--u) * -1) 0 rgba(255, 255, 255, .4),
    0 calc(var(--u) * 1.5) 0 rgba(255, 255, 255, .75);
}
.crt--round .crt-well { border-radius: calc(var(--u) * 26); }
.crt--box .crt-well { top: 6%; left: 6%; right: 15%; bottom: 7%; }
.crt--wide .crt-well { top: 6%; left: 6.5%; right: 6.5%; bottom: 21%; }
.crt--turned .crt-well { top: 8%; left: 8%; right: 8%; bottom: 21%; border-radius: calc(var(--u) * 10); }

/* the curved glass: canvas underneath, scanlines, vignette and glare on top */
.crt-glass {
  position: absolute;
  inset: 5% 4.5%;
  overflow: hidden;
  border-radius: 9% / 12%;
  background: #0b0b0c;
  box-shadow: 0 0 calc(var(--u) * 12) rgba(255, 228, 204, .45);
}
.crt-glass canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.crt-fx {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(110% 80% at 26% 12%, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 42%),
    radial-gradient(ellipse farthest-corner at 50% 50%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, .38) 100%),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .15) 0 1px, rgba(0, 0, 0, 0) 1px 3px);
  box-shadow: inset 0 0 calc(var(--u) * 8) calc(var(--u) * 1) rgba(0, 0, 0, .45);
}

/* knob, a row of dots, three buttons and a power light under the screen */
.crt-panel {
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 5%;
  height: 11%;
  display: flex;
  align-items: center;
  gap: 5%;
}
.crt-knob {
  flex: none;
  height: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fbfbf9 0%, #c3c2be 45%, #77766f 100%);
  box-shadow: 0 0 0 calc(var(--u) * 1) rgba(0, 0, 0, .25);
}
.crt-dots {
  flex: 0 1 40%;
  height: 38%;
  background: radial-gradient(circle closest-side, #55544f 0 55%, rgba(85, 84, 79, 0) 72%) 0 50% / 12.5% 100% repeat-x;
}
.crt-btns {
  flex: 0 0 20%;
  height: 42%;
  border-radius: calc(var(--u) * 2);
  background: repeating-linear-gradient(90deg, #6c6b67 0 26%, rgba(0, 0, 0, 0) 26% 37%);
}
.crt-led {
  flex: none;
  width: calc(var(--u) * 5);
  height: calc(var(--u) * 5);
  margin-left: auto;
  border-radius: 50%;
  background: #c83a2e;
  box-shadow: 0 0 calc(var(--u) * 4) rgba(255, 75, 58, .7);
}
.crt-rig[data-state="waiting"] .crt-led { background: #ff4b3a; box-shadow: 0 0 calc(var(--u) * 8) #ff4b3a; }

/* the boxy TV keeps its controls in a column on the right of the face */
.crt--box .crt-panel {
  left: auto;
  right: 3.5%;
  top: 16%;
  bottom: 16%;
  width: 8%;
  height: auto;
  flex-direction: column;
  gap: 6%;
}
.crt--box .crt-knob { width: 72%; height: auto; }
.crt--box .crt-dots {
  flex: 0 1 34%;
  width: 34%;
  height: auto;
  background-size: 100% 12.5%;
  background-repeat: repeat-y;
  background-position: 50% 0;
}
.crt--box .crt-btns {
  flex: 0 0 16%;
  width: 46%;
  height: auto;
  background: repeating-linear-gradient(180deg, #6c6b67 0 26%, rgba(0, 0, 0, 0) 26% 37%);
}
.crt--box .crt-led { margin: auto 0 0; }
.crt--turned .crt-dots, .crt--turned .crt-led { display: none; }

/* the side of the casing seen at an angle; the floor TV shows its tapered back on the left */
.crt-side {
  position: absolute;
  top: 3%;
  bottom: 3%;
  left: calc(100% - var(--u) * 6);
  width: calc(var(--side) + var(--u) * 6);
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .16) 0 calc(var(--u) * 2), rgba(0, 0, 0, 0) calc(var(--u) * 2) calc(var(--u) * 7)) 50% 78% / 56% 26% no-repeat,
    linear-gradient(90deg, #b5b4af, #8e8d88 70%, #7d7c77);
  clip-path: polygon(0 0, 100% 6%, 100% 94%, 0 100%);
}
.crt--turned .crt-side {
  left: auto;
  right: calc(100% - var(--u) * 6);
  background: linear-gradient(90deg, #7a7974, #a9a8a3);
  clip-path: polygon(0 16%, 100% 0, 100% 100%, 0 84%);
}

/* ---------- phones and tall screens: headline on top, the stack below ---------- */
@media (max-width: 760px), (max-aspect-ratio: 3/4) {
  .hero {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
  }
  .hero-copy { width: auto; padding: 24px 16px 0; }
  .hero-kicker { margin-bottom: 8px; font-size: 15px; }
  .hero-h { font-size: clamp(48px, 15vw, 112px); }
  .hero-sub { margin-top: 16px; font-size: 17px; }
  .cta { margin-top: 24px; }
  .hero-note { margin-top: 8px; }
  .crt-stack {
    position: relative;
    flex: 1 1 auto;
    width: auto;
    min-height: 400px;
    padding: 16px 16px 48px;
  }
  .hero-foot { left: 16px; right: 16px; bottom: 16px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cta { transition: background-color .3s ease; }
  .cta:hover, .cta:active { transform: none; }
}
