/* ========== HERO WAVE WIDGET STYLES ========== */

/* CSS Custom Properties (overridden by widget inline styles) */
.hero-section {
  --hw-word-duration: 0.8s;
  --hw-word-translateY: 40px;
  --hw-word-blur: 12px;
  --hw-word-rotateX: 15deg;
  --hw-shimmer-duration: 16s;
  --hw-shine-duration: 8s;
  --hw-shine-angle: 120deg;
  --hw-aura-duration: 12s;
  --hw-aura-scale: 1.15;
  --hw-line-duration: 1s;
  --hw-line-top-delay: 0s;
  --hw-line-bottom-delay: 1.2s;
  --hw-line-max-width: 320px;
  --hw-line-color: rgba(120, 180, 255, 0.5);

  /* Normal heading gradient */
  --hw-grad-1: #ffffff;
  --hw-grad-2: #a8cfff;
  --hw-grad-3: #ffffff;
  --hw-grad-4: #7bb8ff;
  --hw-grad-5: #ffffff;

  /* Accent gradient */
  --hw-accent-1: #5b9cff;
  --hw-accent-2: #8ec5ff;
  --hw-accent-3: #b8daff;
  --hw-accent-4: #5b9cff;
  --hw-accent-5: #3d7ae0;

  /* Aura */
  --hw-aura-inner: rgba(91, 156, 255, 0.08);
  --hw-aura-outer: rgba(61, 122, 224, 0.03);
}

.hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  background: #000;
  font-family: 'Rethink Sans', system-ui, -apple-system, sans-serif;
  color: #fff;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.hero-section *, .hero-section *::before, .hero-section *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* WebGL canvas */
.hero-section .p-canvas-webgl {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 1;
  display: block;
}

/* Soul particle canvas */
.hero-section .soul-canvas-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  display: block;
}

/* Center content */
.hero-section .hero-content {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  text-align: center;
  width: 90%;
  max-width: 900px;
  pointer-events: none;
}

/* ---- Heading ---- */
.hero-section .hero-heading {
  font-family: 'Rethink Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 5.5vw, 4.2rem);
  letter-spacing: 0.12em;
  line-height: 1.2;
  color: #fff;
  position: relative;
  display: inline-block;
  text-transform: uppercase;
  opacity: 1;
}

/* ---- Word spans ---- */
.hero-section .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(var(--hw-word-translateY)) rotateX(var(--hw-word-rotateX));
  animation: hwWordReveal var(--hw-word-duration) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes hwWordReveal {
  0% {
    opacity: 0;
    transform: translateY(var(--hw-word-translateY, 40px)) rotateX(var(--hw-word-rotateX, 15deg));
    filter: blur(var(--hw-word-blur, 12px));
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
    filter: blur(0);
  }
}

/* ---- Gradient text ---- */
.hero-section .word-inner {
  position: relative;
  display: inline-block;
  background: linear-gradient(
    90deg,
    var(--hw-grad-1) 0%,
    var(--hw-grad-2) 25%,
    var(--hw-grad-3) 50%,
    var(--hw-grad-4) 75%,
    var(--hw-grad-5) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hwShimmer var(--hw-shimmer-duration) ease-in-out infinite;
}

.hero-section.no-shimmer .word-inner {
  animation: none;
}

@keyframes hwShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---- Shine sweep ---- */
.hero-section .word-inner::before {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(
    var(--hw-shine-angle),
    transparent 0%, transparent 35%,
    rgba(255,255,255,0.8) 47%, #fff 50%, rgba(255,255,255,0.8) 53%,
    transparent 65%, transparent 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hwShine var(--hw-shine-duration) ease-in-out infinite;
}

.hero-section.no-shine .word-inner::before {
  animation: none;
  display: none;
}

@keyframes hwShine {
  0% { background-position: 200% 50%; }
  100% { background-position: -100% 50%; }
}

.hero-section .word:nth-child(1) .word-inner::before { animation-delay: 0s; }
.hero-section .word:nth-child(2) .word-inner::before { animation-delay: 1s; }
.hero-section .word:nth-child(3) .word-inner::before { animation-delay: 2s; }
.hero-section .word:nth-child(4) .word-inner::before { animation-delay: 3s; }
.hero-section .word:nth-child(5) .word-inner::before { animation-delay: 4s; }
.hero-section .word:nth-child(6) .word-inner::before { animation-delay: 5s; }

/* ---- Accent words ---- */
.hero-section .word-accent .word-inner {
  background: linear-gradient(
    90deg,
    var(--hw-accent-1) 0%,
    var(--hw-accent-2) 25%,
    var(--hw-accent-3) 50%,
    var(--hw-accent-4) 75%,
    var(--hw-accent-5) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hwShimmer var(--hw-shimmer-duration) ease-in-out infinite;
}

/* ---- Aura glow ---- */
.hero-section .hero-heading::before {
  content: '';
  position: absolute;
  top: -60%; left: -15%; right: -15%; bottom: -60%;
  background: radial-gradient(ellipse at center,
    var(--hw-aura-inner) 0%,
    var(--hw-aura-outer) 35%,
    transparent 65%);
  z-index: -1;
  animation: hwAura var(--hw-aura-duration) ease-in-out infinite;
  pointer-events: none;
}

.hero-section.no-aura .hero-heading::before {
  display: none;
}

@keyframes hwAura {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(var(--hw-aura-scale, 1.15)); opacity: 0.9; }
}

/* ---- Decorative lines ---- */
.hero-section .heading-line {
  display: block;
  width: 0;
  height: 1px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--hw-line-color), transparent);
  opacity: 0;
}

