/* ─────────────────────────────────────────
   DESIGN TOKENS
───────────────────────────────────────── */
:root {
  --bg: #f9f8f6;
  --bg-alt: #f9f8f6;
  --surface: #ffffff;
  --border: #e5e2dc;
  --text: #1a1815;
  --text-muted: #7a746a;
  --accent: #1a1815;
  --tag-bg: #ede9e3;
  --tag-text: #5c564f;
  --dot-color: #22c55e;
  --nav-blur: rgba(249, 248, 246, 0.9);
  --shadow-card: 0 2px 20px rgba(0, 0, 0, 0.06), 0 0 0 1px var(--border);

  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.3s var(--ease-out);
}

[data-theme="dark"] {
  --bg: #111110;
  --bg-alt: #111110;
  --surface: #1c1b19;
  --border: #2e2c29;
  --text: #f0ece6;
  --text-muted: #857f78;
  --accent: #f0ece6;
  --tag-bg: #272522;
  --tag-text: #9c958d;
  --dot-color: #22c55e;
  --nav-blur: rgba(17, 17, 16, 0.9);
  --shadow-card: 0 2px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border);
}

/* ─────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ─────────────────────────────────────────
   LAYOUT
───────────────────────────────────────── */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 32px;
}

.text-center {
  text-align: center;
}

/* ─────────────────────────────────────────
   FLOATING NAV & THEME TOGGLE
───────────────────────────────────────── */
.floating-nav {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
}

