/* =========================================================
   Portfolio  |  styles.css
   Тёмная тема: Teal Blue + Magenta Purple + песочный акцент
   ========================================================= */

/* ---------- 1. Переменные и сброс ---------- */
:root {
  /* Основной фон и поверхности */
  --bg-main: #0d1315;        /* глубокий тёмный петрольно-графитовый */
  --bg: #0d1315;
  --bg-soft: #131c1e;        /* петрольный графит */
  --surface: #1a1217;        /* тёмный сливово-винный */
  --surface-2: #131c1e;
  --border-color: #223538;   /* сдержанный тёмный чирок */
  --line: #223538;
  --line-strong: #361d28;    /* тёмное вино */
  /* Текст */
  --text: #ece7e1;           /* мягкий слоновая кость */
  --text-soft: #a19790;      /* дымчатый серо-бежевый */
  --text-dim: #7f7671;
  /* Акценты */
  --accent: #194a53;         /* Pantone Teal Blue */
  --accent-hover: #22616d;
  --accent-2: #682645;       /* Pantone Magenta Purple */
  --accent-2-hover: #7e3055;
  --accent-3: #b5a494;       /* песочный / бежевый кэмел */
  --accent-soft: rgba(104, 38, 69, 0.22);
  --accent-teal-soft: rgba(25, 74, 83, 0.22);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-2: 0 20px 60px rgba(0, 0, 0, 0.45);
  --container: 1180px;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(180deg, #131c1e 0%, #0d1315 42%, #0d1315 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: 0.1px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }

code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(237, 232, 225, 0.05);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 22px; }
.muted { color: var(--text-dim); }
.hide-sm { display: inline-flex; }

/* ---------- 2. Фон ---------- */
/* Сплошной тёплый фон без сеток и свечений — задаётся в body */

main, .site-header, .site-footer { position: relative; z-index: 1; }

/* ---------- 3. Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  background: rgba(13, 19, 21, 0.78);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.site-header.is-scrolled { background: rgba(19, 28, 30, 0.94); border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: var(--header-h);
}

.logo { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; }
.logo-text { font-size: 15px; letter-spacing: 0.4px; display: flex; flex-direction: column; line-height: 1.05; color: var(--text); }
.logo-text em { font-style: normal; font-weight: 400; font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-dim); }
.footer-brand { font-weight: 700; color: var(--text); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-soft);
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: rgba(237, 232, 225, 0.05); }
.nav-link.is-active { color: var(--text); background: var(--accent-soft); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.burger {
  display: none;
  width: 42px; height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--bg-soft);
  padding: 10px 11px;
  flex-direction: column;
  justify-content: space-between;
}
.burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.scroll-progress {
  position: absolute; left: 0; bottom: -1px;
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  transition: width 0.1s linear;
}

/* ---------- 4. Кнопки ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1px;
  transition: transform 0.22s var(--ease), box-shadow 0.25s var(--ease),
              background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.2s;
  will-change: transform;
}
.btn .ico { width: 17px; height: 17px; transition: transform 0.25s var(--ease); }
.btn:hover .ico { transform: translateX(3px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--text);
  /* Полностью убираем рамку, контур и тень: именно они давали тонкие линии по краям градиента */
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
/* Псевдоэлементы кнопок с градиентом не должны добавлять линий и сдвигов по краям */
.btn-primary::before,
.btn-primary::after {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
.btn-primary::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-2-hover));
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  z-index: -1;
}
.btn-primary:hover { transform: translateY(-2px); border: none !important; outline: none !important; box-shadow: none !important; }
.btn-primary:hover::after { opacity: 1; }

.btn-outline {
  border-color: var(--line-strong);
  background: var(--bg-soft);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent-2); background: var(--accent-soft); transform: translateY(-2px); }

.btn-ghost { color: var(--text-soft); border-color: transparent; background: transparent; }
.btn-ghost:hover { color: var(--text); background: rgba(237, 232, 225, 0.05); }

.btn-sm { padding: 9px 15px; font-size: 13.5px; border-radius: 11px; }
.btn-block { width: 100%; }

/* ---------- 5. Hero ---------- */
.hero { padding: 74px 0 40px; position: relative; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 54px;
  align-items: center;
}

.badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 22px;
}
.badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 4px rgba(181, 164, 148, 0.20);
  animation: pulse 2.4s infinite;
  flex: none;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(181, 164, 148, 0.22); }
  50% { box-shadow: 0 0 0 8px rgba(181, 164, 148, 0.06); }
}

