/* ==========================================================================
   MAHFUZ RAHMAN PORTFOLIO — ADVANCED MINIMALIST LIQUID DESIGN SYSTEM
   Linear & Framer Engineering • 100% Vector Motion • Pure Digital Precision
   ========================================================================== */

:root {
  --bg-base: #08080a;
  --bg-surface: #111216;
  --bg-surface-elevated: #16181f;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.18);
  --accent-glow: rgba(255, 255, 255, 0.05);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  font-size: 16px;
  background-color: var(--bg-base);
  color: #e2e8f0;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: #cbd5e1;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Minimalist Scrollbar */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: #08080a;
}
::-webkit-scrollbar-thumb {
  background: #1e2029;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Liquid Canvas (Subtle Calm Water Surface & Interactive Ripples) */
#liquid-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

/* Ambient Liquid Cursor Spotlight */
#liquid-ambient-spotlight {
  background: radial-gradient(650px circle at var(--mouse-x, 50%) var(--mouse-y, 30%), rgba(255, 255, 255, 0.038), transparent 45%);
  transition: opacity 0.3s ease;
}

/* Minimalist Navigation Bar */
.nav-glass {
  background: rgba(17, 18, 22, 0.88);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  transition: border-color 0.25s ease;
}
.nav-glass:hover {
  border-color: var(--border-highlight);
}

