/* ============================================================
   dmkz.ru — визитка инженера IT-инфраструктуры
   Чистый CSS, без фреймворков. Тёмная технологичная тема.
   ============================================================ */

/* ---------- токены ---------- */
:root {
  --bg: #070b12;
  --text: #e8eef6;
  --muted: #8fa0b3;
  --dim: #5c6b7d;
  --accent: #46e5a0;
  --accent-soft: rgba(70, 229, 160, 0.55);
  --accent-ink: #04120c;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --mono: ui-monospace, "Cascadia Code", Consolas, "JetBrains Mono", "Roboto Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 16px;
  --header-h: 64px;
}

/* ---------- база ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--bg);
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* фоновая подложка: свечение + сетка */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1000px 520px at 72% -12%, rgba(70, 229, 160, 0.075), transparent 62%),
    radial-gradient(820px 420px at 8% -4%, rgba(56, 189, 248, 0.045), transparent 60%),
    var(--bg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 92% 62% at 50% 0%, #000 28%, transparent 74%);
  mask-image: radial-gradient(ellipse 92% 62% at 50% 0%, #000 28%, transparent 74%);
}

::selection { background: rgba(70, 229, 160, 0.3); }

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

.mono { font-family: var(--mono); }

.container {
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 32px);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible { transform: none; }

/* ---------- шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(7, 11, 18, 0.62);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(7, 11, 18, 0.85);
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
}

.logo {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.logo-cursor { color: var(--accent); }

.site-nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.site-nav a {
  padding: 8px 13px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14.5px;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover { color: var(--text); background: rgba(148, 163, 184, 0.08); }

.header-inner > .btn { margin-left: 8px; }

/* ---------- кнопки и ссылки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15.5px;
  font-weight: 650;
  font-family: var(--sans);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 24px -12px rgba(70, 229, 160, 0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -12px rgba(70, 229, 160, 0.6);
}

.btn-sm { padding: 9px 18px; font-size: 14px; border-radius: 10px; }
.btn-lg { padding: 18px 34px; font-size: 17px; border-radius: 14px; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: none;
}

.btn-ghost:hover {
  border-color: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

.btn-ghost.is-copied { color: var(--accent); border-color: var(--accent-soft); }

.link-secondary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
  color: var(--muted);
  font-size: 14.5px;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color 0.2s ease;
}

.link-secondary:hover { color: var(--text); }

/* ---------- герой ---------- */
.hero {
  padding-top: clamp(84px, 14vh, 150px);
  padding-bottom: clamp(48px, 8vw, 80px);
}

.terminal-line {
  font-size: 15px;
  color: var(--dim);
}

.terminal-line .prompt { color: var(--accent); }

.hero-name {
  margin-top: 10px;
  font-size: 17px;
  color: var(--muted);
}

.cursor {
  display: inline-block;
  width: 9px;
  height: 1.1em;
  margin-left: 7px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(2, start) infinite;
}

@keyframes blink { to { visibility: hidden; } }

.hero h1 {
  margin-top: 26px;
  font-size: clamp(34px, 6.4vw, 66px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.h1-accent {
  background: linear-gradient(92deg, var(--accent) 10%, #a5f3cf 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 8px 16px;
  border: 1px solid rgba(70, 229, 160, 0.35);
  border-radius: 999px;
  background: rgba(70, 229, 160, 0.06);
  color: var(--accent);
  font-size: 13px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(70, 229, 160, 0.5);
  animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
  70%  { box-shadow: 0 0 0 9px rgba(70, 229, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(70, 229, 160, 0); }
}

.lead {
  margin-top: 24px;
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(52px, 8vh, 84px);
  border-block: 1px solid var(--border);
}

.hero-stats > div {
  padding: 24px 26px;
}

.hero-stats > div + div { border-left: 1px solid var(--border); }

.hero-stats dt {
  font-size: clamp(21px, 3vw, 30px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.hero-stats dd {
  margin-top: 5px;
  color: var(--dim);
  font-size: 13.5px;
}

/* ---------- секции ---------- */
.section { padding-block: clamp(64px, 10vw, 116px); }

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

.kicker {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.section-head h2 {
  margin-top: 12px;
  font-size: clamp(27px, 3.8vw, 42px);
  font-weight: 750;
  letter-spacing: -0.015em;
}

.section-sub {
  margin-top: 12px;
  max-width: 60ch;
  color: var(--dim);
  font-size: 15px;
}

/* ---------- карточки компетенций ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.card {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.055), rgba(148, 163, 184, 0.015));
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgba(70, 229, 160, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 18px 44px -22px rgba(70, 229, 160, 0.35);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(70, 229, 160, 0.22);
  border-radius: 12px;
  background: rgba(70, 229, 160, 0.08);
  color: var(--accent);
}

.card-index { color: var(--dim); font-size: 13px; }

.card h3 { font-size: 18.5px; font-weight: 650; margin-bottom: 10px; }

.card p { color: var(--muted); font-size: 15px; }

/* ---------- опыт ---------- */
.xp { border-top: 1px solid var(--border); }

.xp-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 28px;
  padding-block: 34px;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.xp-years {
  font-size: clamp(20px, 2.6vw, 27px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.25;
  padding-top: 3px;
}

.xp-body h3 { font-size: clamp(19px, 2.4vw, 23px); font-weight: 650; margin-bottom: 10px; }

.xp-body p { max-width: 72ch; color: var(--muted); font-size: 15.5px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  list-style: none;
}

.tags li {
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- стек ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
}

.chips li {
  padding: 10px 17px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.04);
  color: var(--text);
  font-size: 14px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.chips li:hover { color: var(--accent); border-color: rgba(70, 229, 160, 0.5); }

/* ---------- контакт ---------- */
.contact-card {
  position: relative;
  overflow: hidden;
  padding: clamp(38px, 6.5vw, 76px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(70, 229, 160, 0.06), rgba(148, 163, 184, 0.03) 45%, rgba(148, 163, 184, 0.015));
  text-align: center;
}

.contact-card::before {
  content: "";
  position: absolute;
  top: -180px;
  left: 50%;
  width: 560px;
  height: 280px;
  translate: -50% 0;
  background: radial-gradient(closest-side, rgba(70, 229, 160, 0.16), transparent);
  pointer-events: none;
}

.contact-card > * { position: relative; }

.contact-card h2 {
  margin-top: 12px;
  font-size: clamp(30px, 4.6vw, 50px);
  font-weight: 750;
  letter-spacing: -0.015em;
}

.contact-lead {
  max-width: 56ch;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: clamp(15.5px, 2vw, 17.5px);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 22px;
  margin-top: 38px;
}

/* ---------- подвал ---------- */
.site-footer { border-top: 1px solid var(--border); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
  justify-content: space-between;
  padding-block: 26px;
  color: var(--dim);
  font-size: 13px;
}

.footer-dim { color: var(--dim); }

.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ---------- появление при скролле ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.65s cubic-bezier(0.2, 0.7, 0.3, 1), transform 0.65s cubic-bezier(0.2, 0.7, 0.3, 1);
    transition-delay: var(--d, 0s);
  }

  .js [data-reveal].is-visible { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- адаптив ---------- */
@media (max-width: 860px) {
  .site-nav { display: none; }
  .header-inner > .btn { margin-left: auto; }
}

@media (max-width: 760px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }

  .hero-stats > div + div { border-left: none; }
  .hero-stats > div:nth-child(2n) { border-left: 1px solid var(--border); }
  .hero-stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }

  .xp-row { grid-template-columns: 1fr; gap: 8px; padding-block: 26px; }

  .contact-actions { flex-direction: column; }
}

@media (max-width: 480px) {
  .hero-stats > div { padding: 18px 20px; }
}
