/* ═══════════════════════════════════════════════════════════
   css/interaction.css — Living World Interactions
   Fantasy enhancement layer: cards as artifacts,
   projects as portals, constellation as energy network.
   Loads AFTER projects.css and constellation.css.
═══════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════
   SHARED: mouse-position shimmer
   Cards read --mouse-x / --mouse-y set by JS
════════════════════════════════════════ */
.featured-row,
.project-card {
  --mouse-x: 50%;
  --mouse-y: 50%;
}

/* ════════════════════════════════════════
   FEATURED ROWS — artifact-style
════════════════════════════════════════ */
.featured-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2.5rem 0 3rem;
  border-bottom: 1px solid rgba(61,255,208,0.08);
  overflow: hidden;
  transition: border-color 0.3s ease;
}
.featured-row:nth-child(even) {
  direction: rtl;
}
.featured-row:nth-child(even) > * {
  direction: ltr;
}
.featured-row:last-child { border-bottom: none; }
.featured-row:hover { border-color: rgba(61,255,208,0.18); }

/* Mouse-tracking shimmer layer */
.featured-row::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    320px circle at var(--mouse-x) var(--mouse-y),
    rgba(61,255,208,0.04) 0%,
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}
.featured-row:hover::after { opacity: 1; }

/* Visual / image side */
.featured-visual {
  position: relative;
  aspect-ratio: 16/10;
  border-radius: 4px;
  overflow: hidden;
  background: var(--c-trench, #091828);
  border: 1px solid rgba(61,255,208,0.12);
  transition: border-color 0.3s ease;
}
.featured-row:hover .featured-visual { border-color: rgba(61,255,208,0.28); }

.featured-visual img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease, filter 0.4s ease;
  filter: brightness(0.85) saturate(0.9);
}
.featured-row:hover .featured-visual img {
  transform: scale(1.03);
  filter: brightness(1) saturate(1.1);
}

.featured-visual-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(61,255,208,0.05) 0%, transparent 60%);
  pointer-events: none;
}

/* Placeholder when no image */
.featured-visual-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(12,34,54,0.9) 0%, rgba(5,14,28,0.95) 100%),
    repeating-linear-gradient(
      0deg,
      transparent, transparent 39px,
      rgba(61,255,208,0.025) 39px, rgba(61,255,208,0.025) 40px
    );
}
.featured-sigil {
  text-align: center;
  padding: 1.5rem;
}
.featured-sigil-cat {
  display: block;
  font-family: var(--font-mono, 'Fira Code', monospace);
  font-size: 0.55rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(61,255,208,0.45);
  margin-bottom: 1rem;
}
.featured-sigil-glyph {
  width: 64px; height: 64px;
  margin: 0 auto;
  border: 1px solid rgba(61,255,208,0.25);
  border-radius: 50%;
  position: relative;
  animation: sigil-breathe 6s ease-in-out infinite;
}
.featured-sigil-glyph::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(61,255,208,0.18);
  border-radius: 50%;
  animation: sigil-breathe 4s ease-in-out infinite reverse;
}
.featured-sigil-glyph::after {
  content: '◈';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 1.1rem;
  color: rgba(61,255,208,0.55);
}
@keyframes sigil-breathe {
  0%,100% { transform: scale(1) rotate(0deg); opacity: 0.7; }
  50%      { transform: scale(1.05) rotate(5deg); opacity: 1; }
}

