/* ========================================
   1. FONTS & COLOR VARIABLES
   (change these once, they update everywhere)
======================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #FBF2F0;          /* page background - warm blush */
  --surface: #FFFFFF;     /* card backgrounds */
  --panel: #F7E9E6;       /* tinted panel background for section contrast */
  --ink: #241D28;         /* main text color - near-black plum */
  --ink-soft: #6E6670;    /* lighter text color for paragraphs */
  --line: #E9D9D6;        /* borders */
  --rose: #9C3F50;        /* main accent color - deep wine */
  --rose-soft: #F1DCE0;   /* light wine background for tags */
  --gold: #AD7F2E;        /* small gold accents - warm brass */
  --gold-soft: #F3E6C9;
  --sage: #5F7A52;        /* green used for metric pills */
  --sage-soft: #E4EEDD;
  --radius: 14px;         /* rounded corners */
  --nav-bg: rgba(251, 242, 240, 0.88);
  --serif: 'Fraunces', serif;   /* heading font */
  --sans: 'Inter', sans-serif;  /* body font */
}

/* ========================================
   2. RESET
   (removes browser default spacing so layout is predictable)
======================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth; /* smooth scroll when clicking nav links */
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ========================================
   3. PAGE WRAPPER
   (keeps content centered with a max width)
======================================== */

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

section {
  padding: 46px 0;
}

/* ========================================
   4. SCROLL ANIMATION
   (elements start hidden, JS adds "in" class when scrolled into view)
======================================== */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   5. NAVBAR
======================================== */

header.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
}

.nav-brand .dot {
  color: var(--rose);
}

.nav-links {
  display: flex;
  gap: 26px;
  list-style: none;
  font-size: 13.5px;
  font-weight: 500;
}

.nav-links a {
  color: var(--ink-soft);
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--ink);
}

@media (max-width: 640px) {
  .nav-links {
    gap: 14px;
    font-size: 12px;
  }
}

/* ========================================
   6. HERO SECTION (top intro area)
======================================== */

.hero {
  padding: 100px 0 70px;
  position: relative;
}

/* soft blurry colored circles in the background */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.55;
  z-index: 0;
}

.blob.b1 {
  width: 340px;
  height: 340px;
  background: var(--rose-soft);
  top: -120px;
  right: -100px;
}

.blob.b2 {
  width: 260px;
  height: 260px;
  background: var(--gold-soft);
  top: 180px;
  left: -120px;
}

.hero-inner {
  position: relative;
  z-index: 1; /* keeps text above the blobs */
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

@media (max-width: 760px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-photo-wrap {
    order: -1;
    max-width: 220px;
    height: auto;
    min-height: 0;
    margin: 0 auto;
  }
  .hero-photo {
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

.hero-photo-wrap {
  position: relative;
  height: 100%;
  min-height: 380px;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
  border: 6px solid var(--surface);
  box-shadow: 0 24px 50px -20px rgba(46, 38, 48, 0.35);
  position: relative;
  z-index: 1;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 28px 0 46px;
}

@media (max-width: 600px) {
  .stats-strip {
    grid-template-columns: 1fr 1fr;
  }
}

.stat-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
}

.stat-num {
  display: block;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  color: var(--rose);
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rose);
  background: var(--rose-soft);
  padding: 6px 14px;
  border-radius: 20px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(38px, 6vw, 60px); /* scales with screen size */
  margin-top: 22px;
  line-height: 1.08;
}

.hero h1 em {
  font-style: italic;
  color: var(--rose);
}

.hero p.desc {
  max-width: 600px;
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: 16.5px;
}

.hero-links {
  margin-top: 30px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ========================================
   7. BUTTONS (used in hero, contact, coding cards)
======================================== */

.btn {
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 30px;
  border: 1.5px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--rose);
}

.btn.primary {
  background: var(--ink);
  color: #FBF6F4;
  border-color: var(--ink);
}

.btn.primary:hover {
  background: #3E3540;
  border-color: #3E3540;
}

/* ========================================
   8. SECTION HEADINGS
   (the small "Projects" / "Experience" style labels above each heading)
======================================== */

.section-head {
  margin-bottom: 34px;
}

.section-head .eyebrow-sm {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 8px;
}

.section-head h2 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
}