.hero-title {
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  font-weight: 800;
  line-height: 1.12;
  color: var(--text);
  margin-bottom: 22px;
  max-width: 20ch;
}
.hero-slogan { font-size: 17.5px; color: var(--text-soft); max-width: 56ch; margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 13px; margin-bottom: 38px; }

.hero-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.hero-facts li { display: flex; flex-direction: column; gap: 2px; }
.hero-facts strong { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; }
.hero-facts span { font-size: 12.5px; color: var(--text-dim); line-height: 1.35; }

/* Hero — окно с кодом */
.hero-panel { position: relative; }
.panel-window {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow-2);
  overflow: hidden;
  transform: perspective(1200px) rotateX(3deg) rotateY(-4deg);
  transition: transform 0.6s var(--ease);
}
.hero-panel:hover .panel-window { transform: perspective(1200px) rotateX(0deg) rotateY(0deg) translateY(-4px); }
.panel-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(237, 232, 225, 0.03);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: var(--accent-2); } .dot.yellow { background: var(--accent-3); } .dot.green { background: var(--accent); }
.panel-path { margin-left: 10px; font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: var(--text-dim); }
.panel-code {
  margin: 0;
  padding: 20px 20px 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--text-soft);
  overflow-x: auto;
}
.c-key { color: var(--accent-3); } .c-var { color: #e7e1da; }
.c-prop { color: #7fb0a6; } .c-str { color: #d1a3b8; }
.panel-tags {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--line);
}
.panel-tags span {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-2);
  color: var(--accent-3);
}

/* Бегущая строка */
.marquee {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; width: max-content; gap: 34px; animation: marquee 42s linear infinite; }
.marquee-track span { font-size: 13px; color: var(--text-dim); white-space: nowrap; letter-spacing: 0.6px; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- 6. Секции ---------- */
.section { padding: 96px 0; }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-kicker {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--accent-3);
  margin-bottom: 12px;
}
.section-title { font-size: clamp(1.8rem, 4vw, 2.7rem); }
.section-sub { color: var(--text-soft); margin-top: 12px; }
.sub-title { font-size: 1.2rem; margin: 54px 0 20px; }

/* ---------- 7. Обо мне ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: start;
}
.about-text p { color: var(--text-soft); font-size: 16.5px; }
.about-text strong { color: var(--text); font-weight: 600; }
.about-cards { display: grid; gap: 18px; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(168deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow-1);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.mini-card { padding: 24px; }
.mini-card h3 { font-size: 1.02rem; margin-bottom: 14px; color: var(--text); }
.mini-card:hover { border-color: var(--accent-2); transform: translateY(-3px); }

.check-list { list-style: none; display: grid; gap: 9px; }
.check-list li {
  position: relative;
  padding-left: 26px;
  font-size: 14.5px;
  color: var(--text-soft);
  line-height: 1.55;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 4px; top: 8px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
}

/* ---------- 8. Фильтры ---------- */
.filters, .media-tabs { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 30px; }
.filter {
  padding: 9px 17px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 13.5px;
  color: var(--text-soft);
  transition: all 0.24s var(--ease);
}
.filter:hover { border-color: var(--line-strong); color: var(--text); transform: translateY(-1px); }
.filter.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-2);
  color: var(--text);
}

/* ---------- 9. Проекты ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  align-items: start;
}
.project {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  /* Единый сплошной фон всей карточки: бесшовный стык превью и текста */
  background: var(--surface);
  /* Гасим субпиксельное мерцание на стыке скриншота и карточки */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.project:hover { transform: translateY(-4px); border-color: var(--accent-2); box-shadow: var(--shadow-2); }
.project.is-open { border-color: var(--accent-3); }

/* Снимаем общий сброс transform у .reveal, иначе подъём карточки при наведении не срабатывает */
.project.reveal.is-visible:hover { transform: translateZ(0) translateY(-4px); }
.mini-card.reveal.is-visible:hover,
.skill-card.reveal.is-visible:hover { transform: translateY(-3px); }

/* Обложка проекта: во всю ширину карточки.
   Фон превью совпадает с фоном карточки (.project), а line-height: 0,
   vertical-align: bottom и margin: 0 дают бесшовный стык с текстом —
   без полосок, теней и перепадов цвета. */
