:root {
  --ground: #0a0e1a;
  --tint: #10152a;
  --heading: #f4f6ff;
  --body: #a8b0c8;
  --caption: #8d96b0; /* kept at 4.5:1+ on ground for small text */
  --accent: #5eead4;
  --accent-2: #7c8cf8;
  --card: #1a2138;
  --line: #232c4a;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--ground);
  color: var(--body);
  font-family: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2 { color: var(--heading); line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: 0.4rem; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 5vw, 3rem);
  background: rgba(10, 14, 26, 0.85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand { color: var(--heading); font-weight: 700; font-size: 1.05rem; }
.brand-accent { color: var(--accent); }
.topbar nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.topbar nav a { color: var(--body); font-size: 0.95rem; }
.topbar nav a:hover { color: var(--heading); text-decoration: none; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 12vh, 8rem) clamp(1rem, 5vw, 3rem);
}
.hero-inner { position: relative; max-width: 820px; }
.eyebrow {
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.75rem;
}
.tagline { font-size: clamp(1.05rem, 2.2vw, 1.3rem); margin: 1.1rem 0 2rem; max-width: 560px; }
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0e1a;
}
.btn-ghost {
  color: var(--heading);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
}
.btn-ghost:hover { border-color: var(--accent); }

.glow {
  position: absolute;
  top: -120px; right: -80px;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(124,140,248,0.18), rgba(94,234,212,0.10) 45%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

/* Sections */
.section { padding: clamp(3rem, 9vh, 6rem) clamp(1rem, 5vw, 3rem); }
.section-tint { background: var(--tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-sub { color: var(--caption); margin-bottom: 2rem; max-width: 520px; }
.section > h2, .section > .section-sub { max-width: 1100px; margin-left: auto; margin-right: auto; }
.section > .grid, .section > .skills, .section > .contact-card { max-width: 1100px; margin-left: auto; margin-right: auto; }

/* Projects */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.3s ease, border-color 0.3s ease;
  animation: arrive 0.45s ease backwards;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card h3 { color: var(--heading); font-size: 1.2rem; margin-bottom: 0.5rem; }
.card p { font-size: 0.95rem; }
.card .links { margin-top: 1rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.card .links a { font-size: 0.9rem; font-weight: 600; }
.tech { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.tech li {
  list-style: none;
  font-size: 0.78rem;
  color: var(--caption);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  background: rgba(255,255,255,0.03);
}

.empty-note { color: var(--caption); font-style: italic; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.skill-group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; animation: arrive 0.45s ease backwards; }
.skill-group h3 { color: var(--heading); font-size: 1rem; margin-bottom: 0.75rem; }
.skill-group ul { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.skill-group li {
  list-style: none;
  font-size: 0.85rem;
  color: var(--body);
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
}

/* Contact */
.contact-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  max-width: 720px;
  animation: arrive 0.45s ease backwards;
}
.contact-links { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.25rem; }
.contact-links a { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem clamp(1rem, 5vw, 3rem);
  color: var(--caption);
  font-size: 0.85rem;
}

.hidden { display: none; }

@keyframes arrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* stagger cards */
.card:nth-child(2), .skill-group:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3), .skill-group:nth-child(3) { animation-delay: 0.16s; }
.card:nth-child(4) { animation-delay: 0.24s; }
.card:nth-child(5) { animation-delay: 0.32s; }
.card:nth-child(6) { animation-delay: 0.40s; }

@media (max-width: 560px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .hero { padding-top: 4rem; }
}