.divider {
  width: 52px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  margin-top: 14px;
}

/* ========================================
   9. ABOUT SECTION
======================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 680px) {
  .about-grid {
    grid-template-columns: 1fr; /* stacks on mobile */
  }
}

.about p {
  color: var(--ink-soft);
  margin-bottom: 14px;
  font-size: 15.5px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 12px 30px -20px rgba(46, 38, 48, 0.18);
  position: sticky;
  top: 96px;
}

.stat-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 14px;
  font-size: 13.5px;
}

.stat-card dt {
  color: var(--ink-soft);
}

.stat-card dd {
  font-weight: 600;
}

/* ========================================
   10. SKILLS SECTION
======================================== */

.skill-groups {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 800px) {
  .skill-groups {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 460px) {
  .skill-groups {
    grid-template-columns: 1fr;
  }
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.skill-group h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rose);
  margin-bottom: 12px;
  font-weight: 700;
}

.skill-group ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.skill-group li {
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 20px;
}

/* ========================================
   11. PROJECT CARDS
======================================== */

.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -22px rgba(46, 38, 48, 0.25);
}

/* the thin rose-colored stripe on the left edge of each card */
.project-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--rose);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.project-top h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.metric-pill {
  font-size: 12px;
  font-weight: 700;
  color: var(--sage);
  background: var(--sage-soft);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.project-card .context {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 10px;
  font-style: italic;
}

.project-card ul {
  list-style: none;
  margin-bottom: 14px;
}

.project-card ul li {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin-bottom: 6px;
  padding-left: 18px;
  position: relative;
}

/* little gold star bullet instead of a default dot */
.project-card ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  top: 5px;
  color: var(--gold);
  font-size: 10px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tags span {
  font-size: 11.5px;
  background: var(--rose-soft);
  color: var(--rose);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}

/* ========================================
   12. EXPERIENCE TIMELINE
======================================== */

.timeline {
  position: relative;
  padding-left: 30px;
}

/* the vertical line connecting timeline dots */
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  padding-bottom: 30px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

/* the round dot on the timeline */
.timeline-item::before {
  content: '';
  position: absolute;
  left: -30px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--rose);
  border: 3px solid var(--bg);
}

.timeline-item .meta {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rose);
  margin-bottom: 5px;
}

.timeline-item h3 {
  font-family: var(--serif);
  font-size: 18px;
  margin-bottom: 8px;
}

.timeline-item ul {
  list-style: none;
}

.timeline-item ul li {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin-bottom: 5px;
  padding-left: 18px;
  position: relative;
}

.timeline-item ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  top: 5px;
  color: var(--gold);
  font-size: 10px;
}

/* ========================================
   13. CODING PROFILE CARDS (LeetCode / GfG)
======================================== */

.coding-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .coding-grid {
    grid-template-columns: 1fr;
  }
}

.coding-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.18s, border-color 0.18s;
}

.coding-card:hover {
  transform: translateY(-2px);
  border-color: var(--rose);
}

.coding-card h3 {
  font-family: var(--serif);
  font-size: 17px;
  margin-bottom: 3px;
}

.coding-card p {
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ========================================
   14. CERTIFICATIONS
======================================== */

.cert-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cert-row .chip {
  font-size: 12.5px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 9px 16px;
  border-radius: 20px;
}

.cert-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.cert-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.18s;
}

.cert-card:hover {
  transform: translateY(-2px);
}

.cert-card img {
  width: 100%;
  display: block;
  padding: 10px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--line);
}

.cert-card-body {
  padding: 14px 16px;
}

.cert-card-body h4 {
  font-family: var(--serif);
  font-size: 14.5px;
  margin-bottom: 4px;
}

.cert-card-body p {
  font-size: 12px;
  color: var(--ink-soft);
}

