/* Pavel Komarov — personal site */
:root {
  --bg: #0a0d10;
  --bg-soft: #0d1116;
  --surface: #111821;
  --surface-2: #151d27;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8edf2;
  --muted: #94a2b1;
  --muted-2: #6f7d8c;
  --accent: #8fb6ff;
  --accent-strong: #b9d2ff;
  --accent-soft: rgba(143, 182, 255, 0.12);
  --ok: #7ee2b8;
  --err: #ff9a9a;
  --radius: 18px;
  --container: 1120px;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 12% -8%, rgba(143, 182, 255, 0.10), transparent 60%),
    radial-gradient(900px 520px at 92% 6%, rgba(94, 234, 212, 0.05), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

h1, h2, h3, p, ul, pre { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; }
img, svg { display: block; }

.container {
  position: relative;
  width: min(var(--container), 100% - 48px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #08101c;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; }

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

::selection { background: rgba(143, 182, 255, 0.28); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: rgba(10, 13, 16, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, rgba(143, 182, 255, 0.18), rgba(143, 182, 255, 0.04));
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}

.site-nav a {
  position: relative;
  text-decoration: none;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--text); }
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -7px;
  height: 1px;
  background: var(--accent);
  transition: right 0.25s ease;
}
.site-nav a:hover::after { right: 0; }

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(64px, 10vw, 120px) 0 clamp(56px, 8vw, 96px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(32px, 5vw, 64px);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2.9rem, 6.4vw, 4.9rem);
  line-height: 0.99;
  letter-spacing: -0.045em;
  font-weight: 650;
  margin-bottom: 24px;
}

