/*
 * Custom CSS for Dr. V. V. S. Chandrasekharam static website
 * Integrates Google Fonts, custom scrollbars, glassmorphism, and scroll-triggered animations.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;500;700&family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* Basic setup and smooth behavior */
html {
  scroll-behavior: smooth;
}

body {
  background-color: #FCFCFA; /* Ultra light warm gray */
  color: #334155; /* Slate-700 for high readability */
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  color: #1F2937; /* Soft charcoal */
  font-family: "Playfair Display", serif;
}

/* Premium Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #FCFCFA;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Glassmorphism Styles */
.glass {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(42, 111, 109, 0.05);
}

/* Scroll-Reveal Animation Framework (Vanishes React Framer Motion dependecy) */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

/* Active states triggered by Intersection Observer in JavaScript */
.reveal.active,
.reveal-left.active,
.reveal-right.active,
.reveal-scale.active {
  opacity: 1;
  transform: translateX(0) translateY(0) scale(1);
}

/* Typewriter and post-type reveals (copied/adapted from Dr_N_Subrahmaneswara_Babu template) */
.typewriter-text {
  display: inline-block;
  white-space: pre-wrap;
  overflow: hidden;
}

.typewriter-text::after {
  content: '';
  display: inline-block;
  width: 1px;
  height: 1.1em;
  margin-left: 0.3ch;
  background-color: currentColor;
  animation: blink-caret 1s steps(1) infinite;
}

.typewriter-text.typing-done::after { display: none; }

.hero-desc.fade-in-after-type,
.hero-buttons.fade-in-after-type,
.hero-quick-stats.fade-in-after-type {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.hero-desc.fade-in-after-type.visible,
.hero-buttons.fade-in-after-type.visible,
.hero-quick-stats.fade-in-after-type.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Word-by-word slide for philosophy text */
.philosophy-text .word-slide {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}
.philosophy-text .word-slide.visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* Timeline progressive draw */
.timeline-wrapper {
  position: relative;
  --timeline-line-top: 0px;
  --timeline-fill-height: 0px;
  padding-left: 2rem; /* align with existing content padding */
  border-left: 1px solid rgba(42, 111, 109, 0.1);
}


.timeline-wrapper::before {
  content: '';
  position: absolute;
  /* position the animated foreground directly over the static border-left */
  left: -1px;
  top: var(--timeline-line-top);
  width: 3px;
  height: 0;
  background: #2A6F6D; /* animated foreground color (medical teal) */
  border-radius: 3px;
  transition: height 0.6s ease, top 220ms ease;
  transform-origin: top;
  pointer-events: none;
  z-index: 0;
}

.timeline-wrapper.line-fill-active::before {
  height: var(--timeline-fill-height, 0px);
}

.timeline-marker {
  transition: transform 360ms cubic-bezier(0.2,0.9,0.2,1), background-color 220ms ease, box-shadow 220ms ease;
  transform: scale(0.88);
  z-index: 2;
}

.timeline-marker.active {
  transform: scale(1);
  box-shadow: 0 6px 20px rgba(42,111,109,0.14);
}

.timeline-content {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 320ms ease, transform 320ms cubic-bezier(0.16,1,0.3,1);
  z-index: 2;
}

.timeline-content.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Micro-transition delays for beautifully staggered content loads */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }
.delay-600 { transition-delay: 600ms; }
.delay-700 { transition-delay: 700ms; }
.delay-800 { transition-delay: 800ms; }

/* Pulse animation utility for high priority interactive elements */
.pulse-custom {
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: .5;
    transform: scale(1.1);
  }
}

#info-modal {
  backdrop-filter: blur(10px);
  display: none;
}

#info-modal.show {
  display: flex !important;
}

#info-modal .modal-card {
  max-height: calc(100vh - 4rem);
}

#info-modal img {
  min-height: 240px;
}

.modal-scroll {
  max-height: calc(100vh - 20rem);
  overflow-y: auto;
}

/* 3D Perspective Stack Carousel */
.cancer-carousel-viewport {
  perspective: 1200px;
  transform-style: preserve-3d;
  height: 450px;
  position: relative;
  width: 100%;
}

.cancer-3d-card {
  position: absolute;
  width: 360px;
  will-change: transform, opacity, z-index;
  transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.7s ease, border-color 0.3s ease;
  user-select: none;
  border: 1px solid rgba(42, 111, 109, 0.08);
}

