/* ============================================
   main.css — shared components
   nav, footer, cards, badges, utilities
   ============================================ */

/* --- Base --- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* --- Layout --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.section {
  padding: var(--space-24) 0;
}

.section-title {
  font-family: 'Space Grotesk', var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-12);
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: none;
}

/* --- Navigation: see pill-nav component at bottom of this file --- */

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-16) 0;
  text-align: center;
  background: transparent;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-12);
  margin-bottom: var(--space-8);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color 0.25s;
  letter-spacing: 0.02em;
}

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

.footer-copy {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  opacity: 0.7;
}

/* --- Project Cards --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

@media (max-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
}

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

.project-card,
.skill-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.35s ease, transform 0.35s ease;
  display: flex;
  flex-direction: column;
}

.project-card::before,
.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(350px circle at var(--mouse-x, 0px) var(--mouse-y, 0px), rgba(87, 84, 168, 0.13), transparent 75%);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:hover,
.skill-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.project-card:hover::before,
.skill-card:hover::before {
  opacity: 1;
}

.card-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bg-surface);
  border-radius: var(--radius);
  position: relative;
  z-index: 2;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .card-cover {
  transform: scale(1.03);
}

.card-cover-fallback {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  color: var(--accent);
  opacity: 0.3;
  position: relative;
  z-index: 2;
}

.card-body {
  padding: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 3;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: var(--space-3);
}

.card-title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.card-status {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-status[data-status="shipped"] {
  background: rgba(87, 84, 168, 0.14);
  color: var(--accent);
  border: 1px solid rgba(87, 84, 168, 0.25);
}

.card-status[data-status="in-progress"] {
  background: rgba(142, 140, 137, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(142, 140, 137, 0.15);
}

.card-tagline {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
  flex: 1;
  line-height: 1.6;
}

.card-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* --- Badges --- */
.badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  padding: 3px 10px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
  transition: border-color 0.25s ease, color 0.25s ease;
}

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

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 10px 24px;
  border-radius: var(--radius);
  background: var(--cta-bg);
  color: var(--cta-text);
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
  border: 1px solid var(--cta-border);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 0 rgba(0, 0, 0, 0.18);
  cursor: pointer;
  letter-spacing: 0.02em;
}

.btn:hover {
  background: transparent;
  color: var(--text);
  border-color: rgba(244, 243, 240, 0.3);
  box-shadow: none;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

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

.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: var(--space-2) var(--space-6);
  border-radius: 999px;
  font-weight: 500;
  transition: background-color 0.25s ease;
}

.btn-ghost:hover {
  background: var(--accent-dim);
}

/* --- Stack Filter --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-12);
}

.filter-btn {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.25s ease;
  cursor: pointer;
}

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

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

/* --- Utilities --- */
.text-muted {
  color: var(--text-muted);
}

.text-accent {
  color: var(--accent);
}

.mono {
  font-family: var(--font-mono);
}

.error {
  color: #ef4444;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: var(--space-8);
  text-align: center;
}

/* Fade-in animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fade-in:nth-child(2) {
  animation-delay: 0.08s;
}

.fade-in:nth-child(3) {
  animation-delay: 0.16s;
}

.fade-in:nth-child(4) {
  animation-delay: 0.24s;
}

/* Separator line */
.glow-line {
  width: 80px;
  height: 1px;
  background: var(--accent);
  margin-bottom: var(--space-6);
  opacity: 0.6;
}

/* Visually hidden for a11y */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Scroll Reveal & Advanced Interactions --- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for reveal elements */
.reveal-on-scroll:nth-child(2) {
  transition-delay: 0.05s;
}

.reveal-on-scroll:nth-child(3) {
  transition-delay: 0.1s;
}

.reveal-on-scroll:nth-child(4) {
  transition-delay: 0.15s;
}

/* Timeline Interactive Slide */
.timeline-item {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-item:hover {
  transform: translateX(8px);
}

.timeline-item::before {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover::before {
  background: var(--accent) !important;
  box-shadow: 0 0 16px var(--accent);
}

.bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}
/* ============================================
   PILL NAV — shared gorix-style nav (all pages)
   ============================================ */

.nav-scrim {
  pointer-events: none;
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 40;
  height: 8rem;
  background: linear-gradient(to bottom, rgba(12, 12, 13, 1) 0%, rgba(12, 12, 13, 0.5) 40%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 12%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 12%, transparent 100%);
}

.pill-nav {
  pointer-events: none;
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem;
  transition: opacity 0.7s ease;
}

@media (min-width: 768px) {
  .pill-nav { justify-content: center; }
}

.pill-nav-shell {
  pointer-events: auto;
  max-width: calc(100vw - 1.5rem);
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(244, 243, 240, 0.1);
  background: rgba(12, 12, 13, 0.4);
  padding: 4px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.pill-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  border-radius: var(--radius);
  border: 1px solid rgba(244, 243, 240, 0.08);
  background: rgba(12, 12, 13, 0.5);
  padding: 4px;
}

.pill-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: calc(var(--radius) - 2px);
  padding: 6px 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(244, 243, 240, 0.8);
  letter-spacing: -0.02em;
  transition: color 0.15s;
}
.pill-logo:hover { color: var(--text); }

.pill-links {
  display: none;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 768px) { .pill-links { display: flex; } }

.pill-link {
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);
  padding: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  color: rgba(244, 243, 240, 0.65);
  transition: background 0.15s, color 0.15s;
}
.pill-link:hover,
.pill-link.active {
  background: rgba(244, 243, 240, 0.06);
  color: var(--text);
}

.pill-cta {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 8px 14px;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid rgba(244, 243, 240, 0.25);
  background: var(--cta-bg);
  color: var(--cta-text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 0 rgba(0, 0, 0, 0.18);
  transition: all 0.15s;
}
.pill-cta:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--bg);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), inset 0 -2px 0 0 rgba(0, 0, 0, 0.35);
}
@media (min-width: 768px) { .pill-cta { display: inline-flex; } }

/* Fixed corner meta (clock / version / status) */
.corner-meta {
  position: fixed;
  z-index: 50;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.78rem;
  color: rgba(244, 243, 240, 0.55);
  pointer-events: none;
  display: none;
}
.corner-meta.tl { top: 1rem; left: 1rem; }
.corner-meta.bl { bottom: 1rem; left: 1rem; display: flex; align-items: center; gap: 6px; }
.corner-meta.br { bottom: 1rem; right: 1rem; }
@media (min-width: 1024px) { .corner-meta { display: flex; } }
.corner-meta:hover { color: rgba(244, 243, 240, 0.75); }
.corner-meta .live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-dot 2.5s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* Mobile menu button used inside pill-nav on narrow viewports */
.pill-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: rgba(244, 243, 240, 0.75);
}
@media (min-width: 768px) { .pill-menu-toggle { display: none; } }