.grad {
  background: linear-gradient(100deg, #f2f7ff 6%, #b9d2ff 45%, #7fa6f0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 560px;
  font-size: clamp(16px, 1.7vw, 18px);
  color: var(--muted);
  margin-bottom: 34px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #c3d9ff 0%, #8fb6ff 55%, #7b9fee 100%);
  color: #07101d;
  box-shadow: 0 10px 30px rgba(113, 148, 226, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(113, 148, 226, 0.34);
}

.btn-ghost {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(143, 182, 255, 0.5);
  background: rgba(143, 182, 255, 0.06);
}

.btn:active { transform: translateY(0); }

.btn-block { width: 100%; }

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted-2);
}
.hero-facts li { display: flex; align-items: baseline; gap: 8px; }
.hero-facts strong {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ---------- Hero code card ---------- */
.hero-visual {
  position: relative;
  min-height: 280px;
}

.glow {
  position: absolute;
  inset: 8% 6%;
  z-index: 0;
  background: radial-gradient(closest-side, rgba(143, 182, 255, 0.22), transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}

.code-card {
  position: relative;
  z-index: 1;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(175deg, #0e151d, #0a0f15);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: rotate(-1.4deg);
  overflow: hidden;
}

.code-bar {
  display: flex;
  gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.code-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}
.code-bar span:first-child { background: rgba(255, 122, 122, 0.55); }
.code-bar span:nth-child(2) { background: rgba(255, 200, 110, 0.5); }
.code-bar span:last-child { background: rgba(126, 226, 184, 0.5); }

.code-card pre {
  padding: 22px 24px 26px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 2;
  color: #c7d2df;
}
.code-card code { font-family: inherit; }
.c-dim { color: #5d6a79; }
.c-accent { color: #a9c7ff; }
.c-str { color: #8fe3c0; }
.c-brace { color: #7f8ea0; }

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: clamp(64px, 9vw, 104px) 0;
  scroll-margin-top: 84px;
}

.section + .section { border-top: 1px solid rgba(255, 255, 255, 0.05); }

.section-head { margin-bottom: clamp(32px, 4vw, 52px); }

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 16px;
}
.section-label span:first-child { color: var(--accent); }

.section h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 640;
}

.section-sub {
  max-width: 600px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 16.5px;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.about-text p {
  color: var(--muted);
  font-size: 16.5px;
  margin-bottom: 18px;
}
.about-text p:last-child { margin-bottom: 0; }

.about-list {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
}

.about-list li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 13px 14px;
  border-radius: 12px;
  font-size: 15px;
  color: #d5dee8;
  transition: background 0.2s ease;
}
.about-list li:hover { background: rgba(255, 255, 255, 0.03); }

.dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(143, 182, 255, 0.6);
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.skill-card {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.skill-card:hover {
  border-color: rgba(143, 182, 255, 0.35);
  transform: translateY(-3px);
}

.skill-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.skill-top h3 {
  font-size: 17.5px;
  font-weight: 620;
  letter-spacing: -0.01em;
}
.skill-index {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips li {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 13px;
  color: #c2cedb;
  white-space: nowrap;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 34px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, rgba(143, 182, 255, 0.5), rgba(255, 255, 255, 0.06));
}

.timeline-item { position: relative; }

.timeline-marker {
  position: absolute;
  left: -34px;
  top: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(143, 182, 255, 0.6);
  background: rgba(143, 182, 255, 0.15);
  box-shadow: 0 0 0 5px rgba(143, 182, 255, 0.06);
}

.timeline-card {
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
}

.timeline-period {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.timeline-card h3 {
  font-size: clamp(19px, 2.2vw, 23px);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.timeline-summary {
  color: var(--muted);
  font-size: 15.5px;
  margin-bottom: 20px;
}

.check-list { display: grid; gap: 11px; }
.check-list li {
  position: relative;
  padding-left: 24px;
  color: #c9d4e0;
  font-size: 15px;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, #a9c7ff, #6f96e8);
  box-shadow: 0 0 10px rgba(143, 182, 255, 0.4);
}

/* ---------- Education ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.edu-card {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.edu-card:hover {
  border-color: rgba(143, 182, 255, 0.3);
  transform: translateY(-3px);
}

.edu-type {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 14px;
}

.edu-card h3 {
  font-size: 16.5px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.edu-card p:last-child {
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Contact ---------- */
.section-contact {
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(143, 182, 255, 0.06), transparent 70%);
}

.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 20px;
  align-items: start;
}

.contact-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
}

.contact-list { display: grid; gap: 2px; }

.contact-list a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.2s ease;
}
.contact-list a:hover { background: rgba(143, 182, 255, 0.07); }

.contact-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(143, 182, 255, 0.07);
  color: var(--accent-strong);
}
.contact-icon svg { width: 19px; height: 19px; }

.contact-meta { display: grid; gap: 2px; min-width: 0; }
.contact-meta small {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.contact-meta strong {
  font-size: 15.5px;
  font-weight: 550;
  overflow-wrap: anywhere;
}

/* ---------- Form ---------- */
.contact-form {
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
}

.field { margin-bottom: 16px; }

.field label,
.label-row label {
  display: block;
  font-size: 13.5px;
  font-weight: 550;
  color: #cbd6e2;
  margin-bottom: 7px;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.label-row label { margin-bottom: 7px; }

.counter {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
}
.counter.is-near { color: #ffc46b; }

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(8, 12, 17, 0.65);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input::placeholder,
.field textarea::placeholder { color: #62707f; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(143, 182, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(143, 182, 255, 0.14);
  background: rgba(8, 12, 17, 0.9);
}

.field textarea {
  min-height: 152px;
  resize: vertical;
  line-height: 1.55;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: rgba(255, 122, 122, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 122, 122, 0.1);
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-consent {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted-2);
}

.form-status {
  min-height: 22px;
  margin-top: 10px;
  font-size: 14px;
}
.form-status.is-error { color: var(--err); }
.form-status.is-success { color: var(--ok); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 26px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--muted-2);
}

/* ---------- Reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 0; max-width: 560px; }
  .code-card { transform: rotate(-0.8deg); }
  .about-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .site-nav { display: none; }
  .lang-switch { margin-left: auto; }
}

@media (max-width: 680px) {
  .container { width: min(var(--container), 100% - 32px); }
  .header-inner { height: 64px; gap: 12px; }
  .brand-name { font-size: 14px; }
  .hero { padding-top: 48px; }
  .hero-facts { gap: 8px 20px; }
  .skills-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .section h2 { letter-spacing: -0.02em; }
  .timeline { padding-left: 28px; }
  .timeline-marker { left: -28px; }
  .code-card pre { font-size: 12px; padding: 18px 18px 22px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn,
  .skill-card,
  .edu-card,
  .site-nav a::after { transition: none; }
}

