/* ============================================================
   Malini Sundar – Personal Portfolio
   Stylesheet: css/styles.css
   CS 463/563 – Final Project
   ============================================================ */

/* ── CSS Custom Properties (Variables) ──────────────────────── */
:root {
  --lavender:        #c5a8e8;
  --lavender-light:  #ede6f9;
  --lavender-dark:   #9b7ec8;
  --pink:            #f4b8d1;
  --pink-light:      #fde8f2;
  --mint:            #a8d9be;
  --mint-light:      #e3f5eb;
  --mint-dark:       #6bb99a;
  --peach:           #ffd6a5;
  --peach-light:     #fff3e0;
  --sky:             #b8d9f0;
  --sky-light:       #e6f3fc;

  --bg:              #fefcff;
  --surface:         #f7f3fd;
  --surface-2:       #f0eafc;
  --text:            #2d2040;
  --text-muted:      #6b5f8a;
  --accent-text:     #6d45b0;
  --accent-green:    #1e6b50;
  --border:          #ddd5ef;

  --navbar-bg:       #f0eafc;
  --footer-bg:       #2d2040;
  --footer-text:     #e8dff5;

  --shadow-sm:       0 2px 12px rgba(100, 70, 160, 0.08);
  --shadow-md:       0 6px 24px rgba(100, 70, 160, 0.13);
  --shadow-lg:       0 12px 40px rgba(100, 70, 160, 0.18);

  --radius:          14px;
  --radius-sm:       8px;
  --radius-pill:     50px;

  --transition:      all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

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

a:hover {
  color: var(--accent-green);
}

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

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background-color: var(--navbar-bg);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.navbar-brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-text) !important;
  letter-spacing: -0.3px;
}

.navbar-brand span {
  color: var(--accent-text);
}

.navbar .nav-link {
  color: var(--text) !important;
  font-weight: 500;
  padding: 0.45rem 1rem !important;
  border-radius: var(--radius-pill);
  transition: var(--transition);
  position: relative;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--accent-text) !important;
  background-color: var(--lavender-light);
}

.navbar .nav-link.active::after {
  content: '';
  display: block;
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--lavender-dark);
  border-radius: 50%;
}

.navbar-toggler {
  border: 2px solid var(--lavender);
  border-radius: var(--radius-sm);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(155, 126, 200, 0.3);
}

/* Bootstrap Offcanvas – used for mobile nav (beyond-class feature) */
.offcanvas {
  background-color: var(--surface);
}

.offcanvas-header {
  border-bottom: 1px solid var(--border);
  background-color: var(--navbar-bg);
}

.offcanvas .nav-link {
  font-size: 1.1rem;
  padding: 0.75rem 1rem !important;
  border-radius: var(--radius-sm);
  margin-bottom: 0.25rem;
}

/* ── Section Utilities ──────────────────────────────────────── */
section {
  padding: 5rem 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 3rem;
}

.section-divider {
  width: 60px;
  height: 4px;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
}

