/* ============================================
   Prof. Ghanta Chakrapani — VC Portfolio
   Primary: #23375A | White | Black
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --primary:    #23375A;
  --primary-light: #2e4a7a;
  --accent:     #c8a96e;
  --white:      #ffffff;
  --off-white:  #f8f9fc;
  --text:       #1a1a1a;
  --text-muted: #6b7280;
  --border:     rgba(35, 55, 90, 0.12);
  --glass-bg:   rgba(35, 55, 90, 0.75);
  --glass-border: rgba(255,255,255,0.18);
  --shadow:     0 8px 32px rgba(35,55,90,0.12);
  --transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; }

/* ========== LOADING SCREEN ========== */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loading-screen.hide { opacity: 0; visibility: hidden; }

.loader-content { text-align: center; color: var(--white); }

.loader-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.2s forwards;
}

.loader-bar {
  width: 200px; height: 2px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.4s forwards;
}
.loader-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  animation: loadFill 1.8s ease 0.6s forwards;
  width: 0;
}

@keyframes loadFill { to { width: 100%; } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== NAVBAR ========== */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0;
  transition: var(--transition);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  transition: var(--transition);
}

/* Scrolled state */
#navbar.scrolled .navbar-inner {
  background: rgba(232, 248, 253, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(35,55,90,0.1);
  padding: 0.7rem 2rem;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 4px 24px rgba(35,55,90,0.1);
}

#navbar:not(.scrolled) .navbar-inner {
  background: transparent;
}

.navbar-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: var(--transition);
}

.navbar-brand.dark { color: var(--primary); }

.nav-links {
  display: flex; gap: 2rem; list-style: none;
}

.nav-links a {
  color: rgba(35,55,90,0.7);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute; bottom: -4px; left: 0; right: 0;
  height: 1px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: center;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
}
.nav-links a:hover::after, .nav-links a.active::after {
  transform: scaleX(1);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none; border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: var(--transition);
}
.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); }

/* Mobile menu */
.mobile-menu {
  display: none;
  position: absolute; top: 100%; left: 1rem; right: 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  list-style: none;
  box-shadow: 0 8px 32px rgba(35,55,90,0.3);
  animation: slideDown 0.3s ease;
}
.mobile-menu.open { display: block; }
.mobile-menu li { padding: 0.6rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.mobile-menu li:last-child { border-bottom: none; }
.mobile-menu a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: block;
  transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--accent); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== HERO ========== */
#home {
  min-height: 100vh;
  background: #e8f8fd;
  position: relative;
  overflow: hidden;
  display: flex; align-items: center;
}

#home::before {
  display: none;
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8rem 2rem 5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-photo-wrap {
  display: flex; justify-content: center;
  animation: fadeUp 0.9s ease 0.3s both;
}

.hero-photo-frame {
  position: relative;
  width: 380px; max-width: 100%;
}

.hero-photo-frame::before {
  content: '';
  position: absolute;
  top: -12px; left: -12px; right: 12px; bottom: 12px;
  border: 2px solid var(--accent);
  border-radius: 20px;
  z-index: 0;
}

.hero-photo-frame img {
  width: 100%;
  border-radius: 16px;
  position: relative; z-index: 1;
  object-fit: cover;
  aspect-ratio: 3/4;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}

.hero-photo-frame .photo-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: rgba(255,255,255,0.06);
  border-radius: 16px;
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 0.85rem;
  text-align: center;
  border: 1px dashed rgba(255,255,255,0.15);
}

.hero-text { animation: fadeUp 0.9s ease 0.5s both; }

.hero-tag {
  display: inline-block;
  background: rgba(35, 55, 90, 0.1);
  color: var(--primary);
  border: 1px solid rgba(35, 55, 90, 0.2);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.hero-name {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.15;
  margin-bottom: 0.5rem;
  white-space: nowrap;
}

.hero-title-text {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--primary);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.8rem;
}

.hero-desc {
  font-size: 1rem;
  line-height: 1.85;
  color: rgba(35, 55, 90, 0.75);
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: flex; gap: 1rem; flex-wrap: wrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--primary);
  border: none;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(200,169,110,0.3);
}
.btn-primary:hover {
  background: #d4b87a;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(200,169,110,0.4);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(35, 55, 90, 0.35);
  padding: 0.85rem 2rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.5rem;
  transition: var(--transition);
}
.btn-outline:hover {
  background: rgba(35, 55, 90, 0.07);
  border-color: var(--primary);
}

/* scroll cue */
.scroll-cue {
  position: absolute; bottom: 2.5rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  color: rgba(35, 55, 90, 0.45);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: bounce 2s infinite;
}
.scroll-cue svg { opacity: 0.5; stroke: var(--primary); }
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(8px); }
}

/* ========== SECTIONS ========== */
.section { padding: 6rem 0; }
.section-alt { background: var(--off-white); }

