/* ==========================================================================
   HADAR SAPIR - Personal Site
   Custom CSS: layout primitives, card variants, animations, D3 map, a11y
   All color / spacing defaults handled by Tailwind.
   ========================================================================== */


/* ==========================================================================
   SCROLLING / PAGE BASELINE
   - scroll-padding-top so anchor jumps don't hide section headings under the
     fixed floating nav (~70px tall + 20px top offset = 90px buffer)
   - smooth scroll on hash links
   - overflow-x safety net so a future bug can't trigger horizontal scroll
   ========================================================================== */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

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

body {
  overflow-x: hidden;
}

/* Section anchors get a margin so the smooth-scroll JS lands them below the nav */
section[id] {
  scroll-margin-top: 92px;
}


/* ==========================================================================
   BENTO CARD BASE
   Two variants: default (cream/white) and dark (ink).
   ========================================================================== */

.bento-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.04),
    0 2px 8px rgb(0 0 0 / 0.03);
  transition: box-shadow 0.4s ease, transform 0.4s ease, border-color 0.4s ease;
  will-change: transform;
}

.bento-card:hover {
  box-shadow:
    0 8px 32px rgb(0 0 0 / 0.1),
    0 2px 8px rgb(0 0 0 / 0.05);
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Dark card - used for CTA and contact block */
.bento-card.bento-card-dark {
  background: #111827;
  backdrop-filter: none;
  border-color: #374151;
  box-shadow:
    0 2px 4px rgb(0 0 0 / 0.3),
    0 8px 32px rgb(0 0 0 / 0.2);
}

.bento-card.bento-card-dark:hover {
  border-color: #374151;
  box-shadow:
    0 4px 24px rgb(0 0 0 / 0.35),
    0 2px 8px rgb(0 0 0 / 0.2);
}

/* Accent-tinted card - for the mission pull quote */
.bento-card.bento-card-accent {
  background: rgba(240, 253, 250, 0.8);
  border-color: #99f6e4;
}

.bento-card.bento-card-accent:hover {
  border-color: #5eead4;
}

/* Mission primary card - warm, distinct from work cards */
.mission-card-primary.bento-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(240, 253, 250, 0.5) 100%);
  border-color: rgba(153, 246, 228, 0.4);
}

/* Photo block - structural, subtle depth */
.photo-block {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.04),
    0 2px 8px rgb(0 0 0 / 0.03),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}


/* ==========================================================================
   HERO TYPOGRAPHY
   ========================================================================== */

.hero-name {
  font-feature-settings: "kern" 1, "liga" 1;
  letter-spacing: -0.05em;
  text-wrap: balance;
  /* Subtle gradient on the name */
  background: linear-gradient(135deg, #111827 60%, #4b5563 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Fact rows in hero - number + label side by side */
.fact-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.fact-number {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 900;
  color: #111827;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  width: 5.5rem;
}

/* Gradient text for impact numbers */
.gradient-number {
  background: linear-gradient(135deg, #0d9488 0%, #2dd4bf 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fact-label {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.5;
}


/* ==========================================================================
   EXPERTISE CHIPS
   ========================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Neutral/secondary chips - minimalist */
.chip-default {
  background: rgba(243, 244, 246, 0.5);
  color: #6b7280;
  border: 1px solid rgba(229, 231, 235, 0.6);
}

/* Core superpowers - subtle blue tint */
.chip-blue {
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #ccfbf1;
}



/* ==========================================================================
   SOCIAL LINKS (hero connect row)
   ========================================================================== */

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #4b5563;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.social-link:hover {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

.social-link:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
}


/* ==========================================================================
   TIMELINE ENTRIES
   ========================================================================== */

.timeline-entry {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 480px) {
  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

.timeline-year {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5e7eb;
  flex-shrink: 0;
}

.timeline-dot-active {
  background: #0d9488;
  box-shadow: 0 0 0 3px #ccfbf1;
}

.timeline-content {
  /* nothing special, inherits */
}


/* ==========================================================================
   CONTACT BUTTONS
   ========================================================================== */

.contact-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #0d9488;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 700;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-btn-primary:hover {
  background: #0f766e;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.35);
}

.contact-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: #d1d5db;
  border: 1px solid #374151;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.contact-btn-secondary:hover {
  background: rgba(13, 148, 136, 0.1);
  color: #5eead4;
  border-color: rgba(13, 148, 136, 0.3);
  transform: translateY(-1px);
}


/* ==========================================================================
   ADVENTURE PHOTO BREAK
   Full-bleed image divider between Travel and Mission.
   ========================================================================== */

.adventure-break {
  position: relative;
  width: 100%;
  height: clamp(240px, 40vw, 520px);
  overflow: hidden;
  /* No border-radius - it's meant to break the page rhythm */
}

.adventure-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}