.floating-btn,
.theme-btn {
  height: 40px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  transition: all var(--transition);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.floating-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.theme-btn {
  width: 40px;
  padding: 0;
  border-radius: 50%;
}

.floating-btn:hover,
.theme-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.theme-btn:hover {
  transform: translateY(-2px) rotate(20deg);
}

[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

/* ─────────────────────────────────────────
   HERO
───────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 32px 70px;
  position: relative;
}

.hero-inner {
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  letter-spacing: 0.03em;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-color);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  animation: pulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.06);
  }
}

.hero-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(3.2rem, 8.5vw, 6.2rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 28px;
}

.hero-name em {
  font-style: italic;
  color: var(--text-muted);
}

.hero-tagline {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hero-bio {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.8;
  margin-bottom: 38px;
}

.hero-bio strong {
  color: var(--text);
  font-weight: 500;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 42px;
}

.stat-num {
  display: block;
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 5px;
  letter-spacing: 0.04em;
}

.stat-divider {
  width: 1px;
  height: 38px;
  background: var(--border);
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.btn-ghost {
  color: #de6b00;
  padding: 12px 0;
  transition: all 0.5s;
}

.btn-ghost:hover {
  color: var(--text);
}

/* Scroll prompt */
.scroll-prompt {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-line {
  width: 1px;
  height: 52px;
  background: linear-gradient(to bottom, var(--border), transparent);
  animation: scrollDrop 2s ease-in-out infinite;
}

@keyframes scrollDrop {
  0% {
    transform: scaleY(0);
    transform-origin: top;
    opacity: 1;
  }

  60% {
    transform: scaleY(1);
    transform-origin: top;
    opacity: 1;
  }

  100% {
    transform: scaleY(1);
    transform-origin: top;
    opacity: 0;
  }
}

/* ─────────────────────────────────────────
   MARQUEE
───────────────────────────────────────── */
.marquee-outer {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  background: var(--bg);
}

.marquee-inner {
  display: flex;
  gap: 28px;
  width: max-content;
  animation: marquee 28s linear infinite;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  align-items: center;
}

.marquee-inner .sep {
  opacity: 0.3;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* ─────────────────────────────────────────
   SECTIONS
───────────────────────────────────────── */
.section {
  padding: 96px 0;
}

/* All sections same background */
.section,
.section.section-alt,
body>.section {
  background: var(--bg);
}

/* Alternate faint tint only on even sections for breathing room */
.section:nth-of-type(even) {
  background: var(--bg-alt);
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 56px;
}

/* ── TAG CHIPS ─────────────────────────────────
   Base style + 5 muted colour variants.
   Colours are desaturated to stay elegant on a
   monochrome portfolio in both light & dark mode.
──────────────────────────────────────────────── */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 4px 10px;
  border-radius: 100px;
  transition: background var(--transition), color var(--transition);
}

/* ── Blue — JS / Frontend */
.tag.tag-blue {
  background: #2563eb;
  color: #ffffff;
}

[data-theme="dark"] .tag.tag-blue {
  background: #1e3a5f;
  color: #93c5fd;
}

/* ── Green — Python / Backend */
.tag.tag-green {
  background: #16a34a;
  color: #ffffff;
}

[data-theme="dark"] .tag.tag-green {
  background: #14532d;
  color: #86efac;
}

/* ── Purple — AI / Data */
.tag.tag-purple {
  background: #9333ea;
  color: #ffffff;
}

[data-theme="dark"] .tag.tag-purple {
  background: #2e1065;
  color: #c4b5fd;
}

/* ── Amber — Cloud / Infra */
.tag.tag-amber {
  background: #d97706;
  color: #ffffff;
}

[data-theme="dark"] .tag.tag-amber {
  background: #451a03;
  color: #fcd34d;
}

/* ── Teal — Systems / Data */
.tag.tag-teal {
  background: #0d9488;
  color: #ffffff;
}

[data-theme="dark"] .tag.tag-teal {
  background: #0d3d33;
  color: #5eead4;
}

/* ── Rose — Automation / Workflow */
.tag.tag-rose {
  background: #e11d48;
  color: #ffffff;
}

[data-theme="dark"] .tag.tag-rose {
  background: #4c0519;
  color: #fda4af;
}

/* ─────────────────────────────────────────
   TIMELINE
───────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  margin-left: 100px;
}

.tl-item {
  display: flex;
  position: relative;
  padding-bottom: 48px;
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-meta {
  position: absolute;
  left: -130px;
  top: 2px;
  width: 110px;
  text-align: right;
}

.tl-year {
  font-size: 0.73rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.tl-body {
  padding-left: 32px;
  position: relative;
}

.tl-dot {
  position: absolute;
  left: -5px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border);
}

.tl-role {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.tl-company {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 3px 0 10px;
}

.tl-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.68;
  max-width: 540px;
}

/* ─────────────────────────────────────────
   PROJECTS — ALTERNATING OVERLAP
───────────────────────────────────────── */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 100px;
  /* spacing between project rows */
  padding-top: 10px;
}

.project-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: center;
  position: relative;
}

/* Default (odd): image LEFT, content RIGHT */
.project-img-wrap {
  grid-column: 1 / 5;
  grid-row: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  aspect-ratio: 1;
  z-index: 1;
  background: var(--bg-alt);
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-content {
  grid-column: 6 / 13;
  grid-row: 1;
  background: var(--surface);
  padding: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.06);
  z-index: 2;
  display: flex;
  flex-direction: column;
}

/* Reverse (even): image RIGHT, content LEFT */
.project-row--reverse .project-img-wrap {
  grid-column: 9 / 13;
}

.project-row--reverse .project-content {
  grid-column: 1 / 8;
}

/* Content details */
.project-number {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  opacity: 0.45;
  margin-bottom: 12px;
}

.project-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero-bio {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 24px;
}

.hero-dynamic-container {
  margin-bottom: 40px;
  font-size: 1.2rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-dynamic-prefix {
  color: var(--text-muted);
}

.hero-dynamic-text {
  color: var(--primary);
  display: inline-block;
  transition: all 0.4s ease;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 2px;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 20px;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition), gap var(--transition);
  align-self: flex-start;
}

.project-link:hover {
  color: var(--text);
  gap: 8px;
}

/* ─────────────────────────────────────────
   EDUCATION
───────────────────────────────────────── */
.edu-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}

.edu-degree {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.edu-school {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─────────────────────────────────────────
   CONTACT
───────────────────────────────────────── */
.section-contact {
  padding-bottom: 120px;
}

.contact-sub {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 36px;
  margin-top: -22px;
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

.social-row a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: all var(--transition);
}

.social-row a:hover {
  color: var(--text);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ─────────────────────────────────────────
   SCROLL REVEAL ANIMATIONS
   Hidden state — restored every time element
   leaves the viewport so animation re-fires.
───────────────────────────────────────── */

/* Base: fade-up */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

/* fade-left */
.reveal[data-anim="fade-left"] {
  transform: translateX(-30px);
}

/* fade-right */
.reveal[data-anim="fade-right"] {
  transform: translateX(30px);
}

/* scale-up */
.reveal[data-anim="scale-up"] {
  transform: scale(0.93) translateY(14px);
}

/* Visible — all variants reset to natural position */
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ─────────────────────────────────────────
   HERO TRAVEL COLLAGE
───────────────────────────────────────── */
.hero-travel-collage {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
}

.collage-img {
  width: 200px;
  height: 280px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition);
}

.collage-img.img-1 {
  transform: translateY(20px) rotate(-4deg);
}

.collage-img.img-2 {
  height: 320px;
  z-index: 2;
  transform: translateY(-10px);
}

.collage-img.img-3 {
  transform: translateY(30px) rotate(4deg);
}

.collage-img:hover {
  transform: translateY(0) scale(1.05) rotate(0);
  z-index: 10;
}

/* ─────────────────────────────────────────
   TRAVEL & GALLERY
───────────────────────────────────────── */
.travel-hero-content {
  margin-top: 24px;
}

#travel-dynamic-text {
  transition: opacity 0.4s ease;
}

.travel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.travel-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 5;
  background: var(--surface);
  border: 1px solid var(--border);
}

