:root {
  color-scheme: dark;
  --black: #050604;
  --yellow: #f5ed3d;
  --yellow-hot: #fff96b;
  --yellow-shadow: rgba(245, 237, 61, 0.56);
  font-family: "IBM Plex Mono", monospace;
  background: var(--black);
}

* { box-sizing: border-box; }

html, body { min-width: 320px; min-height: 100%; margin: 0; }

body {
  overflow: hidden;
  background: radial-gradient(ellipse at center, #121405 0%, #070804 48%, #020302 100%);
  color: var(--yellow);
}

#code-rain, .scanlines, .interference, .grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#code-rain { z-index: 0; opacity: 0.7; }

.scanlines {
  z-index: 4;
  opacity: 0.24;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0, 0, 0, 0.66) 4px 5px);
}

.interference { z-index: 5; overflow: hidden; mix-blend-mode: screen; }
.interference::before, .interference::after {
  content: "";
  position: absolute;
  left: -8%;
  width: 116%;
  height: 2px;
  background: var(--yellow);
  box-shadow: 0 0 12px 3px rgba(245, 237, 61, 0.24), 0 0 36px rgba(245, 237, 61, 0.2);
  opacity: 0;
}
.interference::before { animation: interference-a 7.7s steps(1) infinite; }
.interference::after { animation: interference-b 10.1s steps(1) infinite; }

.grain {
  z-index: 6;
  opacity: 0.105;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.screen {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  isolation: isolate;
  overflow: hidden;
  animation: screen-flicker 11s linear infinite;
}

.screen::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.85%, rgba(245, 237, 61, 0.06) 50%, transparent 50.15%),
    linear-gradient(0deg, transparent 49.85%, rgba(245, 237, 61, 0.06) 50%, transparent 50.15%),
    radial-gradient(ellipse at center, rgba(245, 237, 61, 0.09), transparent 47%);
}

.screen__frame {
  position: absolute;
  inset: clamp(16px, 3vw, 48px);
  border: 1px solid rgba(245, 237, 61, 0.21);
  clip-path: polygon(0 0, 24px 0, 24px 1px, calc(100% - 24px) 1px, calc(100% - 24px) 0, 100% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 0 70px rgba(245, 237, 61, 0.025), 0 0 30px rgba(245, 237, 61, 0.02);
}
.screen__frame::before, .screen__frame::after {
  content: "";
  position: absolute;
  left: 12px;
  width: 48px;
  height: 3px;
  background: var(--yellow);
  box-shadow: 0 0 16px var(--yellow-shadow);
}
.screen__frame::before { top: 12px; }
.screen__frame::after { bottom: 12px; left: auto; right: 12px; }

.screen__content {
  position: relative;
  width: min(100%, 1200px);
  padding: 40px 18px 50px;
  text-align: center;
  filter: drop-shadow(0 0 34px rgba(245, 237, 61, 0.12));
}

.brand-icon {
  display: block;
  width: clamp(88px, 9vw, 124px);
  height: auto;
  margin: 0 auto clamp(18px, 3vw, 34px);
  filter: drop-shadow(0 0 18px rgba(245, 237, 61, 0.3));
  animation: mark-glitch 5.8s steps(1) infinite;
}

.glitch { position: relative; width: fit-content; max-width: 100%; margin-left: auto; margin-right: auto; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  white-space: nowrap;
}
.glitch::before {
  color: var(--yellow-hot);
  text-shadow: -5px 0 #a39c06, 3px 0 #fffda7;
  clip-path: inset(0 0 72% 0);
  animation: glitch-top 3.2s steps(1) infinite;
}
.glitch::after {
  color: #c9c00a;
  text-shadow: 5px 0 rgba(255, 250, 118, 0.85), -3px 0 #6f6b08;
  clip-path: inset(78% 0 0 0);
  animation: glitch-bottom 2.7s steps(1) infinite;
}

.wordmark {
  margin-top: 0;
  margin-bottom: 0;
  color: var(--yellow-hot);
  font: 700 clamp(54px, 13.2vw, 190px)/1 "Chakra Petch", "Arial Narrow", sans-serif;
  letter-spacing: -0.062em;
  white-space: nowrap;
  text-shadow: -2px 0 rgba(150, 143, 0, 0.55), 2px 0 rgba(255, 255, 161, 0.5), 0 0 12px rgba(245, 237, 61, 0.55), 0 0 85px rgba(245, 237, 61, 0.18);
}

.signal-cut {
  width: min(82%, 700px);
  height: 3px;
  margin: clamp(25px, 5vw, 66px) auto clamp(24px, 4vw, 54px);
  background: linear-gradient(90deg, transparent, var(--yellow) 14% 34%, transparent 34.5% 39%, var(--yellow) 39.5% 80%, transparent);
  box-shadow: 0 0 20px var(--yellow-shadow);
  animation: line-glitch 6.4s steps(1) infinite;
}

.mission {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 1100px);
  min-height: 2.3em;
  margin-top: 0;
  margin-bottom: 0;
  color: var(--yellow);
  font: 600 clamp(30px, 4.1vw, 58px)/1.12 "Chakra Petch", "Arial Narrow", sans-serif;
  letter-spacing: .015em;
  text-wrap: balance;
  text-shadow: 0 0 14px rgba(245, 237, 61, 0.32);
}

.mission::before, .mission::after {
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  text-wrap: balance;
}

.mission.is-switching { animation: mission-swap 680ms steps(1) both; }

