/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 9999;
  transition: transform 0.08s ease-out, opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.scroll-progress.is-scrolling {
  opacity: 1;
}

/* Hero stats counter */
.hero-stats {
  display: flex;
  gap: 32px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

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

/* Scroll-triggered reveal */
.scroll-reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.985);
  filter: blur(8px);
  transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
  animation: none !important;
}

.scroll-reveal.in-view {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-reveal {
    opacity: 1;
    transform: none;
  }
}

/* Card and project-item - clean transitions */
.card,
.project-item {
  position: relative;
}

/* Enhanced glassmorphism */
.card,
.project-item,
.skills-grid > div,
.experience-photo-frame,
.education-photo-frame {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

[data-theme="dark"] .card,
[data-theme="dark"] .project-item,
[data-theme="dark"] .skills-grid > div {
  background: rgba(21, 25, 34, 0.75);
}



* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  overflow-anchor: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  background-attachment: fixed;
  font-size: 15px;
  line-height: 1.45;
  transition: all 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  opacity: 0;
  animation: pageLoad 0.8s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
    opacity: 1;
  }
  
  .carousel-image,
  .project-item,
  .timeline-simple-item,
  .card,
  .section {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@keyframes pageLoad {
  to {
    opacity: 1;
  }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.08;
  pointer-events: none;
  z-index: -1;
}

[data-theme="dark"] body::before {
  background-image: radial-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  opacity: 0.12;
}

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

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

a:focus,
button:focus,
input:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

*:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Nav is now inline inside main – no separate bar */
.main-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 20px 56px;
}

.nav.nav-inline {
  padding: 12px 0 20px;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  transition: transform 0.2s ease;
}

.logo:hover img {
  transform: scale(1.05);
  border-color: var(--accent-color);
}

