/* ==========================================================================
   PROJECTS.CSS — Standalone Design System & Styling for Projects Catalog Page
   Includes Full App Theme (Variables, Typography, Nav, Cards, Grid, Responsive)
   ========================================================================== */

/* =========================================
   CUSTOM PROPERTIES & DESIGN TOKENS
   ========================================= */
:root {
  /* Colors */
  --c-bg:           #0c0c0c;
  --c-bg-elevated:  #141414;
  --c-border:       #1e1e1e;
  --c-border-light: rgba(255, 255, 255, 0.06);
  --c-text:         #ededed;
  --c-text-muted:   #6a6a6a;
  --c-accent:       #C8A97E;
  --c-accent-light: #E0CDB5;
  --c-white:        #ffffff;

  /* Typography */
  --f-heading:  'Syne', sans-serif;
  --f-body:     'Inter', sans-serif;
  --f-accent:   'Space Grotesk', sans-serif;

  --fs-display: clamp(2.8rem, 6vw, 6rem);
  --fs-h1:      clamp(2.2rem, 5vw, 5rem);
  --fs-h2:      clamp(1.8rem, 3.5vw, 3.5rem);
  --fs-h3:      clamp(1.2rem, 1.8vw, 1.6rem);
  --fs-body:    clamp(0.95rem, 1.1vw, 1.125rem);
  --fs-small:   0.875rem;
  --fs-label:   0.75rem;

  /* Spacing */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  2rem;
  --space-lg:  4rem;
  --space-xl:  6rem;

  --section-py: clamp(4rem, 10vh, 8rem);
  --container-px: clamp(1.5rem, 5vw, 4rem);

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --nav-height: 80px;
}

/* =========================================
   CUSTOM CURSOR
   ========================================= */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
  will-change: transform;
}

.cursor__circle {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition:
    width 0.45s var(--ease-out-expo),
    height 0.45s var(--ease-out-expo),
    background 0.35s ease,
    border-color 0.35s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cursor__label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--f-accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-bg);
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  pointer-events: none;
}

.cursor.is-hovering .cursor__circle {
  width: 60px;
  height: 60px;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

.cursor.has-label .cursor__circle {
  width: 90px;
  height: 90px;
  background: var(--c-accent);
  border-color: transparent;
}

.cursor.has-label .cursor__label {
  opacity: 1;
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  background: var(--c-white);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10001;
}

/* =========================================
   RESET & BASE STYLES
   ========================================= */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--f-body);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--container-px);
}

/* =========================================
   HEADER NAVIGATION
   ========================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-border-light);
  transition: transform 0.4s var(--ease-out-expo), background 0.4s ease;
}

.nav__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--container-px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--f-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.nav__logo span {
  color: var(--c-accent);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.nav__link {
  font-family: var(--f-accent);
  font-size: var(--fs-small);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--c-text-muted);
  transition: color 0.35s ease;
  position: relative;
  padding: 0.4rem 0;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--c-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out-expo);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--c-text);
}

.nav__link:hover::after,
.nav__link.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__link--cta {
  color: var(--c-accent);
  font-weight: 500;
}

.nav__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--c-text);
  z-index: 1001;
}

.nav__hamburger-lines {
  width: 24px;
  height: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nav__hamburger-lines span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Mobile responsive hamburger */
@media (max-width: 768px) {
  .nav__links {
    display: none;
  }
  .nav__hamburger {
    display: block;
  }
}

/* =========================================
   MOBILE OVERLAY MENU
   ========================================= */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #0c0c0c;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--c-border);
  padding: var(--space-xl) var(--container-px);
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.65s var(--ease-out-expo), opacity 0.65s var(--ease-out-expo), visibility 0s linear 0.65s;
}

.menu-overlay.is-open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  transition: transform 0.65s var(--ease-out-expo), opacity 0.65s var(--ease-out-expo), visibility 0s linear 0s;
}

