/* ZTIONIX — Road Rage brush + B/W bloom glitch */

:root {
  --black: #000;
  --white: #ffffff;
  --soft: rgba(255, 255, 255, 0.78);
  --font-brush: "Road Rage", "Impact", "Arial Black", fantasy, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  overflow: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- bg ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000;
  overflow: hidden;
}

.bg__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.1) brightness(0.38);
  transform: scale(1.03);
}

.bg.is-glitch .bg__video {
  animation: vid-slice 0.18s steps(2);
}

@keyframes vid-slice {
  0% { filter: grayscale(1) contrast(1.1) brightness(0.38); transform: scale(1.03) translate(0); }
  40% { filter: grayscale(1) contrast(1.8) brightness(0.7); transform: scale(1.04) translate(-6px, 0); }
  70% { filter: grayscale(1) contrast(1.4) brightness(0.25); transform: scale(1.02) translate(5px, 1px); }
  100% { filter: grayscale(1) contrast(1.1) brightness(0.38); transform: scale(1.03) translate(0); }
}

.bg__dim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 50% at 50% 48%, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.78) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 45%, rgba(0, 0, 0, 0.8) 100%);
  pointer-events: none;
}

.bg__grain {
  position: absolute;
  inset: -20%;
  opacity: 0.09;
  pointer-events: none;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  animation: grain 0.45s steps(2) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-1.5%, 1%); }
  100% { transform: translate(1%, -0.5%); }
}

/* full-screen horizontal tear flash */
.tear-layer {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 6px,
    rgba(255, 255, 255, 0.04) 6px 7px
  );
}

.tear-layer.is-on {
  opacity: 1;
  animation: tear-flash 0.16s steps(2) forwards;
}

@keyframes tear-flash {
  0% { opacity: 0.5; clip-path: inset(30% 0 50% 0); transform: translateX(-10px); }
  50% { opacity: 0.25; clip-path: inset(55% 0 15% 0); transform: translateX(8px); }
  100% { opacity: 0; clip-path: inset(0 0 0 0); transform: none; }
}

/* ---------- side frames ---------- */

.side-frame {
  position: fixed;
  top: 50%;
  z-index: 3;
  width: min(18vw, 220px);
  height: min(70vh, 520px);
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 0 24px rgba(0, 0, 0, 0.65),
    0 0 40px rgba(255, 255, 255, 0.06);
  overflow: hidden;
  background: #0a0a0a;
  pointer-events: none;
}

.side-frame--left {
  left: clamp(0.5rem, 2vw, 1.25rem);
}

.side-frame--right {
  right: clamp(0.5rem, 2vw, 1.25rem);
}

.side-frame__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(0.15) contrast(1.05) brightness(0.9);
  pointer-events: none;
  user-select: none;
}

/* ---------- stage ---------- */

.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

@media (max-width: 720px) {
  .side-frame {
    width: min(22vw, 96px);
    height: min(42vh, 280px);
    opacity: 0.85;
  }
}

@media (max-width: 420px) {
  .side-frame {
    display: none;
  }
}

.logo-wrap {
  position: relative;
  isolation: isolate;
}

/* Road Rage core + bloom */
.logo {
  position: relative;
  display: inline-block;
  margin: 0;
  font-family: var(--font-brush);
  font-weight: 400;
  font-size: clamp(4.2rem, 20vw, 12rem);
  line-height: 0.85;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: transparent;
  user-select: none;
  transform: skewX(-6deg);
}

.logo__core {
  position: relative;
  display: inline-block;
  color: #fff;
  /* bloom / outer glow — washes core like the reference */
  text-shadow:
    0 0 4px #fff,
    0 0 12px #fff,
    0 0 28px rgba(255, 255, 255, 0.95),
    0 0 56px rgba(255, 255, 255, 0.65),
    0 0 100px rgba(255, 255, 255, 0.4),
    0 0 160px rgba(255, 255, 255, 0.22),
    0 0 220px rgba(255, 255, 255, 0.12);
  filter: contrast(1.25) brightness(1.15);
  -webkit-text-stroke: 0.5px rgba(255, 255, 255, 0.35);
}

/* wind / directional ghost layers */
.logo::before,
.logo::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
  white-space: nowrap;
}

/* left wind streak */
.logo::before {
  z-index: -1;
  text-shadow:
    -2px 0 #fff,
    -8px 0 rgba(255, 255, 255, 0.45),
    -16px 0 rgba(255, 255, 255, 0.2),
    -28px 0 rgba(255, 255, 255, 0.08);
  clip-path: inset(0 0 55% 0);
  animation: wind-a 3.2s steps(1) infinite;
  opacity: 0.85;
}