.adventure-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgb(0 0 0 / 0.65) 0%,
    rgb(0 0 0 / 0.25) 40%,
    transparent 70%
  );
  display: flex;
  align-items: flex-end;
  padding-bottom: 2.5rem;
}

/* Fallback when adventure.jpg can't load */
.adventure-fallback {
  background: linear-gradient(135deg, #111827 0%, #1f2937 50%, #111827 100%);
}

.adventure-fallback .adventure-overlay {
  background: transparent;
}


/* ==========================================================================
   MAP CARD OUTER WRAPPER (replaces the old rounded-3xl div)
   ========================================================================== */

.map-outer-card {
  border-radius: 20px;
  background: #0a0e1a;
  border: 1px solid #1a2035;
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.2),
    0 4px 16px rgb(0 0 0 / 0.15);
}


/* ==========================================================================
   PULSE DOT ANIMATION
   ========================================================================== */

.pulse-dot {
  animation: pulseDot 2.2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}


/* ==========================================================================
   SCROLL FADE-IN ANIMATIONS
   ========================================================================== */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

/* Stagger delays - used by script.js cycling 1-7 */
.fade-in.stagger-1 { transition-delay: 0.06s; }
.fade-in.stagger-2 { transition-delay: 0.12s; }
.fade-in.stagger-3 { transition-delay: 0.18s; }
.fade-in.stagger-4 { transition-delay: 0.24s; }
.fade-in.stagger-5 { transition-delay: 0.30s; }
.fade-in.stagger-6 { transition-delay: 0.36s; }
.fade-in.stagger-7 { transition-delay: 0.42s; }


/* ==========================================================================
   D3 MAP STYLES (dark card context - #0a0e1a background)
   ========================================================================== */

#map-container {
  background: #0a0e1a;
  /* Allow vertical page scroll to pass through; D3 zoom only captures
     horizontal pan + pinch. Without this, single-finger vertical swipes on
     the map would hijack scrolling on mobile. */
  touch-action: pan-y;
}

#map-container svg {
  touch-action: pan-y;
}

#map-container .map-skeleton {
  color: #4b5563;
  font-size: 0.875rem;
  animation: skeletonPulse 1.6s ease-in-out infinite;
}

@keyframes skeletonPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.9; }
}

.land {
  fill: #1a2035;
  stroke: none;
}

.flight-path {
  fill: none;
  stroke: #22d3ee;
  stroke-width: 1;
  stroke-dasharray: 6 4;
  opacity: 0.14;
}

.marker-dot {
  fill: #22d3ee;
  cursor: pointer;
  filter: drop-shadow(0 0 3px rgba(34, 211, 238, 0.6));
}

.marker-glow {
  fill: #22d3ee;
  opacity: 0.12;
  pointer-events: none;
}

.marker-pulse {
  fill: none;
  stroke: #22d3ee;
  stroke-width: 0.8;
  opacity: 0;
  pointer-events: none;
}

.home-marker .marker-pulse {
  animation: svgPulse 2.5s infinite;
}

.home-marker .marker-glow {
  opacity: 0.2;
  animation: svgGlowPulse 2s infinite;
}

@keyframes svgPulse {
  0% { r: 4; opacity: 0.5; }
  100% { r: 12; opacity: 0; }
}

@keyframes svgGlowPulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.08; }
}


/* ==========================================================================
   GLASS TOOLTIP (inside dark map card)
   ========================================================================== */

.glass-tooltip {
  position: absolute;
  z-index: 10;
  background: rgba(10, 15, 30, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 12px;
  padding: 0.875rem 1.1rem;
  color: #fff;
  max-width: 280px;
  pointer-events: none;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(34, 211, 238, 0.06);
  transition: opacity 0.2s;
}

.glass-tooltip .tooltip-location {
  font-size: 0.95rem;
  font-weight: 700;
  color: #22d3ee;
  margin-bottom: 0.2rem;
}

.glass-tooltip .tooltip-insight-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #2dd4bf;
  margin-bottom: 0.3rem;
}

