/* ------------------------------------------------------------------
   Визитка — единая таблица стилей
   Тёмная тема по умолчанию, светлая — через [data-theme="light"].
   ------------------------------------------------------------------ */

:root {
  --accent-1: #6ee7ff;
  --accent-2: #a78bfa;
  --accent-3: #f472b6;

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --page-max: 1080px;
  --shadow-soft: 0 18px 60px rgba(3, 6, 20, 0.55);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html[data-theme="dark"] {
  --bg: #080b16;
  --bg-2: #0d1224;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eef2ff;
  --text-dim: #a7b0cc;
  --text-faint: #7c86a6;
  --grid-line: rgba(255, 255, 255, 0.045);
  --code-bg: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] {
  --bg: #f4f6fd;
  --bg-2: #e9edfa;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.95);
  --border: rgba(16, 24, 56, 0.1);
  --border-strong: rgba(16, 24, 56, 0.2);
  --text: #101735;
  --text-dim: #4e5876;
  --text-faint: #6d7794;
  --grid-line: rgba(16, 24, 56, 0.05);
  --code-bg: rgba(16, 24, 56, 0.07);
  --shadow-soft: 0 20px 50px rgba(28, 38, 82, 0.14);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  font: inherit;
  color: inherit;
}

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

.skip-link {
  position: absolute;
  left: 50%;
  top: -60px;
  transform: translateX(-50%);
  z-index: 50;
  padding: 10px 18px;
  border-radius: 0 0 12px 12px;
  background: var(--accent-2);
  color: #0b1020;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 0;
}

/* ---------------------------------------------------------- фон */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--bg-2), transparent 60%),
    var(--bg);
}

.bg__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: float 22s var(--ease) infinite;
}

.bg__blob--1 {
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  top: -12vw;
  left: -8vw;
  background: radial-gradient(circle at 30% 30%, var(--accent-1), transparent 65%);
}

.bg__blob--2 {
  width: 44vw;
  height: 44vw;
  min-width: 300px;
  min-height: 300px;
  top: 18vw;
  right: -12vw;
  background: radial-gradient(circle at 60% 40%, var(--accent-2), transparent 65%);
  animation-delay: -7s;
}

.bg__blob--3 {
  width: 38vw;
  height: 38vw;
  min-width: 260px;
  min-height: 260px;
  bottom: -14vw;
  left: 30vw;
  background: radial-gradient(circle at 50% 50%, var(--accent-3), transparent 68%);
  animation-delay: -13s;
}

html[data-theme="light"] .bg__blob {
  opacity: 0.4;
}

.bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(110% 70% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(110% 70% at 50% 0%, #000 20%, transparent 78%);
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  33% {
    transform: translate3d(3vw, 4vh, 0) scale(1.08);
  }
  66% {
    transform: translate3d(-3vw, -3vh, 0) scale(0.96);
  }
}

/* --------------------------------------------------- каркас */

.page {
  width: min(100% - 32px, var(--page-max));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  width: min(100% - 32px, var(--page-max));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2) 55%, var(--accent-3));
  color: #060a18;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14.5px;
  color: var(--text-dim);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.nav a:hover {
  background: var(--surface);
  color: var(--text);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease);
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .icon-sun,
html[data-theme="light"] .icon-moon {
  display: none;
}

/* --------------------------------------------------- карточки */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.section {
  margin-top: 56px;
  scroll-margin-top: 84px;
}

.section__head {
  margin-bottom: 18px;
}

