/* --- About Page Hero Overhaul --- */
.about-hero-section {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #f8fafc;
  padding: 4rem 1rem;
}

.hero-bg-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.hero-threads-desktop, .hero-threads-mobile {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.hero-threads-desktop { display: block; }
.hero-threads-mobile { display: none; }

@media (max-width: 768px) {
  .hero-threads-desktop { display: none; }
  .hero-threads-mobile { display: block; }
}

@keyframes draw-hold-vanish-grp1 {
  0% { stroke-dasharray: 650; stroke-dashoffset: 650; opacity: 0; }
  15% { opacity: 1; }
  30% { stroke-dasharray: 650; stroke-dashoffset: 0; opacity: 1; }
  75% { stroke-dasharray: 650; stroke-dashoffset: 0; opacity: 1; }
  95%, 100% { stroke-dasharray: 650; stroke-dashoffset: -650; opacity: 0; }
}

@keyframes draw-vanish-grp2 {
  0%, 35% { stroke-dasharray: 750; stroke-dashoffset: 750; opacity: 0; }
  42% { opacity: 1; }
  65% { stroke-dasharray: 750; stroke-dashoffset: 80; opacity: 1; }
  85% { stroke-dasharray: 750; stroke-dashoffset: -200; opacity: 0.9; }
  100% { stroke-dasharray: 750; stroke-dashoffset: -750; opacity: 0; }
}

/* Floating animations */
@keyframes float-string-up-1 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes float-string-down-2 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
@keyframes float-string-up-3 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes float-string-down-4 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@keyframes float-string-up-5 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes float-string-down-6 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(14px); } }
@keyframes float-string-up-7 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }


.grp1-path {
  stroke-dasharray: 950;
  stroke-dashoffset: 950;
  opacity: 0;
  transform-origin: 0px 200px;
}

.grp2-path {
  stroke-dasharray: 750;
  stroke-dashoffset: 750;
  opacity: 0;
  transform-origin: 700px 660px;
}

@keyframes glass-reflection-top { 0% { opacity: 0; filter: blur(4px); } 20%, 75% { opacity: 0.95; filter: blur(0px); } 95%, 100% { opacity: 0; filter: blur(6px); } }
@keyframes glass-reflection-bottom { 0% { opacity: 0; filter: blur(4px); } 20%, 80% { opacity: 0.95; filter: blur(0px); } 95%, 100% { opacity: 0; filter: blur(6px); } }

.terminal-glass-edge-top {
  position: absolute; top: 0; left: 0; width: 320px; height: 220px; pointer-events: none; z-index: 5; border-top-left-radius: 24px; opacity: 0;
  background: radial-gradient(circle at 0% 50%, rgba(6, 182, 212, 0.45) 0%, rgba(250, 204, 21, 0.35) 25%, rgba(239, 68, 68, 0.3) 50%, rgba(168, 85, 247, 0.25) 75%, transparent 100%);
  box-shadow: inset 2px 2px 14px rgba(6, 182, 212, 0.5);
  -webkit-mask: radial-gradient(circle at top left, black 0%, transparent 70%);
  mask: radial-gradient(circle at top left, black 0%, transparent 70%);
  animation: glass-reflection-top 7s infinite ease-in-out 1.8s both;
}

.terminal-glass-edge-bottom {
  position: absolute; bottom: 0; right: 0; width: 480px; height: 140px; pointer-events: none; z-index: 5; border-bottom-right-radius: 24px; opacity: 0;
  background: radial-gradient(circle at 75% 100%, rgba(6, 182, 212, 0.35) 0%, rgba(249, 115, 22, 0.45) 30%, rgba(16, 185, 129, 0.35) 60%, rgba(168, 85, 247, 0.3) 80%, transparent 100%);
  box-shadow: inset -2px -2px 14px rgba(249, 115, 22, 0.45);
  -webkit-mask: radial-gradient(circle at bottom right, black 0%, transparent 70%);
  mask: radial-gradient(circle at bottom right, black 0%, transparent 70%);
  animation: glass-reflection-bottom 5s infinite ease-in-out 4.2s both;
}