.hero-section .heading-line-top {
  margin-bottom: 1.2rem;
  animation: hwLineExpand var(--hw-line-duration) cubic-bezier(0.16, 1, 0.3, 1) var(--hw-line-top-delay) forwards;
}

.hero-section .heading-line-bottom {
  margin-top: 1.2rem;
  animation: hwLineExpand var(--hw-line-duration) cubic-bezier(0.16, 1, 0.3, 1) var(--hw-line-bottom-delay) forwards;
}

@keyframes hwLineExpand {
  0% { width: 0; opacity: 0; }
  100% { width: min(var(--hw-line-max-width, 320px), 60%); opacity: 1; }
}

/* ---- Tag ---- */
.hero-section .heading-tag {
  font-family: 'Rethink Sans', system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(0.6rem, 1.2vw, 0.75rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(120, 180, 255, 0.6);
  margin-bottom: 1rem;
  opacity: 0;
  animation: hwTagReveal 0.8s ease-out 0.05s forwards;
}

@keyframes hwTagReveal {
  0% { opacity: 0; transform: translateY(15px); letter-spacing: 0.6em; }
  100% { opacity: 1; transform: translateY(0); letter-spacing: 0.35em; }
}

/* ---- Line break ---- */
.hero-section .heading-break {
  display: block;
  height: 0.15em;
}

/* ---- Typing ---- */
.hero-section .typing-container {
  margin-top: 2rem;
  min-height: 5em;
  opacity: 0;
  animation: hwFadeInUp 1s ease-out 1.8s forwards;
}

@keyframes hwFadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-section .typing-text {
  font-family: 'Rethink Sans', system-ui, sans-serif;
  font-weight: 300;
  font-size: clamp(0.9rem, 1.8vw, 1.15rem);
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.03em;
  max-width: 720px;
  margin: 0 auto;
}

.hero-section .typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: rgba(120, 180, 255, 0.8);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: hwCursorBlink 0.8s ease-in-out infinite;
}

@keyframes hwCursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ---- No-animations master toggle ---- */
.hero-section.no-animations .word,
.hero-section.no-animations .heading-tag,
.hero-section.no-animations .typing-container {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  filter: none !important;
}

.hero-section.no-animations .heading-line {
  width: min(var(--hw-line-max-width, 320px), 60%) !important;
  opacity: 1 !important;
  animation: none !important;
}

.hero-section.no-animations .word-inner,
.hero-section.no-animations .word-inner::before,
.hero-section.no-animations .hero-heading::before {
  animation: none !important;
}


/* ========== RESPONSIVE ========== */

@media (max-width: 1024px) {
  .hero-section { min-height: 500px; }
  .hero-section .hero-content { width: 92%; max-width: 700px; }
  .hero-section .typing-text { max-width: 580px; }
}

@media (max-width: 768px) {
  .hero-section { min-height: 480px; }
  .hero-section .hero-content { width: 90%; max-width: 500px; }
  .hero-section .hero-heading { letter-spacing: 0.06em; line-height: 1.25; }
  .hero-section .heading-tag { font-size: 0.6rem; letter-spacing: 0.25em; margin-bottom: 0.7rem; }
  .hero-section .heading-line-top { margin-bottom: 0.8rem; }
  .hero-section .heading-line-bottom { margin-top: 0.8rem; }
  .hero-section .typing-container { margin-top: 1.5rem; min-height: 6em; }
  .hero-section .typing-text { max-width: 420px; line-height: 1.7; }
  .hero-section .hero-heading::before { top: -30%; left: -5%; right: -5%; bottom: -30%; }
}

@media (max-width: 480px) {
  .hero-section { min-height: 100svh; height: 100svh; }
  .hero-section .hero-content { width: 88%; max-width: 360px; }
  .hero-section .hero-heading { letter-spacing: 0.04em; line-height: 1.3; }
  .hero-section .heading-tag { font-size: 0.55rem; letter-spacing: 0.2em; margin-bottom: 0.6rem; }
  .hero-section .heading-line-top { margin-bottom: 0.6rem; }
  .hero-section .heading-line-bottom { margin-top: 0.6rem; }
  .hero-section .heading-break { height: 0.1em; }
  .hero-section .typing-container { margin-top: 1.2rem; min-height: 8em; }
  .hero-section .typing-text { max-width: 300px; line-height: 1.65; }
}

@media (max-width: 360px) {
  .hero-section .hero-content { width: 86%; }
  .hero-section .heading-tag { font-size: 0.5rem; letter-spacing: 0.15em; }
  .hero-section .typing-container { min-height: 9em; }
  .hero-section .typing-text { max-width: 260px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .hero-section { min-height: 400px; height: 100vh; }
  .hero-section .hero-heading { font-size: clamp(1.2rem, 4vw, 2.2rem); letter-spacing: 0.06em; }
  .hero-section .heading-tag { font-size: 0.55rem; margin-bottom: 0.4rem; }
  .hero-section .heading-line-top { margin-bottom: 0.4rem; }
  .hero-section .heading-line-bottom { margin-top: 0.4rem; }
  .hero-section .typing-container { margin-top: 0.8rem; min-height: 3em; }
  .hero-section .typing-text { font-size: clamp(0.75rem, 1.5vw, 0.95rem); line-height: 1.5; }
}