/* ============================================================
   IMPULSE — Coming Soon
   Aesthetic: Black & Red / Glitch-Distortion / Raw Electric
   ============================================================ */

/* ---- Design Tokens ---- */
:root {
  /* Surfaces */
  --bg-base:        #050505;
  --bg-raised:      #0a0a0a;
  --bg-overlay:     rgba(10, 10, 10, 0.9);

  /* Foreground */
  --fg-primary:     #f0f0f0;
  --fg-secondary:   #888888;
  --fg-muted:       #4a4a4a;

  /* Borders */
  --border-subtle:  rgba(255, 255, 255, 0.04);
  --border-default: rgba(255, 255, 255, 0.08);
  --border-emphasis: rgba(255, 20, 20, 0.25);

  /* Brand */
  --brand-red:      #ff1a1a;
  --brand-red-dim:  #cc0000;
  --brand-red-glow: rgba(255, 26, 26, 0.4);
  --brand-gradient: linear-gradient(135deg, #ff1a1a, #ff4d4d);

  /* Semantic */
  --success:        #ff4d4d;

  /* Typography */
  --font-display:   'Outfit', system-ui, sans-serif;
  --font-body:      'Space Grotesk', system-ui, sans-serif;

  /* Motion */
  --ease-out:       cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out:    cubic-bezier(0.65, 0, 0.35, 1);
  --duration-micro: 200ms;
  --duration-panel: 350ms;
  --duration-entrance: 500ms;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Font Loading Gate ---- */
.fonts-pending .glitch,
.fonts-pending .topbar__brand,
.fonts-pending .teaser__title {
  opacity: 0;
}
.fonts-ready .glitch,
.fonts-ready .topbar__brand,
.fonts-ready .teaser__title {
  opacity: 1;
  transition: opacity 0.5s var(--ease-out);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--fg-primary);
  background: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input { font: inherit; color: inherit; }

/* ---- Scanlines Overlay ---- */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
}

/* ---- Noise Texture ---- */
.noise {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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-repeat: repeat;
  background-size: 180px 180px;
  animation: noise-scroll 0.5s steps(4) infinite;
}

@keyframes noise-scroll {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2px, 1px); }
  50%  { transform: translate(1px, -1px); }
  75%  { transform: translate(-1px, 2px); }
  100% { transform: translate(2px, -2px); }
}

/* ---- Grid Pattern ---- */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
}

/* ---- Particle Canvas ---- */
#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---- Glow Backdrop ---- */
.glow-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
}

.glow--primary {
  width: 600px;
  height: 600px;
  background: var(--brand-red);
  opacity: 0.14;
  top: -18%;
  left: 50%;
  transform: translateX(-50%);
  animation: glow-drift-1 10s var(--ease-in-out) infinite alternate;
}

.glow--secondary {
  width: 450px;
  height: 450px;
  background: var(--brand-red-dim);
  opacity: 0.09;
  bottom: -10%;
  right: 5%;
  animation: glow-drift-2 13s var(--ease-in-out) infinite alternate;
}

.glow--tertiary {
  width: 350px;
  height: 350px;
  background: #330000;
  opacity: 0.2;
  top: 50%;
  left: -5%;
  transform: translateY(-50%);
  animation: glow-drift-3 16s var(--ease-in-out) infinite alternate;
}

@keyframes glow-drift-1 {
  0%   { transform: translateX(-50%) translateY(0); opacity: 0.14; }
  50%  { opacity: 0.1; }
  100% { transform: translateX(-40%) translateY(30px); opacity: 0.18; }
}

@keyframes glow-drift-2 {
  0%   { transform: translateY(0) translateX(0); opacity: 0.09; }
  100% { transform: translateY(-20px) translateX(-15px); opacity: 0.12; }
}

@keyframes glow-drift-3 {
  0%   { transform: translateY(-50%) translateX(0); opacity: 0.2; }
  100% { transform: translateY(-45%) translateX(20px); opacity: 0.12; }
}

/* ---- Main ---- */
.main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Top Bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  position: relative;
  z-index: 10;
  animation: fade-slide-down var(--duration-entrance) var(--ease-out) both;
}

.topbar__logo {
  display: flex;
  align-items: center;
}

.topbar__logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.topbar__cta {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.55rem 1.3rem;
  border-radius: 2px;
  border: 1px solid var(--border-default);
  background: var(--bg-overlay);
  transition: border-color var(--duration-micro) var(--ease-out),
              background var(--duration-micro) var(--ease-out),
              color var(--duration-micro) var(--ease-out);
}

