/* ==========================================================================
   assets/css/page-transition.css
   ARTYNOVA MANAGEMENT SYSTEM — CINEMATIC ARCHITECTURAL KITCHEN TRANSITION
   (BALANCED LUXURY CINEMATIC PACE: ~3.6s - 3.8s DURATION)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. MAIN OVERLAY CONTAINER
   -------------------------------------------------------------------------- */
#page-transition {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Active State (Entering) */
#page-transition.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Exit State (Dissolving Out) */
#page-transition.exiting {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. ARCHITECTURAL CAD BLUEPRINT BACKDROP
   -------------------------------------------------------------------------- */
.artynova-blueprint-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #112038 0%, #0c1626 60%, #050a12 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* CAD Coordinate Grid Matrix */
.artynova-cad-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1);
}

#page-transition.active .artynova-cad-grid {
  opacity: 1;
}

.cad-grid-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(56, 189, 248, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(245, 158, 11, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.04) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 200px 200px, 200px 200px;
  background-position: center center;
}

/* Technical Corner Crosshairs */
.cad-crosshair {
  position: absolute;
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 10px;
  color: rgba(56, 189, 248, 0.4);
  letter-spacing: 0.5px;
  user-select: none;
}
.ch-top-left     { top: 24px; left: 28px; }
.ch-top-right    { top: 24px; right: 28px; }
.ch-bottom-left  { bottom: 24px; left: 28px; }
.ch-bottom-right { bottom: 24px; right: 28px; }

.cad-scale-marker {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 9px;
  color: rgba(245, 158, 11, 0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   3. KITCHEN BLUEPRINT SVG ANIMATIONS (SMOOTH 2.6s SKETCH SEQUENCE)
   -------------------------------------------------------------------------- */
.artynova-kitchen-blueprint {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0.9;
}

.blueprint-svg {
  width: 90%;
  max-width: 860px;
  height: auto;
  max-height: 85vh;
  filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.25));
}

/* SVG Line Styles */
.dim-line, .dim-leader, .dim-arrow {
  stroke: rgba(245, 158, 11, 0.7);
  stroke-width: 1.2;
  fill: none;
}
.dim-text {
  fill: rgba(245, 158, 11, 0.88);
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 1.0s ease 0.8s;
}
#page-transition.active .dim-text {
  opacity: 1;
}

.dim-text-vert {
  transform-origin: 720px 330px;
  transform: rotate(90deg);
}

.cabinet-outer {
  stroke: #38bdf8;
  stroke-width: 2.2;
  fill: rgba(56, 189, 248, 0.03);
}

.cabinet-inner, .cabinet-divider, .drawer-divider {
  stroke: rgba(56, 189, 248, 0.75);
  stroke-width: 1.4;
  fill: none;
}

.led-channel {
  stroke: #fbbf24;
  stroke-width: 2;
  stroke-dasharray: 6 3;
}

.countertop-slab {
  stroke: #f59e0b;
  stroke-width: 2.5;
  fill: rgba(245, 158, 11, 0.08);
}
.countertop-bevel {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 1;
}

.handle-gola {
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 2;
}

.appliance-box {
  stroke: rgba(56, 189, 248, 0.55);
  stroke-width: 1.5;
  fill: rgba(56, 189, 248, 0.02);
}

.hinge-indicator {
  fill: #f59e0b;
  opacity: 0;
  transition: opacity 0.8s ease 1.4s;
}
#page-transition.active .hinge-indicator {
  opacity: 1;
}

.plinth-base {
  stroke: rgba(56, 189, 248, 0.6);
  stroke-width: 1.5;
  fill: rgba(15, 23, 42, 0.4);
}

.focal-ring-outer {
  stroke: rgba(56, 189, 248, 0.35);
  stroke-width: 1.5;
  fill: none;
}
.focal-ring-inner {
  stroke: rgba(245, 158, 11, 0.5);
  stroke-width: 1.2;
  fill: none;
}
.focal-center-dot {
  fill: #38bdf8;
}
.focal-cross-h, .focal-cross-v {
  stroke: rgba(56, 189, 248, 0.25);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

/* Staggered Stroke Dash Sketching Animations (2.6s) */
#page-transition.active .cabinet-outer,
#page-transition.active .countertop-slab,
#page-transition.active .cabinet-inner,
#page-transition.active .dim-line,
#page-transition.active .drawer-divider,
#page-transition.active .cabinet-divider,
#page-transition.active .handle-gola,
#page-transition.active .appliance-box,
#page-transition.active .plinth-base {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: sketchBlueprintSmooth 2.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

#page-transition.active .focal-ring-inner {
  animation: rotateCompass 14s linear infinite;
  transform-origin: 400px 250px;
}

