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

:root {
  --bg:        #080b12;
  --surface:   rgba(255,255,255,0.04);
  --border:    rgba(255,255,255,0.08);
  --cyan:      #00ffcc;
  --purple:    #a855f7;
  --pink:      #f472b6;
  --text:      #e2e8f0;
  --muted:     #64748b;
  --radius:    14px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Animated Background ──────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% 20%, rgba(0,255,204,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(168,85,247,0.07) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ─── Layout Wrapper ────────────────────────────────────────── */
.wrapper {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ─── Hero Section ──────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 5rem 1rem 3.5rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(0,255,204,0.08);
  border: 1px solid rgba(0,255,204,0.2);
  border-radius: 999px;
  padding: 6px 16px;
  margin-bottom: 1.5rem;
  animation: fadeDown 0.6s ease both;
}

.hero-eyebrow::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 30%, var(--cyan) 60%, var(--purple) 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeDown 0.7s ease 0.1s both;
}

.hero-sub {
  margin-top: 1rem;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 520px;
  margin-inline: auto;
  line-height: 1.6;
  animation: fadeDown 0.7s ease 0.2s both;
}

/* ─── Stat Badges ───────────────────────────────────────────── */
.stats {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
  animation: fadeDown 0.7s ease 0.35s both;
}

.stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  color: var(--text);
  transition: border-color 0.3s;
}

.stat:hover { border-color: rgba(0,255,204,0.35); }
.stat-icon { font-size: 1rem; }

/* ─── Filter Bar ───────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 2.5rem 0 2rem;
  animation: fadeUp 0.6s ease 0.4s both;
}

.filter-btn {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(6px);
}

.filter-btn:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}

.filter-btn.active {
  background: linear-gradient(135deg, rgba(0,255,204,0.18), rgba(168,85,247,0.18));
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 18px rgba(0,255,204,0.12);
}

/* ─── Project Grid ──────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

/* ─── Project Card ──────────────────────────────────────────── */
.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(12px);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  animation: fadeUp 0.5s ease both;
  overflow: hidden;
  position: relative;
  min-height: 160px;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,255,204,0.05), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: inherit;
}

.card:hover { 
  transform: translateY(-5px) scale(1.01);
  border-color: rgba(0,255,204,0.4);
  box-shadow: 0 0 32px rgba(0,255,204,0.1), 0 8px 32px rgba(0,0,0,0.4);
}

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

.card.hidden {
  display: none;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.card-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.card-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

/* Tag color variants */
.tag-flexbox    { color: #38bdf8; border-color: rgba(56,189,248,0.35); background: rgba(56,189,248,0.08); }
.tag-grid       { color: var(--purple); border-color: rgba(168,85,247,0.35); background: rgba(168,85,247,0.08); }
.tag-animation  { color: #fb923c; border-color: rgba(251,146,60,0.35); background: rgba(251,146,60,0.08); }
.tag-art        { color: var(--pink); border-color: rgba(244,114,182,0.35); background: rgba(244,114,182,0.08); }
.tag-forms      { color: #4ade80; border-color: rgba(74,222,128,0.35); background: rgba(74,222,128,0.08); }
.tag-typography { color: #facc15; border-color: rgba(250,204,21,0.35); background: rgba(250,204,21,0.08); }
.tag-accessibility { color: var(--cyan); border-color: rgba(0,255,204,0.35); background: rgba(0,255,204,0.08); }
.tag-html       { color: #f97316; border-color: rgba(249,115,22,0.35); background: rgba(249,115,22,0.08); }
.tag-variables  { color: #c084fc; border-color: rgba(192,132,252,0.35); background: rgba(192,132,252,0.08); }
.tag-portfolio  { color: #00ff88; border-color: rgba(0,255,136,0.35); background: rgba(0,255,136,0.08); }

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.card-arrow {
  margin-top: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cyan);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.25s, transform 0.25s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ─── Divider ───────────────────────────────────────────────── */
.divider {
  text-align: center;
  margin: 3rem 0 1.5rem;
  position: relative;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  border-top: 1px solid var(--border);
}

.divider span {
  position: relative;
  background: var(--bg);
  padding: 0 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── Footer ───────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.8;
}

footer a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}

footer a:hover { opacity: 0.75; }

/* ─── Animations ────────────────────────────────────────────── */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stagger cards */
.card:nth-child(1)  { animation-delay: 0.05s; }
.card:nth-child(2)  { animation-delay: 0.10s; }
.card:nth-child(3)  { animation-delay: 0.15s; }
.card:nth-child(4)  { animation-delay: 0.20s; }
.card:nth-child(5)  { animation-delay: 0.25s; }
.card:nth-child(6)  { animation-delay: 0.30s; }
.card:nth-child(7)  { animation-delay: 0.35s; }
.card:nth-child(8)  { animation-delay: 0.40s; }
.card:nth-child(9)  { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.50s; }
.card:nth-child(11) { animation-delay: 0.55s; }
.card:nth-child(12) { animation-delay: 0.60s; }
.card:nth-child(13) { animation-delay: 0.65s; }
.card:nth-child(14) { animation-delay: 0.70s; }
.card:nth-child(15) { animation-delay: 0.75s; }
.card:nth-child(16) { animation-delay: 0.80s; }
.card:nth-child(17) { animation-delay: 0.85s; }
.card:nth-child(18) { animation-delay: 0.90s; }

/* ─── No-results message ────────────────────────────────────── */
.no-results {
  display: none;
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}
