/* ---------------------------------------------------------
   Design tokens
--------------------------------------------------------- */
:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-dim: #64748b;
  --text-faint: #94a3b8;
  --border: #e2e8f0;

  --accent: #2f6fed;
  --accent-hover: #1f57cc;
  --accent-soft: #e9f0ff;
  --accent-2: #14b8a6;
  --accent-2-soft: #e3faf6;

  --font: 'Inter', system-ui, -apple-system, sans-serif;

  --radius-lg: 12px;
  --radius-full: 9999px;
  --content-max: 1120px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 28px -14px rgba(15, 23, 42, 0.18);
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111827;
  --surface-alt: #0f172a;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --border: #1f2937;

  --accent: #5b8def;
  --accent-hover: #7fa5f2;
  --accent-soft: #16233d;
  --accent-2: #2dd4bf;
  --accent-2-soft: #0f2e2a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 16px 32px -16px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --surface: #111827;
    --surface-alt: #0f172a;
    --text: #f1f5f9;
    --text-dim: #94a3b8;
    --text-faint: #64748b;
    --border: #1f2937;

    --accent: #5b8def;
    --accent-hover: #7fa5f2;
    --accent-soft: #16233d;
    --accent-2: #2dd4bf;
    --accent-2-soft: #0f2e2a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 16px 32px -16px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

a { color: inherit; text-decoration: none; }

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

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------------------------------------------------------
   Nav
--------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
}

.nav__mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}

.nav__mark-badge {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav__links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dim);
  padding: 4px 0;
  transition: color 0.15s ease;
}
.nav__link:hover { color: var(--text); }
.nav__link[aria-current="page"] { color: var(--accent); }

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---------------------------------------------------------
   Hero
--------------------------------------------------------- */
.hero {
  padding: 110px 32px 90px;
  border-bottom: 1px solid var(--border);
}

.hero__content {
  max-width: var(--content-max);
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-badge {
  width: 112px;
  height: 112px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 800;
  font-size: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
}

.hero__name {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.hero__role {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 52ch;
  margin: 0 auto 36px;
}

.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.btn {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 12px 26px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  display: inline-block;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-md); }
.btn--ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------
   Section scaffolding
--------------------------------------------------------- */
.section {
  padding: 88px 32px;
  border-bottom: 1px solid var(--border);
}
.section--alt { background: var(--surface-alt); }

.section__inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.section__eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 10px;
}

.section__title {
  font-size: 1.9rem;
  font-weight: 800;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

.section--center { text-align: center; }
.section--center .section__title,
.section--center .section__eyebrow,
.section--center .section__lead { margin-left: auto; margin-right: auto; }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------
   About
--------------------------------------------------------- */
.prose {
  max-width: 64ch;
  color: var(--text-dim);
  font-size: 1.02rem;
  margin: 0 0 28px;
}
.prose code {
  font-family: ui-monospace, monospace;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-2);
  background: var(--accent-2-soft);
  border-radius: var(--radius-full);
  padding: 7px 14px;
}

/* ---------------------------------------------------------
   Projects
--------------------------------------------------------- */
.section__lead {
  color: var(--text-dim);
  max-width: 62ch;
  margin: 0 auto 40px;
  font-size: 0.98rem;
}
.section__lead code {
  font-family: ui-monospace, monospace;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.project-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.project-card__badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card__tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-2);
  background: var(--accent-2-soft);
  padding: 5px 11px;
  border-radius: var(--radius-full);
}

.project-card__name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 8px;
}
.project-card__desc { font-size: 0.92rem; color: var(--text-dim); margin: 0 0 18px; }

.project-card__link {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid transparent;
}
.project-card__link:hover { border-bottom-color: var(--accent); }

/* ---------------------------------------------------------
   Contact
--------------------------------------------------------- */
.contact__email {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  color: var(--accent);
  display: inline-block;
  margin: 0 0 28px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease;
}
.contact__email:hover { border-color: var(--accent); }

.contact__socials {
  display: flex;
  gap: 14px;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.contact__social {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 9px 18px;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.contact__social:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
.footer {
  padding: 32px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.footer .accent { color: var(--accent); font-weight: 700; }

/* ---------------------------------------------------------
   Responsive
--------------------------------------------------------- */
@media (max-width: 760px) {
  .nav__inner { padding: 14px 20px; }
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav__links.is-open { max-height: 260px; }
  .nav__link { padding: 14px 20px; width: 100%; }
  .nav-toggle { display: flex; }
  .hero { padding: 76px 20px 60px; }
  .section { padding: 60px 20px; }
}

@media (max-width: 480px) {
  .hero__actions { flex-direction: column; align-items: stretch; width: 100%; }
  .btn { text-align: center; }
}
