/* components.css — Shared component styles */

/* Nav Capsule */
.nav-capsule {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  z-index: 1000;
  view-transition-name: nav-capsule;

  background-color: rgba(10, 14, 20, 0.5);
  /* More opaque */
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 0 -1px 1px rgba(0, 0, 0, 0.4),
    0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Dynamic Spotlight Ambient Glow */
.nav-capsule::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(140px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(232, 255, 0, 0.08),
      transparent 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
}

/* Dynamic Fiber-Optic Border Glow */
.nav-capsule::after {
  content: "";
  position: absolute;
  inset: -1px;
  /* Overlap existing border */
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(100px circle at var(--mouse-x, 50%) var(--mouse-y, 100%),
      rgba(232, 255, 0, 0.6),
      transparent 100%);
  -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.5s ease;
  z-index: 1;
}

.nav-capsule:hover::before,
.nav-capsule:hover::after {
  opacity: 1;
}

/* Ensure contents sit above the glows */
.nav-brand,
.nav-links,
.nav-cmd-trigger {
  position: relative;
  z-index: 2;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-bright);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
  display: inline-block;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 4px var(--accent);
  }

  50% {
    opacity: 0.3;
    box-shadow: 0 0 0 transparent;
  }
}

.nav-links {
  display: flex;
  gap: 1rem;
  position: relative;
  /* For absolute positioning of the active indicator */
}

.nav-link {
  font-family: var(--font-mono);
  font-size: var(--font-size-min);
  text-transform: uppercase;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  transition: color 0.3s cubic-bezier(0.32, 0.72, 0, 1), transform 0.15s ease;
  position: relative;
}

.nav-link.active .nav-link-index,
.nav-link:hover .nav-link-index {
  color: var(--accent);
}

.nav-link.active .nav-text,
.nav-link:hover .nav-text {
  color: var(--text-bright);
}

.nav-link.active {
  text-shadow: 0 0 10px rgba(232, 255, 0, 0.3);
}

.nav-link:active {
  transform: scale(0.95);
}

.nav-cmd-trigger {
  font-family: var(--font-body);
  font-size: var(--font-size-min);
  background: rgba(232, 255, 0, 0.03);
  border: 1px solid rgba(232, 255, 0, 0.15);
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  color: var(--text-bright);
  transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-cmd-trigger:hover {
  border-color: rgba(232, 255, 0, 0.4);
  background: rgba(232, 255, 0, 0.08);
  color: var(--accent);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 0 12px rgba(232, 255, 0, 0.15);
}

.nav-cmd-trigger:active {
  transform: scale(0.95);
}

/* Nav Capsule Mobile - Swipeable Tab Bar */
@media (max-width: 768px) {
  .nav-capsule {
    top: 1rem;
    width: calc(100% - 2rem);
    max-width: 400px;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    gap: 0.5rem;
    justify-content: space-between;
  }

  .nav-brand {
    display: none; /* Hide logo on small screens to save space */
  }

  .nav-links {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; /* Momentum scrolling */
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Fade edges for swipe indication */
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    scroll-snap-align: start;
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
  }
  
  .nav-cmd-trigger {
    flex-shrink: 0;
  }
}

/* Command Palette (Glass modal overlay) */
.command-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 12, 0.8);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.command-palette-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.command-palette {
  width: 100%;
  max-width: 600px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cmd-input-wrapper {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--dim);
  /* Tactile: Inner recessed shadow and slight gradient */
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.1) 100%);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.5);
}

.cmd-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  padding: 1rem 0.5rem;
  outline: none;
}

.cmd-results {
  max-height: 40vh;
  overflow-y: auto;
  padding: 1rem 0;
  scrollbar-width: none;
}

.cmd-results::-webkit-scrollbar {
  display: none;
}

.cmd-group {
  margin-bottom: 1rem;
}

.cmd-group-label {
  font-family: var(--font-mono);
  font-size: var(--font-size-min);
  color: var(--muted);
  padding: 0 1.5rem 0.5rem;
  text-transform: uppercase;
}

.cmd-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--text);
  font-family: var(--font-body);
  cursor: pointer;
  border-left: 2px solid transparent;
}

.cmd-item:hover,
.cmd-item.selected {
  background-color: rgba(232, 255, 0, 0.08);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
  border-left-color: var(--accent);
  color: var(--text-bright);
  /* Tactile highlight */
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

/* Tag Pills & Cert Badges */
.tag-pill,
.cert-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--dim);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: var(--font-size-min);
  color: var(--text);
  background: rgba(13, 17, 23, 0.3);
  transition: border-color 0.2s ease, color 0.2s ease;
}

@media (hover: hover) {

  .tag-pill:hover,
  .cert-badge:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
}

/* Project Hover-Cards */
.hover-card-preview {
  position: absolute;
  z-index: 50;
  padding: 1.5rem;
  border-radius: 8px;
  width: 300px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-card-preview.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {

  .hover-card-preview,
  .hover-card-preview.active {
    transition: none;
  }

  .command-palette-overlay {
    transition: none;
  }
}

/* Cursor System */
@media (pointer: fine) {

  body.custom-cursor,
  body.custom-cursor *:not(input):not(textarea),
  ::view-transition,
  ::view-transition-group(*),
  ::view-transition-image-pair(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    cursor: none !important;
  }

  .cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background-color: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
  }

  .cursor-brackets {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    transition: width 0.15s ease, height 0.15s ease, opacity 0.15s ease, transform 0.1s;
  }

  .cursor-brackets::before,
  .cursor-brackets::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: var(--accent);
    border-style: solid;
  }

  /* Top-left & Bottom-left */
  .cursor-brackets::before {
    top: 0;
    left: 0;
    border-width: 1px 0 0 1px;
  }

  /* Top-right & Bottom-right */
  .cursor-brackets::after {
    bottom: 0;
    right: 0;
    border-width: 0 1px 1px 0;
  }

  .cursor-brackets.active {
    opacity: 1;
  }
}

/* Reduced motion disables cursor smoothing transitions */
@media (prefers-reduced-motion: reduce) {
  .cursor-brackets {
    transition: none !important;
  }
}

/* Anti-FOUC for GSAP High-End Entrance Animations */
@media (prefers-reduced-motion: no-preference) {

  .about-bio-section,
  .about-skills-section,
  .about-tags-section,
  .about-certs-section,
  .about-education-section,
  .tags-wrap .tag-pill,
  .cert-card-wrapper,
  .projects-header,
  .project-card-wrapper,
  .labs-stat-item,
  .platform-card-wrapper,
  .labs-writeups-section,
  .contact-badge,
  .contact-statement,
  .contact-card-wrapper,
  #cta-eyebrow,
  #cta-heading,
  #cta-description,
  .cta-card-wrapper,
  .page-header {
    visibility: hidden;
    opacity: 0;
  }
}


/* Eyebrow Tags (High-End Scale) */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(232, 255, 0, 0.2);
  border-radius: 100px;
  background: rgba(232, 255, 0, 0.05);
  margin-bottom: 0.5rem;
}

.header-title-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}