[data-theme="dark"] .logo img {
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-links {
  display: flex;
  gap: 16px;
  font-size: 0.95rem;
}

.nav-links a {
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: #2563eb;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.nav-actions a svg {
  transition: all 0.2s ease;
  color: var(--text-primary);
  flex-shrink: 0;
}

.nav-actions a:hover svg {
  color: var(--accent-color);
  transform: translateY(-2px);
}

.theme-toggle {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.theme-toggle:hover {
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.theme-toggle .sun-icon {
  display: none;
}

.theme-toggle .moon-icon {
  display: block;
}

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

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

.nav-cta {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  color: var(--text-primary);
}

.nav-cta:hover {
  background: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Sticky logo – appears in top-left when scrolling */
.sticky-logo {
  position: fixed;
  top: 16px;
  left: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.sticky-logo.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.sticky-logo img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  transition: transform 0.2s ease;
}

.sticky-logo:hover img {
  transform: scale(1.05);
  border-color: var(--accent-color);
}

[data-theme="dark"] .sticky-logo img {
  border-color: rgba(255, 255, 255, 0.2);
}

main {
  max-width: 100%;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 20px 0 36px;
  animation: fadeInUp 0.8s ease forwards;
}

.hero > * {
  min-width: 0;
}

.hero-content {
  width: 100%;
}

.avatar-container {
  margin-bottom: 10px;
}

.hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.hero-avatar:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .hero-avatar {
  border-color: rgba(255, 255, 255, 0.15);
}

.hero h1.hero-title {
  font-size: 2.25rem;
  margin-bottom: 6px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hero h1 .hero-greeting-text {
  font-size: 0.72em;
  color: #6f6464;
  -webkit-text-fill-color: #6f6464;
  font-weight: 700;
  vertical-align: baseline;
}

[data-theme="dark"] .hero h1 .hero-greeting-text {
  color: #a89b9b;
  -webkit-text-fill-color: #a89b9b;
}

.hero h1 .hero-name-accent {
  color: #ea580c;
  -webkit-text-fill-color: #ea580c;
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-weight: 400;
  opacity: 0.9;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.badge-highlight {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.hero-intro {
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.hero-highlight {
  color: var(--accent-color);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-color), #ea580c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
  text-shadow: none;
}

[data-theme="dark"] .hero-highlight {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin: 16px 0 8px;
}

.hero-intro a {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-color);
  transition: all 0.2s ease;
}

.hero-intro a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

.interests-list {
  margin: 16px 0 20px 24px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.interests-list li {
  margin-bottom: 8px;
}

.hero-links {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
  align-items: center;
}

/* Brand icons — frosted 3D tiles (theme-aware) */
.hero-social .hero-social-link {
  position: relative;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 16px;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.55) 42%,
    rgba(248, 250, 252, 0.45) 100%
  );
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 6px 18px rgba(15, 23, 42, 0.08),
    0 2px 4px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(15, 23, 42, 0.05);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.28s ease,
    border-color 0.2s ease,
    filter 0.2s ease;
}

[data-theme="dark"] .hero-social .hero-social-link {
  background: linear-gradient(
    155deg,
    rgba(48, 54, 68, 0.95) 0%,
    rgba(26, 30, 40, 0.88) 100%
  );
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

.hero-social-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

[data-theme="dark"] .hero-social-icon {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

.hero-social-github .hero-social-icon {
  color: #181717;
}

[data-theme="dark"] .hero-social-github .hero-social-icon {
  color: #f0f6fc;
}

.hero-social-linkedin .hero-social-icon {
  color: #0a66c2;
}

.hero-social-researchgate .hero-social-icon {
  color: #00d2b4;
}

.hero-social-x .hero-social-icon {
  color: #0f1419;
}

[data-theme="dark"] .hero-social-x .hero-social-icon {
  color: #e7e9ea;
}

.hero-social-email .hero-social-icon {
  color: #ea580c;
}

.hero-social .hero-social-link:hover {
  transform: translateY(-4px) scale(1.05);
  border-color: rgba(234, 88, 12, 0.35);
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.12),
    0 4px 8px rgba(234, 88, 12, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .hero-social .hero-social-link:hover {
  border-color: rgba(96, 165, 250, 0.35);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.55),
    0 4px 12px rgba(96, 165, 250, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.hero-social .hero-social-link:hover .hero-social-icon {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.hero-social .hero-social-link.muted {
  opacity: 0.45;
  pointer-events: auto;
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: flex-start;
  align-self: start;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: -20px;
  background: var(--accent-gradient);
  opacity: 0.08;
  filter: blur(30px);
  z-index: -1;
  border-radius: 24px;
}

.hero-photo-frame {
  --frame-tilt: -1.5deg;
  --parallax-offset: 0px;
  --float-amplitude: 6px;
  width: 100%;
  max-width: 392px;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  padding: 16px;
  border-radius: calc(var(--bubble-radius) + 6px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow-lg);
  transform: translate3d(0, var(--parallax-offset), 0) rotate(var(--frame-tilt));
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.25s ease-out, box-shadow 0.3s ease;
  animation: frameFloat 6s ease-in-out infinite;
  will-change: transform;
}

.hero-photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 58%);
  mix-blend-mode: screen;
}

@keyframes frameFloat {
  0%, 100% {
    transform: translate3d(0, var(--parallax-offset), 0) rotate(var(--frame-tilt));
  }
  50% {
    transform: translate3d(0, calc(var(--parallax-offset) - var(--float-amplitude)), 0) rotate(var(--frame-tilt));
  }
}

.photo-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 360 / 600;
  overflow: hidden;
  border-radius: 18px;
}

.carousel-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.carousel-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  display: block;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1), transform 0.85s cubic-bezier(0.4, 0, 0.2, 1), filter 0.85s ease;
  transform: translateX(100%) scale(1.05);
  filter: blur(8px);
  will-change: transform, opacity;
}

.carousel-image.active {
  opacity: 1;
  transform: translateX(0) scale(1);
  filter: blur(0);
  z-index: 2;
  animation: heroKenBurns 6s ease-out both;
}

.carousel-image.exiting {
  opacity: 0;
  transform: translateX(-100%) scale(0.95);
  filter: blur(6px);
  z-index: 1;
}

@keyframes heroKenBurns {
  from {
    transform: translateX(0) scale(1.01);
  }
  to {
    transform: translateX(0) scale(1.05);
  }
}

.carousel-arrow {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
  z-index: 2;
  color: var(--text-primary);
}

.hero-photo-frame:hover .carousel-arrow {
  opacity: 1;
  transform: scale(1);
}

.carousel-arrow:hover {
  background: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
  transform: scale(1.1);
}

.carousel-arrow:active {
  transform: scale(0.95);
}

[data-theme="dark"] .hero-photo-frame {
  border-color: rgba(255, 255, 255, 0.28);
}


.hero-code-card {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: var(--bubble-radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.code-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.code-title {
  margin-left: 8px;
  font-weight: 600;
}

.hero-code-card pre {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  line-height: 1.5;
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
}

.hero-metrics {
  display: grid;
  gap: 12px;
}

.metric {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: var(--bubble-radius);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.metric-value {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.48);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-color 0.2s ease, filter 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.12) 58%, rgba(255, 255, 255, 0.04) 100%);
  opacity: 0.95;
  pointer-events: none;
}

.button > * {
  position: relative;
  z-index: 1;
}

.button.primary {
  background: linear-gradient(145deg, #ff8a3d 0%, #ea580c 58%, #d97706 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 14px 32px rgba(234, 88, 12, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.button.primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 38px rgba(234, 88, 12, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.58);
  filter: saturate(1.06);
}

.button.secondary {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 42%, rgba(248, 250, 252, 0.42) 100%);
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--text-primary);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.button.secondary:hover {
  border-color: rgba(234, 88, 12, 0.35);
  color: #ea580c;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.14), 0 6px 14px rgba(234, 88, 12, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .button {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .button::before {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 64%, rgba(255, 255, 255, 0.02) 100%);
}

[data-theme="dark"] .button.secondary {
  background: linear-gradient(160deg, rgba(40, 45, 58, 0.92) 0%, rgba(24, 28, 37, 0.88) 100%);
  color: #e5e7eb;
}

[data-theme="dark"] .button.secondary:hover {
  border-color: rgba(96, 165, 250, 0.42);
  color: #93c5fd;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.55), 0 5px 12px rgba(96, 165, 250, 0.2);
}

.quick-links {
  display: flex;
  gap: 16px;
  font-size: 0.95rem;
  color: var(--accent-color);
}

.quick-links a {
  transition: all 0.2s ease;
  text-decoration: underline;
  text-decoration-color: transparent;
  color: var(--accent-color);
}

.quick-links a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

.hero-image img {
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .hero-image img {
  border-color: rgba(255, 255, 255, 0.1);
}

.section {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

.section:last-of-type {
  border-bottom: none;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section h2 {
  font-size: 1.6rem;
  margin-bottom: 14px;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
}

.section h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 2px;
  animation: slideIn 0.6s ease 0.3s both;
}

@keyframes slideIn {
  from {
    width: 0;
  }
  to {
    width: 70px;
  }
}

/* Plain-text sections (About, Experience) – no card blocks */
.section-text {
  padding-top: 18px;
  padding-bottom: 18px;
}

.section-text .section-body {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-primary);
  max-width: 100%;
}

.section-text .section-body p {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.section-text .section-body p:last-child {
  margin-bottom: 0;
}

.section-text .section-body .meta {
  color: var(--text-muted);
  font-size: 0.85em;
  font-weight: 500;
}

/* Experience section with photo on right (like hero) */
.experience-section h2 {
  margin-bottom: 20px;
}

.experience-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.experience-grid > * {
  min-width: 0;
}

.experience-content {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.experience-content p {
  margin-bottom: 12px;
}

.experience-content p:last-child {
  margin-bottom: 0;
}

.experience-feature-link {
  color: #ea580c;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  margin-left: 6px;
}

.experience-feature-link:hover {
  color: #ea580c;
}

[data-theme="dark"] .experience-feature-link:hover {
  color: #f97316;
}

.experience-visual {
  display: flex;
  align-items: flex-start;
  align-self: start;
}

.experience-photo-frame {
  --frame-tilt: 0deg;
  --parallax-offset: 0px;
  --float-amplitude: 4px;
  width: 100%;
  max-width: 392px;
}

.experience-photo-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center center;
  border-radius: 18px;
  display: block;
}

.experience-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 18px;
}

.experience-carousel-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
  border-radius: 18px;
  opacity: 0;
  transform: scale(1.03);
  filter: blur(8px);
  transition: opacity 0.8s ease, transform 0.8s ease, filter 0.8s ease;
}

.experience-carousel-image.active {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
  z-index: 2;
}

/* Education section with carousel on right (like experience) */
.education-section h2 {
  margin-bottom: 20px;
}

.education-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.education-grid > * {
  min-width: 0;
}

.education-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.education-school {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.education-school-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.education-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.education-link svg {
  flex-shrink: 0;
}

.education-link:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.education-school-row .education-school {
  margin-bottom: 0;
}

.education-visual {
  display: flex;
  align-items: flex-start;
  align-self: start;
}

.education-photo-frame {
  --frame-tilt: 0deg;
  --parallax-offset: 0px;
  --float-amplitude: 4px;
  width: 100%;
  max-width: 392px;
}

.education-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 18px;
}

.education-carousel-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
  border-radius: 18px;
  opacity: 0;
  transform: scale(1.03);
  filter: blur(8px);
  transition: opacity 0.8s ease, transform 0.8s ease, filter 0.8s ease;
}

.education-carousel-image.active {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
  z-index: 2;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: -8px 0 16px 0;
  font-weight: 500;
}

.projects-featured {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.project-preview {
  display: block;
  margin: 0 0 14px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #0b1220;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(234, 88, 12, 0.18);
}

.project-preview-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.preview-dot:nth-child(1) { background: #ff5f57; }
.preview-dot:nth-child(2) { background: #febc2e; }
.preview-dot:nth-child(3) { background: #28c840; }

.preview-url {
  margin-left: 8px;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-preview-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow-anchor: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(249, 115, 22, 0.25), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(14, 165, 233, 0.2), transparent 40%),
    #0b1220;
  overflow: hidden;
}

.project-preview-iframe {
  position: absolute;
  inset: 0;
  width: 200%;
  height: 200%;
  border: none;
  transform: scale(0.5);
  transform-origin: top left;
  pointer-events: none;
  background: #fff;
  z-index: 1;
}

.project-preview-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #f8fafc;
  text-align: center;
  padding: 16px;
}

.project-preview-fallback span {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.project-preview-fallback small {
  font-size: 0.85rem;
  color: #cbd5e1;
}

.project-preview-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 12px;
  color: transparent;
  font-size: 0;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
}

.project-preview-hit::after {
  content: "Open live →";
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  padding: 6px 10px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.project-preview:hover .project-preview-hit::after,
.project-preview:focus-within .project-preview-hit::after {
  opacity: 1;
  transform: translateY(0);
}

.project-featured {
  border: 2px solid var(--accent-color);
  box-shadow: 0 12px 40px rgba(234, 88, 12, 0.12);
  padding-top: 32px;
}

.project-featured h3 {
  padding-right: 70px; /* avoid overlap with Featured badge */
}

[data-theme="dark"] .project-featured {
  box-shadow: 0 12px 40px rgba(234, 88, 12, 0.2);
}

.project-featured:hover {
  box-shadow: 0 20px 56px rgba(234, 88, 12, 0.2);
}

.featured-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.projects-other-title {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-weight: 600;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.projects-list .project-item:nth-child(1) { --index: 0; }
.projects-list .project-item:nth-child(2) { --index: 1; }
.projects-list .project-item:nth-child(3) { --index: 2; }
.projects-list .project-item:nth-child(4) { --index: 3; }

.project-item {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  border-radius: var(--bubble-radius);
  padding: 16px 18px;
  border: 1px solid var(--border-color);
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out, border-color 0.25s ease-out;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: visible;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: calc(var(--index) * 0.1s);
}

.project-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-color);
  border-radius: var(--bubble-radius) var(--bubble-radius) 0 0;
  opacity: 0;
  transition: opacity 0.25s ease-out;
}

.project-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.project-item:hover::before {
  opacity: 1;
}

.project-links {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.project-links .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  padding: 10px 16px;
  cursor: pointer;
  font-family: inherit;
}

.project-links .button svg {
  flex-shrink: 0;
}

.project-item h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.project-meta {
  font-size: 0.8rem;
  color: var(--accent-color);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-item p {
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.project-tags {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 6px;
  margin-bottom: 0;
}

.timeline-simple {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.timeline-simple .timeline-simple-item:nth-child(1) { --index: 0; }
.timeline-simple .timeline-simple-item:nth-child(2) { --index: 1; }

.timeline-simple-item {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  border-radius: var(--bubble-radius);
  padding: 24px;
  border: 1px solid var(--border-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: calc(var(--index) * 0.15s);
}

.timeline-simple-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
  opacity: 0;
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-simple-item:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-color);
}

.timeline-simple-item:hover::before {
  opacity: 1;
}

.timeline-simple-item h3 {
  font-size: 1.3rem;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-weight: 600;
}

.timeline-simple-item p {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.timeline-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--accent-color);
}

.timeline-item h3 {
  margin-bottom: 8px;
}

.timeline-item h3 a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.timeline-item h3 a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.timeline-item ul {
  margin-left: 18px;
  color: var(--text-secondary);
}

.timeline-item ul a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.timeline-item ul a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

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

[data-theme="dark"] .meta {
  color: var(--text-muted);
  opacity: 0.9;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.card {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  border-radius: var(--bubble-radius);
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: calc(var(--index) * 0.1s);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md), 0 8px 20px rgba(234, 88, 12, 0.1);
  border-color: var(--accent-color);
}

.cards .card:nth-child(1) { --index: 0; }
.cards .card:nth-child(2) { --index: 1; }
.cards .card:nth-child(3) { --index: 2; }
.cards .card:nth-child(4) { --index: 3; }
.cards .card:nth-child(5) { --index: 4; }

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.card a {
  color: var(--accent-color);
  text-decoration: underline;
  transition: color 0.2s ease;
}

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

.stack {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

[data-theme="dark"] .stack {
  opacity: 0.85;
}

.skills-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.skills-grid > div {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  border-radius: var(--bubble-radius);
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: calc(var(--index) * 0.1s);
}

.skills-grid > div:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--accent-color);
}

.skills-grid > div:nth-child(1) { --index: 0; }
.skills-grid > div:nth-child(2) { --index: 1; }
.skills-grid > div:nth-child(3) { --index: 2; }
.skills-grid > div:nth-child(4) { --index: 3; }
.skills-grid > div:nth-child(5) { --index: 4; }
.skills-grid > div:nth-child(6) { --index: 5; }

.skills-grid h3 {
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-weight: 700;
}

.muted {
  color: #64748b;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.section p {
  line-height: 1.5;
}

.section ul li {
  margin-bottom: 8px;
}


/* Schedule section - always-visible Notion Calendar embed */
.schedule-section {
  position: relative;
  padding-bottom: 48px;
}

.schedule-subtitle {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1rem;
}

.schedule-embed-wrapper {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(234, 88, 12, 0.25);
  box-shadow: 0 16px 48px rgba(234, 88, 12, 0.14);
  background: #ffffff;
  min-height: 900px;
}

.schedule-iframe {
  width: 100%;
  height: 900px;
  min-height: 900px;
  border: none;
  display: block;
  background: #ffffff;
}

@media (max-width: 768px) {
  .schedule-embed-wrapper {
    min-height: 820px;
    border-radius: 16px;
  }

  .schedule-iframe {
    height: 820px;
    min-height: 820px;
  }

  .schedule-section {
    padding-bottom: 96px;
  }
}

[data-theme="dark"] .schedule-embed-wrapper {
  border-color: rgba(249, 115, 22, 0.35);
  box-shadow: 0 16px 48px rgba(234, 88, 12, 0.16);
}

/* On-site live preview modal (projects) */
.site-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.site-modal.open {
  display: flex;
}

.site-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, 0.72);
  backdrop-filter: blur(8px);
}

.site-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 32px));
  height: min(860px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.site-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-glass);
}

.site-modal-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
}