@media (max-width: 768px) {
  .terminal-glass-edge-top-mobile {
    display: block; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 85%; height: 70px; pointer-events: none; z-index: 5; opacity: 0; border-top-left-radius: 24px; border-top-right-radius: 24px;
    background: radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.45) 0%, rgba(250, 204, 21, 0.35) 30%, rgba(239, 68, 68, 0.3) 60%, rgba(168, 85, 247, 0.25) 85%, transparent 100%);
    box-shadow: inset 0px 2px 10px rgba(6, 182, 212, 0.5);
    -webkit-mask: radial-gradient(circle at top, black 0%, transparent 70%);
    mask: radial-gradient(circle at top, black 0%, transparent 70%);
    animation: glass-reflection-top 7s infinite ease-in-out 1.8s both;
  }
  .terminal-glass-edge-top { display: none; }

  .terminal-glass-edge-bottom-mobile {
    display: block; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 90%; height: 70px; pointer-events: none; z-index: 5; opacity: 0; border-bottom-left-radius: 24px; border-bottom-right-radius: 24px;
    background: radial-gradient(circle at 50% 100%, rgba(6, 182, 212, 0.35) 0%, rgba(249, 115, 22, 0.45) 35%, rgba(16, 185, 129, 0.35) 70%, rgba(168, 85, 247, 0.3) 90%, transparent 100%);
    box-shadow: inset 0px -2px 10px rgba(249, 115, 22, 0.45);
    -webkit-mask: radial-gradient(circle at bottom, black 0%, transparent 70%);
    mask: radial-gradient(circle at bottom, black 0%, transparent 70%);
    animation: glass-reflection-bottom 5s infinite ease-in-out 4.2s both;
  }
  .terminal-glass-edge-bottom { display: none; }

  /* Mobile button reflection overlay (glow sweep) */
  .hero-btn {
    position: relative; /* Contain the absolute pseudo-element */
    overflow: hidden; /* Keep glow inside button borders */
  }
  
  /* Ensure the text and icon stay above the reflection glow */
  .hero-btn > span,
  .hero-btn > svg {
    position: relative;
    z-index: 2; 
  }
  
  .hero-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(
      135deg,
      rgba(37, 99, 235, 0) 0%,
      rgba(6, 182, 212, 0.45) 25%,
      rgba(168, 85, 247, 0.45) 50%,
      rgba(234, 88, 12, 0.35) 75%,
      rgba(37, 99, 235, 0) 100%
    );
    background-size: 250% 250%;
    background-position: 100% 100%;
    animation: periodic-overlay-sweep 6s ease-in-out infinite 1.8s;
  }
}

@keyframes periodic-overlay-sweep {
  0%   { opacity: 0; background-position: 100% 100%; }
  15%  { opacity: 1; }
  50%  { background-position: 0% 0%; }
  85%  { opacity: 1; }
  100% { opacity: 0; background-position: 0% 0%; }
}

.hero-grp1-container .string-indep-1 { animation: draw-hold-vanish-grp1 9s ease-in-out 0.6s infinite, float-string-up-1 3.4s ease-in-out 2.0s infinite; }
.hero-grp1-container .string-indep-2 { animation: draw-hold-vanish-grp1 9s ease-in-out 0.7s infinite, float-string-down-2 4.2s ease-in-out 2.2s infinite; }
.hero-grp1-container .string-indep-3 { animation: draw-hold-vanish-grp1 9s ease-in-out 0.8s infinite, float-string-up-3 5.1s ease-in-out 2.4s infinite; }
.hero-grp1-container .string-indep-4 { animation: draw-hold-vanish-grp1 9s ease-in-out 0.9s infinite, float-string-down-4 3.1s ease-in-out 2.1s infinite; }
.hero-grp1-container .string-indep-5 { animation: draw-hold-vanish-grp1 9s ease-in-out 1.0s infinite, float-string-up-5 4.6s ease-in-out 2.5s infinite; }
.hero-grp1-container .string-indep-6 { animation: draw-hold-vanish-grp1 9s ease-in-out 1.1s infinite, float-string-down-6 5.5s ease-in-out 2.3s infinite; }
.hero-grp1-container .string-indep-7 { animation: draw-hold-vanish-grp1 9s ease-in-out 1.2s infinite, float-string-up-7 3.8s ease-in-out 2.6s infinite; }

.hero-grp2-container .string-indep-1 { animation: draw-vanish-grp2 9s ease-in-out 0.6s infinite, float-string-down-2 3.8s ease-in-out 4.2s infinite; }
.hero-grp2-container .string-indep-2 { animation: draw-vanish-grp2 9s ease-in-out 0.7s infinite, float-string-up-1 4.5s ease-in-out 4.4s infinite; }
.hero-grp2-container .string-indep-3 { animation: draw-vanish-grp2 9s ease-in-out 0.8s infinite, float-string-down-6 5.3s ease-in-out 4.1s infinite; }
.hero-grp2-container .string-indep-4 { animation: draw-vanish-grp2 9s ease-in-out 0.9s infinite, float-string-up-3 3.3s ease-in-out 4.5s infinite; }
.hero-grp2-container .string-indep-5 { animation: draw-vanish-grp2 9s ease-in-out 1.0s infinite, float-string-down-4 4.8s ease-in-out 4.3s infinite; }
.hero-grp2-container .string-indep-6 { animation: draw-vanish-grp2 9s ease-in-out 1.1s infinite, float-string-up-5 5.0s ease-in-out 4.6s infinite; }
.hero-grp2-container .string-indep-7 { animation: draw-vanish-grp2 9s ease-in-out 1.2s infinite, float-string-up-7 3.6s ease-in-out 4.0s infinite; }

/* Content wrapper */
.hero-content-wrapper {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 800px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 3rem 2rem;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.05), inset 0 0 0 1px rgba(255,255,255,0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-content-wrapper:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(0,0,0,0.08), inset 0 0 0 1px rgba(255,255,255,0.8);
}

