/* ============================================
   FORJA — Intro Animation
   Premium Brand Opening
   ============================================ */

body.intro-active {
  overflow: hidden !important;
  height: 100vh !important;
}

body.intro-active .header,
body.intro-active main,
body.intro-active footer,
body.intro-active .sparks-canvas {
  opacity: 0 !important;
  pointer-events: none !important;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
}

/* Canvas for spark particles */
.intro-overlay__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Ambient radial glow */
.intro-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 106, 59, 0.12) 0%, rgba(140, 106, 59, 0.04) 40%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.intro-glow--animate {
  animation: introGlow 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes introGlow {
  0%   { width: 0; height: 0; opacity: 0; }
  40%  { opacity: 1; }
  100% { width: 800px; height: 800px; opacity: 1; }
}

.intro-glow--expand {
  animation: introGlowExpand 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes introGlowExpand {
  0%   { width: 800px; height: 800px; opacity: 1; }
  100% { width: 1600px; height: 1600px; opacity: 0; }
}

/* Heated metal line */
.intro-line {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #8C6A3B 20%, #D8D1C7 50%, #8C6A3B 80%, transparent 100%);
  box-shadow:
    0 0 15px rgba(140, 106, 59, 0.6),
    0 0 40px rgba(140, 106, 59, 0.2);
  opacity: 0;
  z-index: 2;
}

.intro-line--grow {
  animation: introLineGrow 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes introLineGrow {
  0%   { width: 0; opacity: 0; }
  20%  { opacity: 1; }
  100% { width: 180px; opacity: 1; }
}

.intro-line--impact {
  animation: introLineImpact 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes introLineImpact {
  0%   { width: 180px; opacity: 1; height: 1px;
         box-shadow: 0 0 15px rgba(140, 106, 59, 0.6), 0 0 40px rgba(140, 106, 59, 0.2); }
  30%  { width: 220px; height: 2px;
         box-shadow: 0 0 40px rgba(140, 106, 59, 0.9), 0 0 80px rgba(140, 106, 59, 0.4), 0 0 120px rgba(140, 106, 59, 0.15); }
  100% { width: 0; opacity: 0; height: 1px;
         box-shadow: 0 0 0 transparent; }
}

/* Brand container */
.intro-brand {
  position: relative;
  z-index: 3;
  text-align: center;
  opacity: 0;
  transform: scale(0.92);
}

.intro-brand--reveal {
  animation: introBrandReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes introBrandReveal {
  0%   { opacity: 0; transform: scale(0.92); filter: brightness(2.5) saturate(0); }
  40%  { opacity: 1; filter: brightness(1.8) saturate(0.5); }
  100% { opacity: 1; transform: scale(1); filter: brightness(1) saturate(1); }
}

.intro-brand__logo {
  height: 270px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.intro-brand__tagline {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-style: italic;
  font-weight: 400;
  color: #8C6A3B;
  letter-spacing: 0.12em;
  margin-top: 32px;
  opacity: 0;
  transform: translateY(8px);
}

.intro-brand__tagline--reveal {
  animation: introTaglineReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes introTaglineReveal {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 0.6; transform: translateY(0); }
}

/* Exit */
.intro-overlay--exit {
  animation: introExit 1s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes introExit {
  0%   { opacity: 1; }
  100% { opacity: 0; pointer-events: none; }
}

/* Subtle grain texture */
.intro-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .intro-brand__logo {
    height: 160px;
  }

  .intro-brand__tagline {
    font-size: 1.25rem;
    letter-spacing: 0.08em;
  }

  @keyframes introGlow {
    0%   { width: 0; height: 0; opacity: 0; }
    40%  { opacity: 1; }
    100% { width: 400px; height: 400px; opacity: 1; }
  }

  @keyframes introGlowExpand {
    0%   { width: 400px; height: 400px; opacity: 1; }
    100% { width: 800px; height: 800px; opacity: 0; }
  }
}