.topbar__cta:hover {
  border-color: var(--brand-red);
  background: rgba(255, 26, 26, 0.06);
  color: var(--brand-red);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 4rem;
  text-align: center;
  position: relative;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

/* Hero logo image */
.hero__logo-mark {
  margin-bottom: 2rem;
  animation: fade-slide-up var(--duration-entrance) var(--ease-out) 0.1s both;
}

.hero__logo-img {
  height: 60px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(255, 26, 26, 0.2));
}

/* ============================================================
   GLITCH EFFECT — COMING SOON (large)
   ============================================================ */
.glitch-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
}

.glitch {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.5rem, 12vw, 8.5rem);
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--fg-primary);
  position: relative;
  display: inline-block;
  text-transform: uppercase;
  animation: glitch-skew 4s steps(2, end) infinite;
}

/* Pseudo-element layers for chromatic split */
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.glitch::before {
  color: var(--brand-red);
  z-index: -1;
  animation: glitch-red 3s steps(2, end) infinite;
  clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);
}

.glitch::after {
  color: #00e5ff;
  z-index: -2;
  animation: glitch-cyan 2.5s steps(2, end) infinite reverse;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-skew {
  0%    { transform: skewX(0deg); }
  2%    { transform: skewX(-2deg); }
  4%    { transform: skewX(0deg); }
  40%   { transform: skewX(0deg); }
  42%   { transform: skewX(1.5deg); }
  44%   { transform: skewX(0deg); }
  80%   { transform: skewX(0deg); }
  82%   { transform: skewX(-1deg); }
  83%   { transform: skewX(0deg); }
  100%  { transform: skewX(0deg); }
}

@keyframes glitch-red {
  0%    { transform: translate(0); clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%); }
  5%    { transform: translate(-5px, -2px); clip-path: polygon(0 15%, 100% 15%, 100% 30%, 0 30%); }
  10%   { transform: translate(4px, 1px); clip-path: polygon(0 50%, 100% 50%, 100% 65%, 0 65%); }
  15%   { transform: translate(0); clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%); }
  50%   { transform: translate(0); clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%); }
  52%   { transform: translate(-7px, 1px); clip-path: polygon(0 70%, 100% 70%, 100% 85%, 0 85%); }
  54%   { transform: translate(0); clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%); }
  100%  { transform: translate(0); clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%); }
}

@keyframes glitch-cyan {
  0%    { transform: translate(0); clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%); }
  8%    { transform: translate(6px, 2px); clip-path: polygon(0 25%, 100% 25%, 100% 45%, 0 45%); }
  12%   { transform: translate(-4px, -1px); clip-path: polygon(0 75%, 100% 75%, 100% 90%, 0 90%); }
  16%   { transform: translate(0); clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%); }
  55%   { transform: translate(0); clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%); }
  57%   { transform: translate(5px, -1px); clip-path: polygon(0 10%, 100% 10%, 100% 35%, 0 35%); }
  59%   { transform: translate(0); clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%); }
  100%  { transform: translate(0); clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%); }
}

.hero__subtitle {
  font-size: 1.05rem;
  color: var(--fg-secondary);
  max-width: 500px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
  animation: fade-slide-up var(--duration-entrance) var(--ease-out) 0.5s both;
}

/* ---- Signup ---- */
.signup {
  animation: fade-slide-up var(--duration-entrance) var(--ease-out) 0.65s both;
}

.signup__field {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 440px;
  margin: 0 auto;
  border-radius: 2px;
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
  padding: 4px;
  transition: border-color var(--duration-micro) var(--ease-out),
              box-shadow var(--duration-micro) var(--ease-out);
}

.signup__field:focus-within {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(255, 26, 26, 0.08),
              0 0 30px rgba(255, 26, 26, 0.04);
}

.signup__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.7rem 1.2rem;
  font-size: 0.9rem;
  color: var(--fg-primary);
}

.signup__input::placeholder {
  color: var(--fg-muted);
}

.signup__btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  border-radius: 2px;
  background: var(--brand-red);
  color: #050505;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: transform var(--duration-micro) var(--ease-out),
              box-shadow var(--duration-micro) var(--ease-out),
              background var(--duration-micro) var(--ease-out);
}

.signup__btn:hover {
  background: #ff3333;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255, 26, 26, 0.25),
              0 0 40px rgba(255, 26, 26, 0.08);
}

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

.signup__btn-icon {
  width: 16px;
  height: 16px;
  transition: transform var(--duration-micro) var(--ease-out);
}

.signup__btn:hover .signup__btn-icon {
  transform: translateX(3px);
}

.signup__hint {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 0.8rem;
}

.signup__success {
  display: none;
  font-size: 0.85rem;
  color: var(--brand-red);
  margin-top: 0.8rem;
  animation: fade-slide-up 0.4s var(--ease-out);
}

