:root {
  --bg: #080a0f;
  --panel: rgba(18, 24, 33, 0.78);
  --panel-strong: rgba(18, 24, 33, 0.94);
  --line: rgba(153, 181, 205, 0.16);
  --text: #eef5f8;
  --muted: #9caab5;
  --soft: #c9d6de;
  --cyan: #41d9e6;
  --green: #6ee88d;
  --amber: #ffc857;
  --rose: #ff6b8a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: #0c0f16;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% 8%, rgba(65, 217, 230, 0.13), transparent 28rem),
    radial-gradient(circle at 84% 18%, rgba(255, 200, 87, 0.1), transparent 24rem),
    linear-gradient(135deg, #080a0f 0%, #10151c 50%, #090d12 100%);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 78%);
}

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

.site-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 10, 15, 0.74);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
}

.brand,
.nav,
.hero-actions,
.hero-stats,
.terminal-top,
.terminal-metrics,
.job-head,
.education-row,
.language-box,
.contact-grid {
  display: flex;
}

.brand {
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(65, 217, 230, 0.45);
  border-radius: 8px;
  color: #071015;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  background: linear-gradient(135deg, var(--cyan), var(--green));
}

.nav {
  align-items: center;
  gap: 4px;
}

.nav a,
.contact-pill {
  min-height: 38px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--soft);
  font-size: 14px;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.nav a:hover,
.contact-pill:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.contact-pill {
  border: 1px solid rgba(110, 232, 141, 0.28);
  color: var(--green);
}

.hero {
  position: relative;
  min-height: calc(100svh - 80px);
  padding: 88px 0 70px;
}

.hero-canvas {
  position: absolute;
  inset: 0 50% auto auto;
  width: 50vw;
  height: 100%;
  min-height: 620px;
  pointer-events: none;
  opacity: 0.72;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.72fr);
  gap: 42px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(44px, 7vw, 92px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(30px, 4.5vw, 56px);
  line-height: 1.02;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 21px;
  line-height: 1.24;
  letter-spacing: 0;
}

.lead {
  max-width: 720px;
  margin-bottom: 30px;
  color: var(--soft);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.6;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  color: #061016;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow: 0 18px 50px rgba(65, 217, 230, 0.2);
}

