:root {
  --color-bg: #f5f7fb;
  --color-surface: #ffffff;
  --color-surface-alt: #e8edfb;
  --color-text: #0f172a;
  --color-muted: #5b6474;
  --color-border: #d7ddea;
  --color-accent: #2563eb;
  --color-accent-strong: #1e3a8a;
  --color-accent-soft: rgba(37, 99, 235, 0.12);
  --color-header-bg: rgba(245, 247, 251, 0.9);
  --color-gradient-start: rgba(37, 99, 235, 0.12);
  --color-gradient-end: rgba(232, 237, 251, 0.8);
  --shadow-soft: 0 15px 40px rgba(15, 23, 42, 0.08);
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --radius-base: 1rem;
  --radius-pill: 999px;
  --section-spacing: clamp(3rem, 6vw, 5rem);
}

body[data-theme="dark"] {
  --color-bg: #070a14;
  --color-surface: #0f172a;
  --color-surface-alt: #1e293b;
  --color-text: #f8fafc;
  --color-muted: #94a3b8;
  --color-border: rgba(148, 163, 184, 0.35);
  --color-accent: #7dd3fc;
  --color-accent-strong: #38bdf8;
  --color-accent-soft: rgba(125, 211, 252, 0.18);
  --color-header-bg: rgba(7, 10, 20, 0.92);
  --color-gradient-start: rgba(15, 23, 42, 0.9);
  --color-gradient-end: rgba(37, 99, 235, 0.25);
  --shadow-soft: 0 20px 45px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body.site-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-pill);
  transform: translateY(-200%);
  transition: transform 0.2s ease;
  z-index: 1000;
}

.skip-link:focus {
  transform: translateY(0);
}

.icon-x,
.icon-inline {
  width: 1em;
  height: 1em;
  display: inline-block;
  fill: currentColor;
}

.container {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  position: sticky;
  top: 0;
  background: var(--color-header-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--color-border);
  z-index: 999;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1.25rem;
}

.brand {
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav {
  display: none;
  gap: 1rem;
  font-size: 0.95rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--color-text);
  background: var(--color-accent-soft);
}

.theme-toggle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  color: var(--color-text);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.theme-toggle-icon {
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.theme-toggle-icon i {
  font-size: 1.05rem;
}

.theme-toggle-icon--sun {
  opacity: 1;
}

body[data-theme="dark"] .theme-toggle-icon--sun {
  opacity: 0;
}

body[data-theme="dark"] .theme-toggle-icon--moon {
  opacity: 1;
}

body[data-theme="dark"] .theme-toggle {
  background: var(--color-surface-alt);
}

.site-main {
  padding-bottom: var(--section-spacing);
}

.section {
  padding: var(--section-spacing) 0;
}

.section-heading {
  margin-bottom: 1.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--color-muted);
  margin: 0 0 0.5rem;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  color: var(--color-text);
}

p {
  margin: 0 0 1rem;
  color: var(--color-muted);
}

.hero {
  padding-top: clamp(2rem, 8vw, 5rem);
}

.hero-inner {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero-media {
  margin: 0;
  width: min(65vw, 240px);
  justify-self: center;
}

.hero-media img {
  border-radius: 50%;
  border: 8px solid var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.hero-content {
  text-align: center;
}

.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.hero-lead {
  font-size: 1.1rem;
}

.social-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 0;
  margin: 1.5rem 0 0;
}

.social-links a {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  display: grid;
  place-items: center;
  color: var(--color-text);
  text-decoration: none;
  background: var(--color-surface);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  font-size: 1.1rem;
}

.social-links a svg {
  width: 1.1em;
  height: 1.1em;
}

.social-links a:hover,
.social-links a:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-3px);
}

.skills-grid,
.projects-grid,
.about-grid {
  display: grid;
  gap: 1.5rem;
}

.skills-grid article,
.project-card,
.about-content,
.contact-content {
  background: var(--color-surface);
  padding: 1.5rem;
  border-radius: var(--radius-base);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skills-grid article:hover,
.project-card:hover,
.about-content:hover,
.contact-content:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

body[data-theme="dark"] .skills-grid article,
body[data-theme="dark"] .project-card,
body[data-theme="dark"] .about-content,
body[data-theme="dark"] .contact-content {
  box-shadow: var(--shadow-soft);
}

.skills-grid h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.projects-grid {
  gap: 1.75rem;
}

.project-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.project-tech {
  font-weight: 600;
  color: var(--color-text);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
  margin-top: 0.5rem;
}

.project-link::after {
  content: "→";
  transition: transform 0.2s ease;
}

.project-link:hover::after,
.project-link:focus-visible::after {
  transform: translateX(3px);
}

.about-grid {
  gap: 2rem;
}

.contact {
  background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
}

.contact-inner {
  background: transparent;
  display: grid;
  gap: 1.5rem;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.contact-list a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.contact-list a svg {
  width: 1.05em;
  height: 1.05em;
}

.contact-list i {
  color: var(--color-accent);
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0;
  background: var(--color-surface);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.footer-note {
  color: var(--color-muted);
  margin: 0;
}

.footer-social {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 0;
  margin: 0;
}

.footer-social a {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.footer-social a svg {
  width: 1.4em;
  height: 1.4em;
}

.footer-social a:hover,
.footer-social a:focus-visible {
  transform: translateY(-4px);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.footer-meta {
  margin: 0;
  color: var(--color-muted);
}

@media (min-width: 600px) {
  .site-nav {
    display: flex;
  }

  .hero-inner {
    grid-template-columns: minmax(200px, 280px) 1fr;
  }

  .hero-content {
    text-align: left;
  }

  .social-links {
    justify-content: flex-start;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    grid-template-columns: 0.9fr 1.1fr;
  }

  .contact-inner {
    grid-template-columns: 0.8fr 1.2fr;
  }
}

@media (min-width: 900px) {
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .section-heading {
    margin-bottom: 2rem;
  }

  .site-nav {
    gap: 1.5rem;
  }
}