.nav-link {
  color: #94a3b8;
  padding: 6px 13px;
  border-radius: 9999px;
  transition: all 0.2s ease;
  text-decoration: none;
}
.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}
.nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Minimalist Buttons */
.btn-primary-minimal {
  background: #ffffff;
  color: #08080a;
  border: 1px solid #ffffff;
  border-radius: 9999px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary-minimal:hover {
  background: #e2e8f0;
  border-color: #e2e8f0;
  color: #08080a;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.15);
}

.btn-subtle {
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-highlight);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Magnetic Element Physics */
.magnetic-elem {
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Minimalist Liquid Avatar */
.liquid-avatar-container {
  position: relative;
  width: 146px;
  height: 146px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.liquid-avatar-inner {
  position: relative;
  z-index: 2;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: #111216;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.liquid-avatar-container:hover .liquid-avatar-inner {
  transform: scale(1.03);
}
.liquid-avatar-rim {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
  animation: pulseRim 6s ease-in-out infinite alternate;
}
@keyframes pulseRim {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.04); opacity: 0.9; }
}

/* Professional Liquid Icons (Apple/Framer Squircle Bevel) */
.liquid-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-minimal:hover .liquid-icon-box,
.contact-pill:hover .liquid-icon-box,
.experience-card:hover .liquid-icon-box {
  border-color: var(--border-highlight);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
  transform: translateY(-1px);
}

/* ==========================================================================
   LINEAR-STYLE DYNAMIC BORDER SPOTLIGHT & 3D PERSPECTIVE TILT
   ========================================================================== */
.card-minimal,
.experience-card,
.contact-pill,
.telem-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  overflow: hidden;
  will-change: transform;
  transform-style: preserve-3d;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

/* Dynamic Radial Border Gleam */
.card-minimal::before,
.experience-card::before,
.contact-pill::before,
.telem-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(380px circle at var(--card-x, -500px) var(--card-y, -500px), rgba(255, 255, 255, 0.22), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.card-minimal:hover::before,
.experience-card:hover::before,
.contact-pill:hover::before,
.telem-card:hover::before {
  opacity: 1;
}

.card-minimal:hover,
.experience-card:hover,
.contact-pill:hover,
.telem-card:hover {
  background: var(--bg-surface-elevated);
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.6);
}

/* Tag Minimal */
.tag-minimal {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  padding: 2px 7px;
  border-radius: 5px;
}

.badge-status-online {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.link-action {
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.link-action:hover {
  opacity: 0.8;
}

/* Experience Cards */
.experience-card {
  border-radius: 14px;
  padding: 20px 24px;
}

/* Contact Pills */
.contact-pill {
  padding: 14px 16px;
  border-radius: 12px;
  text-decoration: none;
}

.social-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  text-decoration: none;
  transition: all 0.2s ease;
}
.social-btn:hover {
  color: #ffffff;
  border-color: var(--border-highlight);
  background: var(--bg-surface-elevated);
  transform: translateY(-1px);
}

/* Minimal Form Inputs */
.input-minimal {
  background: #08080a;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 9px 12px;
  color: #f1f5f9;
  font-size: 13px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease;
}
.input-minimal:focus {
  border-color: var(--border-highlight);
}

/* ==========================================================================
   INFINITE MONOCHROME TECH MARQUEE
   ========================================================================== */
.marquee-mask {
  mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeFlow 42s linear infinite;
  will-change: transform;
}
.marquee-track:hover {
  animation-play-state: paused;
}
@keyframes marqueeFlow {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.marquee-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 12px;
  font-family: var(--font-mono);
  white-space: nowrap;
  transition: all 0.2s ease;
}
.marquee-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ==========================================================================
   PROJECT CATEGORY TABS & FILTERING
   ========================================================================== */
.project-tabs-container {
  background: rgba(17, 18, 22, 0.85);
  border: 1px solid var(--border-subtle);
}

.project-tab {
  border-radius: 9999px;
  transition: color 0.2s ease;
  cursor: pointer;
  background: transparent;
  border: none;
  outline: none;
}
.project-tab.active {
  color: #ffffff;
}

.project-card-wrapper {
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card-wrapper.is-hidden {
  opacity: 0;
  transform: scale(0.96) translateY(8px);
  position: absolute;
  pointer-events: none;
  visibility: hidden;
  max-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* ==========================================================================
   COMMAND PALETTE MODAL (⌘K / Ctrl+K)
   ========================================================================== */
.palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.palette-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.palette-modal {
  width: 92%;
  max-width: 600px;
  background: rgba(17, 18, 22, 0.96);
  border: 1px solid var(--border-highlight);
  border-radius: 18px;
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transform: scale(0.96) translateY(-8px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.palette-overlay.open .palette-modal {
  transform: scale(1) translateY(0);
}
.palette-input-wrap {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}
.palette-input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 14px;
  width: 100%;
  outline: none;
  font-family: var(--font-sans);
}
.palette-input::placeholder {
  color: #64748b;
}
.palette-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
}
.palette-group-title {
  font-size: 10px;
  font-family: var(--font-mono);
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px 4px 10px;
}
.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.palette-item:hover, .palette-item.selected {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}
.palette-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-family: var(--font-mono);
  color: #64748b;
  background: rgba(255, 255, 255, 0.01);
}

/* ==========================================================================
   HERO BIO TEXT CARD & HIGH-CONTRAST TYPOGRAPHY
   ========================================================================== */
.hero-bio-card {
  background: rgba(13, 14, 18, 0.88);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  box-shadow: 0 12px 35px -10px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.12);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-bio-card:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(18, 20, 26, 0.92);
  transform: translateY(-1px);
}

/* Reveal Transitions — Hero elements always immediately visible */
#hero [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Minimal Toast */
.toast-msg {
  background: #16181f;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   INTERACTIVE ENTITY FAQ ACCORDION (MINIMALIST & SEARCH-OPTIMIZED)
   ========================================================================== */
.faq-accordion-item {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(14, 15, 20, 0.9) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.faq-accordion-item:hover {
  border-color: rgba(255, 255, 255, 0.24) !important;
  background: rgba(20, 22, 30, 0.95) !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.6);
}
.faq-accordion-item[open] {
  border-color: rgba(56, 189, 248, 0.4) !important;
  background: rgba(16, 19, 27, 0.98) !important;
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.08) !important;
}
.faq-accordion-item summary {
  list-style: none !important;
  cursor: pointer;
  padding: 16px 18px;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px;
  user-select: none;
  font-weight: 600;
  color: #ffffff !important;
  transition: background 0.2s ease, color 0.2s ease;
}
@media (min-width: 640px) {
  .faq-accordion-item summary {
    padding: 18px 22px;
    gap: 16px;
  }
}
.faq-accordion-item summary::-webkit-details-marker,
.faq-accordion-item summary::marker {
  display: none !important;
}
.faq-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.faq-accordion-item summary:hover .faq-num,
.faq-accordion-item[open] .faq-num {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.5);
  color: #7dd3fc !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}
.faq-question-title {
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  transition: color 0.2s ease;
  display: inline-block;
}
@media (min-width: 640px) {
  .faq-question-title {
    font-size: 15px;
  }
}
.faq-accordion-item summary:hover .faq-question-title {
  color: #38bdf8 !important;
}
.faq-icon-box {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.faq-accordion-item summary:hover .faq-icon-box {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  transform: scale(1.05);
}
.faq-accordion-item[open] .faq-icon-box {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}
.faq-icon {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  flex-shrink: 0 !important;
  color: #94a3b8 !important;
  display: block !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
}
.faq-accordion-item summary:hover .faq-icon {
  color: #ffffff !important;
}
.faq-accordion-item[open] .faq-icon {
  transform: rotate(45deg);
  color: #38bdf8 !important;
}
.faq-content {
  padding: 0 18px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 2px;
  padding-top: 14px;
  color: #cbd5e1 !important;
  font-size: 13.5px;
  line-height: 1.7;
  animation: faqFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 640px) {
  .faq-content {
    padding: 0 22px 20px 22px;
    padding-top: 16px;
    font-size: 14px;
  }
}
.faq-content strong {
  color: #ffffff !important;
}
.faq-content a {
  color: #38bdf8 !important;
  text-decoration: none;
  transition: color 0.15s ease;
}
.faq-content a:hover {
  text-decoration: underline;
  color: #7dd3fc !important;
}
@keyframes faqFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   ADVANCED TIMELINE TRACK & TIMEFRAME UI/UX
   ========================================================================== */
.timeline-track-wrapper {
  position: relative;
  padding-left: 28px;
}
@media (min-width: 640px) {
  .timeline-track-wrapper {
    padding-left: 38px;
  }
}
.timeline-spine {
  position: absolute;
  top: 16px;
  bottom: 24px;
  left: 8px;
  width: 2px;
  background: linear-gradient(180deg, #34d399 0%, #38bdf8 35%, rgba(255, 255, 255, 0.15) 75%, rgba(255, 255, 255, 0.04) 100%);
  border-radius: 9999px;
}
@media (min-width: 640px) {
  .timeline-spine {
    left: 11px;
  }
}
.timeline-node {
  position: absolute;
  left: -28px;
  top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
@media (min-width: 640px) {
  .timeline-node {
    left: -38px;
  }
}
.timeline-node-active {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: #08080a;
  border: 2px solid #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.5);
  transition: all 0.25s ease;
}
.timeline-node-active::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #34d399;
  animation: pulseBeacon 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.timeline-node-past {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: #08080a;
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}
.timeline-node-past::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #64748b;
  transition: background 0.2s ease;
}
@keyframes pulseBeacon {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.35); }
}

.timeline-item {
  position: relative;
  transition: transform 0.25s ease;
}
.timeline-item:hover .timeline-node-past {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}
.timeline-item:hover .timeline-node-past::after {
  background: #ffffff;
}
.timeline-item:hover .timeline-node-active {
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.7);
  transform: scale(1.1);
}

.timeline-badge-active {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  padding: 3px 9px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.timeline-badge-past {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 9px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ==========================================================================
   EXPERIENCE TREE (root > branches > role leaves)
   Native <details>; js/app.js section 10 collapses the leaves and adds
   .is-enhanced. Reuses .experience-card and .timeline-node-* from above.
   ========================================================================== */
.exp-tree {
  --exp-line: rgba(255, 255, 255, 0.18);
  --exp-line-hi: #34d399;
  --exp-radius: 10px;
}

/* Root node + Expand/Collapse all (wrap-reverse keeps the root touching the trunk) */
.exp-tree-head {
  display: flex;
  flex-wrap: wrap-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.exp-root {
  display: flex;
  align-items: center;
  gap: 12px;
}
.exp-root-icon {
  flex-shrink: 0;
  color: #e2e8f0;
}
.exp-root-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
}
/* .exp-tree prefix outranks Tailwind preflight's [type='button'] reset */
.exp-tree .exp-toggle-all {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 16px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.exp-tree .exp-toggle-all:hover {
  color: #ffffff;
  border-color: var(--border-highlight);
  background: rgba(255, 255, 255, 0.08);
}
.exp-tree .exp-toggle-all[hidden] {
  display: none;
}

/* Lists + connectors. --exp-trunk: x of the vertical line; --exp-indent: child offset;
   --exp-elbow: y where the line turns into a node (includes --exp-gap). */
.exp-branches,
.exp-leaves {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--exp-indent);
}
.exp-branches {
  --exp-trunk: 20px;
  --exp-indent: 48px;
  --exp-gap: 16px;
  --exp-elbow: 32px;
}
.exp-leaves {
  --exp-trunk: 17px;
  --exp-indent: 42px;
  --exp-gap: 12px;
  --exp-elbow: 42px;
  padding-bottom: 4px;
}
.exp-branch,
.exp-leaf-item {
  position: relative;
  padding-top: var(--exp-gap);
}
.exp-branch::before,
.exp-branch::after,
.exp-leaf-item::before,
.exp-leaf-item::after {
  content: '';
  position: absolute;
  left: calc(var(--exp-trunk) - var(--exp-indent));
  border-left: 1px solid var(--exp-line);
  pointer-events: none;
  transition: border-color 0.25s ease;
}
/* ::before = trunk down to this node + the elbow into it */
.exp-branch::before,
.exp-leaf-item::before {
  top: 0;
  width: calc(var(--exp-indent) - var(--exp-trunk));
  height: var(--exp-elbow);
  border-bottom: 1px solid var(--exp-line);
  border-bottom-left-radius: var(--exp-radius);
}
/* ::after = trunk continuing to the next sibling */
.exp-branch::after,
.exp-leaf-item::after {
  top: calc(var(--exp-elbow) - var(--exp-radius));
  bottom: 0;
}
.exp-branch:last-child::after,
.exp-leaf-item:last-child::after {
  display: none;
}
/* Active/past dot sits on the card edge where the elbow lands */
.exp-tree .timeline-node {
  left: -9px;
  top: calc(var(--exp-elbow) - 9px);
}

/* Disclosure controls */
.exp-tree summary {
  list-style: none;
  cursor: pointer;
}
.exp-tree summary::-webkit-details-marker {
  display: none;
}
.exp-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #64748b;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
}
.exp-tree details[open] > summary .exp-chevron {
  transform: rotate(180deg);
}
.exp-tree summary:hover .exp-chevron {
  color: #cbd5e1;
}
.exp-group-summary {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cbd5e1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.exp-group-summary .exp-chevron {
  width: 12px;
  height: 12px;
}
.exp-leaf {
  padding: 0;
}
.exp-leaf > summary {
  display: block;
  padding: 20px 24px;
  border-radius: inherit;
}
.exp-leaf-body {
  padding: 0 24px 20px;
}
.exp-leaf-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.exp-group-summary:focus-visible,
.exp-tree .exp-toggle-all:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}
.exp-leaf > summary:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: -2px; /* the card clips overflow */
}

/* Path highlight: hovered / keyboard-focused node back to the root.
   :has() rules are kept apart so browsers without it still get the :hover ones. */
.exp-branch:hover::before,
.exp-leaf-item:hover::before {
  border-color: var(--exp-line-hi);
}
.exp-branch:hover > .exp-group > .exp-group-summary {
  color: #ffffff;
  border-color: rgba(52, 211, 153, 0.45);
}
.exp-branch:has(:focus-visible)::before,
.exp-leaf-item:has(:focus-visible)::before {
  border-color: var(--exp-line-hi);
}
.exp-branch:has(:focus-visible) > .exp-group > .exp-group-summary {
  color: #ffffff;
  border-color: rgba(52, 211, 153, 0.45);
}
/* earlier siblings carry the trunk down to the active node */
.exp-branch:has(~ .exp-branch:hover)::before,
.exp-branch:has(~ .exp-branch:hover)::after,
.exp-branch:has(~ .exp-branch :focus-visible)::before,
.exp-branch:has(~ .exp-branch :focus-visible)::after,
.exp-leaf-item:has(~ .exp-leaf-item:hover)::before,
.exp-leaf-item:has(~ .exp-leaf-item:hover)::after,
.exp-leaf-item:has(~ .exp-leaf-item :focus-visible)::before,
.exp-leaf-item:has(~ .exp-leaf-item :focus-visible)::after {
  border-left-color: var(--exp-line-hi);
}
.exp-tree:has(.exp-branch:hover) .exp-root-icon,
.exp-tree:has(.exp-branch :focus-visible) .exp-root-icon {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.5);
}

