/* =========================================================
   GLOBAL THEME & BASE STYLES
   ========================================================= */

/* Reset layout and enable predictable sizing */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* --- Global color variables --- */
:root {
  --accent: #b38bfa;           /* lavender primary */
  --accent-hover: #1abc9c;     /* croc green secondary */
  --background-light: #f2e9ff; /* soft off-white lilac */
  --text-color: #333;
}

/* --- Global text + layout --- */
html { scroll-behavior: smooth; }
body {
  font-family: "Poppins", sans-serif;
  background: #f9f9f9;
  color: var(--text-color);
  line-height: 1.6;
}

/* =========================================================
   NAVBAR — sticky, translucent, mobile-friendly
   ========================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Inner layout: logo left, menu right */
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.25rem;
  transition: padding 0.2s;
}

/* Compact navbar when scrolled */
.navbar.scrolled .nav-inner {
  padding: 0.5rem 1.25rem;
}

/* Logo and accent color */
.nav-logo { font-size: 1.6rem; font-weight: 700; }
.accent { color: var(--accent-hover); }

/* Menu links */
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  position: relative;
}

/* Hover + active underline animation */
.nav-links a:hover,
.nav-links a.active { color: var(--accent-hover); }

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 0;
  background: var(--accent-hover);
  transition: width 0.3s;
}
.nav-links a:hover::after { width: 100%; }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  cursor: pointer;
  font-size: 1.8rem;
  color: var(--accent-hover);
}

/* --- Mobile menu behavior --- */
@media (max-width: 768px) {
  .menu-toggle { display: block; }

  .nav-links {
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    transform: translateY(-16px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.75rem 0;
  }

  .nav-links.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    padding: 0.75rem 1rem;
    display: block;
  }
}

/* =========================================================
   HERO SECTION — gradient intro
   ========================================================= */
.hero {
  text-align: center;
  padding: 6rem 1.5rem;
  background: linear-gradient(135deg, #f2e9ff 0%, #e8fdf7 100%);
}
.hero-compact { padding: 4rem 1.5rem; }
.hero h1 { font-size: 2.2rem; margin: 0.25rem 0 0.5rem; }
.hero h3 { font-weight: 500; margin: 0.25rem 0 1rem; }
.hero-sub { opacity: 0.9; }

/* Circular profile photo */
.hero-img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 3px solid var(--accent-hover);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  display: block;
  margin: 0 auto 0.5rem;
}

/* =========================================================
   FUN FACTS — small personality cards
   ========================================================= */
.fun-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin: 2rem auto 3rem;
  max-width: 920px;
}

.fact {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  padding: 1.1rem;
  width: 250px;
  text-align: center;
  transition: transform 0.25s, border 0.25s;
  border: 2px solid transparent;
}

.fact:hover {
  transform: translateY(-4px);
  border-color: var(--accent-hover);
}
.fact h4 { color: var(--accent); font-weight: 600; margin-bottom: 0.4rem; }
.fact p { font-size: 0.9rem; color: #555; }

/* =========================================================
   SECTION DIVIDERS — subtle gradients between sections
   ========================================================= */
.section-divider {
  width: 100%;
  height: 56px;
  border-radius: 40px;
  margin: 3rem 0;
  background: linear-gradient(to right, var(--accent), var(--accent-hover));
  opacity: 0.08;
}
.section-divider.subtle {
  height: 28px;
  margin: 2rem 0;
  opacity: 0.06;
}

/* =========================================================
   GENERAL SECTION STRUCTURE
   ========================================================= */
.section {
  padding: 5rem 1.5rem;
  max-width: 1000px;
  margin: auto;
}
.alt-bg { background: var(--background-light); }
.section h2 {
  text-align: center;
  color: var(--accent);
  margin-bottom: 2rem;
}

/* =========================================================
   HOW I THINK SECTION — structured process steps
   ========================================================= */
#how-i-think {
  padding-top: 3rem;
  padding-bottom: 2.25rem;
}
#how-i-think .how-intro {
  max-width: 820px;
  margin: 0.5rem auto 1.75rem;
  line-height: 1.75;
  text-align: center;
}
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  justify-items: center;
}
.step {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  padding: 1.2rem;
  width: 100%;
  max-width: 260px;
  text-align: center;
}
.step-number {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

/* =========================================================
   BUTTONS — consistent site-wide
   ========================================================= */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 25px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.25s, transform 0.1s;
}
.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}
.btn:active {
  background: #149e83;
  transform: translateY(0);
}
.btn.small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 20px;
}
.center-btn {
  text-align: center;
  margin-top: 1.5rem;
}

/* =========================================================
   CONTACT SECTION — consistent button layout
   ========================================================= */
#contact {
  text-align: center;
}
#contact h2 {
  text-align: center;
  color: var(--accent);
  margin-bottom: 1.5rem;
}
#contact p {
  font-size: 1rem;
  margin-bottom: 1.8rem;
  color: var(--text-color);
}
.contact-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}
.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 25px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: background 0.25s, transform 0.1s;
}
.contact-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}
.contact-btn:active {
  background: #149e83;
  transform: translateY(0);
}

/* Stack vertically on small screens */
@media (max-width: 600px) {
  .contact-buttons {
    flex-direction: column;
    align-items: center;
  }
  .contact-btn {
    width: 80%;
  }
}

