/* — loader + index-page CSS — */

:root {
  --l_primary: #8338ec;
  --l_secondary: #ffffff;
  --l_main-font: 'Poppins', sans-serif;
  --l_stroke-duration: 3s;
  --l_fill-duration: 1.5s;
  --l_bar-thickness: 3px;
  --l_bar-length: 20%;
  --l_bar-duration: 1s;        /* faster loop */
}

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

body {
  font-family: var(--l_main-font);
  background-color: #000000;
  overflow: hidden;
  color: var(--l_secondary);
}

.l_fullpage-wrapper {
  height: 100%;
  position: relative;
}

.l_line-drawing-demo {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.l_line-drawing-demo.l_processing {
  overflow: hidden;
  position: fixed;
  z-index: 999;
  width: 100%;
  height: 100%;
  background-color: var(--l_primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.l_line-drawing-demo.l_completed {
  z-index: 999;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.l_line-drawing-demo.l_completed-full {
  display: none!important;
}

.l_svg-wrapper {
  width: 500px;
  height: auto;
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
}

svg {
  width: 100%;
}

svg text {
  stroke: var(--l_secondary);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: l_drawStroke var(--l_stroke-duration) cubic-bezier(0.76, 0, 0.24, 1) forwards;
  paint-order: stroke;
}

/* refill via CSS animation (polygon clip‐path works inside SVG) */
.l_fill-text {
  fill: var(--l_secondary);
  stroke: transparent;
  clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
  animation: l_fillText var(--l_fill-duration) ease-in-out var(--l_stroke-duration) forwards;
}

/* secondary text stroke */
svg text.l_secondary-stroke {
  font-size: 24px;
  font-family: Poppins, sans-serif;
  text-anchor: middle;
  stroke: var(--l_secondary);
  stroke-width: 1.5;
  fill: transparent;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: l_drawStroke var(--l_stroke-duration) cubic-bezier(0.76, 0, 0.24, 1) forwards;
  paint-order: stroke;
}

/* secondary text fill */
svg text.l_secondary-fill {
  font-size: 24px;
  font-family: Poppins, sans-serif;
  text-anchor: middle;
  fill: var(--l_secondary);
  stroke: transparent;
  clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
  animation: l_fillText var(--l_fill-duration) ease-in-out var(--l_stroke-duration) forwards;
}

@keyframes l_fillText {
  from {
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
  }
  to {
    clip-path: polygon(0 0%,   100% 0%,   100% 100%, 0 100%);
  }
}

@keyframes l_drawStroke {
  0% {
    stroke-dashoffset: 600;
    fill: transparent;
  }
  100% {
    stroke-dashoffset: 0;
    fill: transparent;
  }
}

.l_splash-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--l_primary);
  z-index: -1;
}

.l_splash-background.l_completed {
  background: var(--l_primary);
  animation: l_panUp 1.1s cubic-bezier(.075,.82,.165,1) forwards;
}

@keyframes l_panUp {
  0% {
    transform: translateY(0);
  }
  to {
    transform: translateY(-100vh);
  }
}

/* Updated logo container without underline */
.l_logo-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#l_main-content {
  opacity: 0;
  transition: opacity 0.5s ease-in;
  position: relative;
  z-index: 1;
  padding: 50px;
  color: var(--l_secondary);
  background-color: #000000;
  height: 100vh;
  width: 100%;
}

#l_main-content.l_show {
  opacity: 1;
}

/* smoother, GPU‐accelerated loading bar */
#l_loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 20%;
  background: var(--l_secondary);
  transform: translateX(-100%);
  animation: l_loading var(--l_bar-duration) cubic-bezier(0.65, 0.05, 0.36, 1) infinite;
  z-index: 10000;
}

@keyframes l_loading {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100vw); }
}

