/* ============================================
   DESIGN SYSTEM — Tirth Shah Portfolio
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --bg-primary: #0a0f1c;
  --bg-secondary: #111827;
  --bg-gradient: linear-gradient(135deg, #0a0f1c 0%, #111827 50%, #0f172a 100%);

  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --surface-border: rgba(255, 255, 255, 0.08);

  --accent-primary: #06b6d4;
  --accent-secondary: #3b82f6;
  --accent-gradient: linear-gradient(135deg, #06b6d4, #3b82f6);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(6, 182, 212, 0.15);

  --transition-fast: 200ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 600ms ease;

  --nav-height: 72px;
  --container-width: 1200px;
  --container-padding: 24px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-secondary);
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h5 { font-size: clamp(1rem, 1.5vw, 1.25rem); }

p {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* --- Container --- */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* --- Section --- */
.section {
  padding: 100px 0;
}

.section-header {
  margin-bottom: 60px;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 15, 28, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--surface-border);
  z-index: 1000;
  transition: background var(--transition-base);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo img {
  height: 36px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  position: relative;
  display: inline-block;
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  letter-spacing: 0.02em;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--surface);
}

.nav-links a.active {
  color: var(--accent-primary);
  background: rgba(6, 182, 212, 0.1);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   GLASSMORPHISM COMPONENTS
   ============================================ */
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition-base);
}

.glass-card:hover {
  background: var(--surface-hover);
  border-color: rgba(6, 182, 212, 0.2);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  letter-spacing: 0.03em;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(6, 182, 212, 0.4);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--accent-primary);
  border: 1.5px solid var(--accent-primary);
}

.btn-outline:hover {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

/* ============================================
   TAGS & BADGES
   ============================================ */
.tag {
  display: inline-block;
  padding: 5px 14px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-primary);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-full);
}

.badge-gold {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

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

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content {
  animation: fadeInUp 0.8s ease forwards;
}

.hero-greeting {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.hero-name {
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-name span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.hero-quote {
  padding: 20px 24px;
  margin-bottom: 36px;
  border-left: 3px solid var(--accent-primary);
  background: rgba(6, 182, 212, 0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.hero-quote p {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero-quote cite {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  font-style: normal;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeInUp 0.8s ease 0.2s forwards;
  opacity: 0;
}

.hero-image-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.hero-image-frame::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--accent-gradient);
  border-radius: var(--radius-xl);
  z-index: -1;
  opacity: 0.5;
}

.hero-image-frame img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-xl);
}

/* ============================================
   ABOUT PAGE SECTIONS
   ============================================ */
.about-hero {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 60px;
}

.about-bio {
  max-width: 900px;
}

.about-bio p {
  margin-bottom: 20px;
  font-size: 1.05rem;
  line-height: 1.9;
}

.about-bio a {
  color: var(--accent-primary);
  font-weight: 500;
  border-bottom: 1px solid rgba(6, 182, 212, 0.3);
  transition: all var(--transition-fast);
}

.about-bio a:hover {
  color: var(--accent-secondary);
  border-bottom-color: var(--accent-secondary);
}

/* Education Timeline */
.timeline {
  position: relative;
  padding-left: 40px;
}

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

.timeline-item {
  position: relative;
  margin-bottom: 36px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.timeline-item .glass-card {
  padding: 24px 28px;
}

.timeline-degree {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-school {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

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

/* Research Interests Tags */
.interests-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.interest-tag {
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.interest-tag:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

/* Achievements Grid */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: 20px;
}

.achievements-grid > .reveal {
  height: 100%;
}

.achievements-grid .glass-card {
  padding: 20px 24px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center !important;
  gap: 16px;
}

.achievement-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: rgba(6, 182, 212, 0.1);
  border-radius: var(--radius-sm);
}

.achievement-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.achievement-text strong {
  color: var(--text-primary);
}

/* ============================================
   PROJECTS PAGE
   ============================================ */
.page-header {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 40px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.project-card .glass-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px;
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.project-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.project-title a:hover {
  color: var(--accent-primary);
}

.project-link-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.project-card:hover .project-link-icon {
  color: var(--accent-primary);
}

.project-description {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-description.expanded {
  -webkit-line-clamp: unset;
}

.project-expand-btn {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 16px;
  font-family: var(--font-family);
  transition: color var(--transition-fast);
}

.project-expand-btn:hover {
  color: var(--accent-secondary);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.project-badge {
  position: absolute;
  top: -8px;
  right: 16px;
  z-index: 2;
}

.project-video-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-primary);
  margin-bottom: 12px;
  transition: color var(--transition-fast);
}

.project-video-link:hover {
  color: var(--accent-secondary);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--surface-border);
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  transition: all var(--transition-base);
}

.social-link:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
  color: var(--accent-primary);
  transform: translateY(-3px);
}

.social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

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

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

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-quote {
    text-align: left;
  }

  .hero-content {
    order: 2;
  }

  .hero-image {
    order: 1;
    opacity: 1;
  }

  .hero-image-frame {
    max-width: 320px;
  }

  .hero .btn {
    margin: 0 auto;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .achievements-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --container-padding: 20px;
    --nav-height: 64px;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    background: rgba(10, 15, 28, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--surface-border);
    padding: 40px;
    transition: right var(--transition-base);
    z-index: 999;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    font-size: 1.1rem;
    padding: 14px 24px;
  }

  .nav-toggle {
    display: flex;
  }

  .section {
    padding: 60px 0;
  }

  .hero-name {
    font-size: 2.5rem;
  }

  .hero-image-frame {
    max-width: 260px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
  }

  .footer .container {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}

/* ============================================
   UTILITY
   ============================================ */
.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