#site-modal-title {
  font-weight: 700;
  font-size: 1rem;
}

#site-modal-external {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-color);
  text-decoration: none;
}

#site-modal-external:hover {
  text-decoration: underline;
}

.site-modal-close {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.site-modal-frame {
  flex: 1;
  min-height: 0;
  background: #fff;
}

.site-modal-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .site-modal {
    padding: 10px;
  }

  .site-modal-dialog {
    width: calc(100vw - 16px);
    height: calc(100vh - 20px);
    border-radius: 14px;
  }
}


.contact {
  border-bottom: none;
}

.contact-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.contact-grid a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease;
  display: block;
  margin-bottom: 6px;
}

.contact-grid a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.contact-grid p {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.footer {
  text-align: center;
  padding: 20px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  border-top: 1px solid var(--border-color);
  margin-top: 24px;
}

.chatbot {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.chatbot-launcher {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chatbot-indicator {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  color: #ff3b3b;
  filter: drop-shadow(0 2px 8px rgba(255, 59, 59, 0.6));
  animation: bounceArrow 0.8s ease-in-out infinite, fadeOutIndicator 2.5s ease forwards;
  pointer-events: none;
  z-index: 21;
}

.chatbot-indicator svg {
  width: 44px;
  height: 44px;
}

@keyframes bounceArrow {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%) translateY(8px);
    opacity: 0.75;
  }
}

@keyframes fadeOutIndicator {
  0%, 65% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

.chatbot-toggle {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  font-weight: 600;
  position: relative;
}

.chatbot-toggle:not(.chatbot-lobster):hover {
  background: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.chatbot-toggle::after {
  content: none;
}

.chatbot-toggle img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  object-fit: cover;
}

.chatbot-toggle.chatbot-lobster {
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  animation: lobsterIntro 1.1s ease-in-out 1;
  transform-origin: center bottom;
}

.chatbot-toggle.chatbot-lobster img {
  width: 88px;
  height: 88px;
  border: none;
  border-radius: 0;
  object-fit: contain;
  display: block;
  background: transparent;
  filter: drop-shadow(0 10px 24px rgba(249, 115, 22, 0.4));
  transition: filter 0.25s ease, transform 0.25s ease;
}

.chatbot-toggle.chatbot-lobster:hover,
.chatbot-toggle.chatbot-lobster:focus-visible {
  background: transparent;
  border: none;
  box-shadow: none;
  transform: scale(1.04);
}

.chatbot-toggle.chatbot-lobster:hover img,
.chatbot-toggle.chatbot-lobster:focus-visible img {
  filter: drop-shadow(0 14px 28px rgba(249, 115, 22, 0.55));
}

@keyframes lobsterIntro {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-7deg); }
  40% { transform: rotate(7deg); }
  60% { transform: rotate(-5deg); }
  80% { transform: rotate(5deg); }
}