.menu-overlay__nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.menu-overlay__link {
  font-family: var(--f-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--c-text);
  transition: color 0.3s ease;
}

.menu-overlay__link:hover {
  color: var(--c-accent);
}

.menu-overlay__footer {
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--c-border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--c-text-muted);
  font-family: var(--f-accent);
  font-size: var(--fs-small);
}

/* =========================================
   PROJECTS HERO SECTION
   ========================================= */
.projects-hero {
  padding-top: calc(var(--nav-height) + 50px);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--c-border-light);
  position: relative;
  z-index: 2;
}

.projects-hero__header {
  max-width: 900px;
}

.projects-hero__tag {
  font-family: var(--f-accent);
  font-size: var(--fs-small);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--space-sm);
  display: block;
}

.projects-hero__title {
  font-family: var(--f-heading);
  font-size: var(--fs-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-md);
}

.projects-hero__subtitle {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  color: var(--c-text-muted);
  line-height: 1.8;
  max-width: 680px;
  margin-bottom: var(--space-lg);
}

/* Stats summary bar */
.projects-stats {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  padding-top: var(--space-md);
  border-top: 1px solid var(--c-border-light);
}

.projects-stat {
  display: flex;
  flex-direction: column;
}

.projects-stat__num {
  font-family: var(--f-heading);
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  font-weight: 800;
  color: var(--c-accent);
}

.projects-stat__label {
  font-family: var(--f-accent);
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

/* =========================================
   TOOLBAR & FILTERS
   ========================================= */
.projects-toolbar {
  padding: var(--space-md) 0;
  margin-bottom: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.projects-toolbar__top {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.projects-search {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.projects-search input {
  width: 100%;
  padding: 0.85rem 1.2rem 0.85rem 2.8rem;
  background: var(--c-bg-elevated);
  border: 1px solid var(--c-border-light);
  border-radius: 100px;
  color: var(--c-text);
  font-family: var(--f-accent);
  font-size: var(--fs-small);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.projects-search input:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(200, 169, 126, 0.15);
}

.projects-search svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-muted);
  pointer-events: none;
}

.projects-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.projects-sort label {
  font-family: var(--f-accent);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.projects-sort select {
  background: var(--c-bg-elevated);
  border: 1px solid var(--c-border-light);
  border-radius: 100px;
  color: var(--c-text);
  font-family: var(--f-accent);
  font-size: var(--fs-small);
  padding: 0.6rem 1.2rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.projects-sort select:focus {
  border-color: var(--c-accent);
}

.projects-filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-pill,
.filter-btn {
  font-family: var(--f-accent);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.05em;
  background: var(--c-bg-elevated);
  border: 1px solid var(--c-border-light);
  border-radius: 100px;
  color: var(--c-text-muted);
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.filter-pill:hover,
.filter-btn:hover {
  border-color: rgba(200, 169, 126, 0.4);
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.filter-pill.is-active,
.filter-pill.active,
.filter-btn.is-active,
.filter-btn.active {
  background: rgba(200, 169, 126, 0.15);
  border-color: var(--c-accent);
  color: var(--c-accent);
  box-shadow: 0 0 16px rgba(200, 169, 126, 0.2);
}

/* =========================================
   PROJECTS GRID & CARDS
   ========================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

@media (min-width: 1200px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

.repo-card {
  background: var(--c-bg-elevated);
  border: 1px solid var(--c-border-light);
  border-radius: 16px;
  padding: clamp(1.4rem, 2vw, 1.8rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--c-text);
  transition: transform 0.45s var(--ease-out-expo), border-color 0.35s ease, box-shadow 0.35s ease;
}

.repo-card:hover {
  transform: translateY(-6px);
  border-color: rgba(200, 169, 126, 0.3);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.4);
}

/* Cursor spotlight on hover */
.repo-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle 280px at var(--mx, 50%) var(--my, 50%),
    rgba(200, 169, 126, 0.10) 0%,
    rgba(200, 169, 126, 0.03) 50%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.repo-card:hover::before {
  opacity: 1;
}

.repo-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3px;
  background: var(--c-border);
  border-radius: 2px;
  transition: background 0.4s ease;
}

.repo-card:hover::after {
  background: var(--c-accent);
}

.repo-card > * {
  position: relative;
  z-index: 1;
}

.repo-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.repo-card__name {
  font-family: var(--f-heading);
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--c-text);
  transition: color 0.3s ease;
  word-break: break-word;
}

.repo-card:hover .repo-card__name {
  color: var(--c-accent);
}

.repo-card__gh-icon {
  color: var(--c-text-muted);
  opacity: 0.5;
  flex-shrink: 0;
  transition: opacity 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.repo-card:hover .repo-card__gh-icon {
  opacity: 1;
  color: var(--c-accent);
  transform: scale(1.1);
}

.repo-card__desc {
  font-size: var(--fs-small);
  color: var(--c-text-muted);
  line-height: 1.65;
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.repo-card__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: var(--space-md);
}

.repo-topic {
  font-family: var(--f-accent);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--c-text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--c-border-light);
  border-radius: 100px;
  padding: 0.2rem 0.55rem;
}

.repo-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--c-border-light);
  gap: 0.5rem;
  flex-wrap: wrap;
}

.repo-card__meta-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--f-accent);
  font-size: var(--fs-label);
  color: var(--c-text-muted);
}

