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

/* ── Skip link ── */
.skip-link {
  position: fixed;
  top: 0;
  left: 16px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  z-index: 9999;
  transform: translateY(-110%);
  transition: transform 0.15s;
}
.skip-link:focus { transform: translateY(0); }

:root {
  --bg: #0a0a0b;
  --surface: #111113;
  --border: #1e1e22;
  --text: #e8e8ed;
  --muted: #888890;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --accent-shadow: rgba(59, 130, 246, 0.3);
  --status-green: #22c55e;
  --status-green-bg: rgba(34, 197, 94, 0.08);
  --status-green-border: rgba(34, 197, 94, 0.2);
  --radius-pill: 9999px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: light) {
  html:not(.dark) {
    --bg: #f9f9fb;
    --surface: #ffffff;
    --border: #e4e4e8;
    --text: #111113;
    --muted: #666670;
    --accent-glow: rgba(59, 130, 246, 0.08);
    --accent-shadow: rgba(59, 130, 246, 0.15);
  }
}

/* Explicit user preference overrides system preference */
html.light {
  --bg: #f9f9fb;
  --surface: #ffffff;
  --border: #e4e4e8;
  --text: #111113;
  --muted: #666670;
  --accent-glow: rgba(59, 130, 246, 0.08);
  --accent-shadow: rgba(59, 130, 246, 0.15);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  background: var(--bg); /* fallback for browsers without color-mix support */
  background: color-mix(in srgb, var(--bg) 80%, transparent);
}

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

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.nav-logo span { color: var(--accent); }

nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}

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

nav a:focus-visible {
  color: var(--text);
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Theme toggle ── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  line-height: 0;
  transition: color 0.15s, border-color 0.15s;
}

.theme-toggle:hover { color: var(--text); border-color: var(--muted); }

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

/* ── Sections ── */
section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

section.hero {
  border-top: none;
  padding: 96px 0 80px;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
}

/* ── Hero ── */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero h1 .accent { color: var(--accent); }

.hero p {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-shadow);
}

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

.btn-ghost:hover {
  background: var(--surface);
  transform: translateY(-1px);
}

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

/* ── About ── */
.about p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.about p:last-child { margin-bottom: 0; }

.about strong { color: var(--text); }

/* ── Stack ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tag {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ── Projects ── */
.projects-grid {
  display: grid;
  gap: 16px;
}

.project-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  transform: translateY(-2px);
}

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

.project-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.project-card p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tech-tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* ── Contact ── */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}

.contact-link:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: translateX(4px);
}

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

.contact-link .label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
}

.contact-link .name { color: var(--text); font-weight: 500; }

.contact-link svg { flex-shrink: 0; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover { color: var(--text); }

/* ── Availability badge ── */
.availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--status-green);
  background: var(--status-green-bg);
  border: 1px solid var(--status-green-border);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 32px;
}

.availability::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--status-green);
  border-radius: 50%;
}

@media (max-width: 480px) {
  section.hero { padding: 64px 0 56px; }

  footer .container {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