/* side loading bars (all use same length/thickness/duration) */
#l_loading-bar-top,
#l_loading-bar-bottom {
  position: fixed;
  left: 0;
  width: var(--l_bar-length);
  height: var(--l_bar-thickness);
  background: var(--l_secondary);
  animation: l_loading-horizontal var(--l_bar-duration) ease-in-out infinite;
  z-index: 10000;
}
#l_loading-bar-top { top: 0; }
#l_loading-bar-bottom { bottom: 0; left: 0; width: var(--l_bar-length); height: var(--l_bar-thickness); animation-name: l_loading-horizontal; animation-direction: reverse; /* added: reverse direction */ }

#l_loading-bar-left,
#l_loading-bar-right {
  position: fixed;
  top: 0;
  width: var(--l_bar-thickness);
  height: var(--l_bar-length);
  background: var(--l_secondary);
  animation: l_loading-vertical var(--l_bar-duration) ease-in-out infinite;
  z-index: 10000;
}
#l_loading-bar-left { left: 0; top: 0; left: 0; width: var(--l_bar-thickness); height: var(--l_bar-length); animation-name: l_loading-vertical; animation-direction: reverse; /* added: reverse direction */ }
#l_loading-bar-right { right: 0; }

@keyframes l_loading-horizontal {
  from { transform: translateX(-100%); }
  to   { transform: translateX(calc(100vw + var(--l_bar-length))); }
}
@keyframes l_loading-vertical {
  from { transform: translateY(-100%); }
  to   { transform: translateY(calc(100vh + var(--l_bar-length))); }
}

/* reset base so no bar animates by default */
#l_loading-bar-top,
#l_loading-bar-right,
#l_loading-bar-bottom,
#l_loading-bar-left {
  animation: none;
}

/* when .animate is added, run once */
#l_loading-bar-top.l_animate {
  animation: l_loading-horizontal var(--l_bar-duration) ease-in-out forwards;
  animation-direction: normal;
}
#l_loading-bar-right.l_animate {
  animation: l_loading-vertical   var(--l_bar-duration) ease-in-out forwards;
  animation-direction: normal;
}
#l_loading-bar-bottom.l_animate {
  animation: l_loading-horizontal var(--l_bar-duration) ease-in-out forwards;
  animation-direction: reverse;
}
#l_loading-bar-left.l_animate {
  animation: l_loading-vertical   var(--l_bar-duration) ease-in-out forwards;
  animation-direction: reverse;
}

/* hide bars when not moving */
#l_loading-bar-top,
#l_loading-bar-right,
#l_loading-bar-bottom,
#l_loading-bar-left {
  opacity: 0;
}

/* show bars during their animation */
#l_loading-bar-top.l_animate,
#l_loading-bar-right.l_animate,
#l_loading-bar-bottom.l_animate,
#l_loading-bar-left.l_animate {
  opacity: 1;
}

@media screen and (max-width: 600px) {
  .l_svg-wrapper {
    width: 80%;
    max-width: 350px;
  }
  /* make VEER text larger on mobile */
  svg text {
    font-size: 200px !important;
  }
  /* allow SVG to overflow the fixed-height wrapper */
  .l_line-drawing-demo.l_processing {
    overflow: visible;
  }
  svg {
    overflow: visible;
  }
}

@media screen and (max-width: 460px) {
  .l_line-drawing-demo {
    height: 100%;
  }
  
  @keyframes l_panUp {
    0% {
      transform: translateY(0);
    }
    to {
      transform: translateY(-100%);
    }
  }
}