.repo-card__lang {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.repo-card__lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
}

.repo-card__stars,
.repo-card__forks {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.repo-card__updated {
  font-family: var(--f-accent);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--c-text-muted);
  opacity: 0.6;
}

.repo-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--f-accent);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  font-weight: 500;
  margin-top: var(--space-md);
  align-self: flex-start;
  transition: transform 0.3s ease;
}

.repo-card:hover .repo-card__btn {
  transform: translateX(4px);
}

/* Loading Skeleton State */
.skeleton-card {
  background: var(--c-bg-elevated);
  border: 1px solid var(--c-border-light);
  border-radius: 16px;
  padding: clamp(1.4rem, 2vw, 1.8rem);
  height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.skeleton-box {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s infinite ease-in-out;
  border-radius: 4px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-title { height: 24px; width: 65%; margin-bottom: 12px; }
.skeleton-text-1 { height: 14px; width: 90%; margin-bottom: 8px; }
.skeleton-text-2 { height: 14px; width: 75%; margin-bottom: 16px; }
.skeleton-meta { height: 16px; width: 40%; }

/* Error & Empty States */
.projects-error,
.projects-empty {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  background: var(--c-bg-elevated);
  border: 1px solid var(--c-border-light);
  border-radius: 16px;
  grid-column: 1 / -1;
}

.projects-error__icon,
.projects-empty__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
  color: var(--c-accent);
}

.projects-error__title,
.projects-empty__title {
  font-family: var(--f-heading);
  font-size: var(--fs-h3);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.projects-error__text,
.projects-empty__text {
  color: var(--c-text-muted);
  font-size: var(--fs-small);
  margin-bottom: var(--space-md);
}

.projects-notice {
  grid-column: 1 / -1;
  background: rgba(200, 169, 126, 0.08);
  border: 1px solid rgba(200, 169, 126, 0.25);
  color: var(--c-accent, #C8A97E);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: var(--fs-small, 0.875rem);
  margin-bottom: var(--space-md, 24px);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
  border-top: 1px solid var(--c-border-light);
  padding: var(--space-md) 0;
  background: var(--c-bg);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer__copy {
  font-family: var(--f-accent);
  font-size: var(--fs-label);
  color: var(--c-text-muted);
}

.creds__linkedin {
  font-family: var(--f-accent);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  transition: color 0.3s ease;
}

.creds__linkedin:hover {
  color: var(--c-accent);
}
