/* ─────────────────────────────────────────────────────────────────
   grnl.dev — Design System
   Colors derived from Path0s / ThreadGarden token set
   ───────────────────────────────────────────────────────────────── */

:root {
  /* Backgrounds */
  --bg-0:       #0B0F1A;   /* deepest shell */
  --bg-1:       #111724;   /* card / section */
  --bg-2:       #1A2133;   /* card lift / hover */
  --bg-glass:   rgba(11, 15, 26, 0.85);

  /* Accents */
  --teal:       #2CCAB8;
  --teal-dim:   rgba(44, 202, 184, 0.12);
  --teal-glow:  rgba(44, 202, 184, 0.22);
  --gold:       #C9AA56;
  --gold-dim:   rgba(201, 170, 86, 0.12);

  /* Text */
  --text-hi:    #DED7C7;   /* primary / headings */
  --text-mid:   #8B96A8;   /* secondary */
  --text-lo:    #5A6478;   /* muted / captions */
  --text-code:  #7ECFCF;   /* inline code */

  /* Borders */
  --border:     rgba(44, 202, 184, 0.10);
  --border-hi:  rgba(44, 202, 184, 0.28);

  /* Radius */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  22px;
  --r-xl:  32px;

  /* Type */
  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ─── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-0);
  color: var(--text-hi);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: rgba(44, 202, 184, 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(44, 202, 184, 0.4); }

/* ─── Nav ────────────────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.4s;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text-hi);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  user-select: none;
}
.nav-logo .teal { color: var(--teal); }
.nav-logo svg { flex-shrink: 0; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-mid);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-hi); }

/* ─── Hero ───────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 8rem 2.5rem 5rem;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Vignette overlay */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 50% 50%, transparent 30%, var(--bg-0) 100%),
    linear-gradient(to bottom, transparent 60%, var(--bg-0) 100%);
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1.6rem;
  opacity: 0.85;
  animation: fadeSlideUp 0.8s ease both;
}

.hero-title {
  font-size: clamp(3.2rem, 9vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-bottom: 1.6rem;
  color: var(--text-hi);
  animation: fadeSlideUp 0.8s 0.1s ease both;
}
.hero-title .accent { color: var(--teal); }
.hero-title .dim { color: var(--text-mid); font-weight: 400; }

.hero-subtitle {
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  color: var(--text-mid);
  max-width: 500px;
  margin-bottom: 2rem;
  line-height: 1.75;
  animation: fadeSlideUp 0.8s 0.2s ease both;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.75rem;
  animation: fadeSlideUp 0.8s 0.3s ease both;
}

.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-lo);
  background: rgba(26, 33, 51, 0.5);
  letter-spacing: 0.05em;
  transition: border-color 0.2s, color 0.2s;
}
.tag:hover { border-color: var(--border-hi); color: var(--text-mid); }
.tag.active {
  border-color: rgba(44, 202, 184, 0.35);
  color: var(--teal);
  background: var(--teal-dim);
}

.hero-actions {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  animation: fadeSlideUp 0.8s 0.4s ease both;
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.72rem 1.5rem;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: -0.01em;
}
.btn-primary {
  background: var(--teal);
  color: #0B0F1A;
  box-shadow: 0 0 30px rgba(44, 202, 184, 0.22);
}
.btn-primary:hover {
  background: #3dddd0;
  box-shadow: 0 0 42px rgba(44, 202, 184, 0.38);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text-hi);
  border-color: var(--border-hi);
  background: var(--teal-dim);
}

/* ─── Sections ───────────────────────────────────────────────────── */
.section-wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 2.5rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.6rem;
  opacity: 0.8;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.028em;
  margin-bottom: 0.75rem;
  color: var(--text-hi);
}
.section-desc {
  font-size: 1rem;
  color: var(--text-mid);
  max-width: 500px;
  margin-bottom: 3rem;
  line-height: 1.75;
}

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

.project-card {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.6rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: default;
}
.project-card.linked { cursor: pointer; }

/* Glow on hover */
.project-card.linked:hover {
  transform: translateY(-4px);
  border-color: var(--border-hi);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(44, 202, 184, 0.07);
}
.project-card.linked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 15% 20%, rgba(44, 202, 184, 0.05) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.project-card.linked:hover::after { opacity: 1; }

/* Featured spans 2 cols */
.project-card.featured {
  grid-column: span 2;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.75rem;
}

/* "Active" badge */
.card-badge {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--teal);
  background: var(--teal-dim);
  border: 1px solid rgba(44, 202, 184, 0.22);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
}
.badge-dot {
  width: 5px; height: 5px;
  background: var(--teal);
  border-radius: 50%;
  animation: pulse-dot 2s ease infinite;
}

.project-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-2);
}
.project-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-icon-placeholder {
  width: 60px;
  height: 60px;
  border-radius: var(--r-md);
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.4rem;
  opacity: 0.5;
}

.project-meta { flex: 1; min-width: 0; }

.project-platform {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  opacity: 0.75;
  margin-bottom: 0.35rem;
}

.project-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-hi);
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.65;
}

.project-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-top: 0.9rem;
}
.pill {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: var(--teal-dim);
  color: rgba(44, 202, 184, 0.85);
  border: 1px solid rgba(44, 202, 184, 0.16);
  letter-spacing: 0.04em;
}
.pill.gold {
  background: var(--gold-dim);
  color: rgba(201, 170, 86, 0.9);
  border-color: rgba(201, 170, 86, 0.2);
}

/* ─── About ──────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

.about-text p {
  color: var(--text-mid);
  line-height: 1.85;
  font-size: 0.975rem;
  margin-bottom: 1.1rem;
}
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--text-hi); font-weight: 600; }
.about-text em { color: var(--teal); font-style: normal; }

.interests-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.interest-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color 0.2s, background 0.2s;
}
.interest-item:hover {
  border-color: var(--border-hi);
  background: var(--bg-2);
}
.interest-icon {
  font-size: 1.25rem;
  width: 2.2rem;
  text-align: center;
  flex-shrink: 0;
}
.interest-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-hi);
  line-height: 1.2;
}
.interest-desc {
  font-size: 0.72rem;
  color: var(--text-lo);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
}

/* ─── Divider ────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  max-width: 1100px;
  margin: 0 auto;
}

/* ─── Footer ─────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.footer-links {
  display: flex;
  gap: 1.75rem;
}
.footer-links a {
  color: var(--text-lo);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--teal); }
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-lo);
  letter-spacing: 0.04em;
}

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

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

/* ─── Scroll reveal ──────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-card.featured {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  #navbar { padding: 1rem 1.5rem; }
  .nav-links { gap: 1.5rem; }

  .hero { padding: 7rem 1.5rem 4rem; }
  .section-wrap { padding: 4.5rem 1.5rem; }

  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-card.featured {
    grid-column: span 1;
    flex-direction: column;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 480px) {
  .nav-links { display: none; }

  .hero-title { font-size: clamp(2.8rem, 14vw, 4rem); }

  .hero-actions { flex-direction: column; }
  .btn { text-align: center; justify-content: center; }
}
