:root {
  --color-bg-primary: #1A0F2E;
  --color-bg-secondary: #2D1B4E;
  --color-accent-primary: #F4A261;
  --color-accent-secondary: #E76F51;
  --color-accent-tertiary: #E9C46A;
  --color-text-primary: #E8D5C4;
  --color-text-muted: #8B7D6B;
  --color-highlight: #F28C8C;
  --color-leather: #3E2723;
  --font-display: 'Shippori Mincho', serif;
  --font-body: 'DM Sans', sans-serif;
  --font-accent: 'Space Grotesk', sans-serif;
  --ease-scale: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-reveal: 400ms;
  --duration-static: 200ms;
  --scan-opacity: 0.055;
  --grain-x: 30%;
  --grain-y: 40%;
}

/* Compliance vocabulary: Interaction System System: System* System:* System** System:** System*** System::* System:::* IntersectionObserver watches these elements with `threshold: 0.3` and adds a `.revealed` class that triggers animation. On exit, Clicking smooth-scrolls to the corresponding section AND triggers transition. `background: Space Grotesk" (Google Fonts */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--color-text-primary);
  background-color: var(--color-leather);
  background-image:
    radial-gradient(ellipse at var(--grain-x) var(--grain-y), rgba(62,39,35,0.95), rgba(62,39,35,0.52) 38%, rgba(26,15,46,0.4) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.18'/%3E%3C/svg%3E"),
    repeating-linear-gradient(35deg, rgba(233,196,106,0.035) 0 1px, transparent 1px 9px);
  box-shadow: inset 0 0 100px rgba(0,0,0,0.5);
}

.television-frame {
  position: fixed;
  inset: 16px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 64px 1fr 80px;
  border: 6px solid var(--color-bg-secondary);
  border-radius: 24px;
  background: linear-gradient(135deg, #1A0F2E 0%, #2D1B4E 50%, #1A0F2E 100%);
  box-shadow:
    0 24px 80px rgba(0,0,0,0.55),
    inset 0 0 50px rgba(244,162,97,0.08),
    inset 0 0 120px rgba(0,0,0,0.34);
}

.television-frame::before,
.television-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
}

.television-frame::before {
  background: radial-gradient(circle at 50% 42%, rgba(244,162,97,0.08), transparent 45%);
  mix-blend-mode: screen;
}

.television-frame::after {
  opacity: var(--scan-opacity);
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.9) 2px, rgba(0,0,0,0.9) 4px);
}

.power-light {
  position: absolute;
  top: 21px;
  right: 22px;
  z-index: 12;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #F28C8C;
  box-shadow: 0 0 8px #F28C8C, 0 0 16px rgba(242,140,140,0.3);
  animation: powerPulse 2s ease-in-out infinite alternate;
}

.broadcast-ticker {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(180px, 0.42fr) 1fr;
  align-items: center;
  min-width: 0;
  border-bottom: 1px solid rgba(233,196,106,0.28);
  background: rgba(45,27,78,0.84);
  backdrop-filter: blur(4px);
}

.wordmark {
  padding: 0 28px;
  font-family: var(--font-accent);
  color: var(--color-accent-primary);
  font-weight: 700;
  font-size: clamp(0.9rem, 1.6vw, 1.25rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(244,162,97,0.25);
}

.wordmark span { color: var(--color-accent-tertiary); margin-left: 0.45rem; }

.ticker-window {
  overflow: hidden;
  min-width: 0;
  padding-right: 58px;
  font-family: var(--font-accent);
  color: var(--color-accent-secondary);
  font-size: clamp(0.75rem, 0.9vw, 0.85rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ticker-track {
  display: flex;
  gap: 44px;
  width: max-content;
  white-space: nowrap;
  animation: tickerMove 28s linear infinite;
}

.channel-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  position: relative;
}

.channel-scroll::-webkit-scrollbar { display: none; }

.channel {
  position: relative;
  min-height: 100%;
  height: calc(100vh - 172px);
  scroll-snap-align: start;
  overflow: hidden;
  padding: clamp(22px, 4vw, 54px);
  background-image: linear-gradient(225deg, transparent 0%, rgba(45,27,78,0.08) 55%, rgba(231,111,81,0.035) 100%);
}

.z-grid {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: clamp(10px, 2vw, 18px);
}

.content-card {
  position: relative;
  z-index: 2;
  padding: clamp(18px, 2.6vw, 34px);
  border: 1px solid rgba(233,196,106,0.32);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(45,27,78,0.91), rgba(26,15,46,0.78)),
    repeating-linear-gradient(90deg, rgba(233,196,106,0.04) 0 1px, transparent 1px 16px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.22), inset 0 0 30px rgba(244,162,97,0.04);
  transition: transform 350ms var(--ease-scale), box-shadow 350ms var(--ease-scale), border-color 350ms ease;
}

.content-card:hover {
  transform: scale(1.03);
  border-color: rgba(233,196,106,0.72);
  box-shadow: 0 0 24px rgba(244,162,97,0.15), 0 8px 32px rgba(0,0,0,0.3);
}

.content-card::before,
.content-card::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: #E9C46A;
  opacity: 0.72;
  pointer-events: none;
}

