/* ============================================================
   HERO SECTION
============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 239px clamp(24px, 6vw, 100px) 100px;
  background:
    linear-gradient(rgba(9, 9, 11, 0.76), rgba(9, 9, 11, 0.82)),
    url('../assets/bg_night.avif') center center / cover no-repeat;
}

/* Background blobs */
.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  pointer-events: none;
  animation: blobFloat 8s ease-in-out infinite;
}
.hero__blob--1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--purple-dark), transparent);
  top: -200px; left: -150px;
  animation-delay: 0s;
}
.hero__blob--2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #4F46E5, transparent);
  bottom: -100px; right: -100px;
  animation-delay: -3s;
}
.hero__blob--3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, var(--purple), transparent);
  top: 40%; left: 40%;
  animation-delay: -6s;
  opacity: 0.2;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.04); }
  66% { transform: translate(-20px, 30px) scale(0.97); }
}

/* Particles */
.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--purple);
  opacity: 0;
  animation: particleAnim var(--dur, 6s) var(--delay, 0s) ease-in-out infinite;
}
@keyframes particleAnim {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  20%  { opacity: 0.6; }
  80%  { opacity: 0.2; }
  100% { transform: translateY(-120vh) scale(0.5); opacity: 0; }
}

/* Cursor glow */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--purple-rgb), 0.12), transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 0.1s linear;
  z-index: 1;
  mix-blend-mode: screen;
}

/* Hero inner */
.hero__inner {
  max-width: 1160px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 100px;
  position: relative;
  z-index: 2;
}

/* Hero content (badge + heading + sub + actions) */
.hero__content {
  max-width: 880px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Hero badge */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--green);
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.25);
  padding: 8px 10px 8px 16px;
  border-radius: 100px;
  margin-bottom: 64px;
}
.hero__badge-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
.hero__badge-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(52,211,153,0.14);
  color: var(--green);
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px var(--green); }
  50% { box-shadow: 0 0 16px var(--green), 0 0 24px rgba(52,211,153,0.4); }
}

/* Hero title */
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(46px, 6.6vw, 92px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0;
  margin-bottom: 40px;
}
.hero__title-icon {
  display: inline-block;
  width: 0.82em;
  height: 0.82em;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin: 0 0.02em;
  animation: hero-title-icon-float 3.2s ease-in-out infinite;
}
@keyframes hero-title-icon-float {
  0%, 100% { transform: translateY(-0.1em); }
  50% { transform: translateY(-0.28em); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__title-icon {
    animation: none;
    transform: translateY(-0.1em);
  }
}
/* Indigo → purple → fuchsia → pink bands flowing top-left → bottom-right.
   The background is --hl-shift wider than the text and slides right by
   exactly that much; at 135deg a horizontal shift of S moves the bands
   S·cos45° along the gradient, so the period --hl-p = S × 0.7071 makes
   the loop seamless. */
.hero__title-highlight {
  --hl-1: #6366F1;
  --hl-2: #8B5CF6;
  --hl-3: #D946EF;
  --hl-4: #EC4899;
  --hl-shift: 20em;
  --hl-p: calc(var(--hl-shift) * 0.70710678);
  background: repeating-linear-gradient(135deg,
    var(--hl-1) 0,
    var(--hl-2) calc(var(--hl-p) * 1 / 6),
    var(--hl-3) calc(var(--hl-p) * 2 / 6),
    var(--hl-4) calc(var(--hl-p) * 3 / 6),
    var(--hl-3) calc(var(--hl-p) * 4 / 6),
    var(--hl-2) calc(var(--hl-p) * 5 / 6),
    var(--hl-1) var(--hl-p));
  background-size: calc(100% + var(--hl-shift)) 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hl-shift 6s linear infinite;
}
/* Deeper tones on light bg so the text keeps contrast */
[data-theme="light"] .hero__title-highlight {
  --hl-1: #4F46E5;
  --hl-2: #7C3AED;
  --hl-3: #C026D3;
  --hl-4: #DB2777;
}
@keyframes hl-shift {
  from { background-position: calc(var(--hl-shift) * -1) 0; }
  to   { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__title-highlight { animation: none; }
}

/* Hero sub */
.hero__sub {
  font-size: 20px;
  color: var(--text);
  max-width: 660px;
  line-height: 1.7;
  margin: 0 auto 56px;
}

/* Hero actions */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

/* ============================================================
   HERO SHOWCASE — featured project carousel
============================================================ */
.hero__showcase {
  width: 100%;
  max-width: 860px;
}

.hero__showcase-frame {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  animation: showcaseFloat 6s ease-in-out infinite;
}
@keyframes showcaseFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero__showcase-track {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-card);
}
.hero__showcase-slide {
  position: absolute;
  inset: 0;
  display: block;
  cursor: pointer;
  transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
}
.hero__showcase-slide:not(.is-active) {
  pointer-events: none;
}
.hero__showcase-media {
  position: absolute;
  inset: 0;
  display: block;
}
.hero__showcase-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.6s var(--ease-out);
}
.hero__showcase-slide:hover img,
.hero__showcase-slide:focus-within img {
  transform: scale(1.04);
}