.hero-title, .hero-subtitle, .hero-buttons {
  position: relative;
  z-index: 20; /* Ensure text and buttons stay above the reflection edges */
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #1e293b, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: #64748b;
  margin-bottom: 2.5rem;
  font-weight: 500;
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.75rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-btn {
  background: white;
  color: #0f172a !important;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.gallery-btn:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* ---- AI Hamburger Glow (About page mobile) ---- */
@keyframes ai-border-orbit {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes ai-btn-glow-about {
  0% { box-shadow: 0 0 0 transparent; }
  6.66% { box-shadow: 0 0 16px rgba(6, 182, 212, 0.4), 0 0 24px rgba(168, 85, 247, 0.3); }
  58.33% { box-shadow: 0 0 16px rgba(6, 182, 212, 0.4), 0 0 24px rgba(168, 85, 247, 0.3); }
  65% { box-shadow: 0 0 0 transparent; }
  100% { box-shadow: 0 0 0 transparent; }
}

@keyframes ai-border-fade-about {
  0%   { opacity: 0; }
  6.66%  { opacity: 1; }
  85% { opacity: 1; }
  98%  { opacity: 0; }
  100% { opacity: 0; }
}

@media (max-width: 768px) {
  /* Allow strings to draw out of the section and over the header to connect with the hamburger button */
  .about-hero-section { overflow: visible !important; }
  .hero-bg-container { overflow: visible !important; }
  .hero-threads-mobile { overflow: hidden !important; }

  .menu-collapse > a {
    position: relative;
    border-radius: 0.4rem;
    animation: ai-btn-glow-about 9s ease-in-out 0s infinite; 
    /* Fix weird Nicepage padding: perfectly hug the icon */
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 8px 10px !important;
    margin-right: 30px !important;
  }
  
  .menu-collapse > a svg {
    margin: 0 !important;
  }
  
  .menu-collapse > a::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 0.4rem;
    padding: 2px;
    background: linear-gradient(
      90deg, #06B6D4, #3B82F6, #A855F7, #EC4899, #EF4444, #F97316, #FACC15, #10B981, #06B6D4
    );
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    animation: 
      ai-border-orbit 3s linear infinite,
      ai-border-fade-about 9s ease-in-out 0s infinite;
  }

  /* Lock the mobile string origin points by disabling their CSS float animations */
  .hero-threads-mobile .hero-grp1-container .string-indep-1 { animation: draw-hold-vanish-grp1 9s ease-in-out 0.6s infinite !important; }
  .hero-threads-mobile .hero-grp1-container .string-indep-2 { animation: draw-hold-vanish-grp1 9s ease-in-out 0.7s infinite !important; }
  .hero-threads-mobile .hero-grp1-container .string-indep-3 { animation: draw-hold-vanish-grp1 9s ease-in-out 0.8s infinite !important; }
  .hero-threads-mobile .hero-grp1-container .string-indep-4 { animation: draw-hold-vanish-grp1 9s ease-in-out 0.9s infinite !important; }
  .hero-threads-mobile .hero-grp1-container .string-indep-5 { animation: draw-hold-vanish-grp1 9s ease-in-out 1.0s infinite !important; }
  .hero-threads-mobile .hero-grp1-container .string-indep-6 { animation: draw-hold-vanish-grp1 9s ease-in-out 1.1s infinite !important; }
  .hero-threads-mobile .hero-grp1-container .string-indep-7 { animation: draw-hold-vanish-grp1 9s ease-in-out 1.2s infinite !important; }
  
  .hero-threads-mobile .hero-grp2-container .string-indep-1 { animation: draw-vanish-grp2 9s ease-in-out 0.6s infinite !important; }
  .hero-threads-mobile .hero-grp2-container .string-indep-2 { animation: draw-vanish-grp2 9s ease-in-out 0.7s infinite !important; }
  .hero-threads-mobile .hero-grp2-container .string-indep-3 { animation: draw-vanish-grp2 9s ease-in-out 0.8s infinite !important; }
  .hero-threads-mobile .hero-grp2-container .string-indep-4 { animation: draw-vanish-grp2 9s ease-in-out 0.9s infinite !important; }
  .hero-threads-mobile .hero-grp2-container .string-indep-5 { animation: draw-vanish-grp2 9s ease-in-out 1.0s infinite !important; }
  .hero-threads-mobile .hero-grp2-container .string-indep-6 { animation: draw-vanish-grp2 9s ease-in-out 1.1s infinite !important; }
  .hero-threads-mobile .hero-grp2-container .string-indep-7 { animation: draw-vanish-grp2 9s ease-in-out 1.2s infinite !important; }
}

.portfolio-btn {
  background: #0f172a;
  color: white !important;
  border: 1px solid transparent;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.portfolio-btn:hover {
  background: #1e293b;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.08);
  color: white !important;
}

.portfolio-btn:hover svg, .gallery-btn:hover svg {
  transform: scale(1.1);
}

.hero-btn svg {
  transition: transform 0.3s ease;
}

@media (max-width: 640px) {
  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }
  .hero-btn {
    width: 100%;
    justify-content: center;
  }
  .hero-title {
    font-size: 2.25rem;
  }
}

.u-header .menu-collapse { position: absolute !important; right: 20px !important; top: 50% !important; transform: translateY(-50%) !important; }