@keyframes lobsterHoverShake {
  0%, 100% { transform: rotate(0deg) scale(1.04); }
  25% { transform: rotate(-6deg) scale(1.04); }
  75% { transform: rotate(6deg) scale(1.04); }
}

.chatbot-toggle.chatbot-lobster.shake-done:hover,
.chatbot-toggle.chatbot-lobster.shake-done:focus-visible {
  animation: lobsterHoverShake 0.45s ease-in-out infinite;
}

.chatbot:has(.chatbot-panel.open) .chatbot-toggle.chatbot-lobster,
.chatbot:has(.chatbot-panel.open) .chatbot-toggle.chatbot-lobster:hover {
  animation: none;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-toggle.chatbot-lobster,
  .chatbot-toggle.chatbot-lobster.shake-done:hover,
  .chatbot-indicator {
    animation: none !important;
  }
}

[data-theme="dark"] .chatbot-toggle img {
  border-color: rgba(255, 255, 255, 0.2);
}

/* Lobster: keep transparent—no background, border, or overlay */
[data-theme="dark"] .chatbot-toggle.chatbot-lobster img,
.chatbot-title img,
.message-row.bot .message-avatar {
  background: transparent !important;
  border: none !important;
  border-radius: 0;
  box-shadow: none;
}

.chatbot-panel {
  width: min(360px, calc(100vw - 40px));
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  border-radius: calc(var(--bubble-radius) + 2px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: none;
  flex-direction: column;
  border: 1px solid var(--border-color);
  animation: panelSlideUp 0.35s ease;
  position: relative;
}

.chatbot-panel.open {
  display: flex;
}

.chatbot-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: var(--accent-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.35;
  pointer-events: none;
}

.chatbot-panel::after {
  content: none;
}

.chatbot-header {
  background: var(--accent-gradient);
  color: #ffffff;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title close"
    "status status";
  gap: 6px 12px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.chatbot-title {
  grid-area: title;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chatbot-title span {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}

.chatbot-title img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
}

.chatbot-header > #chatbot-close,
.chatbot-header > button {
  grid-area: close;
}

.chatbot-status {
  grid-area: status;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  opacity: 0.9;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.chatbot-suggestions {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: none;
}

.chatbot-suggestions.show {
  display: block;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-chip {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.suggestion-chip:hover {
  background: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.chatbot-header button {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
}

.chatbot-messages {
  padding: 12px 16px;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: max-height 0.3s ease;
}

.chatbot-panel.open .chatbot-messages {
  max-height: 420px;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

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

.message-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e2e8f0;
}

.message-row.bot .message-avatar {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
}

.bot-message,
.user-message {
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 0.9rem;
  animation: messageIn 0.25s ease;
}

.bot-message {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
  border: 1px solid var(--border-color);
  max-width: 85%;
  word-wrap: break-word;
}

.bot-message a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
}

.bot-message a:hover {
  text-decoration: underline;
}

.user-message {
  background: var(--accent-color);
  color: #ffffff;
  max-width: 85%;
  word-wrap: break-word;
  border: none;
}

.chatbot-form {
  display: flex;
  border-top: 1px solid var(--border-color);
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.6; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@keyframes panelSlideUp {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.chatbot-form input {
  flex: 1;
  padding: 10px 12px;
  border: none;
  outline: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.chatbot-form input::placeholder {
  color: var(--text-muted);
}

.chatbot-form button {
  background: var(--accent-color);
  color: #ffffff;
  border: none;
  padding: 0 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-form button:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.chatbot-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .nav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav-links {
    flex: 1 1 100%;
    order: 3;
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav-actions {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .nav-cta {
    font-size: 0.85rem;
    padding: 8px 12px;
  }

  .theme-toggle {
    padding: 6px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .button {
    width: 100%;
  }

  .chatbot {
    right: 12px;
    bottom: 12px;
    gap: 10px;
  }

  .chatbot-toggle.chatbot-lobster img {
    width: 72px;
    height: 72px;
  }

  .chatbot-panel {
    width: calc(100vw - 24px);
    max-width: 360px;
    max-height: calc(100vh - 120px);
  }

  .chatbot-messages {
    max-height: 200px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 12px 0 20px;
  }

  .hero-visual {
    order: -1;
  }

  .experience-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .experience-visual {
    order: -1;
    justify-content: center;
  }

  .experience-photo-frame {
    width: 100%;
    max-width: 392px;
    margin: 0 auto;
    transform: none;
  }

  .experience-photo-frame img {
    aspect-ratio: 4 / 3;
  }

  .education-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .education-visual {
    order: -1;
    justify-content: center;
  }

  .education-photo-frame {
    width: 100%;
    max-width: 392px;
    margin: 0 auto;
    transform: none;
  }

  .hero-photo-frame {
    --frame-tilt: 0deg;
    --float-amplitude: 0px;
    width: 100%;
    max-width: 392px;
    margin: 0 auto;
  }
  
  .photo-carousel {
    aspect-ratio: 360 / 600;
  }
  
  .section {
    padding: 18px 0;
  }
  
  .section h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
  }
  
  .hero-highlight {
    display: inline;
  }
  
  .projects-featured {
    grid-template-columns: 1fr;
    margin-bottom: 20px;
  }

  .quick-links {
    flex-wrap: wrap;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-photo-frame,
  .experience-photo-frame,
  .education-photo-frame {
    animation: none !important;
    transform: translate3d(0, 0, 0) rotate(var(--frame-tilt));
  }

  .carousel-image.active,
  .experience-carousel-image.active,
  .education-carousel-image.active {
    animation: none !important;
  }
}