/* right / lower wind streak */
.logo::after {
  z-index: -1;
  text-shadow:
    2px 0 #fff,
    10px 0 rgba(255, 255, 255, 0.4),
    20px 0 rgba(255, 255, 255, 0.18),
    34px 0 rgba(255, 255, 255, 0.07);
  clip-path: inset(48% 0 0 0);
  animation: wind-b 2.6s steps(1) infinite;
  opacity: 0.8;
}

@keyframes wind-a {
  0%, 88%, 100% { transform: translate(0, 0); opacity: 0.75; }
  90% { transform: translate(-10px, 1px) skewX(12deg); opacity: 1; }
  93% { transform: translate(6px, -1px) skewX(-6deg); opacity: 0.9; }
  96% { transform: translate(-4px, 0); opacity: 0.7; }
}

@keyframes wind-b {
  0%, 86%, 100% { transform: translate(0, 0); opacity: 0.7; }
  89% { transform: translate(12px, -1px) skewX(-10deg); opacity: 1; }
  92% { transform: translate(-7px, 1px) skewX(5deg); opacity: 0.85; }
  95% { transform: translate(5px, 0); opacity: 0.65; }
}

/* hard glitch state from JS */
.logo-wrap.is-glitch .logo__core {
  animation: core-shake 0.14s steps(2);
}

.logo-wrap.is-glitch .logo::before {
  animation: wind-a 0.12s steps(2), slice-hard-a 0.14s steps(2);
  opacity: 1;
}

.logo-wrap.is-glitch .logo::after {
  animation: wind-b 0.12s steps(2), slice-hard-b 0.14s steps(2);
  opacity: 1;
}

@keyframes core-shake {
  0% { transform: translate(0); filter: contrast(1.25) brightness(1.15); }
  30% { transform: translate(-5px, 1px) skewX(4deg); filter: contrast(1.8) brightness(1.5); }
  60% { transform: translate(4px, -1px) skewX(-3deg); filter: contrast(1.4) brightness(0.9); }
  100% { transform: translate(0); filter: contrast(1.25) brightness(1.15); }
}

@keyframes slice-hard-a {
  0% { transform: translate(-14px, 0) skewX(18deg); clip-path: inset(10% 0 60% 0); }
  100% { transform: translate(0); }
}

@keyframes slice-hard-b {
  0% { transform: translate(14px, 0) skewX(-14deg); clip-path: inset(50% 0 5% 0); }
  100% { transform: translate(0); }
}

/* ---------- subtitle ---------- */

.line {
  max-width: 32rem;
  font-weight: 300;
  font-size: clamp(0.95rem, 2.3vw, 1.15rem);
  line-height: 1.55;
  letter-spacing: 0.05em;
  color: var(--soft);
  opacity: 0.92;
}

.line__tag {
  position: relative;
  display: inline-block;
  font-family: var(--font-brush);
  font-size: 1.35em;
  color: #fff;
  letter-spacing: 0.04em;
  transform: skewX(-5deg);
  margin-left: 0.2em;
  text-shadow:
    0 0 8px #fff,
    0 0 24px rgba(255, 255, 255, 0.7),
    0 0 48px rgba(255, 255, 255, 0.35);
  vertical-align: baseline;
}

.line__tag::before,
.line__tag::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.7);
}

.logo-wrap.is-glitch ~ .line .line__tag::before {
  opacity: 0.9;
  transform: translate(-4px, 0);
  text-shadow: -3px 0 #fff;
  clip-path: inset(0 0 50% 0);
}

.logo-wrap.is-glitch ~ .line .line__tag::after {
  opacity: 0.9;
  transform: translate(4px, 0);
  text-shadow: 3px 0 #fff;
  clip-path: inset(50% 0 0 0);
}

/* ---------- CTA ---------- */

.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.25rem;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow:
    0 0 20px rgba(255, 255, 255, 0.08),
    inset 0 0 20px rgba(255, 255, 255, 0.03);
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  animation: enter-cta 1.2s ease 0.55s both;
}

.cta:hover,
.cta:focus-visible {
  color: #000;
  background: #fff;
  border-color: #fff;
  box-shadow:
    0 0 12px #fff,
    0 0 36px rgba(255, 255, 255, 0.55),
    0 0 72px rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  outline: none;
}

.cta:active {
  transform: translateY(0) scale(0.98);
}

/* entrance — simple, once */
.logo-wrap {
  animation: enter-logo 1.1s ease both;
}

.line {
  animation: enter-line 1.2s ease 0.35s both;
}

@keyframes enter-logo {
  from { opacity: 0; transform: scale(1.04); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes enter-line {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 0.92; transform: none; }
}

@keyframes enter-cta {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .logo::before,
  .logo::after,
  .bg__grain,
  .logo-wrap,
  .line,
  .cta {
    animation: none !important;
  }

  .logo-wrap,
  .line,
  .cta {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .logo::before,
  .logo::after {
    display: none;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: clamp(3.4rem, 22vw, 5rem);
  }
}