.signup--submitted .signup__field { display: none; }
.signup--submitted .signup__hint { display: none; }
.signup--submitted .signup__success { display: block; }

/* ============================================================
   TEASERS
   ============================================================ */
.teasers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  padding: 3rem 2rem 4rem;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.teaser {
  padding: 1.75rem 1.4rem;
  border-radius: 2px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-raised);
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration-panel) var(--ease-out),
              transform var(--duration-micro) var(--ease-out),
              box-shadow var(--duration-panel) var(--ease-out);
  opacity: 0;
  transform: translateY(24px);
  animation: teaser-in var(--duration-entrance) var(--ease-out) forwards;
}

.teaser:nth-child(1) { animation-delay: 0.9s; }
.teaser:nth-child(2) { animation-delay: 1.0s; }
.teaser:nth-child(3) { animation-delay: 1.1s; }
.teaser:nth-child(4) { animation-delay: 1.2s; }
.teaser:nth-child(5) { animation-delay: 1.3s; }
.teaser:nth-child(6) { animation-delay: 1.4s; }

@keyframes teaser-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Red top accent line on hover */
.teaser::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-panel) var(--ease-out);
}

.teaser:hover::before {
  transform: scaleX(1);
}

.teaser:hover {
  border-color: var(--border-emphasis);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(255, 26, 26, 0.06),
              0 0 60px rgba(255, 26, 26, 0.02);
}

.teaser__icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 2px;
  background: rgba(255, 26, 26, 0.05);
  border: 1px solid rgba(255, 26, 26, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
  color: var(--brand-red);
  transition: background var(--duration-micro) var(--ease-out),
              border-color var(--duration-micro) var(--ease-out);
}

.teaser:hover .teaser__icon-wrap {
  background: rgba(255, 26, 26, 0.08);
  border-color: rgba(255, 26, 26, 0.2);
}

.teaser__icon {
  width: 20px;
  height: 20px;
}

.teaser__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.teaser__desc {
  font-size: 0.82rem;
  color: var(--fg-secondary);
  line-height: 1.6;
}

/* ---- Shopee CTA ---- */
.shopee-cta {
  text-align: center;
  padding: 0 2rem 3rem;
  animation: fade-slide-up var(--duration-entrance) var(--ease-out) 1.4s both;
}

.shopee-cta__link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.5rem;
  border-radius: 2px;
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
  color: var(--fg-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color var(--duration-micro) var(--ease-out),
              border-color var(--duration-micro) var(--ease-out),
              background var(--duration-micro) var(--ease-out),
              box-shadow var(--duration-micro) var(--ease-out),
              transform var(--duration-micro) var(--ease-out);
}

.shopee-cta__link:hover {
  color: var(--fg-primary);
  border-color: var(--brand-red);
  background: rgba(255, 26, 26, 0.04);
  box-shadow: 0 0 20px rgba(255, 26, 26, 0.06);
  transform: translateY(-1px);
}

.shopee-cta__logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.shopee-cta__arrow {
  width: 16px;
  height: 16px;
  transition: transform var(--duration-micro) var(--ease-out);
}

.shopee-cta__link:hover .shopee-cta__arrow {
  transform: translateX(3px);
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.footer__social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 1rem;
}

.footer__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 2px;
  border: 1px solid var(--border-subtle);
  color: var(--fg-muted);
  transition: color var(--duration-micro) var(--ease-out),
              border-color var(--duration-micro) var(--ease-out),
              background var(--duration-micro) var(--ease-out),
              transform var(--duration-micro) var(--ease-out);
}

.footer__link:hover {
  color: var(--brand-red);
  border-color: var(--brand-red);
  background: rgba(255, 26, 26, 0.04);
  transform: translateY(-2px);
}

.footer__link svg {
  width: 18px;
  height: 18px;
}

.footer__copy {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

/* ---- Animations ---- */
@keyframes fade-slide-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-slide-down {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .topbar {
    padding: 1rem 1.25rem;
  }

  .topbar__logo-img {
    height: 22px;
  }

  .hero {
    padding: 1.5rem 1.25rem 3rem;
  }

  .hero__logo-img {
    height: 44px;
  }

  .glitch {
    font-size: clamp(2.2rem, 12vw, 4rem);
  }

  .hero__subtitle {
    font-size: 0.9rem;
  }

  .signup__field {
    flex-direction: column;
    border-radius: 2px;
    padding: 6px;
  }

  .signup__input {
    width: 100%;
    text-align: center;
    padding: 0.6rem 1rem;
  }

  .signup__btn {
    width: 100%;
    justify-content: center;
    padding: 0.7rem;
  }

  .teasers__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .teasers {
    padding: 2rem 1.25rem 3rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .teasers__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