.project-thumb {
  position: relative;
  display: block;
  width: calc(100% + 48px); /* полная ширина карточки с учётом её боковых отступов */
  margin: 0 -24px 20px;
  padding: 0;
  /* Фон совпадает с фоном карточки — на стыке нет перепада цвета */
  background-color: var(--surface);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  line-height: 0;
  cursor: zoom-in;
  border-radius: var(--radius) var(--radius) 0 0;
  /* Аппаратное маскирование и изоляция контекста наложения:
     намертво блокируют утечку субпиксельного блика за границы контейнера */
  isolation: isolate;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: linear-gradient(#fff, #fff);
  clip-path: inset(0 0 0 0 round var(--radius, 16px) var(--radius, 16px) 0 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
/* Полный сброс обводок на всех состояниях контейнера */
.project-thumb,
.project-thumb:hover,
.project-thumb:focus,
.project-thumb:focus-visible,
.project-thumb:active {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
.project-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: bottom;
  margin: 0;
  padding: 0;
  border: none !important;
  outline: none !important;
  transform-origin: center center;
  will-change: transform;
  filter: saturate(0.94) contrast(1.02);
  transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
}
.project:hover .project-thumb img { transform: scale(1.03); transform-origin: center center; filter: saturate(1.06); }
.project-thumb::after {
  content: "Увеличить";
  position: absolute;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 26px 12px 10px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.project-thumb:hover::after { opacity: 1; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  background-color: transparent !important;
  margin-top: 0 !important;
  box-shadow: none !important;
  border: none !important;
}
.card-emoji {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 13px;
  font-size: 19px;
  color: var(--accent-3);
  background: var(--accent-teal-soft);
  border: 1px solid var(--accent);
  transition: transform 0.3s var(--ease);
}
.project:hover .card-emoji { transform: rotate(-6deg) scale(1.06); }
/* Акценты эмодзи — чередование Teal Blue, Magenta Purple и песочного */
.card-emoji[data-accent] { color: var(--accent-3); }
.card-emoji[data-accent="amber"] { color: var(--accent-3); background: var(--accent-soft); border-color: var(--accent-2); }
.card-emoji[data-accent="red"] { color: #d9a7bb; background: var(--accent-soft); border-color: var(--accent-2); }

.pill {
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-dim);
  white-space: nowrap;
}

.card-title { font-size: 1.32rem; margin-bottom: 6px; color: var(--text); }
.card-role { font-size: 13.5px; color: var(--accent-3); margin-bottom: 12px; font-weight: 500; }
.card-desc { font-size: 14.5px; color: var(--text-soft); margin-bottom: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips span {
  font-size: 11.8px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-soft);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.chips span:hover { border-color: var(--accent-2); color: var(--text); background: var(--accent-soft); }

.card-footer { margin-top: auto; padding-top: 18px; }
.toggle .chev { transition: transform 0.35s var(--ease); }
.toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.toggle[aria-expanded="true"] { border-color: var(--accent-3); background: var(--accent-soft); color: var(--text); }

/* Раскрывающийся блок */
.details { overflow: hidden; }
.details[hidden] { display: none; }
.details-inner {
  display: grid;
  gap: 20px;
  padding-top: 22px;
  margin-top: 20px;
  border-top: 1px dashed var(--line-strong);
  animation: revealDown 0.45s var(--ease) both;
}
@keyframes revealDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.detail-block h4 {
  font-size: 12px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent-3);
  margin-bottom: 10px;
  font-weight: 600;
}
.detail-block p { font-size: 14.3px; color: var(--text-soft); margin-bottom: 0; }
.detail-block p + p { margin-top: 10px; }
.detail-links .muted { font-size: 13.5px; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.metric {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(237, 232, 225, 0.03);
}
.metric strong { display: block; font-size: 1.28rem; letter-spacing: -0.02em; color: var(--text); }
.metric span { font-size: 12px; color: var(--text-dim); line-height: 1.4; }

/* ---------- 10. Навыки ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.skill-card { padding: 22px; }
.skill-card h3 { font-size: 1rem; color: var(--text); margin-bottom: 14px; }
.skill-card:hover { border-color: var(--accent-2); transform: translateY(-3px); }

.timeline { margin-top: 40px; display: grid; gap: 14px; }
.timeline-item {
  border-left: 2px solid rgba(25, 74, 83, 0.65);
  padding: 4px 0 4px 22px;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.timeline-item:hover { border-color: var(--accent-3); transform: translateX(4px); }
.timeline-tag {
  display: block;
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent-3);
  margin-bottom: 6px;
}
.timeline-item p { font-size: 14.5px; color: var(--text-soft); margin: 0; max-width: 88ch; }

/* ---------- 11. Медиа ---------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }

/* Витринная видеокарточка: превью сверху, человеческое описание снизу */
.video-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  text-align: left;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.video-card:hover { border-color: var(--accent-2); transform: translateY(-4px); box-shadow: var(--shadow-2); }
.video-card:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--bg-main);
  overflow: hidden;
  /* Убираем любые рамки/тени контейнера видео, которые дают просвет */
  border: none !important;
  border-top: none !important;
  border-bottom: none !important;
  outline: none !important;
  box-shadow: none !important;
}
.video-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: bottom;
  margin-bottom: -1px; /* перекрывает субпиксельный просвет на стыке с текстом */
  border: none !important;
  border-bottom: none !important;
  outline: none !important;
  filter: saturate(0.86) contrast(1.02);
  transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
}
.video-card:hover .video-preview { transform: scale(1.04); filter: saturate(1.02); }
.video-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13, 19, 21, 0.12), rgba(13, 19, 21, 0.74));
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.video-card:hover .video-scrim { opacity: 0.7; }

