/* ============================================================
   XORAZMIY.TECH — Hero & Tech Stack Section
   Full-viewport hero with animated background, code terminal
   visual, stats bar, and infinite-scroll tech strip.
   ============================================================ */

/* ──────────────────────────────────────────────────────────
   1. HERO SECTION WRAPPER
   ────────────────────────────────────────────────────────── */
.xr-hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding-top: 7rem;   /* clear sticky navbar */
  padding-bottom: 4rem;
}

/* ──────────────────────────────────────────────────────────
   2. ANIMATED BACKGROUND — gradient mesh + orbs
   ────────────────────────────────────────────────────────── */
.xr-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--color-bg-base);
  overflow: hidden;
}

/* Base radial gradient */
.xr-hero__bg::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 70%;
  height: 70%;
  background: radial-gradient(ellipse at center,
    rgba(91, 108, 248, 0.12) 0%,
    transparent 70%
  );
  animation: orb-float-a 14s ease-in-out infinite alternate;
  pointer-events: none;
}

.xr-hero__bg::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -5%;
  width: 55%;
  height: 55%;
  background: radial-gradient(ellipse at center,
    rgba(0, 200, 150, 0.07) 0%,
    transparent 70%
  );
  animation: orb-float-b 18s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Grid overlay */
.xr-hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%,
    black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%,
    black 30%, transparent 100%);
  pointer-events: none;
}

@keyframes orb-float-a {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(5%, 8%) scale(1.12); }
}
@keyframes orb-float-b {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-6%, -5%) scale(1.08); }
}

/* ──────────────────────────────────────────────────────────
   3. HERO CONTENT (z-index above bg)
   ────────────────────────────────────────────────────────── */
.xr-hero__content {
  position: relative;
  z-index: 1;
}

/* ── Eyebrow ── */
.xr-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: rgba(91, 108, 248, 0.10);
  border: 1px solid rgba(91, 108, 248, 0.25);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.875rem;
  margin-bottom: 1.75rem;
}

.xr-hero__eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ── Headline ── */
.xr-hero__headline {
  font-size: var(--text-6xl);
  font-weight: 900;
  color: var(--color-text-primary);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.xr-hero__headline-accent {
  background: linear-gradient(135deg, var(--color-accent) 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Sub-headline ── */
.xr-hero__sub {
  font-size: clamp(1rem, 2vw, var(--text-lg));
  color: var(--color-text-secondary);
  line-height: 1.75;
  max-width: 520px;
  margin-bottom: 2.5rem;
}

/* ── CTA Group ── */
.xr-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-bottom: 3rem;
}

.xr-hero__cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-accent);
  color: #fff;
  font-size: var(--text-base);
  font-weight: 600;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition-fast),
              box-shadow var(--transition-fast),
              transform var(--transition-fast);
}

.xr-hero__cta-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--glow-accent);
  transform: translateY(-2px);
  color: #fff;
}

.xr-hero__cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-base);
  font-weight: 500;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-hover);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.xr-hero__cta-secondary:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  border-color: var(--color-border-hover);
}

/* ── Stats Bar ── */
.xr-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.xr-hero__stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.xr-hero__stat-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.xr-hero__stat-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ──────────────────────────────────────────────────────────
   4. CODE TERMINAL VISUAL (right column)
   ────────────────────────────────────────────────────────── */
.xr-hero__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Glow behind the terminal */
.xr-hero__visual::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background: radial-gradient(ellipse at center,
    rgba(91, 108, 248, 0.18) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.xr-terminal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), 0 0 60px rgba(91, 108, 248, 0.12);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* Terminal title bar */
.xr-terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
}

.xr-terminal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.xr-terminal__dot--red   { background: #FF5F57; }
.xr-terminal__dot--yellow{ background: #FFBD2E; }
.xr-terminal__dot--green { background: #28CA41; }

.xr-terminal__title {
  flex: 1;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

/* Terminal body */
.xr-terminal__body {
  padding: 1.5rem 1.25rem;
  line-height: 1.8;
}

.xr-terminal__line {
  display: flex;
  gap: 0.75rem;
}

.xr-terminal__ln {
  color: var(--color-text-muted);
  user-select: none;
  min-width: 1.5rem;
  text-align: right;
}

.xr-terminal__code {
  flex: 1;
}

/* Syntax colors */
.t-comment  { color: #606078; font-style: italic; }
.t-keyword  { color: #c792ea; }
.t-function { color: #82aaff; }
.t-string   { color: #c3e88d; }
.t-number   { color: #f78c6c; }
.t-class    { color: #ffcb6b; }
.t-punct    { color: var(--color-text-secondary); }
.t-var      { color: var(--color-text-primary); }
.t-accent   { color: var(--color-accent); }
.t-teal     { color: var(--color-unibook); }
.t-orange   { color: var(--color-yemak); }

/* Blinking cursor */
.xr-terminal__cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--color-accent);
  border-radius: 2px;
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ──────────────────────────────────────────────────────────
   5. ENTRANCE ANIMATIONS
   ────────────────────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }
.delay-4 { transition-delay: 0.32s; }
.delay-5 { transition-delay: 0.42s; }
.delay-6 { transition-delay: 0.52s; }

/* ──────────────────────────────────────────────────────────
   6. TECH STACK STRIP
   ────────────────────────────────────────────────────────── */
.xr-stack {
  padding: 2.5rem 0;
  background: var(--color-bg-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
  position: relative;
}

/* Edge fade masks */
.xr-stack::before,
.xr-stack::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}

.xr-stack::before {
  left: 0;
  background: linear-gradient(to right, var(--color-bg-surface), transparent);
}

.xr-stack::after {
  right: 0;
  background: linear-gradient(to left, var(--color-bg-surface), transparent);
}

/* Marquee track */
.xr-stack__track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.xr-stack__track:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Individual tech item */
.xr-stack__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0 2.5rem;
  white-space: nowrap;
  opacity: 0.45;
  transition: opacity var(--transition-base);
  cursor: default;
}

.xr-stack__item:hover {
  opacity: 1;
}

.xr-stack__icon {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-primary);
}

.xr-stack__label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-secondary);
  letter-spacing: 0.04em;
}

/* Separator dot between items */
.xr-stack__sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-border-hover);
  margin: 0 0.5rem;
  flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────
   7. RESPONSIVE OVERRIDES
   ────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .xr-hero {
    padding-top: 6rem;
    text-align: center;
  }

  .xr-hero__eyebrow {
    margin-left: auto;
    margin-right: auto;
  }

  .xr-hero__sub {
    margin-left: auto;
    margin-right: auto;
  }

  .xr-hero__ctas {
    justify-content: center;
  }

  .xr-hero__stats {
    justify-content: center;
  }

  .xr-hero__visual {
    margin-top: 3rem;
  }

  .xr-terminal {
    max-width: 100%;
  }
}

@media (max-width: 575.98px) {
  .xr-hero__stats {
    gap: 1.5rem;
  }

  .xr-hero__cta-primary,
  .xr-hero__cta-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* 4K polish */
@media (min-width: 2560px) {
  .xr-terminal {
    max-width: 560px;
  }
}

/* ──────────────────────────────────────────────────────────
   8. MOBILE PERFORMANCE — disable heavy animations on small screens
   ────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .xr-hero__bg::before,
  .xr-hero__bg::after {
    animation: none;
  }

  .xr-hero__visual::before {
    display: none;
  }
}

/* Respect OS-level reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .xr-hero__bg::before,
  .xr-hero__bg::after,
  .xr-hero__eyebrow-dot,
  .xr-terminal__cursor,
  .xr-stack__track {
    animation: none;
  }

  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
