/* ============================================================
   ANIMATIONS — Particle System, Page Transitions, Effects
   ============================================================ */

/* ============================================================
   HERO CANVAS
   ============================================================ */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   PASSION SECTION — Sticky scroll canvas
   ============================================================ */
#passions {
  /* Height set by JS (300vh) for scroll room */
  position: relative;
  background: #08080f;
}

#passion-canvas {
  display: block;
  width: 100%;
  height: 100vh;
  position: sticky;
  top: 0;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--nav-height);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(124,111,255,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 30%, rgba(0,212,255,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 90%, rgba(200,255,0,0.05) 0%, transparent 60%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  width: 100%;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) 0.3s forwards;
}

.hero-eyebrow-line {
  width: 40px;
  height: 1px;
  background: var(--color-accent);
}

.hero-eyebrow-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.hero-title {
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.hero-title-line {
  display: block;
  opacity: 0;
  transform: translateY(100%);
  animation: slideUp 0.9s var(--ease-out) forwards;
}

.hero-title-line:nth-child(1) { animation-delay: 0.4s; }
.hero-title-line:nth-child(2) { animation-delay: 0.55s; }
.hero-title-line:nth-child(3) { animation-delay: 0.7s; }

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--color-text-muted);
  max-width: 500px;
  line-height: 1.7;
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) 0.9s forwards;
  margin-bottom: var(--space-2xl);
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) 1.1s forwards;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: var(--space-2xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  z-index: 2;
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) 1.5s forwards;
}

.hero-scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--color-accent));
  animation: scrollLine 2s ease-in-out infinite;
}

.hero-scroll-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

@keyframes scrollLine {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ============================================================
   FLOATING TECH TAGS (Hero)
   ============================================================ */
.hero-floating-tags {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  z-index: 2;
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) 1.2s forwards;
}

.floating-tag {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  transform: translateX(0);
  animation: float 3s ease-in-out infinite;
}

.floating-tag:nth-child(2) { animation-delay: 0.5s; }
.floating-tag:nth-child(3) { animation-delay: 1s; }
.floating-tag:nth-child(4) { animation-delay: 1.5s; }
.floating-tag:nth-child(5) { animation-delay: 2s; }

.floating-tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes ping {
  0% { transform: scale(1); opacity: 1; }
  75%, 100% { transform: scale(2); opacity: 0; }
}

/* ============================================================
   SHIMMER LOADING
   ============================================================ */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--color-surface) 0%,
    var(--color-surface-2) 50%,
    var(--color-surface) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ============================================================
   GLITCH EFFECT (for special text)
   ============================================================ */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  color: var(--color-accent);
  animation: glitch-1 3s infinite linear;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}

.glitch::after {
  color: var(--color-lime);
  animation: glitch-2 3s infinite linear;
  clip-path: polygon(0 66%, 100% 66%, 100% 100%, 0 100%);
}

@keyframes glitch-1 {
  0%, 94%, 100% { transform: translate(0); }
  95% { transform: translate(-3px, 1px); }
  97% { transform: translate(3px, -1px); }
}

@keyframes glitch-2 {
  0%, 94%, 100% { transform: translate(0); }
  95% { transform: translate(3px, 1px); }
  97% { transform: translate(-3px, -1px); }
}

/* ============================================================
   COUNT UP ANIMATION
   ============================================================ */
.count-up {
  display: inline-block;
}

/* ============================================================
   PAGE TRANSITION EFFECT
   ============================================================ */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
}

.transition-panel {
  position: absolute;
  width: 100%;
  background: var(--color-bg);
  transform-origin: bottom;
  transform: scaleY(0);
}

/* ============================================================
   TYPING CURSOR
   ============================================================ */
.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--color-accent);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

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

/* ============================================================
   MAGNETIC BUTTON EFFECT
   ============================================================ */
.btn-magnetic {
  display: inline-block;
  transition: transform var(--duration-normal) var(--ease-out);
}

/* ============================================================
   TILT CARD EFFECT
   ============================================================ */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform var(--duration-normal) var(--ease-out);
}

/* ============================================================
   STATS / NUMBERS SECTION
   ============================================================ */
.stat-item {
  text-align: center;
  padding: var(--space-xl);
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ============================================================
   TIMELINE (for Ben Kimim page)
   ============================================================ */
.timeline {
  position: relative;
  padding-left: var(--space-3xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--color-accent), transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-2xl);
}

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-3xl) + 10px);
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-bg);
  box-shadow: 0 0 0 4px rgba(124,111,255,0.2);
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-accent);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xs);
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.timeline-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ============================================================
   F1 SECTION SPECIAL EFFECTS
   ============================================================ */
.f1-stripe {
  background: linear-gradient(
    135deg,
    #E8002D 0%,    /* Ferrari red */
    #FF8000 16%,   /* McLaren orange */
    #00D2BE 32%,   /* Mercedes teal */
    #1E41FF 48%,   /* Williams blue */
    #0600EF 64%,   /* Red Bull blue */
    #006F62 80%,   /* Aston Martin green */
    #E8002D 100%
  );
  background-size: 300% 100%;
  animation: f1-stripe 20s linear infinite;
  height: 3px;
}

@keyframes f1-stripe {
  0% { background-position: 0% 0%; }
  100% { background-position: 300% 0%; }
}

/* Speed lines effect */
.speed-lines {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.speed-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
  animation: speed-line 2s linear infinite;
  opacity: 0;
}

@keyframes speed-line {
  0% { transform: translateX(-100%); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateX(100vw); opacity: 0; }
}

/* ============================================================
   PHOTOGRAPHY GRID
   ============================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 220px;
  gap: var(--space-sm);
}

.photo-grid-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
}

.photo-grid-item.wide { grid-column: span 2; }
.photo-grid-item.tall { grid-row: span 2; }

.photo-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slower) var(--ease-out);
}

.photo-grid-item:hover img { transform: scale(1.08); }

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  display: flex;
  align-items: flex-end;
  padding: var(--space-lg);
}

.photo-grid-item:hover .photo-overlay { opacity: 1; }

/* ============================================================
   LOADING SCREEN
   ============================================================ */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo {
  display: none; /* AFO logo removed */
}

.loader-bar {
  width: 200px;
  height: 2px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loader-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-lime));
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.3s var(--ease-out);
}

.loader-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
}

/* ============================================================
   ACTIVE STATE INDICATORS
   ============================================================ */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--color-success);
  opacity: 0.3;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}
