/* ============================================
   Tokens
   ============================================ */
:root {
  --white: #FFFFFF;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;

  --text: #111827;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;

  --accent: #3B82F6;
  --accent-light: rgba(59, 130, 246, 0.08);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --page-padding: clamp(1.5rem, 5vw, 4rem);
  --max-width: 1100px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --radius: 12px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ============================================
   Layout
   ============================================ */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem var(--page-padding);
}

.section-heading {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 2.5rem;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem var(--page-padding);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}

.nav-logo {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

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

.nav-links a:hover {
  color: var(--text);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6rem var(--page-padding) 4rem;
}

.hero-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 480px;
}

.hero-links {
  display: flex;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ============================================
   Hero — 3D Robotic Hand
   ============================================ */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hand-3d-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1 / 1;
  cursor: grab;
}

.hand-3d-container:active {
  cursor: grabbing;
}

#hero-canvas {
  width: 100%;
  height: 100%;
  display: block;
}


/* ============================================
   S.E.S.H. Glove — Layer Jamming Animation
   ============================================ */
.sesh-visual {
  width: 100%;
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.jammer-svg {
  width: 100%;
  max-width: 420px;
}

.jlayer {
  fill: #D1D5DB;
}

.jl1 { animation: jSlide 6s ease-in-out infinite; }
.jl2 { animation: jSlide 6s ease-in-out infinite 0.12s; }
.jl3 { animation: jSlide 6s ease-in-out infinite 0.24s; }
.jl4 { animation: jSlide 6s ease-in-out infinite 0.36s; }
.jl5 { animation: jSlide 6s ease-in-out infinite 0.48s; }
.jl6 { animation: jSlide 6s ease-in-out infinite 0.6s; }
.jl7 { animation: jSlide 6s ease-in-out infinite 0.72s; }
.jl8 { animation: jSlide 6s ease-in-out infinite 0.84s; }

@keyframes jSlide {
  0%, 100% { transform: translateX(0); fill: #D1D5DB; }
  25% { transform: translateX(6px); fill: #D1D5DB; }
  50% { transform: translateX(0); fill: #3B82F6; }
  75% { transform: translateX(-4px); fill: #D1D5DB; }
}

.jforce {
  animation: jForceBob 6s ease-in-out infinite;
}

@keyframes jForceBob {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  45%, 55% { opacity: 1; transform: translateY(3px); }
}

.jvac {
  animation: jVacPulse 6s ease-in-out infinite;
}

@keyframes jVacPulse {
  0%, 30%, 70%, 100% { stroke: #D1D5DB; }
  45%, 55% { stroke: #3B82F6; fill: rgba(59,130,246,0.1); }
}

/* ============================================
   Placeholders (for project images)
   ============================================ */
.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-tertiary);
  overflow: hidden;
}

.placeholder-icon {
  width: 64px;
  height: 64px;
}

.placeholder-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  padding: 0 1rem;
}

.placeholder--media {
  width: 100%;
  aspect-ratio: 16 / 10;
}

.placeholder--thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  margin-bottom: 1rem;
}

.placeholder--portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-width: 300px;
}

/* ============================================
   BeatRite — Data Pipeline Visual
   ============================================ */
.beatrite-visual {
  width: 100%;
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.beatrite-svg {
  width: 100%;
  max-width: 420px;
}

.ble-wave1 {
  animation: blePulse 2s ease-in-out infinite;
}

.ble-wave2 {
  animation: blePulse 2s ease-in-out infinite 0.3s;
}

@keyframes blePulse {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.6; }
}

/* ============================================
   SVG Thumb for Project Cards
   ============================================ */
.svg-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.75rem;
}

.svg-thumb svg {
  width: 100%;
  height: 100%;
}

/* ============================================
   Card Image Thumb
   ============================================ */
.card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}

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

/* ECG line draw animation */
.ecg-line {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: draw 2.5s linear infinite;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

/* ============================================
   Featured Projects
   ============================================ */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.featured-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.featured-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.featured-card-body {
  padding: 1.5rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.featured-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
}

.featured-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stat {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.stat-val {
  font-weight: 700;
  color: var(--text);
  margin-right: 0.25rem;
}

/* ============================================
   Project Grid
   ============================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.project-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   About
   ============================================ */
.section--about {
  border-top: 1px solid var(--border-light);
}

.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
}

.about-photo .headshot {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.about-lead {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.about-text p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.about-details {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
}

.detail {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--border-light);
  font-size: 0.875rem;
}

.detail-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem var(--page-padding);
  border-top: 1px solid var(--border-light);
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

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

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 8rem;
  }

  .hero-visual {
    display: none;
  }

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

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

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

  .about-photo {
    max-width: 240px;
  }
}

