/* ========================================
   Thulasi Rangan – Personal Website
   ======================================== */

/* ---------- CSS Variables ---------- */
:root {
  --blue: #1a3a5c;
  --blue-dark: #0f2440;
  --blue-light: #2a5a8c;
  --gold: #c8963e;
  --gold-light: #e0b96e;
  --white: #ffffff;
  --gray: #f5f7fa;
  --charcoal: #2d3748;
  --charcoal-light: #4a5568;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --transition: 0.3s ease;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  line-height: 1.3;
  color: var(--blue);
}

h1 { font-size: 2.75rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--gold); }

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

ul { list-style: none; }

.container {
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
}

section {
  padding: 80px 0;
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-gold  { color: var(--gold); }
.bg-gray    { background: var(--gray); }
.bg-blue    { background: var(--blue); color: var(--white); }

.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-title h2 {
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}

.section-title h2::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
}

.section-title p {
  color: var(--charcoal-light);
  margin-top: 12px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Navigation ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}

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

.navbar__logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
}

.navbar__logo span {
  color: var(--gold);
}

.navbar__links {
  display: flex;
  gap: 32px;
}

.navbar__links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--blue);
  position: relative;
  padding: 4px 0;
}

.navbar__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width var(--transition);
}

.navbar__links a:hover::after,
.navbar__links a.active::after {
  width: 100%;
}

.navbar__links a.active {
  color: var(--gold);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
  transition: var(--transition);
}

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

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

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

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: var(--white);
  padding: 120px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(200, 150, 62, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 16px;
  font-size: 3.25rem;
}

.hero h1 span {
  color: var(--gold);
}

.hero p {
  font-size: 1.15rem;
  max-width: 640px;
  margin: 0 auto 32px;
  opacity: 0.9;
  line-height: 1.8;
}

.hero__cta {
  display: inline-flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  font-family: 'Inter', sans-serif;
}

.btn--primary {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

.btn--primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--white);
}

.btn--outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn--outline:hover {
  background: var(--white);
  color: var(--blue);
}

.btn--outline-blue {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}

.btn--outline-blue:hover {
  background: var(--blue);
  color: var(--white);
}

.btn--small {
  padding: 8px 20px;
  font-size: 0.85rem;
}

/* ---------- Profile Card ---------- */
.profile-card {
  display: flex;
  align-items: center;
  gap: 40px;
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.profile-card__image {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--gold);
}

.profile-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-card__info h2 {
  margin-bottom: 8px;
}

.profile-card__info p {
  color: var(--charcoal-light);
  margin-bottom: 16px;
}

.profile-card__social {
  display: flex;
  gap: 12px;
}

.profile-card__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray);
  color: var(--blue);
  font-size: 1.1rem;
  transition: var(--transition);
}

.profile-card__social a:hover {
  background: var(--gold);
  color: var(--white);
}

/* ---------- Card Grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--blue);
}

.card__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card__body {
  padding: 24px;
}

.card__body h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.card__body p {
  color: var(--charcoal-light);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--charcoal-light);
  margin-bottom: 12px;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--gray);
}

/* ---------- Skill Tags ---------- */
.tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--gold);
  color: var(--blue-dark);
  transition: var(--transition);
}

.tag:hover {
  background: var(--gold-light);
}

.tag--outline {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
}

.tag--outline:hover {
  background: var(--gold);
  color: var(--blue-dark);
}

/* ---------- Filter / Tag Buttons ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
}

.filter-btn {
  padding: 8px 22px;
  border-radius: 50px;
  border: 2px solid var(--blue);
  background: transparent;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}

/* ---------- Search Bar ---------- */
.search-bar {
  display: flex;
  max-width: 480px;
  margin: 0 auto 32px;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.search-bar input {
  flex: 1;
  padding: 12px 24px;
  border: 2px solid var(--gray);
  border-right: none;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  border-radius: 50px 0 0 50px;
  transition: border-color var(--transition);
}

.search-bar input:focus {
  border-color: var(--blue);
}

.search-bar button {
  padding: 12px 24px;
  background: var(--blue);
  color: var(--white);
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  border-radius: 0 50px 50px 0;
  transition: background var(--transition);
}

.search-bar button:hover {
  background: var(--blue-light);
}

/* ---------- Quote Card ---------- */
.quote-card {
  background: var(--white);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 32px 36px;
  box-shadow: var(--shadow);
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.quote-card blockquote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--blue);
  line-height: 1.8;
  margin-bottom: 16px;
}

.quote-card cite {
  display: block;
  font-style: normal;
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 600;
}

.quote-card .btn {
  margin-top: 20px;
}

