/* =========================================================
   Arten — portfolio
   1. Reset & tokens
   2. Animated backdrop
   3. Hero
   4. Navigation
   5. Panels (about / skills / stats / projects / contacts)
   6. Overlays (toast, dialog)
   7. Themes & motion preferences
   8. Responsive
   ========================================================= */

/* ---------- 1. Reset & tokens ---------- */

:root {
  --bg: #05070a;
  --bg-elevated: #111822;
  --text: #f3f4fb;
  --text-muted: #b7bacd;
  --text-dim: #8c93aa;
  --accent: #96c7ff;
  --accent-strong: #88b4ff;
  --online: #00df86;
  --glass-border: #8591a560;
  --glass-highlight: #ffffff16;
  --radius-panel: 24px;
  --radius-tile: 18px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

/* Плавный скролл навигации: чуть мягче, чем браузерный smooth */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 Arial, Helvetica, sans-serif;
}

button,
a,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

button:hover,
a:hover {
  filter: brightness(1.2);
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

svg {
  display: inline-block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

/* ---------- 2. Animated backdrop ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 75% 28%, #0b1119 0, transparent 35%),
    #030507;
}

.backdrop canvas {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/*
 * Стеклянная основа — тот самый фон с жидким металлом.
 * Лежит ПОД canvas-анимацией (z-index), поэтому свечение и частицы
 * видны поверх неё, а не наоборот.
 */
.backdrop-texture {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('assets/glass-background.png') center top / cover no-repeat;
  opacity: .9;
  pointer-events: none;
}

/* Виньетка поверх стекла: гасит края, центр остаётся читаемым */
.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at 50% 42%, transparent 40%, #030507d9 118%);
  pointer-events: none;
}

.backdrop-glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 15%, #4f7fff2e, transparent 42%),
    radial-gradient(circle at 82% 70%, #9a7bff26, transparent 40%),
    radial-gradient(circle at 60% 95%, #3fd7ff1f, transparent 38%);
  animation: backdrop-drift 26s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes backdrop-drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(2%, 2%, 0) scale(1.08); }
}

/* ---------- 3. Hero ---------- */

.glass {
  border: 1px solid var(--glass-border);
  border-top-color: #a8b5cc80;
  border-left-color: #abbdd28a;
  background:
    radial-gradient(ellipse at 5% 0%, #829bc620, transparent 50%),
    linear-gradient(120deg, #242a347d, #0b0e14ab 58%, #29303973);
  box-shadow:
    inset 1px 1px 2px var(--glass-highlight),
    inset -1px -1px 1px #b9ccff15,
    0 12px 35px #0006;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.shell {
  max-width: 1222px;
  margin: auto;
  padding: 64px 38px 44px;
}

.hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 23px;
  min-height: 263px;
}

.portrait-frame {
  position: relative;
  flex: none;
  width: 245px;
  height: 252px;
  padding: 22px;
  border-radius: 40px;
  background: linear-gradient(135deg, #d2e5ffb3, #292f3f80 32%, #b7a9dba0 50%, #10131dcc 75%);
  box-shadow:
    inset 2px 2px 4px #f0f7ff6b,
    0 12px 24px #0008;
}

.portrait {
  width: 100%;
  height: 100%;
  border-radius: 27px;
  background: url('assets/avatar.png') center / cover no-repeat;
}

.online {
  display: inline-block;
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 15px #00dc8199;
}

.portrait-frame > .online {
  position: absolute;
  left: 29px;
  bottom: 28px;
  width: 14px;
  height: 14px;
  animation: pulse-online 2.4s ease-in-out infinite;
}

@keyframes pulse-online {
  50% { box-shadow: 0 0 22px 5px #00dc8170; }
}

.icon-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid #bec7e025;
  border-radius: 14px;
  background: linear-gradient(135deg, #636b7b42, #8387971a);
  box-shadow: inset 1px 1px 2px #fff1;
  font-size: 27px;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.intro {
  flex: 1;
  min-width: 305px;
  padding-top: 11px;
}

/*
 * Длинный ник: заголовок масштабируется от ширины контейнера,
 * но не вылезает за пределы и не ломает сетку.
 */
h1 {
  margin: 8px 0 5px;
  font-size: clamp(30px, 5.2vw, 70px);
  font-weight: 750;
  letter-spacing: -1px;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  /* Не даём нику наехать на карточку локации в шапке */
  position: relative;
  z-index: 2;
}

/* Если даже минимальный кегль не влез — разрешаем перенос */
h1[data-length='xlong'] {
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

/* Для совсем длинных ников включаем «усадку» по фактической длине */
h1[data-length='long'] { font-size: clamp(26px, 3.6vw, 52px); }
h1[data-length='xlong'] { font-size: clamp(22px, 2.7vw, 40px); letter-spacing: -.5px; }

.profession {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #b5b8cc;
  font-size: 23px;
}

.code-icon {
  width: 35px;
  height: 30px;
  border: 1px solid #939bad70;
  border-radius: 8px;
  background: #7e8ba218;
  font-size: 22px;
  line-height: 27px;
  text-align: center;
}

.intro p {
  margin: 17px 0;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.3;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tags > span {
  padding: 4px 12px;
  border: 1px solid #a4adbf38;
  border-radius: 20px;
  background: linear-gradient(#717a8c36, #282d3440);
  box-shadow: inset 0 1px 1px #fff1;
  font-size: 14px;
  white-space: nowrap;
}

.hero-widgets {
  position: absolute;
  top: 12px;
  right: 141px;
  width: 297px;
  pointer-events: none;
}

.location {
  display: flex;
  align-items: center;
  gap: 21px;
  width: 418px;
  height: 64px;
  margin-left: -121px;
  padding: 0 20px;
  border-radius: 21px;
  color: #c5cad9;
  font-size: 14px;
  pointer-events: auto;
}

.location svg {
  width: 20px;
  color: var(--text-dim);
}

.location time {
  margin-left: auto;
  font-size: 18px;
  white-space: nowrap;
}

.location > .online {
  margin-left: 9px;
}

.hero blockquote {
  position: relative;
  width: 297px;
  min-height: 158px;
  margin: 26px 0 0;
  padding: 49px 27px 22px 52px;
  border-radius: 25px;
  background: linear-gradient(135deg, #11172280, #0a0d1480 60%, #978ac44d);
  pointer-events: auto;
}

.quote-mark {
  position: absolute;
  top: 2px;
  left: 22px;
  color: #85869c9c;
  font: bold 60px Georgia, serif;
}

.hero blockquote p {
  margin: 0;
  color: #bdc0d2;
  font-size: 19px;
  line-height: 1.4;
}

.tools {
  position: absolute;
  top: 41px;
  right: 19px;
  display: flex;
  flex-direction: column;
  width: 69px;
  overflow: hidden;
  border-radius: 22px;
}

.tools button {
  display: grid;
  place-items: center;
  height: 61px;
  border: 1px solid #b6c1d71a;
  border-radius: 20px;
  background: #747f8d0b;
}

.tools svg {
  width: 22px;
  height: 22px;
  color: #b9bfd7;
}

/* ---------- 4. Navigation ---------- */

.navigation {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 76px;
  margin: 24px 0;
  padding: 5px;
  border-radius: 27px;
}

.navigation a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: 22px;
  color: #ced0de;
  font-size: 16px;
}

.navigation a + a::before {
  content: '';
  position: absolute;
  left: 0;
  width: 1px;
  height: 48px;
  background: linear-gradient(transparent, #c3c9e329, transparent);
}

.navigation svg {
  width: 25px;
  height: 25px;
  color: #979bb2;
}

.navigation a.active {
  border: 1px solid #a3c7ffb3;
  background: linear-gradient(130deg, #a6aabc54, #8599c329 55%, #7dacf05e);
  box-shadow:
    inset 0 1px 4px #fff9,
    0 0 15px #6da8ff68;
  color: #fff;
}

.navigation a.active svg {
  color: #eef1ff;
}

/* ---------- 5. Panels ---------- */

.dashboard {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.06fr;
  gap: 20px;
}

.panel {
  min-width: 0;
  padding: 17px 19px;
  border-radius: var(--radius-panel);
  scroll-margin-top: 24px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  margin-bottom: 15px;
}

h2 {
  display: flex;
  align-items: center;
  gap: 17px;
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  white-space: nowrap;
}

h2 svg {
  width: 27px;
  height: 27px;
  color: #d4d7ee;
}

/* --- About --- */

.about {
  padding: 16px 22px 20px;
}

.about p {
  margin: 16px 0 26px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.55;
}

.about p + p {
  margin-bottom: 20px;
}

.facts {
  display: grid;
  gap: 5px;
}

.facts > div {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 55px;
  padding: 10px 17px;
  border: 1px solid #a9bfd04a;
  border-right-color: #a9bfd012;
  border-bottom-color: #a9bfd01f;
  border-radius: var(--radius-tile);
  background: linear-gradient(110deg, #6a778e2e, #10141b45);
}

.facts svg {
  flex: none;
  width: 23px;
  color: #bfc7e3;
}

.facts span {
  min-width: 70px;
  color: #b6bbcf;
  font-size: 14px;
}

.facts strong {
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

.facts .online {
  width: 10px;
  height: 10px;
  margin-right: 9px;
}

/* --- Skills --- */

.skills {
  padding: 16px 18px 19px;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}

.technology {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 94px;
  border: 1px solid #9ca6b025;
  border-top-color: #bdc7df48;
  border-left-color: #bdc7df68;
  border-radius: var(--radius-tile);
  background: linear-gradient(130deg, #747f9233, #22262e80);
  font-size: 14px;
  transition: transform .25s var(--ease-out), border-color .25s;
}

.technology:hover {
  transform: translateY(-3px);
  border-color: #a8c8ff70;
}

.technology img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

/* --- Stats --- */

/* Правая колонка: только статистика, по высоте содержимого */
.right-column {
  display: grid;
  align-content: start;
  grid-template-rows: auto;
  gap: 20px;
}

/* Проекты и контакты занимают второй ряд — на месте бывшего блока музыки */
.projects {
  grid-row: 2;
  grid-column: 1 / 3;
}

.contacts {
  grid-row: 2;
  grid-column: 3;
}

.stats {
  padding: 15px 17px 12px;
}

.stats .panel-head {
  margin-bottom: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-grid > div {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 77px;
  padding: 12px 16px;
  border: 1px solid #a2b3ca66;
  border-right-color: #a2b3ca24;
  border-bottom-color: #a2b3ca27;
  border-radius: var(--radius-tile);
  background: linear-gradient(120deg, #71829d38, #0a0e144d);
}

.stat-grid svg {
  flex: none;
  width: 29px;
  height: 29px;
  color: #d7ddf2;
}

.stat-grid p {
  margin: 0;
}

.stat-grid b {
  display: block;
  font-size: 23px;
  line-height: 1.15;
}

.stat-grid span {
  display: block;
  margin-top: 4px;
  color: #acb3c7;
  font-size: 14px;
  white-space: nowrap;
}

/* --- Projects --- */

.projects {
  padding: 16px 17px 19px;
}

.projects .panel-head {
  margin-bottom: 14px;
  padding: 0 5px;
}

.all-projects {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid #c7d0e33b;
  border-radius: 15px;
  background: linear-gradient(120deg, #75829f50, #797d8c28);
  font-size: 14px;
  white-space: nowrap;
}

.all-projects span {
  margin-left: 5px;
  color: #acb8cf;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.project {
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid #b7c3d236;
  border-radius: var(--radius-tile);
  background: linear-gradient(130deg, #454e5c66, #0a0e14b3);
  text-align: left;
  transition: transform .2s, border-color .2s;
}

.project:hover {
  transform: translateY(-4px);
  border-color: #accbff;
}

.project-cover {
  display: grid;
  place-items: center;
  height: 116px;
  border-radius: 17px;
  background-position: center;
  background-size: cover;
}

/* Обложка XasanVPN: логотип по центру на градиенте бренда */
.cover-xasan {
  background:
    radial-gradient(circle at 50% 42%, #1c4a8f80, transparent 62%),
    linear-gradient(140deg, #0d1b33, #131a2b 55%, #0a0f1a);
}

.cover-xasan img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px #4f9bff55);
  transition: transform .3s var(--ease-out);
}

.project:hover .cover-xasan img {
  transform: scale(1.06);
}

.project-info {
  padding: 5px 10px 8px;
}

.project h3 {
  margin: 0;
  font-size: 17px;
}

.project p {
  margin: 0 0 9px;
  color: #b4b9cd;
  font-size: 13px;
}

.project .tags {
  gap: 5px;
}

.project .tags span {
  padding: 3px 9px;
  font-size: 11px;
}

/* --- Contacts --- */

.contacts {
  padding: 16px 18px 14px;
}

.contact-list {
  display: grid;
  gap: 7px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 47px;
  padding: 6px 11px;
  border: 1px solid #bdcce04a;
  border-right-color: #bdcce019;
  border-radius: 17px;
  background: linear-gradient(100deg, #8390a742, #11151d60 40%);
  font-size: 13px;
}

.contact-row .brand {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #e5eaff;
}

/* Официальные цвета брендов */
.brand.discord  { background: #5865f2; }
.brand.telegram { background: #26a5e4; }
.brand.github   { background: #181717; }
.brand.mail     { background: linear-gradient(140deg, #7d8dff, #4a56c9); }

.brand img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Логотипы из Simple Icons чёрные — делаем их белыми на цветном фоне */
.brand img[src*='discord'],
.brand img[src*='telegram'],
.brand img[src*='github'] {
  filter: brightness(0) invert(1);
}

.brand svg {
  width: 20px;
  height: 20px;
}

.contact-label {
  width: 65px;
  flex: none;
}

.contact-row > a {
  overflow: hidden;
  margin-left: auto;
  color: #b7bfd3;
  font-size: 13px;
  text-decoration: underline;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy {
  display: grid;
  place-items: center;
  margin-left: auto;
  padding: 1px;
  background: none;
  color: #c0c9e2;
}

.copy svg {
  width: 18px;
  height: 18px;
}

/* ---------- 6. Overlays ---------- */

#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 20;
  padding: 12px 22px;
  border: 1px solid #a0c5ff70;
  border-radius: 16px;
  background: #1c2639f2;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: .2s;
}

#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

dialog {
  width: min(480px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid #899ab470;
  border-radius: 24px;
  background: #111822f5;
  box-shadow: 0 30px 100px #000b;
  color: #f0f3ff;
}

dialog::backdrop {
  background: #0009;
  backdrop-filter: blur(9px);
}

.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.dialog-top h2 {
  white-space: normal;
}

.dialog-top .icon-button {
  font-size: 26px;
}

.detail-description {
  color: #bac3d8;
}

.project-list {
  display: grid;
  gap: 12px;
}

.project-open {
  width: 100%;
  text-align: left;
}

.project-open span {
  display: block;
  margin-top: 4px;
  color: #b8c2d8;
}

.save-button {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 12px;
  background: var(--accent-strong);
  color: #0a1427;
  font-weight: 600;
}

/* ---------- 6.5 Animations ---------- */

/*
 * Появление блоков при скролле.
 *
 * Скрываем элементы ТОЛЬКО при наличии класса .js-reveal на <html>.
 * Его ставит app.js. Если скрипт не загрузился или упал — класс не появится,
 * и весь контент останется видимым. Без этой страховки сбой JS
 * оставил бы половину страницы пустой.
 */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(26px) scale(.985);
  transition:
    opacity .7s var(--ease-out),
    transform .7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Поочерёдное появление карточек внутри сетки */
.js-reveal .technology,
.js-reveal .stat-grid > div,
.js-reveal .contact-row {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity .55s var(--ease-out),
    transform .55s var(--ease-out),
    border-color .25s;
  transition-delay: var(--stagger, 0ms);
}

.js-reveal .reveal.is-visible .technology,
.js-reveal .reveal.is-visible .stat-grid > div,
.js-reveal .reveal.is-visible .contact-row {
  opacity: 1;
  transform: none;
}

/* Вход шапки: портрет, текст и виджеты появляются друг за другом */
.hero .portrait-frame,
.hero .intro,
.hero .hero-widgets,
.hero .tools {
  animation: hero-in .9s var(--ease-out) both;
}

.hero .intro       { animation-delay: .1s; }
.hero .hero-widgets { animation-delay: .22s; }
.hero .tools       { animation-delay: .34s; }

@keyframes hero-in {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

/* Портрет: мягкое «дыхание» рамки */
.portrait-frame {
  animation: portrait-in 1s var(--ease-out) both, portrait-float 9s ease-in-out 1s infinite;
}

@keyframes portrait-in {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

@keyframes portrait-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* Индикатор активного пункта навигации */
.navigation a {
  transition: color .3s, background .35s var(--ease-out), box-shadow .35s;
}

.navigation a.active {
  animation: nav-glow 3.2s ease-in-out infinite;
}

@keyframes nav-glow {
  0%, 100% { box-shadow: inset 0 1px 4px #fff9, 0 0 15px #6da8ff68; }
  50%      { box-shadow: inset 0 1px 4px #fff9, 0 0 26px #6da8ffa8; }
}

/* Карточки панелей: лёгкий подъём при наведении */
.panel {
  transition: border-color .35s, box-shadow .35s, transform .35s var(--ease-out);
}

.panel:hover {
  border-color: #9fb4d980;
  box-shadow:
    inset 1px 1px 2px var(--glass-highlight),
    0 18px 44px #0007;
}

/* Обложка альбома покачивается при наведении */
.album img {
  transition: transform .5s var(--ease-out);
}

.track:hover .album img {
  transform: scale(1.06) rotate(-1.5deg);
}

/* Ссылки контактов: подчёркивание «прорисовывается» */
.contact-row > a {
  background-image: linear-gradient(#9fc7ff, #9fc7ff);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size .35s var(--ease-out), color .25s;
  text-decoration: none;
}

.contact-row > a:hover {
  background-size: 100% 1px;
  color: #dbe8ff;
}

/* Кнопки «копировать» и иконки — отклик на нажатие */
.copy svg,
.icon-button svg,
.tools svg {
  transition: transform .25s var(--ease-out), color .25s;
}

.copy:active svg {
  transform: scale(.82);
}

.icon-button:hover svg,
.tools button:hover svg {
  transform: scale(1.12);
}

/* Плавная смена темы */
body,
.glass,
.panel,
.technology,
.project,
.contact-row {
  transition:
    background-color .4s ease,
    border-color .4s ease,
    color .4s ease;
}

/* ---------- 7. Motion preferences ---------- */

.no-motion *,
.no-motion *::before,
.no-motion *::after {
  animation: none !important;
  scroll-behavior: auto !important;
  transition: none !important;
}

.no-motion .reveal,
.no-motion .technology,
.no-motion .stat-grid > div,
.no-motion .contact-row {
  opacity: 1 !important;
  transform: none !important;
}

/*
 * Подсветка блока, к которому перешли по клику.
 * Раньше здесь был :target, но адрес меняется через history.replaceState —
 * такой переход :target не обновляет. Поэтому класс ставит JS.
 */
.panel.is-targeted {
  animation: highlight 1.6s ease;
}

@keyframes highlight {
  0%   { box-shadow: 0 0 0 0 #9fcaff00, inset 0 0 0 0 #9fcaff00; border-color: var(--glass-border); }
  35%  { box-shadow: 0 0 34px #9fcaffaa, inset 0 0 26px #9fcaff2e; border-color: #b8d7ff; }
  100% { box-shadow: 0 0 0 0 #9fcaff00, inset 0 0 0 0 #9fcaff00; border-color: var(--glass-border); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .backdrop-glow,
  .portrait-frame > .online,
  .portrait-frame,
  .navigation a.active,

  .reveal,
  .technology,
  .stat-grid > div,
  .contact-row {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- 8. Responsive ---------- */

@media (max-width: 1100px) {
  .shell {
    padding: 35px 24px;
  }

  .hero {
    gap: 18px;
    min-height: 270px;
  }

  .portrait-frame {
    width: 210px;
    height: 229px;
    padding: 15px;
  }

  .intro {
    min-width: 0;
    max-width: 360px;
  }

  .intro p {
    font-size: 16px;
  }

  .intro .tags {
    max-width: 300px;
    gap: 5px;
  }

  .intro .tags span {
    padding: 3px 8px;
    font-size: 12px;
  }

  h1 {
    font-size: 60px;
  }

  .hero-widgets {
    top: 0;
    right: 85px;
    width: 245px;
  }

  .location {
    width: 290px;
    margin-left: -45px;
    gap: 12px;
    padding: 0 14px;
    font-size: 12px;
  }

  .hero blockquote {
    width: 245px;
    padding-left: 40px;
  }

  .hero blockquote p {
    font-size: 17px;
  }

  .tools {
    right: 0;
    width: 60px;
  }

  .dashboard {
    grid-template-columns: 1.15fr 1fr;
  }

  .right-column {
    grid-column: 1 / 3;
    grid-row: 2;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .stats {
    min-height: 249px;
  }

  .projects {
    grid-row: 3;
  }

  .contacts {
    grid-column: 1 / 3;
  }

  .contact-list {
    grid-template-columns: 1fr 1fr;
  }

  .facts strong {
    font-size: 13px;
  }
}

@media (max-width: 850px) {
  .hero {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
  }

  .portrait-frame {
    width: 180px;
    height: 200px;
    padding: 13px;
    border-radius: 30px;
  }

  .hero-widgets {
    position: static;
    display: flex;
    grid-column: 1 / 3;
    align-items: center;
    gap: 18px;
    width: auto;
  }

  .location {
    width: 50%;
    margin: 0;
  }

  .hero blockquote {
    width: 50%;
    min-height: 130px;
    margin: 0;
    padding: 32px 20px 20px 40px;
  }

  .hero blockquote p {
    font-size: 16px;
  }

  .hero blockquote p br {
    display: none;
  }

  .tools {
    top: 0;
  }

  .intro {
    padding-top: 0;
    padding-right: 55px;
  }

  h1 {
    font-size: 52px;
  }

  .profession {
    font-size: 20px;
  }

  .intro p {
    margin: 12px 0;
  }

  .desktop-br {
    display: none;
  }

  .navigation {
    margin: 20px 0;
  }

  .navigation a {
    gap: 8px;
    font-size: 14px;
  }

  .dashboard {
    gap: 16px;
  }

  .panel {
    padding: 16px;
  }

  h2 {
    gap: 12px;
    font-size: 19px;
  }

  .facts > div {
    gap: 12px;
    padding: 9px 12px;
  }

  .facts span {
    min-width: 58px;
  }

  .facts strong {
    white-space: normal;
  }

  .contact-list {
    gap: 10px;
  }
}

@media (max-width: 600px) {
  .shell {
    padding: 26px 16px;
  }

  .hero {
    grid-template-columns: 112px 1fr;
    gap: 15px;
  }

  .portrait-frame {
    width: 112px;
    height: 133px;
    padding: 8px;
    border-radius: 25px;
  }

  .portrait {
    border-radius: 19px;
  }

  .portrait-frame > .online {
    left: 12px;
    bottom: 13px;
    width: 9px;
    height: 9px;
  }

  .intro {
    padding-right: 0;
  }

  h1 {
    margin: 0 0 4px;
    font-size: 43px;
  }

  .profession {
    gap: 8px;
    font-size: 17px;
  }

  .code-icon {
    width: 27px;
    height: 24px;
    font-size: 16px;
    line-height: 23px;
  }

  .intro p {
    margin: 9px 0 11px;
    font-size: 13px;
    line-height: 1.4;
  }

  .intro .tags {
    gap: 4px;
  }

  .intro .tags span {
    padding: 2px 7px;
    font-size: 10px;
  }

  .tools {
    position: static;
    flex-direction: row;
    grid-column: 1 / 3;
    justify-self: end;
    width: auto;
    margin-top: -3px;
    /* Кнопки в строку — скругляем контейнер по их радиусу,
       иначе угол выглядит квадратным */
    border-radius: 14px;
    overflow: visible;
  }

  .tools button {
    width: 44px;
    height: 38px;
    border-radius: 13px;
    /* Убираем стык между кнопками, чтобы не было двойной рамки */
    border-color: #b6c1d71a;
  }

  .tools svg {
    width: 18px;
  }

  .hero-widgets {
    gap: 10px;
    margin-top: 4px;
  }

  .location {
    flex-wrap: wrap;
    gap: 8px;
    height: 90px;
    padding: 12px;
    border-radius: 18px;
  }

  .location > span:not(.online) {
    font-size: 11px;
  }

  .location svg {
    width: 15px;
  }

  .location time {
    margin-left: 23px;
    font-size: 17px;
  }

  .location > .online {
    margin-left: auto;
  }

  .hero blockquote {
    min-height: 110px;
    padding: 33px 12px 14px 25px;
    border-radius: 18px;
  }

  .hero blockquote p {
    font-size: 13px;
  }

  .quote-mark {
    left: 10px;
    font-size: 40px;
  }

  .navigation {
    position: sticky;
    top: 8px;
    z-index: 5;
    height: 66px;
    margin: 17px 0;
    padding: 4px;
    border-radius: 21px;
    background: #121923e8;
  }

  .navigation a {
    flex-direction: column;
    gap: 3px;
    border-radius: 16px;
    font-size: 10px;
  }

  .navigation a svg {
    width: 20px;
    height: 20px;
  }

  .navigation a + a::before {
    height: 35px;
  }

  .dashboard {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .panel {
    padding: 17px;
    border-radius: 22px;
  }

  .about p {
    font-size: 15px;
  }

  .facts > div {
    gap: 15px;
  }

  .facts span {
    min-width: 65px;
  }

  .facts strong {
    font-size: 12px;
  }

  .tech-grid {
    gap: 10px;
  }

  .technology {
    height: 91px;
  }

  .right-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .stat-grid > div {
    gap: 20px;
  }

  .track-info {
    padding-right: 5px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project {
    display: grid;
    grid-template-columns: 40% 1fr;
    min-height: 130px;
  }

  .project-cover {
    height: 100%;
    min-height: 130px;
    border-radius: 15px;
  }

  .cover-xasan img {
    width: 74px;
    height: 74px;
  }

  .project-info {
    padding: 14px 10px;
  }

  .project h3 {
    font-size: 17px;
  }

  .project p {
    margin-top: 3px;
  }

  .project .tags {
    gap: 4px;
    margin-top: 10px;
  }

  .project .tags span {
    padding: 3px 7px;
    font-size: 10px;
  }

  .all-projects {
    padding: 8px 12px;
    font-size: 12px;
  }

  .contact-list {
    grid-template-columns: 1fr;
  }

  .contact-row {
    min-height: 50px;
    font-size: 13px;
  }

  .contact-row > a {
    font-size: 12px;
  }

  .contact-label {
    width: 64px;
  }

  .contact-row .brand {
    width: 29px;
  }
}