/* Full-bleed website screenshots (edge-to-edge nav/CTA content) should
   never be cropped — letterbox instead of cover-cropping the frame. */
.hero__showcase-slide--contain img {
  object-fit: contain;
  background: #1f1e1c;
}

.hero__showcase-counter {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #F4F4F5;
  background: rgba(9,9,11,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  transition: opacity 0.25s;
}
.hero__showcase-counter-current { color: #fff; }

.hero__showcase-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  /* Fixed (not theme-driven) — the showcase frame is always a dark
     device bezel regardless of site theme, so the icon must stay light
     to keep contrast against it in light mode too. */
  color: #F4F4F5;
  background: rgba(9,9,11,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.25s, border-color 0.25s, transform 0.25s, opacity 0.25s;
}
/* Real mouse hover only — avoids the "stuck" highlight touch devices
   get when :hover is triggered by a tap and never releases */
@media (hover: hover) and (pointer: fine) {
  /* Hidden until the frame is hovered (or a button gets keyboard focus) —
     touch devices skip this block entirely, so they keep the buttons
     always visible since there's no hover to reveal them with. */
  .hero__showcase-nav,
  .hero__showcase-counter {
    opacity: 0;
  }
  .hero__showcase:hover .hero__showcase-nav,
  .hero__showcase:focus-within .hero__showcase-nav,
  .hero__showcase:hover .hero__showcase-counter,
  .hero__showcase:focus-within .hero__showcase-counter {
    opacity: 1;
  }
  .hero__showcase-nav:hover {
    background: rgba(var(--purple-rgb), 0.35);
    border-color: rgba(var(--purple-rgb), 0.5);
    transform: translateY(-50%) scale(1.06);
  }
}
.hero__showcase-nav:active {
  background: rgba(var(--purple-rgb), 0.35);
  border-color: rgba(var(--purple-rgb), 0.5);
}
.hero__showcase-nav--prev { left: 26px; }
.hero__showcase-nav--next { right: 26px; }

/* Autoplay progress bar */
.hero__showcase-progress {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 5px;
  height: 3px;
  border-radius: 100px;
  background: rgba(255,255,255,0.14);
  overflow: hidden;
  z-index: 3;
}
.hero__showcase-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 100px;
  background: var(--purple-light);
}
.hero__showcase-progress-fill.is-animating {
  animation: showcaseProgress linear forwards;
  animation-duration: var(--showcase-duration, 5.5s);
}
.hero__showcase:hover .hero__showcase-progress-fill.is-animating {
  animation-play-state: paused;
}
@keyframes showcaseProgress {
  from { width: 0%; }
  to { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__showcase-progress { display: none; }
}

/* Hover overlay — CTA + project details revealed on hover/focus */
.hero__showcase-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  background: linear-gradient(to top, rgba(9,9,11,0.9) 0%, rgba(9,9,11,0.55) 40%, rgba(9,9,11,0.05) 68%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.hero__showcase-slide:hover .hero__showcase-overlay,
.hero__showcase-slide:focus-within .hero__showcase-overlay {
  opacity: 1;
}

.hero__showcase-view {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--purple);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 100px;
  box-shadow: 0 4px 24px rgba(var(--purple-rgb), 0.4);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  text-decoration: none;
}
.hero__showcase-slide:hover .hero__showcase-view,
.hero__showcase-slide:focus-within .hero__showcase-view {
  opacity: 1;
  transform: translateY(0);
}

.hero__showcase-overlay-info {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s ease 0.05s, transform 0.35s ease 0.05s;
}
.hero__showcase-slide:hover .hero__showcase-overlay-info,
.hero__showcase-slide:focus-within .hero__showcase-overlay-info {
  opacity: 1;
  transform: translateY(0);
}
.hero__showcase-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple-light);
  background: rgba(var(--purple-rgb), 0.16);
  border: 1px solid rgba(var(--purple-rgb), 0.3);
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 10px;
}
.hero__showcase-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}
.hero__showcase-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  max-width: 580px;
}

@media (prefers-reduced-motion: reduce) {
  .hero__showcase-frame { animation: none; }
  .hero__showcase-slide,
  .hero__showcase-slide img,
  .hero__showcase-overlay,
  .hero__showcase-view,
  .hero__showcase-overlay-info { transition: none; }
  .hero__blob,
  .particle { animation: none; }
  .cursor-glow { display: none; }
}

/* No pointer to react to — the glow JS already skips itself here too,
   this just covers the brief window before/if that runs. */
@media (hover: none), (pointer: coarse) {
  .cursor-glow { display: none; }
}

/* Staggered reveal delays */
.hero__content .reveal-up:nth-child(1) { transition-delay: 0.1s; }
.hero__content .reveal-up:nth-child(2) { transition-delay: 0.2s; }
.hero__content .reveal-up:nth-child(3) { transition-delay: 0.3s; }
.hero__content .reveal-up:nth-child(4) { transition-delay: 0.4s; }