.mission-copy {
  max-width: 850px;
  margin: 16px auto 0;
  color: rgba(255, 249, 107, .8);
  font: 400 clamp(15px, 1.65vw, 21px)/1.5 "IBM Plex Mono", monospace;
  text-wrap: balance;
}

.coming-soon {
  margin: 32px 0 0;
  color: rgba(255, 249, 107, .55);
  font: 600 13px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: .34em;
}

.tear {
  position: absolute;
  z-index: 3;
  height: 1px;
  background: var(--yellow);
  opacity: 0;
  box-shadow: 0 0 12px var(--yellow);
  pointer-events: none;
  animation: tear 6.8s steps(1) infinite;
}
.tear--one { width: 32%; left: 8%; top: 33%; }
.tear--two { width: 52%; right: -3%; top: 62%; animation-delay: -2.3s; }
.tear--three { width: 13%; left: 61%; top: 82%; animation-delay: -4.7s; }

@keyframes glitch-top {
  0%, 88%, 93%, 100% { transform: translate(2px, -1px); opacity: .24; clip-path: inset(8% 0 84% 0); }
  89% { transform: translate(-13px, -2px); opacity: .92; clip-path: inset(6% 0 72% 0); }
  90% { transform: translate(9px, 0); opacity: 1; clip-path: inset(34% 0 45% 0); }
  91% { transform: translate(-4px, 1px); opacity: .9; clip-path: inset(61% 0 25% 0); }
  92% { transform: translate(5px, 0); opacity: .8; clip-path: inset(12% 0 78% 0); }
}
@keyframes glitch-bottom {
  0%, 75%, 80%, 100% { transform: translate(-2px, 1px); opacity: .3; clip-path: inset(83% 0 8% 0); }
  76% { transform: translate(11px, 1px); opacity: .9; clip-path: inset(74% 0 7% 0); }
  77% { transform: translate(-7px, -1px); opacity: 1; clip-path: inset(22% 0 57% 0); }
  78% { transform: translate(14px, 1px); opacity: .9; clip-path: inset(46% 0 40% 0); }
  79% { transform: translate(-4px, 0); opacity: .7; clip-path: inset(84% 0 4% 0); }
}
@keyframes line-glitch {
  0%, 94%, 100% { transform: translateX(0) scaleX(1); opacity: 1; }
  95% { transform: translateX(28px) scaleX(.9); opacity: .3; }
  96% { transform: translateX(-16px) scaleX(1.04); opacity: 1; }
}
@keyframes tear {
  0%, 71%, 77%, 100% { opacity: 0; transform: translateX(0); }
  72% { opacity: .8; transform: translateX(34px); }
  73% { opacity: .2; transform: translateX(-15px); }
  74% { opacity: 1; transform: translateX(8px); }
  75% { opacity: 0; }
}
@keyframes interference-a {
  0%, 64%, 68%, 100% { opacity: 0; top: 0; transform: translateX(0); }
  65% { opacity: .48; top: 39%; transform: translateX(-20px); }
  66% { opacity: .18; top: 43%; transform: translateX(24px); }
  67% { opacity: .5; top: 40%; transform: translateX(0); }
}
@keyframes interference-b {
  0%, 83%, 87%, 100% { opacity: 0; top: 0; }
  84% { opacity: .34; top: 72%; }
  85% { opacity: .13; top: 18%; }
  86% { opacity: .4; top: 73%; }
}
@keyframes screen-flicker {
  0%, 96%, 98%, 100% { opacity: 1; }
  97% { opacity: .84; }
}

@keyframes mark-glitch {
  0%, 82%, 87%, 100% { transform: translate(0, 0); filter: drop-shadow(0 0 18px rgba(245, 237, 61, .3)); }
  83% { transform: translate(-4px, 1px); filter: drop-shadow(5px 0 0 rgba(245, 237, 61, .45)); }
  84% { transform: translate(3px, -1px); filter: drop-shadow(-4px 0 0 rgba(245, 237, 61, .55)); }
  85% { transform: translate(-2px, 0); }
}

@keyframes mission-swap {
  0%, 100% { opacity: 1; transform: translateX(0); filter: none; }
  10% { opacity: .85; transform: translateX(-8px) skewX(-4deg); clip-path: inset(0 0 58% 0); }
  22% { opacity: .28; transform: translateX(15px); clip-path: inset(42% 0 34% 0); }
  36% { opacity: .95; transform: translateX(-11px); clip-path: inset(70% 0 0 0); }
  48% { opacity: .15; transform: translateX(0); clip-path: inset(0 0 0 0); }
  61% { opacity: 1; transform: translateX(9px) skewX(3deg); clip-path: inset(12% 0 50% 0); }
  76% { opacity: .62; transform: translateX(-4px); clip-path: inset(0 0 0 0); }
}

@media (max-width: 650px) {
  .screen__frame { inset: 14px; }
  .screen__content { padding: 26px 18px 32px; }
  .brand-icon { width: 82px; margin-bottom: 23px; }
  .wordmark { font-size: clamp(50px, 13.5vw, 88px); letter-spacing: -0.062em; }
  .mission { min-height: 3.4em; font-size: clamp(25px, 6vw, 38px); }
  .mission-copy { max-width: 36ch; margin-top: 12px; font-size: 14px; }
  .coming-soon { margin-top: 24px; font-size: 11px; }
  .signal-cut { width: 86%; margin: 30px auto 22px; }
}

@media (max-width: 380px) {
  .wordmark { font-size: 13.2vw; }
  .mission { font-size: 6.4vw; min-height: 4.2em; }
  .mission-copy { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .glitch::before, .glitch::after, .interference, .tear { display: none; }
}
