:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-alt: #eef1f8;
  --text: #14181f;
  --muted: #5b6472;
  --border: #e2e6ef;
  --accent: #2f6fed;
  --accent-soft: #e7eefd;
  --accent-2: #0aa88a;
  --shadow: 0 10px 30px rgba(20, 30, 60, .08);
  --shadow-sm: 0 2px 8px rgba(20, 30, 60, .06);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-alt: #11161d;
    --text: #e6edf3;
    --muted: #9aa4b2;
    --border: #232a33;
    --accent: #5b8dff;
    --accent-soft: #16233d;
    --accent-2: #2fd0ad;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: .85rem;
  letter-spacing: .02em;
}
.logo-name { white-space: nowrap; }

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav a {
  color: var(--muted);
  font-weight: 500;
}
.nav a:hover, .nav a.is-active {
  color: var(--text);
  text-decoration: none;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
}
.lang-btn.is-active {
  background: var(--accent);
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  position: relative;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transform: translateX(-50%);
}
.nav-toggle-bar { top: 50%; margin-top: -1px; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }

/* Hero */
.hero {
  padding: clamp(56px, 9vw, 104px) 0 clamp(40px, 6vw, 64px);
  background:
    radial-gradient(60% 80% at 85% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(50% 70% at 5% 20%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 70%);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: .8em;
}
.role {
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  font-weight: 600;
  color: var(--muted);
  margin-top: -.3em;
}
.lead {
  max-width: 640px;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 44px;
}
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.stats li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.stats strong {
  display: block;
  font-size: 1.9rem;
  line-height: 1.1;
  color: var(--accent);
}
.stats span {
  color: var(--muted);
  font-size: .9rem;
}

/* Sections */
.section { padding: clamp(48px, 7vw, 84px) 0; }
.section-alt { background: var(--surface-alt); }
.kicker {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: .5em;
}
.section-intro {
  max-width: 660px;
  color: var(--muted);
  margin-bottom: 2em;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: start;
}
.about-facts {
  display: grid;
  gap: 14px;
}
.fact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.fact-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}
.fact-label {
  color: var(--muted);
  font-size: .9rem;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 40px;
}
.skill-group h3 {
  color: var(--muted);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags li {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: .88rem;
  font-weight: 500;
}

/* Projects */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .4em; }
.card p { color: var(--muted); font-size: .95rem; }
.tech {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}
.tech li {
  font-size: .78rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
}
.more { margin-top: 26px; font-weight: 600; }

/* Contacts */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, border-color .15s ease;
}
.contact-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: var(--accent);
}
.contact-card.is-static:hover { transform: none; border-color: var(--border); }
.contact-label {
  display: block;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 4px;
}
.contact-value {
  font-weight: 600;
  word-break: break-word;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  color: var(--muted);
  font-size: .9rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.site-footer p { margin: 0; }
.muted { color: var(--muted); }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, .contact-card { transition: none; }
}

/* Responsive */
@media (max-width: 820px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 64px;
    right: 20px;
    left: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 8px 0; width: 100%; }
  .lang-switch { margin-top: 8px; }
}

@media (max-width: 460px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .actions .btn { flex: 1 1 auto; text-align: center; }
}