.section__label {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.section__head h2 {
  margin: 6px 0 0;
  font-size: clamp(22px, 3.4vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.grid {
  display: grid;
  gap: 16px;
}

/* --------------------------------------------------- hero */

.hero {
  margin-top: 24px;
  padding: clamp(22px, 4vw, 40px);
  display: grid;
  grid-template-columns: 176px 1fr;
  gap: clamp(20px, 4vw, 40px);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(110, 231, 255, 0.5), transparent 35%, transparent 65%, rgba(244, 114, 182, 0.4));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  pointer-events: none;
}

.hero__aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.avatar {
  position: relative;
  width: 136px;
  height: 136px;
  display: grid;
  place-items: center;
}

.avatar__img {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  background: linear-gradient(140deg, rgba(110, 231, 255, 0.25), rgba(167, 139, 250, 0.25));
}

.avatar__mono {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
}

.avatar--mono .avatar__img {
  display: none;
}

.avatar--mono .avatar__mono {
  opacity: 1;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: linear-gradient(140deg, rgba(110, 231, 255, 0.28), rgba(167, 139, 250, 0.28) 60%, rgba(244, 114, 182, 0.24));
}

.avatar__ring {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 1px dashed var(--border-strong);
  animation: spin 26s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #37d67a;
  box-shadow: 0 0 0 4px rgba(55, 214, 122, 0.16);
}

.status[data-state="busy"] .status__dot {
  background: #f0b429;
  box-shadow: 0 0 0 4px rgba(240, 180, 41, 0.16);
}

.hero__main {
  min-width: 0;
}

.hero__name {
  margin: 0;
  font-size: clamp(30px, 5.6vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--text) 30%, color-mix(in srgb, var(--accent-1) 65%, var(--text)) 75%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__role {
  margin: 10px 0 0;
  font-size: clamp(15px, 2.2vw, 18px);
  color: var(--text-dim);
}

.hero__tagline {
  margin: 14px 0 0;
  max-width: 60ch;
  color: var(--text-dim);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}

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

.btn--primary {
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2) 60%, var(--accent-3));
  color: #070b17;
  box-shadow: 0 12px 30px rgba(110, 231, 255, 0.22);
}

.btn--ghost {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.btn--ghost:hover {
  background: var(--surface-strong);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.facts__k {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.facts__v {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

/* --------------------------------------------------- about */

.grid--about {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}

.prose {
  padding: clamp(20px, 3vw, 30px);
}

.prose p {
  margin: 0 0 14px;
  color: var(--text-dim);
}

.prose p:last-child {
  margin-bottom: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  align-content: start;
}

.stat {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(16px);
}

.stat__value {
  display: block;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat__label {
  display: block;
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--text-faint);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--text-dim);
}

/* --------------------------------------------------- services */

.grid--services {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.service {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(16px);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease);
}

.service:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.service__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(140deg, rgba(110, 231, 255, 0.18), rgba(167, 139, 250, 0.18));
  color: var(--accent-1);
  margin-bottom: 14px;
}

.service h3 {
  margin: 0 0 8px;
  font-size: 17.5px;
  letter-spacing: -0.01em;
}

.service p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14.5px;
}

.service__price {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-faint);
}

/* --------------------------------------------------- projects */

.projects {
  display: grid;
  gap: 12px;
}

.project {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 18px;
  align-items: center;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(16px);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), background 0.22s var(--ease);
}

a.project:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--surface-strong);
}

.project__title {
  margin: 0;
  font-size: 17.5px;
  letter-spacing: -0.01em;
}

.project__year {
  font-size: 13px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.project__text {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 14.5px;
}

.project__tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-faint);
}

/* --------------------------------------------------- contacts */

.grid--contacts {
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
}

.contact {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(16px);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.contact:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.contact__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(140deg, rgba(110, 231, 255, 0.16), rgba(167, 139, 250, 0.16));
  color: var(--accent-1);
}

.contact__body {
  min-width: 0;
}

.contact__label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.contact__value {
  display: block;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact__copy {
  margin-left: auto;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.contact__copy:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.cta {
  margin-top: 16px;
  padding: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cta__title {
  margin: 0;
  font-weight: 620;
}

.cta__text {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 14.5px;
  max-width: 62ch;
}

code {
  padding: 2px 7px;
  border-radius: 7px;
  background: var(--code-bg);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
}

/* --------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer__inner {
  width: min(100% - 32px, var(--page-max));
  margin: 0 auto;
  padding: 22px 0 34px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-faint);
  font-size: 14px;
}

.footer__sep {
  opacity: 0.6;
}

.linklike {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 1px dashed var(--border-strong);
  transition: color 0.18s var(--ease);
}

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

/* --------------------------------------------------- прочее */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 24px);
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
  backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 14.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  z-index: 40;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 900px) {
  .grid--about {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__aside {
    justify-content: center;
  }

  .hero__actions {
    justify-content: center;
  }

  .facts {
    text-align: left;
  }

  .footer__inner {
    justify-content: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .bg__blob,
  .avatar__ring {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn:hover,
  .service:hover,
  .project:hover,
  .contact:hover {
    transform: none;
  }
}

@media print {
  .bg,
  .topbar,
  .footer,
  .toast {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card,
  .service,
  .project,
  .contact,
  .stat {
    border-color: #ccc;
    box-shadow: none;
    background: #fff;
  }
}