.travel-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.travel-card:hover .travel-thumb {
  transform: scale(1.05);
}

.travel-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: #fff;
}

.travel-location {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  margin-bottom: 4px;
  color: #fff;
}

.travel-date {
  font-size: 0.8rem;
  opacity: 0.8;
  color: #fff;
}

/* ─────────────────────────────────────────
   LIBRARY PAGE STYLES
───────────────────────────────────────── */
.library-hero-content {
  margin-top: 24px;
  gap: 48px;
}

#library-dynamic-text {
  transition: opacity 0.4s ease;
}

/* Abstract Stack Animation */
.hero-abstract-stack {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0px auto 20px;
  perspective: 1000px;
  transform-style: preserve-3d;
}

.layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  animation: floatLayer 6s infinite ease-in-out alternate;
  transform: rotateX(60deg) rotateZ(-45deg);
}

.layer-1 {
  animation-delay: 0s;
  z-index: 3;
  background: linear-gradient(135deg, var(--bg-alt), var(--surface));
}

.layer-2 {
  animation-delay: -1s;
  z-index: 2;
  margin-top: 30px;
  opacity: 0.8;
}

.layer-3 {
  animation-delay: -2s;
  z-index: 1;
  margin-top: 60px;
  opacity: 0.6;
}

@keyframes floatLayer {
  0% {
    transform: rotateX(60deg) rotateZ(-45deg) translateZ(0);
  }

  100% {
    transform: rotateX(60deg) rotateZ(-45deg) translateZ(40px);
  }
}

/* Document Grid */
/* Document Grid */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.doc-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}

.doc-card:hover {
  transform: translateY(-5px);
  border-color: var(--text-muted);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.doc-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.doc-icon {
  font-size: 2rem;
  margin-right: 12px;
}

.doc-title {
  font-size: 1.2rem;
  margin: 0;
}

.doc-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.doc-card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 16px;
}

