:root {
  color-scheme: light;
  --ink: #0a0a0a;
  --paper: #fff;
  --cyan: #00f5e9;
  --red: #ff1738;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}

.landing {
  display: grid;
  min-height: 100svh;
  place-content: center;
  justify-items: center;
  padding: 2rem;
}

.brand {
  position: relative;
  width: min(86vw, 820px);
  aspect-ratio: 960 / 190;
  line-height: 0;
  isolation: isolate;
  overflow: hidden;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
  position: absolute;
  inset: 0;
  transform: translateY(-35.25%);
  user-select: none;
  -webkit-user-drag: none;
}

.brand__base {
  z-index: 2;
}

.brand__slice {
  z-index: 3;
  opacity: 0;
  pointer-events: none;
}

.brand.is-glitching .brand__base {
  animation: base-glitch 360ms steps(2, end) both;
}

.brand.is-glitching .brand__slice--cyan {
  animation: cyan-glitch 360ms steps(2, end) both;
}

.brand.is-glitching .brand__slice--red {
  animation: red-glitch 360ms steps(2, end) both;
}

/* Pattern two deliberately hits harder: wider throws and a longer disruption. */
.brand.is-glitching.glitch--two .brand__base {
  animation: base-glitch-wide 540ms steps(2, end) both;
}

.brand.is-glitching.glitch--two .brand__slice--cyan {
  animation: cyan-glitch-wide 540ms steps(2, end) both;
}

.brand.is-glitching.glitch--two .brand__slice--red {
  animation: red-glitch-wide 540ms steps(2, end) both;
}

.brand.is-glitching.glitch--three .brand__base {
  animation: base-glitch-scan 420ms steps(3, end) both;
}

.brand.is-glitching.glitch--three .brand__slice--cyan {
  animation: cyan-glitch-scan 420ms steps(3, end) both;
}

.brand.is-glitching.glitch--three .brand__slice--red {
  animation: red-glitch-scan 420ms steps(3, end) both;
}

.identity {
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
  margin: clamp(0.85rem, 2.4vw, 1.45rem) 0 0;
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.115em;
  text-transform: uppercase;
}

.identity a {
  display: inline-grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  color: var(--ink);
  text-decoration: none;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.28em;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

.identity a svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.identity a:hover {
  color: var(--red);
  text-decoration: underline;
  text-decoration-color: var(--cyan);
}

.identity a:focus-visible,
.motion-toggle:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 5px;
}

.motion-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(10, 10, 10, 0.22);
  color: rgba(10, 10, 10, 0.72);
  background: rgba(248, 250, 252, 0.78);
  backdrop-filter: blur(8px);
  font: 700 0.65rem/1 Arial, Helvetica, sans-serif;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}

