/* ============================================================
   COMPONENTS · Reusable UI primitives
   Buttons · Badges · Cards · Tags · Inputs · Nav · Footer
   ============================================================ */

/* ----------------------------------------------------------------
   NAVIGATION
   Sticky, blurred-glass top bar. Inspired by Linear / Vercel.
   ---------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  width: 100%;
  background: rgba(8, 8, 11, 0.65);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-out-expo);
}
.nav.is-scrolled {
  border-bottom-color: var(--border-subtle);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--s-4);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: var(--tracking-snug);
  color: var(--fg-primary);
}
.nav__brand-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulse 2.4s var(--ease-in-out) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.25); }
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.nav__link {
  position: relative;
  padding: var(--s-2) var(--s-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--fg-tertiary);
  border-radius: var(--r-sm);
  transition:
    color var(--dur-fast) var(--ease-out-expo),
    background-color var(--dur-fast) var(--ease-out-expo);
}
.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--fg-primary);
  background: var(--bg-card);
}
.nav__cta {
  margin-left: var(--s-2);
}
@media (max-width: 640px) {
  .nav__links { gap: 0; }
  .nav__link  { padding-inline: var(--s-2); font-size: var(--text-xs); }
}

/* ----------------------------------------------------------------
   BUTTON
   ---------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0.75rem 1.25rem;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-normal);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-out-expo),
    border-color    var(--dur-fast) var(--ease-out-expo),
    color           var(--dur-fast) var(--ease-out-expo),
    transform       var(--dur-fast) var(--ease-out-expo),
    box-shadow      var(--dur-fast) var(--ease-out-expo);
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--fg-primary);
  color: var(--bg-base);
  border-color: var(--fg-primary);
}
.btn--primary:hover {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.10);
}

.btn--accent {
  background: var(--accent);
  color: var(--fg-on-accent);
  border-color: var(--accent);
  box-shadow: 0 8px 28px -8px var(--accent-glow);
}
.btn--accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 12px 36px -8px var(--accent-glow);
}

.btn--ghost {
  background: transparent;
  color: var(--fg-primary);
  border-color: var(--border-default);
}
.btn--ghost:hover {
  background: var(--bg-card);
  border-color: var(--border-strong);
}

.btn--sm  { padding: 0.5rem 0.875rem; font-size: var(--text-xs); }
.btn--lg  { padding: 0.9rem 1.6rem;   font-size: var(--text-base); }

.btn__icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
}

/* Subtle "arrow nudge" on hover for ghost buttons containing arrow icon */
.btn:hover .btn__icon--arrow { transform: translateX(3px); }
.btn__icon--arrow { transition: transform var(--dur-fast) var(--ease-out-expo); }

/* ----------------------------------------------------------------
   BADGE · small inline status pill
   ---------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.3rem 0.7rem;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  color: var(--fg-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--r-full);
}
.badge--live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
  animation: pulse 2.4s var(--ease-in-out) infinite;
}
.badge--accent {
  color: var(--accent-hover);
  background: var(--accent-soft);
  border-color: var(--border-accent);
}

/* ----------------------------------------------------------------
   EYEBROW · small uppercase label above headings
   ---------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--fg-tertiary);
}
.eyebrow::before {
  content: '';
  display: block;
  width: 1.5rem;
  height: 1px;
  background: var(--border-strong);
}
.eyebrow--accent { color: var(--accent-hover); }
.eyebrow--accent::before { background: var(--accent); }

/* ----------------------------------------------------------------
   TAG · chips for stack / tech
   ---------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-default);
  border-radius: var(--r-sm);
  transition:
    border-color var(--dur-fast) var(--ease-out-expo),
    color        var(--dur-fast) var(--ease-out-expo);
}
.tag:hover {
  color: var(--fg-primary);
  border-color: var(--border-strong);
}
.tag--accent {
  color: var(--accent-hover);
  background: var(--accent-soft);
  border-color: var(--border-accent);
}
.tag--learning {
  color: var(--fg-tertiary);
  border-style: dashed;
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

/* ----------------------------------------------------------------
   SECTION HEADING · used at top of every section
   ---------------------------------------------------------------- */
.section {
  padding-block: clamp(4rem, 9vw, 7rem);
  position: relative;
}
.section__head {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  margin-bottom: var(--s-12);
  max-width: 720px;
}
.section__title {
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--fg-primary);
}
.section__title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-hover);
}
.section__desc {
  max-width: 56ch;
  font-size: var(--text-lg);
  color: var(--fg-tertiary);
  line-height: var(--leading-relaxed);
}

/* ----------------------------------------------------------------
   CARD primitives
   ---------------------------------------------------------------- */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition:
    border-color var(--dur-base) var(--ease-out-expo),
    background-color var(--dur-base) var(--ease-out-expo),
    transform var(--dur-base) var(--ease-out-expo);
}
.card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

/* "Spotlight" highlight that tracks the mouse on hover.
   The position is set via CSS variables by main.js. */
.card--spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    320px circle at var(--mx, 50%) var(--my, 50%),
    rgba(99, 102, 241, 0.10),
    transparent 50%
  );
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out-expo);
}
.card--spotlight:hover::before { opacity: 1; }

/* ----------------------------------------------------------------
   FOOTER
   ---------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding-block: var(--s-16) var(--s-10);
  margin-top: var(--s-24);
}
.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--s-12);
  padding-bottom: var(--s-12);
  border-bottom: 1px solid var(--border-subtle);
}
.footer__cta-eyebrow { margin-bottom: var(--s-4); }
.footer__cta-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--s-6);
}
.footer__cta-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-hover);
}
.footer__cta-desc {
  font-size: var(--text-lg);
  color: var(--fg-tertiary);
  margin-bottom: var(--s-8);
  max-width: 48ch;
}
.footer__cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.footer__meta {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  font-size: var(--text-sm);
  color: var(--fg-tertiary);
}
.footer__meta-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--fg-quaternary);
  margin-bottom: var(--s-2);
}
.footer__meta-value {
  color: var(--fg-secondary);
  font-size: var(--text-base);
}
.footer__meta-value a:hover { color: var(--accent-hover); }

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-4);
  padding-top: var(--s-8);
  font-size: var(--text-xs);
  color: var(--fg-quaternary);
}
.footer__socials {
  display: flex;
  gap: var(--s-2);
}
.footer__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-default);
  color: var(--fg-tertiary);
  transition:
    color var(--dur-fast) var(--ease-out-expo),
    border-color var(--dur-fast) var(--ease-out-expo),
    background-color var(--dur-fast) var(--ease-out-expo);
}
.footer__social:hover {
  color: var(--fg-primary);
  border-color: var(--border-strong);
  background: var(--bg-card);
}
.footer__social svg { width: 16px; height: 16px; }

@media (max-width: 720px) {
  .footer__top { grid-template-columns: 1fr; gap: var(--s-8); }
  .footer__bottom { justify-content: center; text-align: center; }
}

/* ----------------------------------------------------------------
   ICON helper (lucide-style inline SVGs)
   ---------------------------------------------------------------- */
.icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