.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-label {
  display: inline-block;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  position: relative;
  padding-left: 2rem;
}
.section-label::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  width: 1.3rem; height: 1px;
  background: var(--accent);
}

.section-heading {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  line-height: 1.25;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.7;
}

.divider {
  width: 48px; height: 3px;
  background: linear-gradient(to right, var(--accent), transparent);
  border-radius: 2px;
  margin: 1.2rem 0 2.5rem;
}

/* ========== ABOUT ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 4rem;
  align-items: start;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.stat-card {
  background: var(--primary);
  color: var(--white);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
}
.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  font-size: 0.78rem;
  opacity: 0.75;
  margin-top: 0.3rem;
  letter-spacing: 0.05em;
}

.about-text p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

/* ========== BLOG ========== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.blog-card {
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid var(--border);
}
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(35,55,90,0.18);
}

.blog-card-img {
  height: 200px;
  background: var(--primary);
  overflow: hidden;
}
.blog-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.blog-card:hover .blog-card-img img { transform: scale(1.05); }

.blog-card-img-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.2);
  font-size: 3rem;
}

.blog-card-body { padding: 1.5rem; }
.blog-card-date {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.blog-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.blog-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ========== VIDEOS ========== */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.video-card {
  border-radius: 16px;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(35,55,90,0.16);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--primary);
}
.video-thumb iframe {
  width: 100%; height: 100%;
  border: none;
}
.video-thumb .yt-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  cursor: pointer;
}
.yt-play-btn {
  width: 60px; height: 60px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s;
}
.yt-play-btn:hover { transform: scale(1.1); }
.yt-play-btn svg { fill: var(--primary); margin-left: 4px; }

.video-info { padding: 1.2rem; }
.video-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.video-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ========== BOOKS ========== */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
}

.book-card {
  text-align: center;
  transition: var(--transition);
}
.book-card:hover { transform: translateY(-6px); }

.book-cover {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(35,55,90,0.2);
  display: flex; align-items: center; justify-content: center;
}
.book-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.book-cover-placeholder {
  color: rgba(255,255,255,0.25);
  font-size: 0.8rem;
  padding: 1rem;
}

.book-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.3rem;
  line-height: 1.4;
}
.book-author {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.book-link {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.book-link:hover { color: var(--primary); }

/* ========== RESEARCH ========== */
.research-list { display: flex; flex-direction: column; gap: 1.5rem; }

.research-item {
  background: var(--white);
  border-radius: 16px;
  padding: 1.8rem 2rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  transition: var(--transition);
  box-shadow: 0 2px 12px rgba(35,55,90,0.06);
}
.research-item:hover {
  box-shadow: var(--shadow);
  transform: translateX(4px);
}

.research-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.research-meta {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.75rem;
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.research-abstract {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.research-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.research-link:hover { color: var(--accent); }

/* ========== FOOTER ========== */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 2.5rem 2rem;
  font-size: 0.85rem;
}
footer a { color: var(--accent); text-decoration: none; }

/* ========== MODAL ========== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: 20px;
  max-width: 700px; width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  animation: fadeUp 0.3s ease;
}

.modal-close {
  position: absolute; top: 1.2rem; right: 1.2rem;
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; color: var(--text-muted);
  line-height: 1; padding: 4px;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }

.modal-title {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.modal-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.modal-img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  object-fit: cover;
  max-height: 300px;
}
.modal-content {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-muted);
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state p { font-size: 0.95rem; margin-top: 0.5rem; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .hero-container {
    grid-template-columns: 1fr;
    padding: 7rem 1.5rem 4rem;
    text-align: center;
    gap: 2.5rem;
  }

  .hero-photo-frame { width: 260px; margin: 0 auto; }

  .hero-cta { justify-content: center; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .section { padding: 4rem 0; }

  .section-container { padding: 0 1.25rem; }

  .blog-grid, .videos-grid {
    grid-template-columns: 1fr;
  }

  .books-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-box { padding: 1.5rem; }

  .navbar-inner { padding: 1rem 1.25rem; }
  #navbar.scrolled .navbar-inner { padding: 0.6rem 1.25rem; }
}

@media (max-width: 400px) {
  .books-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr; }
}

/* ========== FADE-IN ANIMATION ========== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== SOCIAL FLOAT ========== */
.social-float {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 500;
}

.social-btn {
  width: 36px;
  height: 36px;
  background: var(--white);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: 0 2px 12px rgba(35,55,90,0.14);
  transition: var(--transition);
  border: 1px solid rgba(35,55,90,0.08);
  text-decoration: none;
}

.social-btn svg {
  width: 15px;
  height: 15px;
}

.social-btn:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateX(-3px);
  box-shadow: 0 4px 16px rgba(35,55,90,0.22);
  border-color: transparent;
}

@media (max-width: 768px) {
  .social-float {
    right: 0.6rem;
    gap: 0.4rem;
  }
  .social-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }
  .social-btn svg {
    width: 13px;
    height: 13px;
  }
}