.cancer-3d-card img {
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.cancer-3d-card.card-active:hover img {
  transform: scale(1.05);
}

/* 3D Index Position States */
.cancer-3d-card.card-active {
  transform: translate3d(0, 0, 0) rotateY(0deg) scale(1);
  opacity: 1;
  z-index: 10;
  pointer-events: auto;
  box-shadow: 0 30px 60px -15px rgba(42, 111, 109, 0.2), 0 15px 30px -10px rgba(0, 0, 0, 0.05);
  border-color: rgba(42, 111, 109, 0.25);
}

.cancer-3d-card.card-next {
  transform: translate3d(140px, 0, -100px) rotateY(-18deg) scale(0.9);
  opacity: 0.8;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.1);
}

.cancer-3d-card.card-prev {
  transform: translate3d(-140px, 0, -100px) rotateY(18deg) scale(0.9);
  opacity: 0.8;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.1);
}

.cancer-3d-card.card-far-next {
  transform: translate3d(260px, 0, -200px) rotateY(-30deg) scale(0.8);
  opacity: 0.4;
  z-index: 2;
  pointer-events: none;
}

.cancer-3d-card.card-far-prev {
  transform: translate3d(-260px, 0, -200px) rotateY(30deg) scale(0.8);
  opacity: 0.4;
  z-index: 2;
  pointer-events: none;
}

.cancer-3d-card.card-hidden {
  transform: translate3d(0, 0, -300px) scale(0.7);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}

/* Carousel Dot Styles */
.carousel-dot {
  transition: all 0.3s ease;
}
.carousel-dot.active {
  background-color: #2A6F6D;
  width: 24px;
}

/* Mobile Responsiveness Viewport Adjustments */
@media (max-width: 640px) {
  .cancer-3d-card {
    width: 280px !important;
  }
  .cancer-3d-card.card-next {
    transform: translate3d(60px, 0, -80px) rotateY(-10deg) scale(0.85);
    opacity: 0.6;
  }
  .cancer-3d-card.card-prev {
    transform: translate3d(-60px, 0, -80px) rotateY(10deg) scale(0.85);
    opacity: 0.6;
  }
  .cancer-3d-card.card-far-next,
  .cancer-3d-card.card-far-prev {
    opacity: 0;
  }
}

.modal-scroll::-webkit-scrollbar {
  width: 8px;
}

/* Media section layout: left horizontal scroll, right LinkedIn card */
.media-grid {
  display: block;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .media-grid {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 2rem;
    align-items: start;
  }
}

/* LinkedIn card sizing */
.linkedin-card {
  width: 100%;
  min-height: 520px;
}

@media (min-width: 1024px) {
  .linkedin-card {
    max-width: 420px;
    min-height: 520px;
    margin-left: auto;
    margin-right: 0;
  }
}

/* Hover effect: gentle lift and stronger shadow */
.linkedin-card {
  transition: transform 240ms cubic-bezier(.2,.9,.2,1), box-shadow 240ms cubic-bezier(.2,.9,.2,1);
  will-change: transform, box-shadow;
}

.linkedin-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(2,6,23,0.12), 0 6px 12px rgba(2,6,23,0.06);
}

.modal-scroll::-webkit-scrollbar-track {
  background: #f8fafc;
}

.modal-scroll::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

.modal-scroll::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Expertise card template tweaks */
#expertise .expertise-card {
  text-align: center;
}

#expertise .expertise-card .w-14 {
  width: 56px;
  height: 56px;
}

#expertise .expertise-card h3 {
  margin-bottom: 0.5rem;
}

#expertise .expertise-card p {
  margin-bottom: 1rem;
}

#expertise .expertise-card .rounded-full, #expertise .expertise-card .w-8 {
  margin-left: auto;
  margin-right: auto;
}

/* Make expertise cards wider and responsive like the template */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2.5rem;
  max-width: 1700px;
  margin: 0 auto;
}

/* 2 columns on medium, 3 columns on large screens to match template; increase min widths for wider cards */
@media (min-width: 768px) {
  .expertise-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1200px) {
  .expertise-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Make individual cards wider and more airy */
.expertise-card {
  padding: 2.5rem; /* 40px */
  min-height: 260px;
  border-radius: 1rem;
}

.expertise-card h3 { font-size: 1.125rem; }
.expertise-card p { max-width: 44ch; margin-left: auto; margin-right: auto; }

/* Slightly larger gap indicator */
.expertise-card .w-8 { height: 6px; }
