:root {
  --bg: #0f1117;
  --text: #e6e8ee;
  --dim: #9aa3b2;
  --line: #262b36;
  --accent: #8ab4f8;
  --accent-ink: #0b1220;
  --tag-bg: #1a2130;
  --ok: #7ddc9a;
  --err: #f28b82;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --bg: #ffffff; --text: #1b1f27; --dim: #5c6676; --line: #e6e8ec; --accent: #1a56c4; --accent-ink: #ffffff; --tag-bg: #eef3fb; --ok: #1f7a46; --err: #b3261e; }
}
:root[data-theme="light"] { --bg: #ffffff; --text: #1b1f27; --dim: #5c6676; --line: #e6e8ec; --accent: #1a56c4; --accent-ink: #ffffff; --tag-bg: #eef3fb; --ok: #1f7a46; --err: #b3261e; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
main, .top, .foot { max-width: 680px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 2.2rem; font-weight: 700; }
h2 { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 1.2rem; }
h3 { font-size: 1.02rem; font-weight: 600; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 6px 10px; border-radius: 6px; }
.skip:focus { left: 8px; z-index: 10; }

.top { display: flex; align-items: center; justify-content: space-between; padding-top: 24px; padding-bottom: 24px; }
.nav { display: flex; gap: 18px; }
.nav a { color: var(--dim); font-size: 0.9rem; font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }
.theme-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--dim); cursor: pointer; }
.theme-toggle:hover { color: var(--text); border-color: var(--dim); }
.icon-moon { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }
:root[data-theme="light"] .icon-sun { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .icon-moon { display: block; }
  :root:not([data-theme="dark"]) .icon-sun { display: none; }
}

.intro { padding: 48px 0 16px; }
.role { font-size: 1.1rem; font-weight: 500; margin: 6px 0 10px; }
.tagline { color: var(--dim); max-width: 46ch; margin-bottom: 1.4rem; }
.social { list-style: none; padding: 0; margin: 0; display: flex; gap: 16px; }
.social a { color: var(--dim); display: inline-flex; }
.social a:hover { color: var(--text); }

.section { padding: 40px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section p { max-width: 62ch; }

.list { list-style: none; padding: 0; margin: 0; }
.list > li { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 16px 0; }
.list > li + li { border-top: 1px solid var(--line); }
.when { color: var(--dim); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; padding-top: 4px; }
.list p { color: var(--dim); font-size: 0.95rem; margin: 6px 0 0; }
.projects > li { grid-template-columns: 40px 1fr; }
.tags { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 0.75rem; font-weight: 500; color: var(--accent); background: var(--tag-bg); border-radius: 999px; padding: 3px 10px; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 560px; margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: 0.85rem; font-weight: 500; color: var(--dim); }
.field input, .field textarea { font: inherit; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.btn { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 10px 20px; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .6; cursor: progress; }
.form-status { margin: 0; color: var(--dim); font-size: 0.9rem; }
.form-status.is-ok { color: var(--ok); }
.form-status.is-error { color: var(--err); }

.foot { border-top: 1px solid var(--line); padding-top: 24px; padding-bottom: 48px; color: var(--dim); font-size: 0.85rem; }
.foot p { margin: 0; }
.notfound { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }

@media (max-width: 560px) {
  .nav { gap: 14px; }
  .list > li { grid-template-columns: 1fr; gap: 4px; }
  .projects > li { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
}