.glass-tooltip .tooltip-insight-text {
  font-size: 0.78rem;
  color: #9ca3af;
  line-height: 1.55;
}


/* ==========================================================================
   PASSPORT SIDEBAR (light theme, inside white .bento-card)
   ========================================================================== */

.passport-card::-webkit-scrollbar {
  width: 3px;
}

.passport-card::-webkit-scrollbar-track {
  background: transparent;
}

.passport-card::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.location-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.15rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 0.8rem;
  color: #6b7280;
  border-left: 2px solid transparent;
}

.location-item:hover {
  background: #f9fafb;
  color: #374151;
}

.location-item:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: -2px;
  background: #f9fafb;
  color: #374151;
}

.location-item.active {
  background: #f0fdfa;
  color: #0f766e;
  border-left-color: #0d9488;
}

.location-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0d9488;
  box-shadow: 0 0 4px rgba(13, 148, 136, 0.35);
  flex-shrink: 0;
}

.location-name {
  font-weight: 600;
  color: #374151;
  font-size: 0.76rem;
}

.location-insight-label {
  font-size: 0.67rem;
  color: #0d9488;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 0.15rem;
}

.location-cities {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-top: 0.1rem;
  line-height: 1.4;
}


/* ==========================================================================
   NAV ACTIVE STATE
   ========================================================================== */

.nav-link.nav-active {
  color: #111827 !important;
  background: rgba(0, 0, 0, 0.07);
  border-radius: 9999px;
}


/* ==========================================================================
   GLOBAL FOCUS VISIBLE
   ========================================================================== */

:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
}


/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 640px) {
  .hero-name {
    /* On small screens, disable the gradient to ensure legibility */
    background: none;
    -webkit-background-clip: unset;
    color: #111827;
    -webkit-text-fill-color: #111827;
    background-clip: unset;
    letter-spacing: -0.04em;
  }

  html.dark .hero-name {
    color: #f9fafb;
    -webkit-text-fill-color: #f9fafb;
  }

  .fact-row {
    flex-direction: column;
    gap: 0.2rem;
  }

  .fact-number {
    width: auto;
    font-size: 2rem;
  }

  .adventure-overlay {
    padding-bottom: 1.5rem;
  }
}

@media (max-width: 768px) {
  .bento-card {
    border-radius: 16px;
  }

  .photo-block {
    border-radius: 16px;
  }

  .map-outer-card {
    border-radius: 16px;
  }
}


/* ==========================================================================
   TERMINAL COMPONENT
   ========================================================================== */

.terminal-card {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 12px;
  overflow: hidden;
  max-width: 520px;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Cascadia Code', 'Courier New', monospace;
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.9rem;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  gap: 0.5rem;
}

.terminal-dots {
  display: flex;
  gap: 0.35rem;
}