.motion-toggle:hover {
  border-color: var(--red);
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes base-glitch {
  0%, 100% { transform: translate(0, -35.25%); }
  12% { transform: translate(-3px, calc(-35.25% + 1px)) skewX(-1.5deg); }
  30% { transform: translate(5px, calc(-35.25% - 1px)); }
  45% { transform: translate(-2px, -35.25%); }
  65% { transform: translate(2px, calc(-35.25% + 1px)) skewX(1deg); }
}

@keyframes cyan-glitch {
  0%, 100% { opacity: 0; transform: translate(0, -35.25%); clip-path: inset(0 0 100% 0); }
  12% { opacity: 0.9; transform: translate(12px, -35.25%); clip-path: inset(8% 0 72% 0); }
  29% { opacity: 0.72; transform: translate(-9px, -35.25%); clip-path: inset(48% 0 31% 0); }
  47% { opacity: 0.88; transform: translate(7px, -35.25%); clip-path: inset(73% 0 9% 0); }
  67% { opacity: 0.5; transform: translate(-4px, -35.25%); clip-path: inset(27% 0 55% 0); }
}

@keyframes red-glitch {
  0%, 100% { opacity: 0; transform: translate(0, -35.25%); clip-path: inset(100% 0 0 0); }
  17% { opacity: 0.85; transform: translate(-11px, -35.25%); clip-path: inset(20% 0 61% 0); }
  34% { opacity: 0.68; transform: translate(8px, -35.25%); clip-path: inset(61% 0 20% 0); }
  51% { opacity: 0.9; transform: translate(-6px, -35.25%); clip-path: inset(4% 0 80% 0); }
  72% { opacity: 0.45; transform: translate(4px, -35.25%); clip-path: inset(80% 0 5% 0); }
}

@keyframes base-glitch-wide {
  0%, 100% { transform: translate(0, -35.25%) scaleX(1); }
  10% { transform: translate(-13px, calc(-35.25% + 2px)) skewX(-3deg) scaleX(1.018); }
  24% { transform: translate(18px, calc(-35.25% - 2px)) skewX(2.5deg) scaleX(0.985); }
  42% { transform: translate(-9px, -35.25%) skewX(-1deg); }
  60% { transform: translate(12px, calc(-35.25% + 1px)) skewX(2deg); }
  78% { transform: translate(-4px, -35.25%); }
}

@keyframes cyan-glitch-wide {
  0%, 100% { opacity: 0; transform: translate(0, -35.25%); clip-path: inset(0 0 100% 0); }
  10% { opacity: 0.9; transform: translate(34px, -35.25%); clip-path: inset(6% 0 76% 0); }
  27% { opacity: 0.8; transform: translate(-28px, -35.25%); clip-path: inset(38% 0 38% 0); }
  45% { opacity: 0.95; transform: translate(23px, -35.25%); clip-path: inset(68% 0 10% 0); }
  65% { opacity: 0.65; transform: translate(-17px, -35.25%); clip-path: inset(20% 0 61% 0); }
}

@keyframes red-glitch-wide {
  0%, 100% { opacity: 0; transform: translate(0, -35.25%); clip-path: inset(100% 0 0 0); }
  15% { opacity: 0.92; transform: translate(-31px, -35.25%); clip-path: inset(18% 0 61% 0); }
  33% { opacity: 0.75; transform: translate(25px, -35.25%); clip-path: inset(56% 0 24% 0); }
  52% { opacity: 0.98; transform: translate(-19px, -35.25%); clip-path: inset(3% 0 82% 0); }
  70% { opacity: 0.55; transform: translate(14px, -35.25%); clip-path: inset(77% 0 7% 0); }
}

@keyframes base-glitch-scan {
  0%, 100% { transform: translate(0, -35.25%); }
  15% { transform: translate(6px, calc(-35.25% - 4px)); }
  31% { transform: translate(-7px, calc(-35.25% + 3px)); }
  50% { transform: translate(3px, calc(-35.25% - 2px)) skewX(-2deg); }
  72% { transform: translate(-4px, calc(-35.25% + 2px)); }
}

@keyframes cyan-glitch-scan {
  0%, 100% { opacity: 0; transform: translate(0, -35.25%); clip-path: inset(0 0 100% 0); }
  14% { opacity: 0.8; transform: translate(17px, calc(-35.25% - 3px)); clip-path: inset(10% 0 76% 0); }
  35% { opacity: 0.85; transform: translate(-13px, calc(-35.25% + 4px)); clip-path: inset(42% 0 43% 0); }
  58% { opacity: 0.7; transform: translate(11px, calc(-35.25% - 2px)); clip-path: inset(78% 0 8% 0); }
}

@keyframes red-glitch-scan {
  0%, 100% { opacity: 0; transform: translate(0, -35.25%); clip-path: inset(100% 0 0 0); }
  19% { opacity: 0.75; transform: translate(-15px, calc(-35.25% + 3px)); clip-path: inset(27% 0 58% 0); }
  43% { opacity: 0.9; transform: translate(14px, calc(-35.25% - 4px)); clip-path: inset(63% 0 20% 0); }
  66% { opacity: 0.65; transform: translate(-9px, calc(-35.25% + 2px)); clip-path: inset(5% 0 82% 0); }
}

@media (max-width: 520px) {
  .landing {
    padding: 1.5rem;
  }

  .brand {
    width: min(94vw, 760px);
  }

  .identity {
    gap: 0.45rem;
    font-size: 0.78rem;
    letter-spacing: 0.075em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
