:root {
  --brand-primary: #2563eb;
  --brand-secondary: #7c3aed;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-elevated: #f1f5f9;
  --border-light: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  --shadow-soft: 0 8px 30px rgb(0 0 0 / 0.06);
}

/* ============================================
   LOADING STATES
   ============================================ */

.home-viewport {
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.home-viewport.is-ready {
  opacity: 1;
  transform: none;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #ffffff;
  z-index: 1100;
  transition: opacity 0.4s ease;
}

.loading-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--border-light);
  border-top-color: var(--brand-primary);
  animation: spinner 0.8s linear infinite;
}

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

/* ============================================
   TYPOGRAPHY & LABELS
   ============================================ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.125rem;
  border-radius: 100px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.15);
  color: var(--brand-primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}

/* ============================================
   HERO SECTION - PROFESSIONAL LAYOUT
   ============================================ */

.hero-section {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
  padding: clamp(4rem, 8vh, 6rem) 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(4rem, 8vw, 6rem);
  align-items: center;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 max(2rem, 5vw);
}

.hero-copy h1 {
  font-size: clamp(2.75rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1.75rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-copy > p {
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 580px;
}

.hero-copy a {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.hero-copy a:hover {
  border-bottom-color: var(--brand-primary);
}

/* Typing Animation */
.typing-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.5rem;
  border-radius: 100px;
  background: white;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2.5rem;
}

.typing-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-secondary);
}

.typing-line {
  min-width: 18ch;
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Action Buttons */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.25rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--brand-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  transform: translateY(-2px);
}

.btn-secondary {
  background: white;
  color: var(--text-primary);
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Hero Highlights */
.hero-highlights {
  display: grid;
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hero-highlights li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.hero-highlights li::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 0.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Hero Visual */
.hero-visual {
  display: grid;
  gap: 1.75rem;
  justify-items: center;
}

.pdb-frame {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1;
  border-radius: 24px;
  overflow: hidden;
  background: 
    radial-gradient(circle at 30% 30%, rgba(37, 99, 235, 0.08), transparent 70%),
    radial-gradient(circle at 70% 70%, rgba(124, 58, 237, 0.06), transparent 70%),
    linear-gradient(135deg, #f8fafc, #ffffff);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
}

.pdb-viewer {
  position: absolute;
  inset: 0;
}

.pdb-glow {
  position: absolute;
  inset: 8%;
  border-radius: 20px;
  box-shadow: 0 40px 80px rgba(37, 99, 235, 0.2);
  pointer-events: none;
}

.hero-badges {
  display: grid;
  gap: 1.25rem;
  width: 100%;
  max-width: 520px;
}

.badge {
  padding: 1.5rem 1.75rem;
  border-radius: 16px;
  background: white;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.badge:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.3);
}

.badge-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-primary);
  font-weight: 700;
  margin-bottom: 0.625rem;
}

.badge p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ============================================
   SECTION LAYOUTS
   ============================================ */

.section {
  padding: clamp(5rem, 10vh, 8rem) max(2rem, 5vw);
}

.section-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 4rem;
}

.section-header h2 {
  font-size: clamp(2.25rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 1.25rem 0;
}

.section-header p {
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================
   ABOUT SECTION
   ============================================ */

.about-section {
  background: white;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto 3.5rem;
}

.about-card {
  padding: 2.5rem;
  border-radius: 20px;
  background: var(--surface-muted);
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.about-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37, 99, 235, 0.3);
  background: white;
}

.about-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.about-card h3::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  border-radius: 2px;
}

.about-card p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 0;
}

/* Focus Cards */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  max-width: 1200px;
  margin: 0 auto;
}

.focus-card {
  padding: 2.25rem 2rem;
  border-radius: 16px;
  background: white;
  border: 1px solid var(--border-light);
  text-align: center;
  transition: all 0.3s ease;
}

.focus-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-primary);
}

.focus-card i {
  font-size: 2.5rem;
  color: var(--brand-primary);
  margin-bottom: 1.25rem;
  display: block;
}

.focus-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
}

.focus-card p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================
   PROJECTS & BLOG SECTIONS
   ============================================ */

.projects-section,
.blog-section {
  background: var(--surface-muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
}

.project-card,
.blog-card {
  display: flex;
  flex-direction: column;
  padding: 2.25rem;
  border-radius: 20px;
  background: white;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover,
.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(37, 99, 235, 0.3);
}

.project-card-body h3,
.blog-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
}

.project-card-body h3 a,
.blog-card h3 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.project-card-body h3 a:hover,
.blog-card h3 a:hover {
  color: var(--brand-primary);
}

.project-card-body p,
.blog-card > p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 0 0 1.75rem 0;
  flex-grow: 1;
}

.project-card-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.project-tag,
.blog-meta {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.project-link,
.blog-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.project-link:hover,
.blog-link:hover {
  color: var(--brand-primary);
  gap: 0.75rem;
}

.project-link span,
.blog-link span {
  transition: transform 0.2s ease;
}

.project-link:hover span,
.blog-link:hover span {
  transform: translateX(4px);
}

.section-cta {
  margin-top: 3.5rem;
  text-align: center;
}

/* ============================================
   CONTACT SECTION
   ============================================ */

.contact-section {
  background: linear-gradient(to bottom, var(--surface-muted) 0%, white 100%);
  padding-bottom: clamp(6rem, 12vh, 9rem);
}

.contact-card {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 4.5rem);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.04), rgba(124, 58, 237, 0.03));
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-wrap: wrap;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
  justify-content: space-between;
}

.contact-card h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
}

.contact-card p {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 0;
  max-width: 540px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */

[data-animate] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: var(--animate-delay, 0ms);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }
  
  .hero-copy {
    text-align: center;
  }
  
  .hero-highlights {
    text-align: left;
    max-width: 580px;
    margin: 0 auto;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .typing-wrapper {
    margin-left: auto;
    margin-right: auto;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
  }
  
  .focus-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .section {
    padding: clamp(3.5rem, 7vh, 5rem) 1.5rem;
  }
  
  .hero-section {
    min-height: auto;
    padding: clamp(3rem, 6vh, 4rem) 1.5rem;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .focus-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-card {
    padding: 2.5rem 1.75rem;
    text-align: center;
  }
  
  .contact-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .hero-copy h1 {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }
  
  .section-header h2 {
    font-size: clamp(1.75rem, 7vw, 2.25rem);
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .home-viewport,
  [data-animate] {
    transform: none !important;
  }
}