/* Полупрозрачная кнопка Play в бирюзово-сливовом круге */
.play-btn {
  position: absolute;
  left: 50%; top: 50%;
  width: 58px; height: 58px;
  margin: -29px 0 0 -29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(25, 74, 83, 0.62);
  border: 1px solid rgba(181, 164, 148, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--text);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.play-btn svg { width: 26px; height: 26px; fill: currentColor; margin-left: 2px; }
.video-card:hover .play-btn { transform: scale(1.12); background: rgba(104, 38, 69, 0.86); border-color: var(--accent-3); }

.video-badge {
  position: absolute; left: 12px; top: 12px;
  font-size: 10.5px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(19, 28, 30, 0.78);
  border: 1px solid var(--line-strong);
  color: var(--accent-3);
}

/* Блок описания ролика: поднимаем на 1px, чтобы исключить субпиксельный просвет,
   и накладываем сплошной фон карточки поверх нижнего среза видео */
.video-body {
  display: grid;
  gap: 6px;
  padding: 15px 16px 16px;
  position: relative;
  z-index: 2;
  margin-top: -1px;
  background-color: var(--surface);
  border: none !important;
  border-top: none !important;
  outline: none !important;
  box-shadow: none !important;
}
.video-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; }
.video-sub { font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }
.video-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  padding-top: 11px;
  border: none !important;
  border-top: none !important;
  outline: none !important;
  box-shadow: none !important;
}
.video-size { font-size: 11.5px; color: var(--text-dim); font-family: "JetBrains Mono", monospace; }
.video-index { font-size: 11px; color: var(--text-dim); font-family: "JetBrains Mono", monospace; letter-spacing: 1.4px; }