/* Open/close motion. Only after JS has done its initial collapse, so load never animates.
   Height animates where interpolate-size exists; elsewhere it falls back to a fade or an instant toggle. */
.exp-tree.is-enhanced {
  interpolate-size: allow-keywords;
}
.exp-tree.is-enhanced details::details-content {
  height: 0;
  opacity: 0;
  overflow: clip;
  transition: height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, content-visibility 0.35s allow-discrete;
}
.exp-tree.is-enhanced details[open]::details-content {
  height: auto;
  opacity: 1;
}

@media (max-width: 639px) {
  .exp-root-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .exp-branches {
    --exp-trunk: 16px;
    --exp-indent: 28px;
  }
  .exp-leaves {
    --exp-trunk: 12px;
    --exp-indent: 28px;
    --exp-elbow: 36px;
  }
  .exp-leaf > summary {
    padding: 14px 16px;
  }
  .exp-leaf-body {
    padding: 0 16px 14px;
  }
}

/* No JS: nothing adds .revealed, so show this section's reveal blocks outright */
@media (scripting: none) {
  #experience [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .exp-tree *,
  .exp-tree *::before,
  .exp-tree *::after {
    transition: none !important;
    animation: none !important;
  }
  /* own rule: an unsupported pseudo-element would void the list above */
  .exp-tree details::details-content {
    transition: none !important;
  }
}