.doc-card-full {
  width: 100%;
  margin-top: 32px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.question-chips {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.question-chips:nth-last-child(1) {
  padding-bottom: 0px;
  border-bottom: none
}

.question-chip {
  padding: 5px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.7rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.question-chip:hover {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  transform: translateY(-3px);
}

/* Minimalistic & Professional Book Stack */
.book-stack-container {
  display: flex;
  justify-content: center;
  margin-top: 60px;
  padding-bottom: 80px;
  perspective: 1200px;
}

.book-stack {
  position: relative;
  width: 200px;
  height: 280px;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.coming-soon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -150%);
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-style: italic;
  color: var(--primary);
  opacity: 0;
  transition: all 0.5s ease;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

.book-stack-container:hover .coming-soon {
  opacity: 1;
  transform: translate(-220%, -150%);
}

.book {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 4px 8px 8px 4px;
  background-size: cover;
  background-position: center;
  box-shadow: -5px 5px 20px rgba(0, 0, 0, 0.2);
  transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: left center;
  border-left: 4px solid rgba(0, 0, 0, 0.1);
}

.book:nth-child(1) {
  z-index: 6;
  transform: translateZ(0);
}

.book:nth-child(2) {
  z-index: 5;
  transform: translateZ(-15px) translateX(8px) translateY(-4px);
}

.book:nth-child(3) {
  z-index: 4;
  transform: translateZ(-30px) translateX(16px) translateY(-8px);
}

.book:nth-child(4) {
  z-index: 3;
  transform: translateZ(-45px) translateX(24px) translateY(-12px);
}

.book:nth-child(5) {
  z-index: 2;
  transform: translateZ(-60px) translateX(32px) translateY(-16px);
}

.book:nth-child(6) {
  z-index: 1;
  transform: translateZ(-75px) translateX(40px) translateY(-20px);
}

/* Hover: Horizontal Expand Reveal */
.book-stack-container:hover .book:nth-child(2) {
  transform: translateZ(-15px) translateX(60px);
}

.book-stack-container:hover .book:nth-child(3) {
  transform: translateZ(-30px) translateX(120px);
}

.book-stack-container:hover .book:nth-child(4) {
  transform: translateZ(-45px) translateX(180px);
}

.book-stack-container:hover .book:nth-child(5) {
  transform: translateZ(-60px) translateX(240px);
}

.book-stack-container:hover .book:nth-child(6) {
  transform: translateZ(-75px) translateX(300px);
}

/* Certifications Grid */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 40px;
}

@media (max-width: 1000px) {
  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .cert-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.cert-card {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  transition: transform 0.3s ease;
}

.cert-card:hover {
  transform: translateY(-4px);
  box-shadow: none;
  border: none;
}

.cert-img {
  width: 100%;
  aspect-ratio: 16/11.4;
  object-fit: cover;
  border-radius: 8px;
  border: none;
  filter: brightness(0.95) contrast(1);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.cert-card:hover .cert-img {
  transform: scale(1.02);
  filter: brightness(1) contrast(1.02);
}

.cert-title {
  font-size: 0.95rem;
  margin: 12px 0 0 0;
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  transition: color 0.3s ease;
}

.cert-card:hover .cert-title {
  color: var(--primary);
}

/* Memorable Events */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.event-card {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all var(--transition);
}

.event-card:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.event-img-wrap {
  width: 150px;
  flex-shrink: 0;
}

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

.event-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.event-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.event-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.event-card iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  display: block;
}

@media (max-width: 600px) {
  .event-card {
    flex-direction: column;
  }

  .event-img-wrap {
    width: 100%;
    height: 200px;
  }

  .event-card iframe {
    min-height: 350px;
    border-radius: 12px;
  }
}

/* Hobbies Grid */
.hobbies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.hobby-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform var(--transition);
}

.hobby-card:hover {
  transform: translateY(-8px);
}

.hobby-img {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
}

.hobby-content {
  padding: 24px;
}

.hobby-content h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.hobby-content p {
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─────────────────────────────────────────
   MODAL
───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg-alt);
  transform: scale(1.05);
}

.modal-header {
  margin-bottom: 24px;
  padding-right: 40px;
  /* space for close btn */
}

.modal-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.5rem;
  margin-bottom: 8px;
  color: var(--text);
}

.modal-date {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.modal-msg {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 32px;
  color: var(--text-muted);
}

.modal-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-gallery img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  aspect-ratio: 4/3;
  border: 1px solid var(--border);
}

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 900px) {
  .project-list {
    gap: 60px;
  }

  .project-row {
    display: flex;
    flex-direction: column;
  }

  .project-img-wrap {
    width: 100%;
    margin-bottom: -30px;
    z-index: 1;
  }

  .project-content {
    width: 90%;
    margin: 0 auto;
    z-index: 2;
    padding: 30px;
  }

  .project-row--reverse .project-img-wrap {
    margin-bottom: -30px;
    /* same as default row */
  }
}