.media-note { margin-top: 18px; font-size: 13px; color: var(--text-dim); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.gallery-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 4 / 5;
  padding: 0;
  cursor: zoom-in;
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
  filter: saturate(0.92) contrast(1.02);
}
.gallery-item:hover img { transform: scale(1.06); filter: saturate(1.1); }
.gallery-item::after {
  content: "Увеличить";
  position: absolute; inset: auto 0 0 0;
  padding: 26px 12px 11px;
  font-size: 12px;
  text-align: center;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.gallery-item:hover::after { opacity: 1; }

/* Лайтбокс */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 26px;
  background: rgba(13, 19, 21, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.25s var(--ease) both;
}
.lightbox[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
  max-width: min(92vw, 1000px);
  max-height: 80vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  animation: revealDown 0.35s var(--ease) both;
}
.lightbox-caption { font-size: 12.5px; color: var(--text-dim); font-family: "JetBrains Mono", monospace; margin: 0; }
.lightbox-close {
  position: absolute; top: 20px; right: 22px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  font-size: 22px;
  line-height: 1;
  transition: background 0.2s, transform 0.2s;
}
.lightbox-close:hover { background: var(--accent); transform: rotate(90deg); }

/* Модальный просмотр видео */
.video-lightbox {
  position: fixed; inset: 0; z-index: 210;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(13, 19, 21, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.25s var(--ease) both;
}
.video-lightbox[hidden] { display: none; }
.vlb-inner { width: min(100%, 1040px); display: grid; gap: 14px; }
.vlb-inner video {
  width: 100%;
  max-height: 74vh;
  background: #000;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  animation: revealDown 0.35s var(--ease) both;
}
.vlb-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.vlb-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.vlb-original { font-size: 12.5px; color: var(--accent-3); border-bottom: 1px dashed rgba(181, 164, 148, 0.5); }
.vlb-original:hover { color: var(--text); border-bottom-color: var(--accent-3); }
.vlb-note { margin: 0; font-size: 12.5px; color: #d9a7bb; }
.vlb-note[hidden] { display: none; }

/* ---------- 12. Контакты ---------- */
.contact-grid { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 26px; align-items: start; }
.contact-info { display: grid; gap: 13px; }
.contact-item {
  display: flex; align-items: center; gap: 15px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: all 0.26s var(--ease);
}
.contact-item:hover { border-color: var(--accent-2); background: var(--accent-soft); transform: translateX(4px); }
.contact-ico {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--accent-3);
  background: var(--accent-teal-soft);
  border: 1px solid var(--accent);
  font-size: 17px;
}
.contact-text { display: flex; flex-direction: column; min-width: 0; }
.contact-text strong { font-size: 14.5px; font-weight: 600; }
.contact-text span { font-size: 13.5px; color: var(--text-dim); word-break: break-word; }
.copy-btn {
  margin-left: auto;
  flex: none;
  padding: 8px 13px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  font-size: 12.5px;
  color: var(--text-soft);
  transition: all 0.22s var(--ease);
}
.copy-btn:hover { border-color: var(--accent-2); color: var(--text); background: var(--accent-soft); }
.copy-btn.is-done { border-color: var(--accent-3); color: var(--accent-3); background: var(--accent-soft); }

.availability {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--text-soft);
}

.contact-form { padding: 26px; }
.contact-form h3 { font-size: 1.15rem; margin-bottom: 20px; }
.field { margin-bottom: 16px; display: flex; flex-direction: column; }
.field label { font-size: 13px; color: var(--text-soft); margin-bottom: 7px; font-weight: 500; }
.field input, .field textarea {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  resize: vertical;
  transition: border-color 0.22s, box-shadow 0.22s, background 0.22s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent-3);
  background: rgba(25, 74, 83, 0.14);
  box-shadow: 0 0 0 4px rgba(25, 74, 83, 0.20);
}
.field.has-error input, .field.has-error textarea { border-color: var(--accent-2-hover); }
.error { font-size: 12px; color: #d9a7bb; min-height: 0; margin-top: 5px; }
.form-hint { font-size: 12.5px; color: var(--text-dim); margin: 14px 0 0; }
.form-status { font-size: 13.5px; margin: 10px 0 0; min-height: 0; }
.form-status.ok { color: var(--accent-3); }
.form-status.err { color: #d9a7bb; }

/* ---------- 13. Футер ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 34px 0; margin-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; font-size: 13.5px; }
.footer-inner p { margin: 0; }

.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 70;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(19, 28, 30, 0.92);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--accent); border-color: var(--accent-3); color: var(--text); transform: translateY(-3px); }

/* ---------- 14. Анимация появления ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 15. Адаптив ---------- */
@media (max-width: 1080px) {
  .hero { padding-top: 54px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .panel-window { transform: none; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .hide-sm { display: none; }
  .burger { display: flex; }
  .nav {
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 18px 22px;
    background: rgba(19, 28, 30, 0.98);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-14px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.28s var(--ease);
  }
  .nav.is-open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-link { padding: 13px 14px; font-size: 15.5px; border-radius: 12px; }
}

@media (max-width: 720px) {
  .section { padding: 66px 0; }
  .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .projects { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-item { flex-wrap: wrap; }
  .copy-btn { margin-left: 57px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .panel-code { font-size: 11.5px; padding: 16px 16px 4px; }
}

@media (max-width: 460px) {
  .container { padding: 0 16px; }
  .video-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 2.3rem; }
  .mini-card, .contact-form, .skill-card { padding: 20px; }
  /* Обложка проекта остаётся во всю ширину карточки при уменьшенных отступах */
  .project { padding: 0 20px 20px; }
  .project-thumb { width: calc(100% + 40px); margin: 0 -20px 18px; }
  .gallery { grid-template-columns: 1fr; }
  .copy-btn { margin-left: 0; width: 100%; text-align: center; }
  .contact-item { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .project.reveal.is-visible:hover,
  .mini-card.reveal.is-visible:hover,
  .skill-card.reveal.is-visible:hover { transform: none; }
  .project:hover .project-thumb img,
  .video-card:hover .video-preview,
  .gallery-item:hover img { transform: none; }
}

/* Печать */
@media print {
  .site-header, .to-top, .marquee, .lightbox, .video-lightbox { display: none !important; }
  .project-thumb, .project-thumb::after { display: none !important; }
  body { background: #fff; color: #000; }
  .details[hidden] { display: block; }
}