:root {
  --bg: #ffffff;
  --text: #1a1d23;
  --muted: #5b6270;
  --line: #e6e8ec;
  --card: #f6f7f9;
  --accent: #2557d6;
  --accent-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --text: #e8eaee;
    --muted: #9aa1ae;
    --line: #232731;
    --card: #171a21;
    --accent: #6c93ff;
    --accent-text: #0f1115;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1115;
  --text: #e8eaee;
  --muted: #9aa1ae;
  --line: #232731;
  --card: #171a21;
  --accent: #6c93ff;
  --accent-text: #0f1115;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

main, .nav, footer {
  max-width: 820px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand { font-weight: 700; color: var(--text); text-decoration: none; }

.nav nav { display: flex; gap: 18px; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav nav { align-items: center; }
.nav nav a:hover, .nav nav a.active { color: var(--text); }
.nav nav a.active { font-weight: 600; }

.icon-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 6px 9px;
}
.icon-btn:hover { border-color: var(--accent); }

button.btn { font: inherit; font-weight: 600; background: none; cursor: pointer; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

section { padding: 48px 0; border-top: 1px solid var(--line); }
section.hero { border-top: 0; padding: 72px 0 56px; }

h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.2; margin: 0 0 20px; }
h2 { font-size: 1.5rem; margin: 0 0 20px; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
h4 { font-size: 1rem; margin: 0 0 4px; }
p { margin: 0 0 14px; }

.eyebrow { color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.muted { color: var(--muted); margin: 0; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { opacity: 0.9; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: 10px; padding: 20px; }
.card p { margin: 0; color: var(--muted); }

.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-bottom: 20px; }

.projects { list-style: none; margin: 0; padding: 0; }
.projects li { padding: 16px 0; border-top: 1px solid var(--line); }
.projects p { margin: 0; color: var(--muted); }

.skills { display: grid; gap: 18px; }
.skills h3 { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: 0.92rem; }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 32px; position: relative; }
.hero::before {
  content: "";
  position: absolute;
  inset: -40px -20px auto auto;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.16;
  z-index: -1;
  pointer-events: none;
}
.avatar {
  flex: none;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-text);
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 8px var(--line);
}

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 8px; }
.stats div { background: var(--card); border-radius: 10px; padding: 18px; text-align: center; }
.stats strong { display: block; font-size: 2rem; line-height: 1.2; color: var(--accent); }
.stats span { color: var(--muted); font-size: 0.9rem; }

.icon {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.projects { border-left: 2px solid var(--line); }
.projects li { position: relative; padding-left: 24px; border-top: 0; }
.projects li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
}

.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }

footer { padding-top: 24px; padding-bottom: 40px; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--line); }

@media (max-width: 560px) {
  .nav { flex-direction: column; gap: 10px; }
  .hero { flex-direction: column-reverse; align-items: flex-start; }
  .avatar { width: 100px; height: 100px; font-size: 2rem; }
  .stats { grid-template-columns: 1fr; }
}