@media (max-width: 700px) {
  .timeline {
    margin-left: 0;
  }

  .tl-meta {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 40px 20px 100px;
    justify-content: flex-start;
  }

  .container {
    padding: 0 20px;
  }

  .edu-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer .container {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .section-title {
    font-size: 2rem;
  }

  .timeline {
    margin-left: 0;
    padding-left: 16px;
  }

  .tl-meta {
    position: static;
    transform: none;
    text-align: left;
    margin-bottom: 8px;
    padding-right: 0;
  }

  .hero-name {
    font-size: 3rem;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 16px;
  }

  .hero-inner {
    padding: 0 16px;
  }

  .hero-travel-collage {
    flex-direction: row;
    gap: 8px;
    margin-top: 32px;
  }

  .collage-img {
    width: 30vw;
    height: 42vw;
    aspect-ratio: auto;
  }

  .collage-img.img-1 {
    transform: translateY(10px) rotate(-4deg);
  }

  .collage-img.img-2 {
    height: 48vw;
    transform: translateY(-5px);
  }

  .collage-img.img-3 {
    transform: translateY(15px) rotate(4deg);
  }

  .travel-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .travel-card-overlay {
    padding: 12px;
  }

  .travel-location {
    font-size: 1.1rem;
  }

  .travel-date {
    font-size: 0.75rem;
  }

  .floating-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    bottom: 24px;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100vw - 40px);
    gap: 4px;
    background: rgba(var(--bg-rgb, 255, 255, 255), 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 6px;
    border-radius: 100px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    z-index: 1000;
  }

  .floating-btn,
  .theme-btn {
    height: 42px;
    font-size: 0.8rem;
    padding: 0 18px;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: all 0.3s ease;
  }

  .floating-btn.active {
    background: var(--text);
    color: var(--bg);
  }

  .theme-btn {
    display: flex !important;
    width: 38px;
    height: 38px;
    padding: 0;
    background: rgba(0, 0, 0, 0.05);
  }

  .floating-btn:hover,
  .theme-btn:hover {
    transform: none;
  }

  .theme-btn:hover {
    transform: none;
  }

  [data-theme="dark"] .floating-nav {
    background: rgba(30, 30, 30, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
  }

  [data-theme="dark"] .theme-btn {
    background: rgba(255, 255, 255, 0.1);
  }

  /* Mobile Book Stack Adjustments */
  .library-hero-content {
    gap: 0px;
  }

  .coming-soon {
    position: relative;
    top: 80px;
    left: 0;
    transform: none;
    opacity: 1;
    display: block;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1rem;
  }

  .book-stack-container:hover .coming-soon {
    transform: none;
  }

  .book-stack {
    width: 140px;
    height: 200px;
    margin: 0 auto;
  }

  .book-stack-container:hover .book {
    transform: none !important;
    /* Minimal animation on mobile */
  }

  .book-stack-container:hover .book:nth-child(1) {
    transform: rotateZ(-3deg) translateY(-5px) !important;
  }

  .modal-content {
    padding: 24px;
  }

  .modal-gallery {
    grid-template-columns: 1fr;
  }

  .modal-title {
    font-size: 2rem;
  }

  .book-stack-container:hover .book:nth-child(1) {
    transform: translateY(-40px) translateX(0) rotateZ(-5deg);
  }

  .book-stack-container:hover .book:nth-child(2) {
    transform: translateY(-15px) translateX(0) rotateZ(-2deg);
    opacity: 1;
    z-index: 5;
  }

  .book-stack-container:hover .book:nth-child(3) {
    transform: translateY(10px) translateX(0) rotateZ(2deg);
    opacity: 1;
    z-index: 6;
  }

  .book-stack-container:hover .book:nth-child(4) {
    transform: translateY(35px) translateX(0) rotateZ(5deg);
    opacity: 1;
    z-index: 7;
  }
}

/* ─────────────────────────────────────────
   AI CHAT WIDGET
───────────────────────────────────────── */
.ai-chat-widget {
  position: fixed;
  bottom: 100px;
  right: 32px;
  width: 380px;
  height: 520px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 180px);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .ai-chat-widget {
  background: rgba(26, 26, 26, 0.85);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.ai-chat-widget.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

.ai-chat-header {
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-chat-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-chat-avatar {
  font-size: 1.25rem;
  background: var(--primary);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(222, 107, 0, 0.2);
}

.ai-chat-meta {
  display: flex;
  flex-direction: column;
}

.ai-chat-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.ai-chat-status {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.ai-chat-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.2s;
  border-radius: 50%;
}

.ai-chat-close:hover {
  color: var(--text);
  background: var(--border);
  transform: rotate(90deg);
}

.ai-chat-messages {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-wrapper {
  display: flex;
  width: 100%;
}

.message-wrapper.user {
  justify-content: flex-end;
}

.message-wrapper.bot {
  justify-content: flex-start;
}

.message {
  max-width: 80%;
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  word-break: break-word;
}

.message.user {
  background: var(--text);
  color: var(--bg);
  border-bottom-right-radius: 4px;
}

.message.bot {
  background: var(--surface);
  color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

.message.bot.olive {
  border-left: 3px solid #808000;
}

.message.bot.terracotta {
  border-left: 3px solid #C34A2C;
}

.message.bot.orange {
  border-left: 3px solid #DE6B00;
}

.message.bot.red {
  border-left: 3px solid #E32636;
}

.ai-chat-input-bar {
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-chat-input-bar input {
  flex-grow: 1;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.3s;
}

.ai-chat-input-bar input:focus {
  border-color: var(--primary);
}

.ai-chat-send-btn {
  background: var(--text);
  color: var(--bg);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
  flex-shrink: 0;
}

.ai-chat-send-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.05);
}

@media (max-width: 600px) {
  .ai-chat-widget {
    bottom: 90px;
    right: 20px;
    width: calc(100vw - 40px);
    height: 440px;
  }
}