/* ---------- Video Grid ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.video-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.video-card__thumbnail {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  overflow: hidden;
  background: var(--charcoal);
}

.video-card__thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.video-card:hover .video-card__thumbnail img {
  transform: scale(1.05);
}

.video-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background: rgba(200, 150, 62, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.video-card__play::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent var(--white);
  margin-left: 4px;
}

.video-card:hover .video-card__play {
  background: var(--gold);
  transform: translate(-50%, -50%) scale(1.1);
}

.video-card__thumbnail iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-card__body {
  padding: 20px 24px;
}

.video-card__body h4 {
  margin-bottom: 4px;
}

.video-card__body p {
  color: var(--charcoal-light);
  font-size: 0.9rem;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
}

.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 50px;
  border: 2px solid var(--blue);
  background: transparent;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.pagination__btn:hover,
.pagination__btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}

.pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Contact Section ---------- */
.contact {
  text-align: center;
}

.contact__links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  background: var(--white);
  color: var(--blue);
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.contact__link:hover {
  background: var(--gold);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.contact__link svg,
.contact__link i {
  font-size: 1.2rem;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--blue);
  color: rgba(255, 255, 255, 0.8);
  padding: 48px 0 24px;
}

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

.footer__logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}

.footer__logo span {
  color: var(--gold);
}

.footer__links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer__links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer__links a:hover {
  color: var(--gold);
}

.footer__social {
  display: flex;
  gap: 16px;
}

.footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

.footer__social a:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}

.footer__copy {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-top: 12px;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold);
  border-radius: 2px;
}

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

.timeline__item:last-child {
  margin-bottom: 0;
}

.timeline__marker {
  position: absolute;
  left: -32px;
  top: 4px;
  width: 17px;
  height: 17px;
  background: var(--white);
  border: 3px solid var(--gold);
  border-radius: 50%;
  z-index: 1;
}

.timeline__content {
  background: var(--white);
  padding: 24px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}

.timeline__content:hover {
  box-shadow: var(--shadow-hover);
}

.timeline__date {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 4px;
}

.timeline__content h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.timeline__content p {
  color: var(--charcoal-light);
  font-size: 0.95rem;
}

/* ---------- Fade-In Animation ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  html { font-size: 15px; }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }

  section { padding: 56px 0; }

  .hero { padding: 80px 0 64px; }
  .hero h1 { font-size: 2.25rem; }

  /* Mobile nav */
  .navbar__links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .navbar__links.open {
    max-height: 400px;
    padding: 16px 0;
  }

  .navbar__links a {
    padding: 12px 0;
    width: 90%;
    text-align: center;
    border-bottom: 1px solid var(--gray);
  }

  .navbar__links a:last-child {
    border-bottom: none;
  }

  .hamburger {
    display: flex;
  }

  /* Grids */
  .card-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }

  /* Profile card */
  .profile-card {
    flex-direction: column;
    text-align: center;
    padding: 28px;
    gap: 24px;
  }

  .profile-card__social {
    justify-content: center;
  }

  /* Quote */
  .quote-card {
    padding: 24px;
  }

  .quote-card blockquote {
    font-size: 1.1rem;
  }

  /* Filter */
  .filter-bar {
    gap: 8px;
  }

  .filter-btn {
    padding: 6px 16px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .container { width: 92%; }

  .hero__cta {
    flex-direction: column;
    align-items: center;
  }

  .contact__links {
    flex-direction: column;
    align-items: center;
  }

  .search-bar {
    flex-direction: column;
    border-radius: var(--radius);
  }

  .search-bar input {
    border-radius: var(--radius) var(--radius) 0 0;
    border-right: 2px solid var(--gray);
    border-bottom: none;
  }

  .search-bar button {
    border-radius: 0 0 var(--radius) var(--radius);
  }
}

/* ---------- Blog Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  overflow-y: auto;
  padding: 40px 20px;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal-content {
  background: var(--white);
  border-radius: 12px;
  max-width: 760px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--charcoal-light);
  cursor: pointer;
  line-height: 1;
  z-index: 1;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--blue);
}

.modal-body {
  padding: 48px 40px;
}

.modal-body h2 {
  font-size: 2rem;
  margin-bottom: 16px;
  padding-right: 40px;
}

.modal-date {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.modal-text {
  line-height: 1.9;
  font-size: 1.05rem;
  color: var(--charcoal);
}

.modal-text p {
  margin-bottom: 16px;
}

.modal-text blockquote {
  border-left: 4px solid var(--gold);
  padding: 16px 24px;
  margin: 24px 0;
  font-style: italic;
  font-family: 'Playfair Display', serif;
  color: var(--blue);
  background: var(--gray);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.8;
}

.modal-text ul, .modal-text ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.modal-text li {
  margin-bottom: 8px;
  list-style: disc;
}

.modal-text ol li {
  list-style: decimal;
}

.card__read-more {
  display: inline-block;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 4px;
}

@media (max-width: 600px) {
  .modal-body {
    padding: 32px 20px;
  }
  .modal-body h2 {
    font-size: 1.5rem;
  }
}

/* ---------- Quote Image Poster ---------- */
.quote-image-wrapper {
  margin-bottom: 16px;
}

.quote-poster {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