/* =========================================================
   PROJECT CARDS — grid and hover overlays
   ========================================================= */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.project-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  border: 2px solid transparent;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s, border 0.25s;
}
.project-card:hover {
  transform: translateY(-4px);
  border: 2px solid var(--accent-hover);
}

/* --- Image styling --- */
.project-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

/* --- Hover overlay --- */
.project-card .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  transition: opacity 0.2s;
}
.project-card:hover .overlay { opacity: 1; }

/* =========================================================
   PLACEHOLDER CARDS — for upcoming projects
   ========================================================= */
.project-card.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 180px;
  background: linear-gradient(135deg, #f9f5ff 0%, #f2f9ff 100%);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}
.placeholder-inner h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--accent);
  font-weight: 600;
}
.placeholder-inner p {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.5;
}

/* =========================================================
   PROJECT FILTER BUTTONS
   ========================================================= */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.filter-btn {
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
}
.filter-btn.active,
.filter-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* =========================================================
   ABOUT PAGE — text, photo, and vertical timeline
   ========================================================= */
#about { max-width: 950px; margin: 0 auto; padding: 3rem 2rem; }
#about h2 { text-align: center; color: var(--accent); margin-bottom: 2rem; }
#about p { line-height: 1.9; font-size: 1rem; margin-bottom: 1.4rem; text-align: left; }
#about b { color: var(--accent); font-weight: 600; }

/* --- Toolkit chip --- */
#about .toolkit {
  background: rgba(179, 139, 250, 0.12);
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

/* --- Text + photo layout --- */
.about-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.about-text { flex: 1 1 55%; min-width: 260px; }
.about-photo { flex: 1 1 40%; text-align: center; }

/* --- Photo styling --- */
.about-photo img {
  width: 100%;
  max-width: 320px;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  border: 3px solid var(--accent-hover);
}
.about-photo .photo-caption {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.6rem;
  font-style: italic;
  line-height: 1.4;
}

/* --- Responsive layout for mobile --- */
@media (max-width: 768px) {
  .about-flex {
    flex-direction: column-reverse;
    align-items: center;
    text-align: left;
  }
  .about-photo img { max-width: 100%; border-radius: 12px; }
  .about-photo .photo-caption {
    font-size: 0.85rem;
    text-align: center;
  }
}

/* =========================================================
   VERTICAL TIMELINE — About page
   ========================================================= */
.timeline-vertical {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding-left: 28px;
}
.timeline-vertical::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent) 0%, var(--accent-hover) 100%);
  opacity: 0.35;
  border-radius: 2px;
}
.t-item {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  padding: 1rem 1.2rem;
  margin: 0 0 1rem 0;
}
.t-item::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent-hover);
}
.t-year {
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.t-emoji { font-size: 1.05rem; }

/* =========================================================
   QUIZ SECTION — interactive fun on About Me page
   ========================================================= */

/* Grid container for quiz cards */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
  justify-items: center;
}

/* Each quiz card = flip animation container */
.quiz-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  width: 100%;
  max-width: 320px;
  height: 260px;
  position: relative;
  perspective: 1000px;              /* enables 3D flip effect */
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

/* Slight lift on hover */
.quiz-card:hover {
  transform: translateY(-6px);
}

/* Flip the card when class 'flipped' is added */
.quiz-card.flipped {
  transform: rotateY(180deg);
}

/* Shared styles for front & back */
.quiz-front, .quiz-back {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  padding: 1.5rem;
  box-sizing: border-box;
}

/* --- FRONT of card --- */
.quiz-front {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
}
.quiz-front p {
  font-weight: 500;
  text-align: center;
  margin-bottom: 0.8rem;
}

/* Quiz buttons */
.quiz-front button {
  display: block;
  width: 100%;
  margin: 0.3rem 0;
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.25s;
}
.quiz-front button:hover {
  background: var(--accent-hover);
}

/* --- BACK of card --- */
.quiz-back {
  background: var(--background-light);
  color: var(--accent);
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-align: center;
}

/* Result + play again */
#quiz-result {
  text-align: center;
  margin-top: 2rem;
  font-weight: 600;
}
#play-again {
  display: block;
  margin: 1rem auto 0;
}

/* --- MOBILE FALLBACK (no flip animation) --- */
@media (max-width: 700px) {
  .quiz-grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
    padding: 0 1rem;
  }
  .quiz-card {
    max-width: 100%;
    height: auto;
    transform: none !important;
    perspective: none;
  }
  .quiz-front, .quiz-back {
    position: static;
    transform: none;
    height: auto;
    backface-visibility: visible;
    padding: 1.5rem;
  }
  .quiz-front {
    gap: 1rem;
    align-items: center;
  }
  .quiz-front button {
    width: 85%;
    margin: 0.4rem auto;
    border-radius: 12px;
    font-size: 1rem;
    padding: 0.9rem;
  }
  .quiz-back {
    margin-top: 0.5rem;
    border-radius: 12px;
    font-size: 1rem;
  }
  .quiz-card:hover { transform: none; }
}

/* =========================================================
   FOOTER — consistent across all pages
   ========================================================= */
footer {
  text-align: center;
  background: #fff;
  padding: 1rem;
  margin-top: 3rem;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
  color: var(--text-color);
}

/* =========================================================
   SCROLL REVEAL — fade-in animation
   ========================================================= */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