.terminal-dots span {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dots span:nth-child(1) { background: #ff5f56; }
.terminal-dots span:nth-child(2) { background: #ffbd2e; }
.terminal-dots span:nth-child(3) { background: #27c93f; }

.terminal-filename {
  font-size: 0.67rem;
  color: #6b7280;
  margin: 0 auto;
  letter-spacing: 0.02em;
}

.terminal-body {
  padding: 0.875rem 1.1rem 1rem;
  font-size: 0.775rem;
  line-height: 1.6;
  min-height: 2.5rem;
}

.terminal-prompt-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.terminal-dollar {
  color: #0d9488;
  font-weight: 700;
  flex-shrink: 0;
  user-select: none;
}

.terminal-cmd-text {
  color: #e6edf3;
}

.terminal-caret {
  display: inline-block;
  width: 7px;
  height: 0.9em;
  background: #22d3ee;
  vertical-align: text-bottom;
  animation: caretBlink 1s step-end infinite;
  margin-left: 1px;
}

.terminal-caret.no-blink {
  animation: none;
  opacity: 1;
}

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

.terminal-output {
  margin-top: 0.1rem;
}

.terminal-output-line {
  font-size: 0.775rem;
  line-height: 1.7;
  white-space: pre;
}

.terminal-line-dim   { color: #6b7280; }
.terminal-line-ok    { color: #22c55e; }
.terminal-line-accent { color: #22d3ee; font-weight: 600; }


/* ==========================================================================
   THREE PILLARS
   ========================================================================== */

.pillar-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.pillar-icon-saas      { background: #eff6ff; border: 1px solid #bfdbfe; color: #2563eb; }
.pillar-icon-ai        { background: #f0fdfa; border: 1px solid #ccfbf1; color: #0d9488; }
.pillar-icon-community { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }

.pillar-bullet {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #4b5563;
}

.pillar-bullet-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* ==========================================================================
   CHIP INTERACTIVE TILT
   ========================================================================== */

.chip-interactive {
  transition: transform 0.12s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  cursor: default;
  user-select: none;
}

.chip-interactive:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


/* ==========================================================================
   GIT LOG TIMELINE
   ========================================================================== */

.gitlog-card {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 20px;
  overflow: hidden;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
}

.gitlog-titlebar {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.9rem;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  gap: 0.75rem;
}

.gitlog-title {
  font-size: 0.67rem;
  color: #6b7280;
  letter-spacing: 0.02em;
}

.gitlog-body {
  padding: 1.75rem 1.5rem 1.5rem;
}

.gitlog-commit {
  display: flex;
  gap: 1rem;
  cursor: pointer;
  padding: 0.85rem 0.75rem;
  border-radius: 10px;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.15s ease;
}

.gitlog-commit.gl-visible {
  opacity: 1;
  transform: translateX(0);
}

.gitlog-commit:hover {
  background: rgba(255, 255, 255, 0.04);
}

.gitlog-graph-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 14px;
  padding-top: 0.1rem;
}

.gitlog-star {
  color: #22d3ee;
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
}

.gitlog-vline {
  width: 1px;
  flex: 1;
  background: #30363d;
  min-height: 1.25rem;
  margin-top: 0.3rem;
}

.gitlog-content {
  flex: 1;
  min-width: 0;
}

.gitlog-header-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gitlog-hash {
  font-size: 0.78rem;
  color: #f0a050;
  flex-shrink: 0;
  font-weight: 600;
}

.gitlog-tag {
  font-size: 0.68rem;
  padding: 0.18rem 0.5rem;
  border-radius: 5px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.gitlog-tag-head {
  background: rgba(34, 211, 238, 0.1);
  color: #22d3ee;
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.gitlog-msg {
  font-size: 0.95rem;
  color: #f3f6fa;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.gitlog-meta-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.gitlog-author { font-size: 0.74rem; color: #9ca3af; }
.gitlog-date   { font-size: 0.74rem; color: #6b7280; }

.gitlog-company {
  font-size: 0.74rem;
  color: #2dd4bf;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.gitlog-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease, margin-top 0.3s ease;
  overflow: hidden;
}

.gitlog-detail.open {
  grid-template-rows: 1fr;
  margin-top: 0.5rem;
}

.gitlog-detail-inner {
  min-height: 0;
}

.gitlog-detail-inner p {
  font-family: Inter, -apple-system, sans-serif;
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.7;
  padding: 0.25rem 0 0.5rem 0;
}


/* ==========================================================================
   API RESPONSE CARD
   ========================================================================== */

.api-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  overflow: hidden;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  /* Critical: in a grid, min-width defaults to auto (content-based). This
     causes the long monospace JSON lines to push the parent wider than the
     viewport on mobile. Force shrinking. */
  min-width: 0;
}

@media (max-width: 640px) {
  .api-body { padding: 0.7rem 0.85rem 0.8rem; }
  .api-line { font-size: 0.68rem; line-height: 1.85; }
  .api-field { padding-left: 0.9rem; }
  .api-endpoint { font-size: 0.65rem; }
}

.api-titlebar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.api-method {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.2);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}

.api-endpoint {
  font-size: 0.72rem;
  color: #e6edf3;
  flex: 1;
}

.api-status-ok {
  font-size: 0.65rem;
  font-weight: 700;
  color: #22c55e;
}

.api-body {
  padding: 0.9rem 1.1rem 1rem;
}

.api-line {
  font-size: 0.75rem;
  line-height: 1.9;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.api-line.al-visible {
  opacity: 1;
}

.api-field { padding-left: 1.1rem; }

.api-brace  { color: #e6edf3; }
.api-key    { color: #7dd3fc; }
.api-colon  { color: #e6edf3; margin: 0 0.2rem; }
.api-string { color: #86efac; }
.api-comma  { color: #4b5563; }

.api-link {
  color: #86efac;
  text-decoration: none;
  border-bottom: 1px solid rgba(134, 239, 172, 0.3);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.api-link:hover {
  color: #22d3ee;
  border-bottom-color: rgba(34, 211, 238, 0.4);
}

.api-status-val {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.api-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulseDot 2.2s ease-in-out infinite;
  flex-shrink: 0;
  vertical-align: middle;
}


/* ==========================================================================
   COMPANY LOGOS STRIP
   ========================================================================== */

.logos-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9ca3af;
  text-align: center;
  margin-bottom: 1rem;
  padding: 0 1rem;
}

/* Marquee container — overflow hidden + edge fade */
.logos-strip {
  overflow: hidden;
  padding: 0.5rem 0;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

/* The scrolling track — duplicated logos for seamless loop */
.logos-track {
  display: flex;
  align-items: center;
  gap: 4rem;
  width: max-content;
  animation: logos-marquee 28s linear infinite;
}

@media (hover: hover) {
  .logos-track:hover { animation-play-state: paused; }
}

@keyframes logos-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .logos-track { animation: none; }
}

.logo-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0 1.5rem;
}

.logo-img {
  height: 36px;
  width: auto;
  max-width: 180px;
  display: block;
  opacity: 0.82;
  transition: opacity 0.2s ease;
}

.logo-item:hover .logo-img { opacity: 1; }


/* ==========================================================================
   TESTIMONIALS
   ========================================================================== */

.testimonial-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.07);
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 99px;
  padding: 0.25rem 0.7rem;
  margin-bottom: 1.1rem;
}

.testimonial-quote {
  position: relative;
  padding-top: 0.25rem;
  margin-bottom: 0;
}

.testimonial-mark {
  display: block;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 3.5rem;
  line-height: 0.6;
  color: #e5e7eb;
  margin-bottom: 0.5rem;
  user-select: none;
}

.testimonial-text {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #374151;
}

.testimonial-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(229, 231, 235, 0.9);
}

.testimonial-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.testimonial-role {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.15rem;
}

.testimonial-linkedin {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  color: #9ca3af;
  background: transparent;
  transition: color 0.2s ease, background 0.2s ease;
}

.testimonial-linkedin:hover {
  color: #0a66c2;
  background: rgba(10, 102, 194, 0.08);
}

/* Dark mode */
html.dark .testimonial-tag {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.2);
}

html.dark .testimonial-mark { color: rgba(255, 255, 255, 0.07); }

html.dark .testimonial-text { color: #d1d5db; }

html.dark .testimonial-footer { border-top-color: rgba(255, 255, 255, 0.07); }

html.dark .testimonial-name { color: #f9fafb; }

html.dark .testimonial-role { color: #9ca3af; }

html.dark .testimonial-linkedin { color: #6b7280; }

html.dark .testimonial-linkedin:hover {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
}


/* ==========================================================================
   THEME TOGGLE BUTTON
   ========================================================================== */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  margin: 0 0.15rem;
  color: #6b7280;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

/* On touch devices the button needs a 44px tap target.
   Keep the visual size but expand the hit area via a transparent ::before. */
@media (hover: none) and (pointer: coarse) {
  .theme-toggle { position: relative; }
  .theme-toggle::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: inherit;
  }
  #mobile-toggle { position: relative; }
  #mobile-toggle::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 9999px;
  }
  .social-link { position: relative; }
  .social-link::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: inherit;
  }
}

.theme-toggle:hover {
  background: rgba(229, 231, 235, 0.6);
  color: #111827;
}

.theme-toggle:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
}

/* Icon convention: the visible icon represents the action, not current state.
   - Light mode → show MOON (click to go dark)
   - Dark mode  → show SUN  (click to go light) */
.theme-toggle .theme-icon-moon { display: block; }
.theme-toggle .theme-icon-sun  { display: none; }

html.dark .theme-toggle .theme-icon-moon { display: none; }
html.dark .theme-toggle .theme-icon-sun  { display: block; }


/* ==========================================================================
   DARK MODE
   Comprehensive overrides for the light-themed components.
   The map card, terminal, gitlog, contact block, dark CTA card, and adventure
   break are already dark — they get small accent tweaks only.
   ========================================================================== */

html.dark {
  color-scheme: dark;
}

html.dark body {
  background: #0a0e1a !important;
  color: #d1d5db;
}

/* Floating nav */
html.dark nav[aria-label="Main navigation"] > div {
  background: rgba(17, 24, 39, 0.65);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 32px rgb(0 0 0 / 0.4);
}

html.dark .nav-link {
  color: #9ca3af !important;
}

html.dark .nav-link:hover {
  color: #f9fafb !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

html.dark .nav-link.nav-active {
  color: #f9fafb !important;
  background: rgba(255, 255, 255, 0.08);
}

html.dark nav a[href="#"][class*="font-black"] { color: #f9fafb; }

/* The "HS." logo in the nav */
html.dark nav .text-\[\#111827\] { color: #f9fafb !important; }

/* "Get in Touch" pill */
html.dark nav a[href="#contact"] {
  background: #f9fafb !important;
  color: #0a0e1a !important;
}

html.dark nav a[href="#contact"]:hover {
  background: #e5e7eb !important;
}

/* Mobile menu */
html.dark #mobile-menu {
  background: rgba(17, 24, 39, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark .mobile-nav-link {
  color: #9ca3af !important;
}

html.dark .mobile-nav-link:hover {
  color: #f9fafb !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

/* Theme toggle in dark */
html.dark .theme-toggle { color: #d1d5db; }
html.dark .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Default light bento card -> dark glassy card */
html.dark .bento-card {
  background: rgba(31, 41, 55, 0.55);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.4),
    0 4px 16px rgb(0 0 0 / 0.25);
}

html.dark .bento-card:hover {
  border-color: rgba(45, 212, 191, 0.25);
  box-shadow:
    0 8px 32px rgb(0 0 0 / 0.5),
    0 2px 8px rgb(0 0 0 / 0.3);
}

/* Mission primary card */
html.dark .mission-card-primary.bento-card {
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.6) 0%, rgba(13, 148, 136, 0.08) 100%);
  border-color: rgba(45, 212, 191, 0.15);
}

/* Accent (mission pull quote) card */
html.dark .bento-card.bento-card-accent {
  background: rgba(13, 148, 136, 0.08);
  border-color: rgba(45, 212, 191, 0.2);
}

/* The dark cards (already dark) get a subtle border tweak */
html.dark .bento-card.bento-card-dark {
  background: #0f1422;
  border-color: rgba(255, 255, 255, 0.06);
}

/* Photo block */
html.dark .photo-block {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.08);
}

/* Hero name gradient */
html.dark .hero-name {
  background: linear-gradient(135deg, #f9fafb 60%, #9ca3af 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Fact rows */
html.dark .fact-number { color: #f9fafb; }
html.dark .fact-label  { color: #9ca3af; }
html.dark .fact-row + div, /* divider */
html.dark .w-full.h-px.bg-\[\#e5e7eb\] {
  background: rgba(255, 255, 255, 0.07) !important;
}

/* Common text colors used inline */
html.dark .text-\[\#111827\] { color: #f9fafb !important; }
html.dark .text-\[\#374151\] { color: #d1d5db !important; }
html.dark .text-\[\#6b7280\] { color: #9ca3af !important; }
html.dark .text-\[\#9ca3af\] { color: #6b7280 !important; }

/* Common bg colors used inline */
html.dark .bg-\[\#f8f9fa\] { background: #0a0e1a !important; }
html.dark .bg-\[#f9fafb\] { background: #0a0e1a !important; }
html.dark .bg-\[\#fafafa\] { background: rgba(31, 41, 55, 0.4) !important; }
html.dark .border-\[\#e5e7eb\] { border-color: rgba(255, 255, 255, 0.08) !important; }
html.dark .border-\[\#f3f4f6\] { border-color: rgba(255, 255, 255, 0.06) !important; }

/* Footer */
html.dark footer { border-top-color: rgba(255, 255, 255, 0.06) !important; }
html.dark footer p { color: #6b7280; }

/* Chips */
html.dark .chip-default {
  background: rgba(255, 255, 255, 0.04);
  color: #9ca3af;
  border-color: rgba(255, 255, 255, 0.08);
}

html.dark .chip-blue {
  background: rgba(13, 148, 136, 0.12);
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.25);
}

/* Social links */
html.dark .social-link {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: #d1d5db;
}

html.dark .social-link:hover {
  background: #f9fafb;
  color: #0a0e1a;
  border-color: #f9fafb;
}

/* Pillar icons - keep but tone for dark */
html.dark .pillar-icon-saas      { background: rgba(37, 99, 235, 0.12); border-color: rgba(96, 165, 250, 0.25); color: #93c5fd; }
html.dark .pillar-icon-ai        { background: rgba(13, 148, 136, 0.12); border-color: rgba(45, 212, 191, 0.25); color: #5eead4; }
html.dark .pillar-icon-community { background: rgba(22, 163, 74, 0.12); border-color: rgba(74, 222, 128, 0.25); color: #86efac; }

html.dark .pillar-bullet { color: #9ca3af; }

/* Project card icon backgrounds — dim the pastel tints in dark mode */
html.dark .bg-rose-50    { background: rgba(244, 63, 94, 0.1) !important; }
html.dark .bg-amber-50   { background: rgba(245, 158, 11, 0.1) !important; }
html.dark .bg-orange-50  { background: rgba(249, 115, 22, 0.1) !important; }
html.dark .bg-sky-50     { background: rgba(14, 165, 233, 0.1) !important; }
html.dark .bg-purple-50  { background: rgba(168, 85, 247, 0.1) !important; }
html.dark .bg-violet-50  { background: rgba(139, 92, 246, 0.1) !important; }
html.dark .bg-teal-50    { background: rgba(13, 148, 136, 0.12) !important; }
html.dark .bg-emerald-50 { background: rgba(16, 185, 129, 0.12) !important; }
html.dark .bg-\[\#fdf2f2\] { background: rgba(220, 38, 38, 0.1) !important; }

html.dark .border-rose-100    { border-color: rgba(244, 63, 94, 0.25) !important; }
html.dark .border-amber-100   { border-color: rgba(245, 158, 11, 0.25) !important; }
html.dark .border-orange-100  { border-color: rgba(249, 115, 22, 0.25) !important; }
html.dark .border-sky-100     { border-color: rgba(14, 165, 233, 0.25) !important; }
html.dark .border-purple-100  { border-color: rgba(168, 85, 247, 0.25) !important; }
html.dark .border-violet-100  { border-color: rgba(139, 92, 246, 0.25) !important; }
html.dark .border-teal-100    { border-color: rgba(13, 148, 136, 0.3) !important; }
html.dark .border-emerald-100 { border-color: rgba(16, 185, 129, 0.3) !important; }
html.dark .border-\[\#fde8e8\] { border-color: rgba(220, 38, 38, 0.25) !important; }

/* Mission stat boxes */
html.dark .bg-white\/50 { background: rgba(255, 255, 255, 0.04) !important; }
html.dark .border-white\/40 { border-color: rgba(255, 255, 255, 0.08) !important; }

/* Adventure break */
html.dark .adventure-overlay {
  background: linear-gradient(
    to top,
    rgb(0 0 0 / 0.78) 0%,
    rgb(0 0 0 / 0.4) 40%,
    rgb(0 0 0 / 0.15) 80%,
    transparent 100%
  );
}

/* Logo strip */
html.dark .logos-eyebrow { color: #6b7280; }

html.dark .logo-img { opacity: 0.7; }
html.dark .logo-item:hover .logo-img { opacity: 1; }

/* Passport sidebar */
html.dark .location-item { color: #9ca3af; }

html.dark .location-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #d1d5db;
}

html.dark .location-item.active {
  background: rgba(13, 148, 136, 0.12);
  color: #5eead4;
  border-left-color: #2dd4bf;
}

html.dark .location-name { color: #d1d5db; }
html.dark .location-cities { color: #6b7280; }

html.dark .passport-card::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

/* Resume input */
html.dark #resume-contact {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}


/* ==========================================================================
   PREFERS-REDUCED-MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .pulse-dot,
  .marker-pulse,
  .home-marker .marker-glow,
  #map-container .map-skeleton,
  .terminal-caret,
  .api-status-dot {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .bento-card,
  .contact-btn-primary,
  .contact-btn-secondary,
  .social-link,
  .chip-interactive,
  .gitlog-commit,
  .gitlog-detail,
  .api-line {
    transition: none;
  }

  .gitlog-commit {
    opacity: 1;
    transform: none;
  }

  .api-line {
    opacity: 1;
  }

  .bento-card:hover,
  .contact-btn-primary:hover,
  .contact-btn-secondary:hover,
  .chip-interactive:hover {
    transform: none;
  }
}