/* ============================================
   Project Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.modal-content {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  transform: translateY(16px);
  transition: transform 0.25s var(--ease);
}

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

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.modal-images {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
}

.modal-images:empty {
  display: none;
}

.modal-images img {
  flex: 0 0 auto;
  width: 80%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius);
  scroll-snap-align: start;
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-images img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-images img:only-child {
  width: auto;
  max-width: 100%;
  max-height: 450px;
  object-fit: contain;
  margin: 0 auto;
}

/* ============================================
   Image Lightbox
   ============================================ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: zoom-out;
}

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

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.lightbox-overlay.active .lightbox-content {
  transform: scale(1);
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  padding: 0.5rem;
  line-height: 1;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 1rem 0.75rem;
  border-radius: 8px;
  opacity: 0.7;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.lightbox-nav:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
  left: -60px;
}

.lightbox-next {
  right: -60px;
}

.lightbox-counter {
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  .lightbox-nav {
    display: none;
  }

  .lightbox-content img {
    max-width: 95vw;
    max-height: 80vh;
  }
}

.modal-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.modal-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 0.75rem;
  padding-right: 2.5rem;
}

.modal-description {
  margin-bottom: 1.5rem;
}

.modal-description:empty {
  display: none;
}

.modal-skills-label,
.modal-links-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 0.625rem;
}

.modal-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1.5rem;
}

.modal-skill {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
}

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

body.modal-open {
  overflow: hidden;
}

/* ============================================
   Modal Sections (Structured Project Content)
   ============================================ */
.modal-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.modal-section h4 {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 0.625rem;
}

.modal-section p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.modal-section blockquote {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.7;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
}

.modal-section ul {
  list-style: none;
  padding: 0;
}

.modal-section li {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 1.25rem;
  position: relative;
}

.modal-section li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Modal Stats Grid */
.modal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
}

.modal-stat-box {
  background: var(--accent-light);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  text-align: center;
}

.modal-stat-box .stat-value {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.modal-stat-box .stat-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

/* Modal Diagram Container */
.modal-diagram {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
}

.modal-diagram svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 120px;
}

