/* Polish layer for ayanzadeh.com
   Loaded after refresh.css. Adds motion, depth and modern interaction
   details without touching the existing layout. Everything here respects
   prefers-reduced-motion. */

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: var(--section-title-gradient);
  z-index: 1000;
  pointer-events: none;
}

/* ---------- Sticky nav elevation once scrolled ---------- */
.top-navbar {
  transition: box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.top-navbar.nav-scrolled {
  box-shadow: 0 6px 24px rgba(10, 18, 28, 0.12);
}

:root[data-theme="dark"] .top-navbar.nav-scrolled {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

/* ---------- Hero: living background + gradient name ---------- */
.hero {
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

.hero::before {
  width: 46vw;
  height: 46vw;
  top: -18%;
  right: -10%;
  background: radial-gradient(circle, var(--hero-aurora) 0%, transparent 65%);
  animation: aurora-drift 14s ease-in-out infinite alternate;
}

.hero::after {
  width: 38vw;
  height: 38vw;
  bottom: -22%;
  left: -8%;
  background: radial-gradient(circle, var(--hero-aurora-strong) 0%, transparent 65%);
  animation: aurora-drift 18s ease-in-out infinite alternate-reverse;
}

.hero .container {
  position: relative;
  z-index: 1;
}

@keyframes aurora-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-6%, 8%, 0) scale(1.12); }
}

.ai-text {
  background: linear-gradient(120deg, #f5ede3 0%, #e9d9c3 40%, #cfe3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Profile photo: soft glowing ring */
.ai-frame {
  position: relative;
  border-radius: 50%;
}

.ai-frame::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--primary-light), var(--accent-color), var(--primary-light));
  opacity: 0.35;
  filter: blur(14px);
  z-index: -1;
  animation: ring-spin 12s linear infinite;
}

@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

/* Expertise tags: gentle lift */
.expertise-tag {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    border-color var(--transition-fast), background-color var(--transition-fast);
}

.expertise-tag:hover {
  transform: translateY(-2px);
  border-color: var(--primary-light);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* ---------- Buttons: lift + sheen sweep ---------- */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background-color var(--transition-fast), border-color var(--transition-fast);
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s var(--ease-out-soft);
  pointer-events: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:hover::before {
  left: 120%;
}

.btn:active {
  transform: translateY(0);
}

/* ---------- Metric band: elevated cards, gradient numbers ---------- */
.metric {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.metric:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.metric__value {
  background: var(--section-title-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Cards: consistent hover elevation ---------- */
.project-card,
.news-card,
.publication-item,
.experience-card,
.timeline-content,
.focus-card,
.skill-category,
.award-card {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.project-card:hover,
.news-card:hover,
.publication-item:hover,
.experience-card:hover,
.focus-card:hover,
.skill-category:hover,
.award-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

/* ---------- Section titles: animated underline ---------- */
.section-title {
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 2px;
  background: var(--section-title-gradient);
  transform: scaleX(0.6);
  transform-origin: center;
  transition: transform 0.6s var(--ease-out-expo);
}

.section.reveal-visible .section-title::after,
.section-title.reveal-visible::after {
  transform: scaleX(1);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out-soft), transform 0.7s var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.reveal-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--background-white);
  color: var(--primary-color);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--transition-fast), transform var(--transition-fast),
    visibility var(--transition-fast), background-color var(--transition-fast);
  z-index: 900;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-color);
  color: var(--background-white);
}

/* ---------- Copy email chip ---------- */
.copy-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.copy-email-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.6);
}

.copy-email-btn.copied {
  border-color: #4ade80;
  color: #4ade80;
}

/* ---------- Smooth anchor scrolling ---------- */
html {
  scroll-behavior: smooth;
}

/* ---------- Reduced motion: everything settles instantly ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .hero::after,
  .ai-frame::after {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn::before {
    display: none;
  }

  html {
    scroll-behavior: auto;
  }
}
