/* ── Tokens ── */
:root {
  --black: #000000;
  --white: #ffffff;
  --gold: #c5b391;
  --gold-dim: rgba(197, 179, 145, 0.35);
  --gold-glow: rgba(197, 179, 145, 0.45);
  --cyan: rgba(0, 255, 255, 0.7);
  --magenta: rgba(255, 0, 128, 0.7);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background: var(--black);
  color: var(--white);
  font-family: "Montserrat", system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background layers ── */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(197, 179, 145, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(197, 179, 145, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, black 20%, transparent 75%);
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 42%, rgba(197, 179, 145, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particles::before,
.particles::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow:
    12vw 18vh 0 0 var(--gold-dim),
    78vw 12vh 0 0 rgba(255, 255, 255, 0.15),
    45vw 72vh 0 0 var(--gold-dim),
    88vw 65vh 0 0 rgba(255, 255, 255, 0.1),
    22vw 55vh 0 0 var(--gold-dim),
    65vw 38vh 0 0 rgba(255, 255, 255, 0.12),
    5vw 82vh 0 0 var(--gold-dim),
    92vw 28vh 0 0 rgba(255, 255, 255, 0.08);
  animation: drift 20s linear infinite;
}

.particles::after {
  animation-delay: -10s;
  opacity: 0.6;
}

/* ── Hero layout ── */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 3vw, 1.25rem);
  padding:
    calc(var(--safe-top) + 1.5rem)
    1.25rem
    calc(var(--safe-bottom) + 1.5rem);
  text-align: center;
}

/* ── Headline ── */
.headline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 22rem;
  margin-bottom: 0.25rem;
}

.headline-line {
  font-size: clamp(0.62rem, 2.8vw, 0.85rem);
  letter-spacing: 0.38em;
  font-weight: 300;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.9s ease forwards;
}

.headline-line:first-child {
  animation-delay: 0.1s;
}

.headline-accent {
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.22em;
  animation-delay: 0.35s;
}

/* ── Logo + glitch ── */
.logo-wrap {
  position: relative;
  width: min(88vw, 420px);
  margin: 0.5rem 0 0.25rem;
  opacity: 0;
  transform: scale(0.96);
  animation: logoIn 1s ease 0.5s forwards;
}

.logo-stack {
  position: relative;
  line-height: 0;
}

.logo-main,
.logo-layer {
  display: block;
  width: 100%;
  height: auto;
}

.logo-main {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 14px rgba(197, 179, 145, 0.35));
  animation: pulseGlow 4s ease-in-out infinite;
}

.logo-glitch {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.logo-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  opacity: 0;
}

.logo-wrap.glitch-active .logo-cyan {
  animation: glitchCyan 0.1s steps(2) 5;
}

.logo-wrap.glitch-active .logo-magenta {
  animation: glitchMagenta 0.1s steps(2) 5;
}

.scan-line {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: linear-gradient(
    transparent 38%,
    rgba(197, 179, 145, 0.55) 50%,
    transparent 62%
  );
  animation: scan 5s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
  -webkit-mask-image: url("assets/imal-logo.png");
  mask-image: url("assets/imal-logo.png");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* ── Tagline ── */
.tagline {
  font-size: clamp(0.55rem, 2.2vw, 0.7rem);
  letter-spacing: 0.32em;
  font-weight: 400;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.85s forwards;
  line-height: 1.8;
}

.tagline .accent {
  color: var(--gold);
}

.tagline .sep {
  margin: 0 0.35em;
  opacity: 0.4;
  letter-spacing: 0;
}

/* ── Globe + subtag ── */
.globe {
  width: clamp(22px, 6vw, 28px);
  height: auto;
  color: var(--gold);
  opacity: 0;
  animation: fadeUp 0.8s ease 1s forwards;
}

.subtag {
  font-size: clamp(0.55rem, 2vw, 0.65rem);
  letter-spacing: 0.48em;
  font-weight: 300;
  opacity: 0;
  color: rgba(255, 255, 255, 0.65);
  animation: fadeUp 0.8s ease 1.1s forwards;
}

/* ── Badge ── */
.badge {
  margin-top: clamp(0.75rem, 4vw, 1.5rem);
  background: var(--gold);
  color: var(--black);
  padding: 0.4rem 1.4rem;
  border-radius: 999px;
  font-size: clamp(0.55rem, 2vw, 0.65rem);
  letter-spacing: 0.35em;
  font-weight: 600;
  opacity: 0;
  animation: fadeUp 0.8s ease 1.25s forwards;
}

/* ── Instagram ── */
.instagram-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: clamp(1rem, 5vw, 1.75rem);
  padding: 0.75rem;
  color: var(--white);
  text-decoration: none;
  opacity: 0;
  animation: fadeUp 0.8s ease 1.4s forwards;
  transition: color 0.25s ease, transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.instagram-link:hover,
.instagram-link:focus-visible {
  color: var(--gold);
  transform: translateY(-2px);
}

.instagram-link:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
  border-radius: 8px;
}

.instagram-icon {
  width: clamp(26px, 7vw, 30px);
  height: clamp(26px, 7vw, 30px);
}

.instagram-handle {
  font-size: clamp(0.55rem, 2vw, 0.65rem);
  letter-spacing: 0.22em;
  font-weight: 400;
  text-transform: lowercase;
}

/* ── Animations ── */
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logoIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes glitchCyan {
  0%, 100% { opacity: 0; transform: translate(0); filter: none; }
  50% {
    opacity: 1;
    transform: translate(-5px, 1px);
    filter: drop-shadow(3px 0 0 rgba(0, 255, 255, 0.85));
  }
}

@keyframes glitchMagenta {
  0%, 100% { opacity: 0; transform: translate(0); filter: none; }
  50% {
    opacity: 1;
    transform: translate(5px, -1px);
    filter: drop-shadow(-3px 0 0 rgba(255, 0, 128, 0.85));
  }
}

@keyframes pulseGlow {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.15));
  }
  50% {
    filter:
      drop-shadow(0 0 18px rgba(197, 179, 145, 0.55))
      drop-shadow(0 0 32px rgba(197, 179, 145, 0.25));
  }
}

@keyframes scan {
  0%, 100% { transform: translateY(-110%); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translateY(110%); opacity: 1; }
  60% { opacity: 0; }
}

@keyframes ringPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.02); }
}

@keyframes drift {
  0% { transform: translateY(0); }
  100% { transform: translateY(-30px); }
}

/* ── Small phones ── */
@media (max-width: 360px) {
  .headline-accent {
    letter-spacing: 0.14em;
    font-size: clamp(0.58rem, 2.6vw, 0.75rem);
  }

  .tagline {
    letter-spacing: 0.18em;
    font-size: 0.5rem;
  }
}
@media (min-width: 640px) {
  .hero {
    gap: 1.5rem;
  }

  .headline {
    max-width: 32rem;
  }

  .logo-wrap {
    width: min(460px, 55vw);
  }

  .tagline {
    letter-spacing: 0.38em;
  }
}

@media (min-width: 1024px) {
  .logo-wrap {
    width: 480px;
  }

  .headline-line {
    letter-spacing: 0.42em;
  }

  .headline-accent {
    letter-spacing: 0.28em;
  }
}

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

  .logo-wrap.glitch-active .logo-cyan,
  .logo-wrap.glitch-active .logo-magenta {
    animation: none;
  }
}