/* Content side */
.featured-content { padding: 0.5rem 0; }
.featured-category {
  margin-bottom: 0.5rem;
  color: var(--c-biolume, #3dffd0);
  font-size: 0.60rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.featured-title {
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: clamp(1.3rem, 2.5vw, 1.9rem);
  color: var(--c-star, #e6f3f8);
  margin-bottom: 0.6rem;
  line-height: 1.2;
}
.featured-oneliner {
  color: var(--c-star);
  font-size: 0.94rem;
  line-height: 1.72;
  margin-bottom: 1rem;
}
.project-bullets {
  margin: 0 0 1rem 1.2rem;
  list-style: none;
  padding: 0;
}
.project-bullets li {
  color: var(--c-star);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 0.35rem;
  padding-left: 1rem;
  position: relative;
}
.project-bullets li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--c-biolume, #3dffd0);
  opacity: 0.65;
}

/* ════════════════════════════════════════
   PROJECT CARDS — portal/artifact feel
════════════════════════════════════════ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.project-card {
  position: relative;
  background: rgba(9,24,40,0.7);
  border: 1px solid rgba(61,255,208,0.10);
  border-radius: 4px;
  padding: 1.4rem 1.6rem 1.2rem;
  overflow: hidden;
  transition:
    border-color 0.25s ease,
    transform 0.28s cubic-bezier(0.16,1,0.3,1),
    box-shadow 0.28s ease;
  isolation: isolate;
}

/* Mouse shimmer overlay */
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    180px circle at var(--mouse-x) var(--mouse-y),
    rgba(61,255,208,0.06) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 0;
}
.project-card:hover::before { opacity: 1; }
.project-card > * { position: relative; z-index: 1; }

/* Animated glow ring */
.card-glow-ring {
  position: absolute;
  inset: -1px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background:
    linear-gradient(135deg, transparent 20%, rgba(61,255,208,0.06) 50%, transparent 80%);
}

.project-card:hover {
  border-color: rgba(61,255,208,0.28);
  transform: translateY(-4px) scale(1.01);
  box-shadow:
    0 0 0 1px rgba(61,255,208,0.10),
    0 8px 32px rgba(0,0,0,0.4),
    0 0 20px rgba(61,255,208,0.06);
}
.project-card:hover .card-glow-ring { opacity: 1; }

.card-category {
  font-size: 0.56rem;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--c-biolume, #3dffd0);
  margin-bottom: 0.4rem;
  opacity: 0.75;
}
.card-title {
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: 1.05rem;
  color: var(--c-star, #e6f3f8);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.card-oneliner {
  font-size: 0.84rem;
  color: var(--c-star);
  line-height: 1.68;
  margin-bottom: 0.9rem;
}

/* ════════════════════════════════════════
   ENVIRONMENT TINTS — per project type
════════════════════════════════════════ */
/* Pipeline: structured teal grid */
.env-pipeline .featured-visual-placeholder,
.env-pipeline.project-card {
  --env-color: rgba(29,136,112,0.12);
  --env-glow: rgba(29,136,112,0.25);
}
.env-pipeline:hover { box-shadow: 0 8px 32px rgba(29,136,112,0.08), 0 0 20px rgba(29,136,112,0.05); }
.env-pipeline .card-category,
.env-pipeline .featured-category { color: #2ab89a; }

/* ML/AI: nebula violet */
.env-ml .featured-visual-placeholder,
.env-ml.project-card {
  --env-color: rgba(157,120,245,0.10);
  --env-glow: rgba(157,120,245,0.22);
}
.env-ml:hover { box-shadow: 0 8px 32px rgba(157,120,245,0.08), 0 0 20px rgba(157,120,245,0.05); }
.env-ml .card-category,
.env-ml .featured-category { color: #9d78f5; }

/* Graphics/C++: electric amber */
.env-graphics .featured-visual-placeholder,
.env-graphics.project-card {
  --env-color: rgba(240,160,80,0.08);
  --env-glow: rgba(240,160,80,0.20);
}
.env-graphics:hover { box-shadow: 0 8px 32px rgba(240,160,80,0.07), 0 0 20px rgba(240,160,80,0.04); }
.env-graphics .card-category,
.env-graphics .featured-category { color: #f0a050; }

/* Creative/XR: cosmos teal-violet blend */
.env-creative.project-card,
.env-creative .featured-visual-placeholder { --env-color: rgba(61,255,208,0.06); }

/* ════════════════════════════════════════
   SHARED: tools + links
════════════════════════════════════════ */
.project-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.9rem;
}
.project-tool-chip {
  font-family: var(--font-mono, 'Fira Code', monospace);
  font-size: 0.54rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid rgba(61,255,208,0.18);
  color: rgba(61,255,208,0.65);
  background: rgba(61,255,208,0.04);
  border-radius: 2px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.project-card:hover .project-tool-chip,
.featured-row:hover .project-tool-chip {
  border-color: rgba(61,255,208,0.30);
  color: rgba(61,255,208,0.85);
  background: rgba(61,255,208,0.06);
}

.project-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.2rem;
}
.project-link {
  font-family: var(--font-mono, 'Fira Code', monospace);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-biolume, #3dffd0);
  text-decoration: none;
  transition: color 0.15s, text-shadow 0.15s;
}
.project-link:hover {
  color: #fff;
  text-shadow: 0 0 12px rgba(61,255,208,0.7);
}
.project-inspect-btn {
  font-family: var(--font-mono, 'Fira Code', monospace);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  background: none;
  border: 1px solid rgba(61,255,208,0.20);
  color: rgba(61,255,208,0.55);
  padding: 3px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.project-inspect-btn:hover {
  border-color: rgba(61,255,208,0.55);
  color: var(--c-biolume, #3dffd0);
  background: rgba(61,255,208,0.05);
}

/* ════════════════════════════════════════
   FILTER CHIPS — enhanced
════════════════════════════════════════ */
.role-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.8rem;
}
.filter-chip {
  font-family: var(--font-mono, 'Fira Code', monospace);
  font-size: 0.60rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 14px;
  background: rgba(9,24,40,0.6);
  border: 1px solid rgba(61,255,208,0.18);
  color: var(--c-mist);         /* was c-ghost — one step lighter */
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.filter-chip:hover {
  border-color: rgba(61,255,208,0.40);
  color: var(--c-star);         /* was c-mist */
}
.filter-chip.is-active {
  border-color: var(--c-biolume, #3dffd0);
  color: var(--c-biolume, #3dffd0);
  background: rgba(61,255,208,0.06);
  box-shadow: 0 0 8px rgba(61,255,208,0.12);
}
.filter-chip.is-active::after {
  content: '◉';
  margin-left: 0.4em;
  font-size: 0.5em;
  opacity: 0.7;
}

/* ════════════════════════════════════════
   CONSTELLATION SECTION
════════════════════════════════════════ */
#skill-canvas {
  display: block;
  width: 100%;
  border-radius: 4px;
  cursor: default;
  transition: filter 0.3s ease;
}
.constellation-section:hover #skill-canvas {
  filter: brightness(1.05);
}
.constellation-sub {
  font-family: var(--font-mono, 'Fira Code', monospace);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: rgba(61,255,208,0.40);
  text-align: center;
  margin-top: 0.4rem;
  margin-bottom: 1.5rem;
}
.constellation-sub::after {
  content: ' // interactive · hover to trace';
  display: block;
  font-size: 0.48rem;
  letter-spacing: 0.18em;
  color: rgba(61,255,208,0.22);
  margin-top: 0.2rem;
}

/* Constellation filter feedback pill */
.constellation-active-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(61,255,208,0.65);
  border: 1px solid rgba(61,255,208,0.22);
  padding: 3px 10px;
  border-radius: 2px;
  animation: fade-in 0.3s ease;
}
.constellation-active-filter button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
  padding: 0;
  line-height: 1;
}
.constellation-active-filter button:hover { opacity: 1; }

/* ════════════════════════════════════════
   R&D — FIELD LOG SYSTEM enhancements
════════════════════════════════════════ */
.rnd-entry {
  position: relative;
}
/* Field log number annotation */
.rnd-entry::after {
  content: attr(data-log-num);
  position: absolute;
  right: 0; top: var(--s4, 2rem);
  font-family: var(--font-mono, monospace);
  font-size: 0.44rem;
  letter-spacing: 0.14em;
  color: rgba(157,120,245,0.22);
  pointer-events: none;
  user-select: none;
}

/* Boot animation on section enter */
.section-rnd.nebula-lit .rnd-grid-bg {
  animation: grid-boot 1.2s ease forwards;
}
@keyframes grid-boot {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* R&D labels — color overrides handled in rnd.css */
.rnd-hypothesis {
  position: relative;
}
/* ::before label removed — duplicated with rnd.css, caused double labels */
.rnd-finding::before {
  content: '→ ';
  color: var(--c-teal) !important;
  font-family: var(--font-mono);
  font-size: inherit !important;
  letter-spacing: 0;
}

/* ════════════════════════════════════════
   HERO: click ripple
════════════════════════════════════════ */
.hero-ripple {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(61,255,208,0.45);
  width: 4px; height: 4px;
  transform: translate(-50%,-50%) scale(1);
  animation: ripple-expand 1.2s ease-out forwards;
  pointer-events: none;
  z-index: 10;
}
@keyframes ripple-expand {
  from {
    width: 4px; height: 4px;
    opacity: 0.8;
    border-width: 1px;
  }
  to {
    width: 180px; height: 180px;
    opacity: 0;
    border-width: 0.5px;
  }
}

/* ════════════════════════════════════════
   PORTAL GEMS — enhanced hover
════════════════════════════════════════ */
.portal:hover .portal-sigil {
  filter: drop-shadow(0 0 6px rgba(61,255,208,0.6));
}

/* ════════════════════════════════════════
   GRID LABEL
════════════════════════════════════════ */
.grid-label {
  font-family: var(--font-mono, 'Fira Code', monospace);
  font-size: 0.58rem;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(61,255,208,0.30);
  margin: 2.5rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.grid-label::before {
  content: '//';
  color: rgba(61,255,208,0.18);
}
.grid-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(61,255,208,0.12), transparent);
}

/* ════════════════════════════════════════
   HIDDEN EASTER EGG STARS
   Scattered across sections — subtle glow on hover
════════════════════════════════════════ */
.easter-star {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(61,255,208,0.08);
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  z-index: 5;
}
.easter-star:hover,
.easter-star.found {
  background: rgba(61,255,208,0.75);
  box-shadow: 0 0 12px rgba(61,255,208,0.6), 0 0 24px rgba(61,255,208,0.3);
  transform: scale(1.4);
}
.easter-star::after {
  content: '✦';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 0.5rem;
  color: rgba(61,255,208,0);
  transition: color 0.3s ease;
}
.easter-star:hover::after,
.easter-star.found::after {
  color: rgba(61,255,208,0.9);
}

/* ════════════════════════════════════════
   FADE-IN ANIMATION
════════════════════════════════════════ */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════
   REDUCED MOTION overrides
════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .featured-row::after,
  .project-card::before { display: none; }
  .featured-visual img,
  .project-card,
  .featured-row,
  .filter-chip,
  .project-tool-chip { transition: none !important; }
  .hero-ripple { animation: none; }
  .easter-star { transition: none; }
  .featured-sigil-glyph,
  .featured-sigil-glyph::before { animation: none; }
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 820px) {
  .featured-row {
    grid-template-columns: 1fr;
    direction: ltr;
  }
  .featured-row:nth-child(even) { direction: ltr; }
  .featured-visual { aspect-ratio: 16/7; }
}
@media (max-width: 560px) {
  .project-grid { grid-template-columns: 1fr; }
  .featured-row { padding: 1.5rem 0 2rem; }
}