.divider-lavender { background: linear-gradient(90deg, var(--lavender), var(--lavender-dark)); }
.divider-mint     { background: linear-gradient(90deg, var(--mint), var(--mint-dark)); }
.divider-pink     { background: linear-gradient(90deg, var(--pink), #d96da0); }
.divider-peach    { background: linear-gradient(90deg, var(--peach), #f5a850); }

/* ── Hero Section (index.html) ──────────────────────────────── */
.hero-section {
  min-height: 92vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg,
    var(--lavender-light) 0%,
    var(--pink-light) 35%,
    var(--mint-light) 70%,
    var(--sky-light) 100%);
  position: relative;
  overflow: hidden;
  padding: 4rem 0;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(197, 168, 232, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 217, 190, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero-greeting {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-text);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--lavender-dark) 0%, #d96da0 50%, var(--mint-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  min-height: 2rem;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--lavender-dark);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.9s step-end infinite;
}

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

.hero-bio {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 2rem;
}

.hero-photo-wrapper {
  position: relative;
  display: inline-block;
}

.hero-photo {
  width: 320px;
  height: 320px;
  object-fit: cover;
  object-position: center top;
  border-radius: 40% 60% 55% 45% / 45% 50% 50% 55%;
  border: 5px solid white;
  box-shadow: var(--shadow-lg);
  animation: morph 8s ease-in-out infinite;
}

.hero-photo-placeholder {
  width: 320px;
  height: 320px;
  border-radius: 40% 60% 55% 45% / 45% 50% 50% 55%;
  border: 5px solid white;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--lavender-light), var(--pink-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7rem;
  animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
  0%, 100% { border-radius: 40% 60% 55% 45% / 45% 50% 50% 55%; }
  25%       { border-radius: 55% 45% 40% 60% / 55% 45% 55% 45%; }
  50%       { border-radius: 45% 55% 60% 40% / 50% 60% 40% 50%; }
  75%       { border-radius: 60% 40% 45% 55% / 40% 55% 45% 60%; }
}

.hero-photo-badge {
  position: absolute;
  bottom: 20px;
  right: -10px;
  background: white;
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  box-shadow: var(--shadow-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-text);
  border: 2px solid var(--lavender-light);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--lavender-dark), #b57ee8);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.7rem 1.8rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(155, 126, 200, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(155, 126, 200, 0.5);
  color: white;
}

.btn-outline-custom {
  background: transparent;
  color: var(--accent-text);
  border: 2px solid var(--accent-text);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.8rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-outline-custom:hover {
  background: var(--lavender-dark);
  color: white;
  transform: translateY(-2px);
}

.btn-mint {
  background: linear-gradient(135deg, var(--mint-dark), #5aaa88);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(107, 185, 154, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-mint:hover {
  transform: translateY(-2px);
  color: white;
  box-shadow: 0 8px 25px rgba(107, 185, 154, 0.5);
}

/* ── About Section ──────────────────────────────────────────── */
.about-section {
  background-color: var(--bg);
}

.about-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ── Skills ─────────────────────────────────────────────────── */
.skills-section {
  background-color: var(--surface);
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.skill-tag:hover {
  border-color: var(--lavender-dark);
  background: var(--lavender-light);
  color: var(--lavender-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.skill-tag.lang   { border-color: var(--lavender); }
.skill-tag.web    { border-color: var(--pink); }
.skill-tag.ai     { border-color: var(--mint); }
.skill-tag.tool   { border-color: var(--peach); }

.skill-category-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* ── Stats Strip ────────────────────────────────────────────── */
.stats-strip {
  background: linear-gradient(135deg, var(--lavender-dark), var(--mint-dark));
  color: white;
  padding: 3rem 0;
}

.stat-item {
  text-align: center;
  padding: 1rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.85;
  font-weight: 500;
}

/* ── Experience / Cards ─────────────────────────────────────── */
.experience-section {
  background-color: var(--bg);
}

.exp-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.exp-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 0 2px 2px 0;
}

.exp-card.lavender::before { background: var(--lavender-dark); }
.exp-card.mint::before     { background: var(--mint-dark); }
.exp-card.pink::before     { background: #d96da0; }
.exp-card.peach::before    { background: #f5a850; }

.exp-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.exp-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.exp-org {
  font-size: 0.95rem;
  color: var(--accent-text);
  font-weight: 600;
}

.exp-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Bootstrap Accordion – custom styling */
.accordion-item {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  margin-bottom: 0.75rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.accordion-button {
  background-color: var(--surface) !important;
  color: var(--text) !important;
  font-weight: 600;
  border-radius: var(--radius) !important;
}

.accordion-button:not(.collapsed) {
  background-color: var(--lavender-light) !important;
  color: var(--accent-text) !important;
  box-shadow: none !important;
}

.accordion-button:focus {
  box-shadow: 0 0 0 0.2rem rgba(155, 126, 200, 0.25) !important;
}

.accordion-button::after {
  filter: hue-rotate(240deg);
}

.accordion-body {
  background-color: white;
  padding: 1.25rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

/* ── Projects ───────────────────────────────────────────────── */
.projects-section {
  background-color: var(--bg);
}

.project-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.project-card-header {
  padding: 2rem 1.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.project-card-body {
  padding: 1.25rem 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.project-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
}

.tag-ai       { background: var(--lavender-light); color: var(--accent-text); }
.tag-web      { background: var(--mint-light);     color: var(--accent-green); }
.tag-research { background: var(--pink-light);      color: #8b1a5e; }
.tag-ml       { background: var(--peach-light);     color: #8a5200; }
.tag-python   { background: var(--sky-light);       color: #1a5a8a; }
.tag-js       { background: #fffde7;               color: #7a5c00; }

.project-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.project-desc {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.project-links {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.project-links .btn {
  font-size: 0.82rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── Contact Section ────────────────────────────────────────── */
.contact-section {
  background-color: var(--surface);
}

.contact-form-card {
  background: white;
  border-radius: var(--radius);
  padding: 2.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.form-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.form-control,
.form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  color: var(--text);
  background-color: var(--bg);
  transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--lavender-dark);
  box-shadow: 0 0 0 0.2rem rgba(155, 126, 200, 0.2);
  background-color: white;
}

.form-control.is-valid  { border-color: var(--mint-dark); }
.form-control.is-invalid { border-color: #e07a7a; }

.invalid-feedback {
  font-size: 0.82rem;
}

.contact-info-card {
  background: linear-gradient(135deg, var(--lavender-dark), var(--mint-dark));
  color: white;
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  height: 100%;
}

.contact-info-card h3 {
  color: white;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-info-icon {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-info-text small {
  opacity: 0.75;
  font-size: 0.8rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  color: white;
  font-size: 1.1rem;
  transition: var(--transition);
  text-decoration: none;
}

.social-link:hover {
  background: rgba(255,255,255,0.35);
  color: white;
  transform: translateY(-2px);
}

/* Bootstrap Toast – custom styling */
.toast-container {
  z-index: 9999;
}

.toast {
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
}

.toast-header {
  background: var(--mint-light);
  color: var(--accent-green);
  border-bottom: 1px solid var(--border);
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 3rem 0 1.5rem;
}

footer h5 {
  color: white;
  font-weight: 800;
}

footer p,
footer li {
  color: var(--footer-text);
  opacity: 0.8;
  font-size: 0.9rem;
}

footer a {
  color: var(--lavender-light);
  font-size: 0.9rem;
}

footer a:hover {
  color: var(--mint);
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.footer-social-link {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  transition: var(--transition);
}

.footer-social-link:hover {
  background: var(--lavender);
  color: white;
  transform: translateY(-2px);
}

.footer-divider {
  border-color: rgba(255,255,255,0.1);
  margin: 1.5rem 0 1rem;
}

.footer-bottom {
  font-size: 0.82rem;
  opacity: 0.6;
  text-align: center;
}

/* ── Back to Top Button ─────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--lavender-dark);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--mint-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ── Page Hero (inner pages) ────────────────────────────────── */
.page-hero {
  padding: 4rem 0 3rem;
  background: linear-gradient(135deg,
    var(--lavender-light) 0%,
    var(--pink-light) 50%,
    var(--mint-light) 100%);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-size: 2.5rem;
  font-weight: 900;
}

.page-hero .lead {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ── Scroll Animation Classes ───────────────────────────────── */
/* Only hide elements when JS is confirmed running (.js class on <html>).
   Without this guard, if JS fails to execute everything stays invisible. */
.js .fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.js .fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.js .fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered delay for cards in a grid */
.js .fade-in-up:nth-child(1) { transition-delay: 0.05s; }
.js .fade-in-up:nth-child(2) { transition-delay: 0.15s; }
.js .fade-in-up:nth-child(3) { transition-delay: 0.25s; }
.js .fade-in-up:nth-child(4) { transition-delay: 0.35s; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .hero-section {
    min-height: auto;
    text-align: center;
    padding: 4rem 0 3rem;
  }

  .hero-photo-wrapper {
    margin-top: 2.5rem;
  }

  .hero-photo,
  .hero-photo-placeholder {
    width: 240px;
    height: 240px;
    margin: 0 auto;
  }

  .hero-bio {
    margin: 0 auto 2rem;
  }

  .hero-buttons {
    justify-content: center;
  }

  .page-hero h1 {
    font-size: 2rem;
  }

  section {
    padding: 3.5rem 0;
  }
}

@media (max-width: 575.98px) {
  .hero-name {
    font-size: 2.2rem;
  }

  .section-title {
    font-size: 1.65rem;
  }

  .contact-form-card,
  .about-card {
    padding: 1.5rem;
  }

  .back-to-top {
    bottom: 1rem;
    right: 1rem;
  }
}

/* ── Utility Classes ────────────────────────────────────────── */
.text-lavender { color: var(--accent-text) !important; }
.text-mint     { color: var(--accent-green) !important; }
.bg-surface    { background-color: var(--surface) !important; }
.gap-sm        { gap: 0.5rem; }

.badge-custom {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
}

.badge-lave