.button.secondary {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.hero-stats {
  flex-wrap: wrap;
  gap: 12px;
}

.hero-stats div {
  min-width: 154px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(14px);
}

.hero-stats dt {
  margin-bottom: 4px;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 22px;
  font-weight: 800;
}

.hero-stats dd {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.terminal-card {
  overflow: hidden;
  border: 1px solid rgba(153, 181, 205, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(13, 18, 25, 0.96), rgba(7, 10, 15, 0.92));
  box-shadow: var(--shadow);
}

.terminal-top {
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.terminal-top span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.terminal-top span:nth-child(1) {
  background: var(--rose);
}

.terminal-top span:nth-child(2) {
  background: var(--amber);
}

.terminal-top span:nth-child(3) {
  background: var(--green);
}

.terminal-top p {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}

.terminal-body {
  min-height: 384px;
  padding: 22px;
  font-family: "JetBrains Mono", monospace;
}

.terminal-body p {
  margin-bottom: 10px;
  color: #dce9ee;
  line-height: 1.6;
}

.prompt {
  color: var(--green);
}

.terminal-output {
  color: var(--muted);
}

.typed::after {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  margin-left: 3px;
  vertical-align: text-bottom;
  content: "";
  background: var(--cyan);
  animation: blink 850ms steps(2, start) infinite;
}

.terminal-metrics {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}

.terminal-metrics span,
.skill-grid span {
  border: 1px solid rgba(65, 217, 230, 0.18);
  border-radius: 8px;
  color: #d9f8fb;
  background: rgba(65, 217, 230, 0.075);
}

.terminal-metrics span {
  padding: 9px 10px;
  font-size: 13px;
}

.section {
  padding: 84px 0;
  margin-bottom: 10px;
}

.about {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 40px;
  align-items: end;
  border-top: 1px solid var(--line);
}

.about > p,
.contacts p,
.education p,
.timeline-content li,
.highlight-card p {
  color: var(--soft);
  line-height: 1.72;
}

.about > p {
  margin-bottom: 0;
  font-size: 18px;
}

.section-heading {
  margin-bottom: 34px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 18px;
}

.timeline::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 178px;
  width: 1px;
  content: "";
  background: linear-gradient(var(--cyan), var(--green), transparent);
}

.timeline-item {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 40px;
}

.timeline-date {
  padding-top: 24px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
}

.timeline-content,
.highlight-card,
.contacts,
.education {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

.timeline-content {
  position: relative;
  padding: 26px;
}

.timeline-content::before {
  position: absolute;
  top: 23px;
  left: -32px;
  width: 13px;
  height: 13px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  content: "";
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(65, 217, 230, 0.16);
}

.job-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.job-head p {
  margin: 0;
  color: var(--muted);
}

.job-head > span {
  flex: 0 0 auto;
  color: var(--amber);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}

.timeline-content ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 19px;
}

.stack-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.skill-grid span {
  min-height: 54px;
  padding: 16px 14px;
  font-weight: 800;
  text-align: center;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.skill-grid span:hover {
  border-color: rgba(110, 232, 141, 0.5);
  background: rgba(110, 232, 141, 0.1);
  transform: translateY(-3px);
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.highlight-card {
  min-height: 260px;
  padding: 22px;
}

.card-index {
  display: block;
  margin-bottom: 44px;
  color: var(--green);
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}

.education {
  padding: 30px;
}

.education-row {
  justify-content: space-between;
  gap: 22px;
  flex-direction: column;
}

.education-list {
  display: grid;
  flex: 1 1 auto;
  gap: 18px;
}

.education-group {
  display: grid;
  gap: 10px;
}

.education-label {
  color: var(--green);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.education-group-course .education-label {
  color: var(--amber);
}

.education-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 18px;
  border: 1px solid rgba(153, 181, 205, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(65, 217, 230, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.035);
}

.education-group-course .education-item {
  border-color: rgba(255, 200, 87, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 200, 87, 0.09), transparent 42%),
    rgba(255, 255, 255, 0.035);
}

.education-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid rgba(65, 217, 230, 0.28);
  border-radius: 8px;
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 800;
  background: rgba(65, 217, 230, 0.075);
}

.education-group-course .education-badge {
  border-color: rgba(255, 200, 87, 0.34);
  color: var(--amber);
  background: rgba(255, 200, 87, 0.075);
}

.education h3,
.education p {
  margin-bottom: 0;
}

.language-box {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.language-box span {
  padding: 10px 12px;
  border: 1px solid rgba(255, 200, 87, 0.28);
  border-radius: 8px;
  color: var(--amber);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  background: rgba(255, 200, 87, 0.065);
}

.contacts {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 34px;
  align-items: center;
  margin-bottom: 70px;
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(65, 217, 230, 0.12), transparent 38%),
    var(--panel-strong);
}

.contacts h2 {
  margin-bottom: 16px;
}

.contact-grid {
  flex-direction: column;
  gap: 10px;
}

.contact-grid a {
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.contact-grid a:hover {
  border-color: rgba(65, 217, 230, 0.48);
  background: rgba(65, 217, 230, 0.08);
  transform: translateX(4px);
}

.contact-grid span {
  color: var(--muted);
  font-size: 13px;
}

.contact-grid strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 650ms ease, transform 650ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

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

@media (max-width: 980px) {
  .site-shell {
    width: min(100% - 28px, 760px);
  }

  .brand,
  .hero-actions,
  .hero-stats,
  .terminal-top,
  .terminal-metrics,
  .job-head,
  .education-row,
  .language-box {
    justify-content: center; /* Центр по главной оси */
    align-items: center;     /* Центр по поперечной оси */
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .hero {
    min-height: auto;
    padding-top: 64px;
  }

  .hero-canvas {
    inset: 0;
    width: 100%;
    min-height: 540px;
    opacity: 0.36;
  }

  .hero-grid,
  .about,
  .contacts {
    grid-template-columns: 1fr;
  }

  .terminal-card {
    max-width: 620px;
    margin: 0 auto;
  }

  .timeline::before {
    left: 8px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-left: 30px;
  }

  .timeline-date {
    padding-top: 0;
  }

  .timeline-content::before {
    top: 26px;
  }

  .skill-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .highlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .education-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .education-list {
    width: 100%;
  }

  .language-box {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .site-shell {
    width: min(100% - 22px, 460px);
  }

  .topbar {
    top: 8px;
    margin-top: 8px;
  }

  .brand {
    width: 100%;
    justify-content: space-between;
  }

  .contact-pill {
    display: none;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
  }

  .nav a {
    flex: 0 0 auto;
    padding-inline: 10px;
  }

  .hero {
    padding: 46px 0 56px;
  }

  h1 {
    font-size: clamp(42px, 14vw, 58px);
  }

  .lead {
    font-size: 17px;
  }

  .button,
  .hero-actions {
    width: 100%;
  }

  .hero-stats div {
    width: 100%;
  }

  .terminal-body {
    min-height: 320px;
    padding: 18px;
    font-size: 13px;
  }

  .section {
    padding: 58px 0;
  }

  .timeline-content,
  .highlight-card,
  .education,
  .contacts {
    padding: 20px;
  }

  .job-head {
    flex-direction: column;
    gap: 6px;
  }

  .education-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .education-badge {
    justify-self: flex-start;
  }

  .skill-grid,
  .highlight-grid {
    grid-template-columns: 1fr;
  }

  .highlight-card {
    min-height: auto;
  }

  .card-index {
    margin-bottom: 28px;
  }
}