/* Modal Images Grid */
.modal-section .modal-img {
  width: 100%;
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

/* Modal Comparison Table */
.modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.modal-table th,
.modal-table td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.modal-table th {
  font-weight: 600;
  color: var(--text);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-table td {
  color: var(--text-secondary);
}

.modal-table tr:last-child td {
  border-bottom: none;
}

.modal-table .highlight {
  color: var(--accent);
  font-weight: 600;
}

.featured-card,
.project-card {
  cursor: pointer;
}

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

  .footer {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

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

/* ============================================
   Skills Constellation
   ============================================ */

/* Skill Search */
.skill-search-container {
  position: relative;
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

.skill-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-left: 2.5rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.875rem center;
}

.skill-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.skill-search-input::placeholder {
  color: var(--text-tertiary);
}

.skill-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 280px;
  overflow-y: auto;
  z-index: 20;
  display: none;
}

.skill-search-results.visible {
  display: block;
}

.skill-search-result {
  padding: 0.625rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  transition: background 0.15s ease;
}

.skill-search-result:hover,
.skill-search-result.highlighted {
  background: var(--accent-light);
}

.skill-search-result-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skill-search-result-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.skill-search-result-name mark {
  background: transparent;
  color: var(--accent);
  font-weight: 600;
}

.skill-search-result-domain {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  margin-left: auto;
}

.skill-search-result-projects {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.skill-search-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.skill-search-hint {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

.constellation-container {
  position: relative;
  width: 100%;
  height: 500px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

#skill-constellation {
  width: 100%;
  height: 100%;
  display: block;
}

/* Constellation nodes */
.constellation-node {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.constellation-node circle {
  transition: r 0.2s ease, stroke-width 0.2s ease;
}

.constellation-node:hover circle {
  stroke-width: 3px;
}

.constellation-node.dimmed {
  opacity: 0.15;
}

.constellation-node.highlighted circle {
  stroke-width: 3px;
}

.constellation-node.selected circle {
  stroke-width: 4px;
  stroke: var(--text);
}

/* Constellation links */
.constellation-link {
  stroke: var(--border);
  stroke-opacity: 0.4;
  transition: stroke-opacity 0.2s ease, stroke-width 0.2s ease;
}

.constellation-link.dimmed {
  stroke-opacity: 0.05;
}

.constellation-link.highlighted {
  stroke-opacity: 0.8;
  stroke-width: 2px;
}

/* Constellation labels */
.constellation-label {
  font-size: 0.6875rem;
  font-weight: 500;
  fill: var(--text);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-anchor: middle;
}

.constellation-label.visible {
  opacity: 1;
}

/* Constellation tooltip */
.constellation-tooltip {
  position: absolute;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
  max-width: 280px;
}

.constellation-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.constellation-tooltip-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.constellation-tooltip-domain {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.constellation-tooltip-section {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

.constellation-tooltip-section:first-of-type {
  margin-top: 0.375rem;
}

.constellation-tooltip-section-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
}

.constellation-tooltip-classes {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.constellation-tooltip-projects {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.constellation-tooltip-projects span {
  display: block;
  padding: 0.125rem 0;
}

.constellation-tooltip-project-link {
  cursor: pointer;
  transition: color 0.15s ease;
}

.constellation-tooltip-project-link:hover {
  color: var(--accent);
}

/* Constellation legend */
.constellation-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Project card highlighting when skill selected */
.project-card.skill-match,
.featured-card.skill-match {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.project-card.skill-dimmed,
.featured-card.skill-dimmed {
  opacity: 0.35;
}

/* Mobile fallback - skill badges grouped by domain (accordion) */
.skills-mobile-fallback {
  display: none;
}

.skills-mobile-group {
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.skills-mobile-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--white);
  cursor: pointer;
  transition: background 0.15s ease;
}

.skills-mobile-group-header:active {
  background: var(--bg);
}

.skills-mobile-group-title {
  font-size: 0.8125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
}

.skills-mobile-group-title::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skills-mobile-group[data-domain="hardware"] .skills-mobile-group-title::before { background: #10B981; }
.skills-mobile-group[data-domain="electrical"] .skills-mobile-group-title::before { background: #F59E0B; }
.skills-mobile-group[data-domain="software"] .skills-mobile-group-title::before { background: #3B82F6; }
.skills-mobile-group[data-domain="ml"] .skills-mobile-group-title::before { background: #8B5CF6; }

.skills-mobile-group[data-domain="hardware"] .skills-mobile-group-title { color: #059669; }
.skills-mobile-group[data-domain="electrical"] .skills-mobile-group-title { color: #D97706; }
.skills-mobile-group[data-domain="software"] .skills-mobile-group-title { color: #2563EB; }
.skills-mobile-group[data-domain="ml"] .skills-mobile-group-title { color: #7C3AED; }

.skills-mobile-group-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
}

.skills-mobile-group.expanded .skills-mobile-group-chevron {
  transform: rotate(180deg);
}

.skills-mobile-badges {
  display: none;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
  background: var(--bg);
}

.skills-mobile-group.expanded .skills-mobile-badges {
  display: flex;
}

.skill-badge {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.skill-badge:hover,
.skill-badge:active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.skill-badge.selected {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

/* Mobile skill tooltip */
.mobile-skill-tooltip {
  position: fixed;
  z-index: 100;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  left: 1rem !important;
  right: 1rem;
  width: auto !important;
  max-width: none;
  transform: none !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.mobile-skill-tooltip.visible {
  opacity: 1;
  pointer-events: auto;
}

.mobile-tooltip-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  margin-bottom: 0.875rem;
}

.mobile-tooltip-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.mobile-tooltip-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

.mobile-tooltip-classes {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.mobile-tooltip-project {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.75rem 1rem;
  margin: 0.375rem 0;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-tooltip-project:hover,
.mobile-tooltip-project:active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 600px) {
  .constellation-container {
    display: none;
  }

  .constellation-legend {
    display: none;
  }

  .skills-mobile-fallback {
    display: block;
  }
}
