:root {
  --bg: #05060d;
  --text: #e9ebf5;
  --muted: #9aa0b8;
  --accent-1: #22d3ee;
  --accent-2: #8b5cf6;
  --accent: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --border: 1px solid rgba(255, 255, 255, .08);
  --card-bg: rgba(255, 255, 255, .03);
  --radius: 16px;
  --radius-sm: 8px;
  --space: 1.5rem;
  --space-section: clamp(4rem, 10vw, 8rem);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

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

.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- Navigation (liquid glass) ---------- */
.nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(560px, 100% - 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1.5rem;
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 10px 40px rgba(0, 0, 0, .45);
  transition: background .3s, box-shadow .3s;
}
.nav:hover { background: rgba(255, 255, 255, .1); }
.nav.is-scrolled { background: rgba(10, 12, 24, .55); }

.nav__logo { font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
.nav__links { display: flex; gap: 1.5rem; }
.nav__links a, .nav__logo { position: relative; transition: text-shadow .2s, color .2s; }
.nav__links a { color: var(--muted); font-size: .95rem; padding: .2rem 0; }
.nav__links a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform .25s;
}
.nav__links a:hover { color: var(--text); text-shadow: 0 0 12px rgba(34, 211, 238, .6); }
.nav__links a:hover::after { transform: scaleX(1); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: .85rem 2rem;
  border-radius: 999px;
  background: var(--accent);
  color: #05060d;
  font-weight: 600;
  box-shadow: 0 6px 24px rgba(139, 92, 246, .25);
  transition: transform .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 34px rgba(34, 211, 238, .4); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  /* faint nebula glows + deep-space base */
  background:
    radial-gradient(ellipse 50% 40% at 20% 75%, rgba(139, 92, 246, .14), transparent 70%),
    radial-gradient(ellipse 45% 35% at 80% 25%, rgba(34, 211, 238, .09), transparent 70%),
    radial-gradient(ellipse at 50% 0%, #11122a 0%, var(--bg) 65%);
}
#stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__content {
  position: relative;
  z-index: 1;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.hero__title {
  font-size: clamp(1rem, 4.4vw, 2.5rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap; /* keep the heading on one line */
}
.hero__typing {
  font-size: clamp(1.2rem, 3.5vw, 1.9rem);
  color: var(--muted);
  min-height: 1.6em;
}
.cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: var(--accent-1);
  box-shadow: 0 0 8px var(--accent-1);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Sections ---------- */
.section { padding: var(--space-section) 0; }
.section__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 3rem;
}

.card {
  background: var(--card-bg);
  border: var(--border);
  border-radius: var(--radius);
  transition: transform .3s, border-color .3s, box-shadow .3s;
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space);
}

.project { overflow: hidden; display: flex; flex-direction: column; }
.project:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, .45);
  box-shadow: 0 0 30px rgba(34, 211, 238, .15);
}
.project__bar {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem .9rem;
  background: rgba(255, 255, 255, .04);
  border-bottom: var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot--r { background: #ff5f57; }
.dot--y { background: #febc2e; }
.dot--g { background: #28c840; }
.project__url { margin-left: .6rem; font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.project__preview {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #12183a, #2a1450 55%, #0e3a4a); /* placeholder when image is missing */
}
.project__preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.project:hover .project__preview img { transform: scale(1.06); }

.project__body { padding: 1.25rem; display: flex; flex-direction: column; gap: .75rem; flex: 1; }
.project__body h3 { font-size: 1.15rem; }
.project__body p { color: var(--muted); font-size: .95rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  font-size: .72rem;
  padding: .2rem .65rem;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, .35);
  background: rgba(139, 92, 246, .1);
  color: #c4b5fd;
}
.project__link {
  margin-top: auto;
  align-self: flex-start;
  font-size: .9rem;
  font-weight: 600;
  color: var(--accent-1);
}
.project__link:hover { text-decoration: underline; }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: 1fr; gap: var(--space); }
.service { padding: 2rem; }
.service:hover {
  transform: translateY(-6px);
  border-color: rgba(139, 92, 246, .45);
  box-shadow: 0 0 30px rgba(139, 92, 246, .15);
}
.service__icon { width: 44px; height: 44px; color: var(--accent-1); margin-bottom: 1.25rem; }
.service h3 { margin-bottom: .5rem; font-size: 1.25rem; }
.service p { color: var(--muted); }

/* ---------- Contact ---------- */
.section--contact { padding-bottom: calc(var(--space-section) * .8); }
.contact { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.contact .section__title { margin-bottom: 0; }
.contact p { color: var(--muted); }
.contact__mail {
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  font-weight: 600;
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow-wrap: anywhere;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
/* keep hover lift working after reveal finished */
.card.reveal.is-visible { transition: opacity .7s ease, transform .3s, border-color .3s, box-shadow .3s; }

/* ---------- Breakpoints (mobile-first) ---------- */
@media (min-width: 480px) {
  .nav { padding: .75rem 1.75rem; }
}
@media (min-width: 768px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .projects-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  #stars { display: none; }
}