/* Mobile Optimization - Improved loading experience */
@media screen and (max-width: 768px) {
  /* Adjust SVG size for better visibility on mobile */
  .l_svg-wrapper {
    width: 90%;
    max-width: 320px;
  }
  
  /* Increase loading bar thickness for better visibility on mobile */
  :root {
    --l_bar-thickness: 4px;
    --l_bar-length: 30%;
  }
  
  /* Adjust main text size for mobile */
  svg text:not(.l_secondary-stroke, .l_secondary-fill) {
    font-size: 70px !important;
  }
  
  /* Adjust secondary text size for mobile */
  svg text.l_secondary-stroke,
  svg text.l_secondary-fill {
    font-size: 16px !important; 
    stroke-width: 1px !important;
    y: 125px !important;
    text-anchor: middle !important;
    font-family: "Poppins", sans-serif !important;
    font-weight: 500 !important;
    letter-spacing: 0.5px !important;
  }
  
  /* Ensure colors are properly applied on mobile */
  :root {
    --l_primary: #8338ec;
    --l_secondary: #ffffff;
  }
  
  /* Make the SVG rendering more reliable on mobile */
  svg {
    width: 100%;
    height: auto;
    overflow: visible;
    shape-rendering: geometricPrecision;
    text-rendering: geometricPrecision;
  }
  
  /* Improve performance by simplifying animations on mobile */
  @keyframes l_drawStroke {
    to {
      stroke-dashoffset: 0;
      fill: transparent;
    }
  }
  
  /* Make loading bars more visible on mobile */
  #l_loading-bar-top.l_animate,
  #l_loading-bar-right.l_animate,
  #l_loading-bar-bottom.l_animate,
  #l_loading-bar-left.l_animate {
    opacity: 0.8;
  }
  
  /* Better content transition for mobile */
  #l_main-content.l_show {
    transition: opacity 0.3s ease-in;
  }
}

/* Small phones optimization */
@media screen and (max-width: 375px) {
  .l_svg-wrapper {
    width: 85%;
    max-width: 280px;
  }
  
  svg text:not(.l_secondary-stroke, .l_secondary-fill) {
    font-size: 60px !important;
  }
  
  svg text.l_secondary-stroke,
  svg text.l_secondary-fill {
    font-size: 16px;
    y: 125px; /* Move slightly up on smaller screens */
  }
  
  /* Ensure SVG text doesn't overflow */
  .l_svg-wrapper {
    overflow: visible;
    padding: 0 5px;
  }
  
  /* Further reduce animation complexity for performance */
  :root {
    --l_stroke-duration: 2.5s;
    --l_fill-duration: 1.2s;
  }
}

/* Comprehensive mobile fixes */
@media screen and (max-width: 768px) {
  /* Fix text rendering completely */
  svg text.l_secondary-stroke,
  svg text.l_secondary-fill {
    font-size: 16px !important; 
    stroke-width: 1px !important;
    y: 125px !important;
    text-anchor: middle !important;
    font-family: "Poppins", sans-serif !important;
    font-weight: 500 !important;
    letter-spacing: 0.5px !important;
  }
  
  /* Ensure color consistency */
  .l_splash-background {
    background-color: #8338ec !important;
  }
  
  /* Improve SVG rendering on mobile */
  .l_svg-wrapper svg {
    max-height: 150px !important;
    height: auto !important;
    transform: scale(0.95) !important;
  }
}

/* Ultra small device fixes */
@media screen and (max-width: 360px) {
  /* Alternate solution for very small screens */
  .l_svg-wrapper svg text.l_secondary-stroke,
  .l_svg-wrapper svg text.l_secondary-fill {
    font-size: 14px !important;
    y: 120px !important;
    letter-spacing: 0px !important;
  }
}

/* — begin inlined template.css — */
/* General Styles */
:root {
  /* Colors - Light Mode */
  --l_primary-color: #3a86ff;
  --l_secondary-color: #8338ec;
  /* …all other template.css variables… */
  --l_dark_primary_color: #4d8cff;
  /* …etc… */
}
/* copy every rule from template.css here */
/* … */
/* — end inlined template.css — */

/* secondary label inside SVG */
.l_secondary-text {
  fill: var(--l_secondary);
  opacity: 0;
  letter-spacing: 2px;
  font-size: 24px;
  font-family: Poppins, sans-serif;
  animation: l_showSecondary 0.6s ease-in-out forwards;
  animation-delay: calc(var(--l_stroke-duration) + var(--l_fill-duration));
}
@keyframes l_showSecondary {
  to { opacity: 1; }
}