/* ========================================
   15. CONTACT SECTION
======================================== */

.contact-box {
  background: var(--ink);
  color: #FBF6F4;
  border-radius: 24px;
  padding: 48px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact-box .blob.b3 {
  background: var(--rose);
  opacity: 0.25;
  width: 260px;
  height: 260px;
  top: -100px;
  left: -60px;
}

.contact-box h2 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.contact-box p.email {
  font-size: 14px;
  color: #D8CDD1;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.contact-box .hero-links {
  justify-content: center;
  position: relative;
  z-index: 1;
}

.contact-box .btn.light {
  background: transparent;
  border-color: #4A414C;
  color: #FBF6F4;
}

.contact-box .btn.light:hover {
  border-color: var(--rose);
}

/* ========================================
   16. FOOTER
======================================== */

footer {
  padding: 30px 0 44px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ========================================
   17. SCROLL PROGRESS BAR
======================================== */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 100;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rose), var(--gold));
  transition: width 0.1s linear;
}

/* ========================================
   18. ACTIVE NAV LINK
======================================== */

.nav-links a {
  position: relative;
  padding-bottom: 3px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--rose);
  transition: width 0.2s;
}

.nav-links a.active {
  color: var(--ink);
  font-weight: 600;
}

.nav-links a.active::after {
  width: 100%;
}

/* ========================================
   19. THEME TOGGLE BUTTON
======================================== */

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s, border-color 0.18s;
  margin-left: 8px;
}

.theme-toggle:hover {
  transform: rotate(15deg);
  border-color: var(--rose);
}

/* ========================================
   20. DARK MODE
   Overrides the color variables when html[data-theme="dark"] is set
======================================== */

html[data-theme="dark"] {
  --bg: #1A1518;
  --surface: #251E23;
  --panel: #2C232A;
  --ink: #F2EEEF;
  --ink-soft: #B3A8AC;
  --line: #3A3136;
  --rose: #D98A96;
  --rose-soft: #3A2429;
  --gold: #D4B268;
  --gold-soft: #362E1C;
  --sage: #9DB88C;
  --sage-soft: #253023;
  --nav-bg: rgba(26, 21, 24, 0.88);
}

html[data-theme="dark"] .contact-box {
  background: #141016;
}

html[data-theme="dark"] .hero-photo {
  border-color: var(--surface);
}

/* ========================================
   21. PROJECT FILTER TABS
======================================== */

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-tab {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s;
}

.filter-tab:hover {
  border-color: var(--rose);
  color: var(--ink);
}

.filter-tab.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ========================================
   22. SECTION CONTRAST (subtle panel backgrounds for structure)
======================================== */

#about, #experience, #certs {
  position: relative;
}

#about::before, #experience::before, #certs::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  z-index: -1;
}

/* ========================================
   23. AI CHAT WIDGET
======================================== */

.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.4);
  z-index: 200;
  transition: transform 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-fab:hover {
  transform: scale(1.08);
}

.chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 140px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.35);
  z-index: 200;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel.open {
  display: flex;
}

.chat-header {
  background: var(--ink);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-header-text strong {
  font-family: var(--serif);
  font-size: 15px;
}

.chat-header-text span {
  font-size: 11px;
  color: #C9C0C6;
}

.chat-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.7;
}

.chat-close:hover {
  opacity: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.chat-msg.bot {
  background: var(--panel);
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-msg.user {
  background: var(--rose);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-msg.typing {
  background: var(--panel);
  color: var(--ink-soft);
  align-self: flex-start;
  font-style: italic;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.chat-input-row input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 13.5px;
  background: var(--bg);
  color: var(--ink);
}

.chat-input-row input:focus {
  outline: 2px solid var(--rose);
}

.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  border: none;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-send:hover {
  background: var(--rose);
}

@media (max-width: 460px) {
  .chat-panel {
    right: 16px;
    left: 16px;
    width: auto;
  }
  .chat-fab {
    right: 16px;
  }
}