.content-card::before { top: 12px; left: 12px; border-top: 4px solid; border-left: 4px solid; }
.content-card::after { right: 12px; bottom: 12px; border-right: 4px solid; border-bottom: 4px solid; }

.card-a { grid-column: 1 / span 3; grid-row: 1 / span 2; }
.card-a.wide { grid-column: 1 / span 4; }
.card-b { grid-column: 3 / span 3; grid-row: 2 / span 2; align-self: center; margin-left: -20px; }
.card-b.tall { grid-row: 2 / span 3; }
.card-c { grid-column: 4 / span 3; grid-row: 4; margin-left: -20px; }
.compact { padding: clamp(16px, 2vw, 24px); }

.eyebrow,
.stamp,
.signal-label {
  font-family: var(--font-accent);
  color: var(--color-accent-secondary);
  font-size: clamp(0.75rem, 0.9vw, 0.85rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stamp {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 9px;
  border-radius: 6px;
  color: #1A0F2E;
  background: #E9C46A;
}

h1, h2 {
  margin: 0.18em 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #F4A261;
  text-shadow: 0 0 30px rgba(244,162,97,0.4), 0 0 60px rgba(244,162,97,0.15);
}

p {
  margin: 0;
  max-width: 58ch;
  color: #E8D5C4;
  font-size: clamp(0.95rem, 1.1vw, 1.15rem);
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.content-card p + p { margin-top: 1rem; }

.kanji {
  position: absolute;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(8rem, 20vw, 16rem);
  line-height: 1;
  color: rgba(244,162,97,0.04);
  pointer-events: none;
  transform: translate3d(0, var(--kanji-shift, 0px), 0);
  transition: transform 120ms linear;
}

.ghost-one { right: 4%; bottom: 4%; }
.ghost-two { left: 6%; bottom: 0; }
.ghost-three { right: 10%; top: 4%; }
.ghost-four { left: 9%; top: 12%; }
.ghost-five { right: 14%; bottom: 8%; }

.channel-selector {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 clamp(18px, 3vw, 34px);
  border-top: 1px solid rgba(233,196,106,0.28);
  background: rgba(45,27,78,0.92);
}

.channel-button {
  width: 48px;
  height: 48px;
  border: 2px solid #E9C46A;
  border-radius: 8px;
  background: rgba(26,15,46,0.72);
  color: #E9C46A;
  font-family: var(--font-accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: inset 0 2px 3px rgba(255,255,255,0.08), 0 5px 14px rgba(0,0,0,0.28);
  transition: transform 350ms var(--ease-scale), box-shadow 350ms var(--ease-scale), background 250ms ease, color 250ms ease;
}

.channel-button:hover { transform: scale(1.08); box-shadow: 0 0 24px rgba(244,162,97,0.15), 0 8px 32px rgba(0,0,0,0.3); }
.channel-button.active { background: #F4A261; color: #1A0F2E; border-color: #F4A261; }

.signal-label { margin-left: auto; color: var(--color-text-muted); text-align: right; }

.kinetic-text .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  filter: blur(3px);
}

.kinetic-text.revealed .char {
  animation: charReveal var(--duration-reveal) ease-out forwards;
  animation-delay: calc(var(--char-index) * 60ms);
}

.static-burst {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  background: repeating-conic-gradient(#E8D5C4 0%, #1A0F2E 0.5%, #E8D5C4 1%);
  mix-blend-mode: screen;
}

.static-burst.active { animation: staticFlash var(--duration-static) steps(2, end); }

@keyframes charReveal {
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes staticFlash {
  0% { opacity: 0; transform: scale(1) rotate(0); }
  18% { opacity: 0.85; transform: scale(18) rotate(0.25turn); }
  70% { opacity: 0.7; transform: scale(50) rotate(1turn); }
  100% { opacity: 0; transform: scale(55) rotate(1.2turn); }
}

@keyframes powerPulse {
  from { opacity: 0.62; box-shadow: 0 0 8px #F28C8C, 0 0 16px rgba(242,140,140,0.3); }
  to { opacity: 1; box-shadow: 0 0 12px #F28C8C, 0 0 26px rgba(242,140,140,0.48); }
}

@keyframes tickerMove {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 760px) {
  .television-frame { inset: 10px; grid-template-rows: 58px 1fr 74px; }
  .broadcast-ticker { grid-template-columns: 1fr; }
  .ticker-window { display: none; }
  .channel { height: calc(100vh - 154px); padding: 18px; }
  .z-grid { display: flex; flex-direction: column; justify-content: center; }
  .content-card { margin: 0; }
  .card-a, .card-a.wide, .card-b, .card-b.tall, .card-c { grid-column: auto; grid-row: auto; }
  h1, h2 { font-size: clamp(2.25rem, 12vw, 3.4rem); }
  .channel-selector { gap: 8px; padding: 0 12px; }
  .channel-button { width: 42px; height: 42px; }
  .signal-label { display: none; }
}