@keyframes sketchBlueprintSmooth {
  0% {
    stroke-dashoffset: 1400;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes rotateCompass {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   4. CENTER FOCAL STAGE & ARTYNOVA BRANDING (PROMINENT CINEMATIC LOGO)
   -------------------------------------------------------------------------- */
.artynova-focal-stage {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: translate3d(0, 0, 0);
  width: 100%;
  max-width: 520px;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Warm Radiant Architectural Glow */
.focal-glow-disc {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.28) 0%, rgba(245, 158, 11, 0.14) 45%, transparent 75%);
  filter: blur(36px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease 1.2s, transform 1.4s ease 1.2s;
}

#page-transition.active .focal-glow-disc {
  opacity: 1;
  animation: pulseAura 3s ease-in-out infinite alternate;
}

@keyframes pulseAura {
  0%   { transform: scale(0.92); opacity: 0.55; }
  100% { transform: scale(1.15); opacity: 1; }
}

/* Logo Presentation Frame (Spacious Architectural Mount) */
.logo-blueprint-frame {
  position: relative;
  padding: 22px 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.38);
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.7), 
              0 0 40px rgba(56, 189, 248, 0.22),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: scale(0.85);
  opacity: 0;
  transition: transform 1.4s cubic-bezier(0.16, 1, 0.3, 1) 1.5s,
              opacity 1.3s ease 1.5s;
  max-width: 90vw;
  box-sizing: border-box;
}

#page-transition.active .logo-blueprint-frame {
  transform: scale(1);
  opacity: 1;
}

/* Large, High-Presence Artynova Logo (Desktop: 320px - 420px) */
.artynova-transition-logo {
  width: 100%;
  max-width: 380px;
  height: auto;
  max-height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.65));
  display: block;
}

/* Brand Typography (Reveal at 2.1s) */
.artynova-transition-tagline {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(8px);
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1) 2.1s,
              opacity 1.1s ease 2.1s;
}

#page-transition.active .artynova-transition-tagline {
  opacity: 1;
  transform: translateY(0);
}

.tagline-sub {
  font-family: 'Cairo', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.5px;
}

.tagline-tech {
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 10px;
  font-weight: 600;
  color: #f59e0b;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

/* Sleek Progress Indicator Bar (Fills continuously over 3.4s) */
.blueprint-loading-track {
  margin-top: 22px;
  width: 180px;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.blueprint-loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #f59e0b);
  border-radius: 4px;
  box-shadow: 0 0 10px #38bdf8;
  transition: width 3.4s cubic-bezier(0.15, 0.85, 0.15, 1);
}

#page-transition.active .blueprint-loading-bar {
  width: 100%;
}

/* --------------------------------------------------------------------------
   5. MINI LOADER FOR AJAX & COMPACT INTERACTIONS
   -------------------------------------------------------------------------- */
.artynova-mini-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 28px;
  height: 28px;
}
.artynova-mini-loader::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-right-color: #f59e0b;
  animation: miniSpin 1.2s linear infinite;
}
@keyframes miniSpin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   6. ACCESSIBILITY & RESPONSIVE ADAPTATIONS
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .artynova-transition-logo {
    max-width: 320px;
    max-height: 95px;
  }
  .logo-blueprint-frame {
    padding: 18px 28px;
    border-radius: 22px;
  }
  .focal-glow-disc {
    width: 330px;
    height: 330px;
  }
}

@media (max-width: 640px) {
  .cad-crosshair, .cad-scale-marker {
    display: none;
  }
  .blueprint-svg {
    width: 98%;
    max-height: 65vh;
  }
  .artynova-focal-stage {
    max-width: 100%;
    padding: 0 16px;
  }
  /* Mobile: 220px - 300px range */
  .artynova-transition-logo {
    max-width: 260px;
    max-height: 80px;
  }
  .logo-blueprint-frame {
    padding: 14px 20px;
    border-radius: 18px;
  }
  .focal-glow-disc {
    width: 260px;
    height: 260px;
  }
  .tagline-sub {
    font-size: 12px;
  }
  .tagline-tech {
    font-size: 8px;
    letter-spacing: 1.5px;
  }
  .blueprint-loading-track {
    width: 140px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #page-transition,
  #page-transition.active,
  #page-transition.exiting {
    transition: opacity 0.2s linear;
  }
  .blueprint-svg,
  .focal-glow-disc,
  .focal-ring-inner,
  .cabinet-outer,
  .countertop-slab {
    animation: none !important;
  }
}
