:root {
  --bg: #0B0D10;
  --surface: #14171C;
  --border: #232830;
  --text: #E8EAED;
  --text-muted: #8A93A0;
  --accent: #7C5CFF;
  --accent-text: #ffffff;
  --radius: 10px;
  --container-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

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

section {
  scroll-margin-top: 76px;
}

/* Header / Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 16, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-weight: 700;
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-menu a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:disabled:hover {
  border-color: var(--border);
  color: var(--text);
  opacity: 0.4;
}

/* Section titles */
.section-title {
  font-size: 1.8rem;
  margin: 0 0 2rem;
  letter-spacing: -0.01em;
}

section > .container {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero > .container {
  padding-top: 6rem;
  padding-bottom: 6rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  line-height: 1.08;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

.hero-subhead {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 46ch;
  margin: 0 0 1rem;
}

.hero-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-media {
  display: flex;
  justify-content: center;
}

.avatar-frame {
  width: 280px;
  height: 280px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.avatar-fallback {
  display: none;
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.avatar-frame.no-image .avatar-fallback {
  display: block;
}

/* About */
.about-body p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 68ch;
  margin: 0 0 1.1rem;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-image {
  aspect-ratio: 16 / 9;
  background: linear-gradient(180deg, #171b21, #12151a);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  filter: blur(3px);
  transform: scale(1.05);
  transition: filter 0.2s ease;
}

.project-card:hover .card-image img,
.project-card:focus-within .card-image img {
  filter: blur(0);
}

.card-image.no-image::before {
  content: "Preview coming soon";
  color: var(--text-muted);
  font-size: 0.85rem;
}

.card-body {
  padding: 1.25rem 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.card-body p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 1rem;
  flex: 1;
}

.tech-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
  padding: 0;
}

.tech-tags li {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  gap: 0.6rem;
}

.projects-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 2.5rem 0 0;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.skill-group h3 {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chip-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.chip {
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Contact */
.contact-lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 52ch;
  margin: 0 0 2rem;
}

.contact-actions {
  margin-bottom: 1.75rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.social-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
}

.site-footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Tablet */
@media (max-width: 1024px) {
  .container {
    padding: 0 1.25rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .nav-menu {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    display: none;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu a {
    display: block;
    padding: 0.85rem 1.5rem;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    min-height: auto;
  }

  .hero > .container {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-media {
    order: -1;
  }

  .avatar-frame {
    width: 160px;
    height: 160px;
  }

  .avatar-fallback {
    font-size: 2.25rem;
  }

  section > .container {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
