/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg: #0c0812;
  --bg-elevated: #140f1e;
  --bg-card: #1a1228;
  --border: rgba(196, 181, 253, 0.1);
  --text: #f3eeff;
  --text-muted: #a89bc4;
  --accent: #a855f7;
  --accent-light: #c084fc;
  --accent-dim: rgba(168, 85, 247, 0.18);
  --accent-warm: #e879f9;
  --gradient: linear-gradient(135deg, #6d28d9 0%, #a855f7 48%, #d8b4fe 100%);
  --shadow: 0 24px 64px rgba(76, 29, 149, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --header-h: 72px;
  --container: min(1120px, calc(100% - 2.5rem));
  --transition: 0.25s ease;
}

/* ── Reset & base ──────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

strong {
  color: #fff;
  font-weight: 600;
}

.container {
  width: var(--container);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 999;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* ── Header ────────────────────────────────────────────────── */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  background: rgba(12, 8, 18, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
}

.nav__logo-img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.35);
}

.nav__logo-text {
  letter-spacing: -0.02em;
}

.nav__menu {
  display: flex;
  gap: 2rem;
}

.nav__menu a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav__menu a:hover,
.nav__menu a:focus-visible {
  color: var(--accent);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--gradient);
  color: var(--bg);
  box-shadow: 0 8px 28px rgba(168, 85, 247, 0.35);
}

.btn--primary:hover {
  box-shadow: 0 12px 36px rgba(168, 85, 247, 0.5);
}

.btn--ghost {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.btn--ghost:hover {
  border-color: rgba(168, 85, 247, 0.45);
  background: var(--accent-dim);
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 3rem) 0 4rem;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 20% 40%, rgba(168, 85, 247, 0.2), transparent),
    radial-gradient(ellipse 50% 40% at 80% 20%, rgba(124, 58, 237, 0.15), transparent),
    radial-gradient(ellipse 40% 30% at 60% 80%, rgba(216, 180, 254, 0.1), transparent);
  pointer-events: none;
}

.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black, transparent);
}

.hero__inner {
  position: relative;
  max-width: 760px;
}

.hero__eyebrow {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.hero__title {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.hero__title-accent {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 34ch;
  margin-bottom: 2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 3.5rem;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero__stats dt {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
}

.hero__stats dd {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Sections ──────────────────────────────────────────────── */
.section {
  padding: 6rem 0;
}

.section__eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
}

.section__header h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section__header--center {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: 3rem;
}

.section__subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ── About ─────────────────────────────────────────────────── */
.about {
  background: var(--bg-elevated);
  border-block: 1px solid var(--border);
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
}

.about__content p {
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

.about__intro {
  font-size: 1.15rem;
  color: var(--text) !important;
}

.about__quote {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text);
}

/* ── Projects ──────────────────────────────────────────────── */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  border-color: rgba(168, 85, 247, 0.35);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.project-card__category {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-warm);
  margin-bottom: 0.5rem;
}

.project-card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.project-card__top p {
  color: var(--text-muted);
  font-size: 0.98rem;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.project-card__tags li {
  padding: 0.3rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
}

.project-card__features {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.project-card__features li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.project-card__features li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8rem;
}

/* ── Skills ────────────────────────────────────────────────── */
.skills {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.skills__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.skill-group {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.skill-group h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #fff;
}

.skill-group li {
  font-size: 0.92rem;
  color: var(--text-muted);
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.skill-group li:last-child {
  border-bottom: none;
}

/* ── Contact ───────────────────────────────────────────────── */
.contact__inner {
  text-align: center;
}

.contact__card {
  display: inline-block;
  margin-top: 2rem;
  padding: 2.5rem 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact__name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.contact__role {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.contact__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.contact__link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--accent);
  padding: 0.6rem 1.2rem;
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 999px;
  transition: background var(--transition);
}

.contact__link:hover {
  background: var(--accent-dim);
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer__top {
  transition: color var(--transition);
}

.footer__top:hover {
  color: var(--accent);
}

/* ── Scroll reveal ─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .about__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .projects__grid {
    grid-template-columns: 1fr;
  }

  .skills__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero__stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .nav__toggle {
    display: flex;
  }

  .nav__menu {
    position: fixed;
    inset: var(--header-h) 0 auto;
    flex-direction: column;
    gap: 0;
    background: rgba(12, 8, 18, 0.97);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem 1.5rem;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
  }

  .nav__menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav__menu li {
    border-bottom: 1px solid var(--border);
  }

  .nav__menu a {
    display: block;
    padding: 0.85rem 0;
  }

  .skills__grid {
    grid-template-columns: 1fr;
  }

  .contact__card {
    padding: 1.75rem 1.5rem;
    width: 100%;
  }

  .footer__inner {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}
