:root {
  --bg: #05050f;
  --bg-2: #0b0b1f;
  --surface: #10112680;
  --border: #ffffff1a;
  --text: #e8e9f5;
  --text-dim: #9a9cc0;
  --accent: #7bdcff;
  --accent-2: #b98bff;
  --accent-3: #ff8bd8;
  --glow: 0 0 24px #7bdcff40, 0 0 48px #b98bff26;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at top, var(--bg-2) 0%, var(--bg) 60%);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
}

.hero {
  flex: 0 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem) 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem clamp(1.25rem, 4vw, 3rem) 1.25rem;
  max-width: 900px;
}

.eyebrow {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.65rem;
  color: var(--accent-3);
}

.hero-content h1 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  line-height: 1.2;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  letter-spacing: -0.01em;
}

.hero-sub {
  margin: 0;
  max-width: 70ch;
  color: var(--text-dim);
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  line-height: 1.5;
}

.projects {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(1.25rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem);
}

.grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 210px));
  justify-content: center;
  gap: 1.25rem;
}

.card {
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #7bdcff55;
  box-shadow: var(--glow);
}

.card-img {
  flex: 0 0 42%;
  min-height: 0;
  width: calc(100% + 2.2rem);
  margin: -1.1rem -1.1rem 0.85rem;
  object-fit: cover;
  object-position: top;
  border-bottom: 1px solid var(--border);
  filter: saturate(0.9) brightness(0.9);
}

.card-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-body h3 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 1rem;
  color: var(--accent);
}

.card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

@media (max-width: 1000px) {
  html, body {
    height: auto;
  }

  body {
    overflow: visible;
  }

  .projects {
    padding-top: 1rem;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 240px));
  }

  .card {
    aspect-ratio: auto;
  }

  .card-img {
    height: 150px;
    flex-basis: auto;
  }

  .card p {
    -webkit-line-clamp: initial;
  }
}
