/* ============================================
   Ashima Sitaula Portfolio — Custom Styles
   ============================================ */

/* --- Custom Properties --- */
:root {
  --navy: #1B2A4A;
  --terracotta: #E07A5F;
  --terracotta-dark: #c9664b;
  --gold: #F2CC8F;
  --off-white: #FAFAFA;
  --warm-gray: #F0EDE8;
  --text-primary: #2D3748;
  --text-secondary: #4A5568;
  --text-light: #718096;

  --font-body: 'Inter', sans-serif;
  --font-heading: 'Playfair Display', serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;
  --fs-4xl: 2.25rem;
  --fs-5xl: 3rem;
  --fs-6xl: 3.75rem;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
}

/* --- Base --- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--navy);
}

/* --- Skip to content --- */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--terracotta);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: 100;
  transition: top 0.2s;
  font-weight: 600;
}

.skip-to-content:focus {
  top: 0;
}

/* --- Navbar --- */
.navbar {
  transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.scrolled {
  background-color: rgba(27, 42, 74, 0.97) !important;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
}

.nav-link {
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--terracotta);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* --- Hero gradient background --- */
.hero-gradient {
  background: linear-gradient(135deg, #1B2A4A 0%, #2d4a7a 40%, #3d5a8a 60%, #1B2A4A 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

/* --- Section styles --- */
.section-title {
  font-family: var(--font-heading);
  color: var(--navy);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--terracotta);
  border-radius: 2px;
}

.section-title-center::after {
  left: 50%;
  transform: translateX(-50%);
}

/* --- Project cards --- */
.project-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.project-card .card-image {
  transition: transform 0.4s ease;
  overflow: hidden;
}

.project-card:hover .card-image img,
.project-card:hover .card-image svg {
  transform: scale(1.05);
}

/* --- Filter pills --- */
.filter-pill {
  transition: all 0.2s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.filter-pill:hover {
  border-color: var(--terracotta);
}

.filter-pill.active {
  background-color: var(--terracotta);
  color: white;
  border-color: var(--terracotta);
}

/* --- Case study blocks --- */
.case-study {
  transition: box-shadow 0.3s ease;
}
.case-study:hover {
  box-shadow: var(--shadow-md);
}


/* --- Timeline --- */
.timeline {
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--terracotta), var(--gold));
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 1.5rem;
}

.timeline-item:nth-child(odd) {
  padding-right: 3rem;
  text-align: right;
}

.timeline-item:nth-child(even) {
  margin-left: 50%;
  padding-left: 3rem;
}

.timeline-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--terracotta);
  border: 3px solid white;
  border-radius: 50%;
  top: 2rem;
  box-shadow: var(--shadow-md);
  z-index: 2;
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -8px;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -8px;
}

.timeline-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Timeline mobile */
@media (max-width: 768px) {
  .timeline::before {
    left: 20px;
  }

  .timeline-item,
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    width: 100%;
    margin-left: 0;
    padding-left: 3.5rem;
    padding-right: 1rem;
    text-align: left;
  }

  .timeline-item:nth-child(odd) .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    left: 12px;
    right: auto;
  }
}

/* --- Stat cards --- */
.stat-card {
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-number {
  font-family: var(--font-heading);
  color: var(--terracotta);
}

/* --- Skill cards --- */
.skill-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* --- Publication cards --- */
.pub-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pub-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* --- Buttons --- */
.btn-primary {
  background: var(--terracotta);
  color: white;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--terracotta-dark);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  border: 2px solid white;
  color: white;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background: white;
  color: var(--navy);
}

/* --- Tag pills --- */
.tag-pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: 500;
  background: rgba(224, 122, 95, 0.1);
  color: var(--terracotta);
  transition: all 0.2s ease;
}

.tag-pill:hover {
  background: var(--terracotta);
  color: white;
}

/* --- Mobile menu --- */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-menu.open {
  transform: translateX(0);
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- Project detail page --- */
.project-hero {
  background: linear-gradient(135deg, #1B2A4A 0%, #2d4a7a 50%, #1B2A4A 100%);
}

.iframe-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  background: white;
}

.iframe-container iframe {
  width: 100%;
  height: 600px;
  border: none;
}

@media (max-width: 640px) {
  .iframe-container iframe {
    height: 400px;
  }
}

/* --- Back to top --- */
.back-to-top {
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* --- Focus styles for accessibility --- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal-left,
  .reveal-right {
    opacity: 1;
    transform: none;
  }
}
