/* ============================================================
   Лев Минаков — DevOps-инженер. Светлая тема в цветах Argo CD.
   ============================================================ */

:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #16232c;
  --muted: #5f7280;
  --line: #e2e8ee;

  --slate: #0e2b3a;      /* хедер/футер, как тёмная панель Argo CD */
  --slate-2: #123449;

  --orange: #ef7b4d;     /* фирменный оранжевый Argo */
  --orange-dark: #d9663a;
  --orange-ink: #b4502a; /* оранжевый для текста на светлом: ≥4.5:1 */
  --teal: #0dadea;       /* progressing */
  --green: #18be94;      /* healthy / synced */
  --yellow: #f4c030;     /* out-of-sync */
  --red: #e96d76;        /* degraded */

  --green-tint: #e4f7f0;
  --green-deep: #0d7359;
  --red-tint: #fdeeee;
  --red-deep: #a83a4a;
  --teal-tint: #e3f4fd;
  --teal-deep: #096a90;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono", "Liberation Mono", Menlo, Consolas, monospace;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(14, 43, 58, .06), 0 10px 28px rgba(14, 43, 58, .08);
  --shadow-lift: 0 2px 4px rgba(14, 43, 58, .07), 0 16px 40px rgba(14, 43, 58, .13);
}

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

html {
  scroll-padding-top: 84px;
  overflow-x: hidden;
  overflow-x: clip;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

h1, h2, h3 { line-height: 1.15; margin: 0; }

.container {
  width: min(1120px, 100% - 48px);
  margin-inline: auto;
}
@media (max-width: 560px) {
  .container { width: calc(100% - 36px); }
}

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

:focus-visible {
  outline: 2px solid var(--teal-deep);
  outline-offset: 3px;
  border-radius: 4px;
}
/* На тёмных панелях тёмное кольцо не видно — там светлый teal */
.topbar :focus-visible,
.footer :focus-visible {
  outline-color: var(--teal);
}
main:focus-visible { outline: none; }

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--slate);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- YAML-eyebrow секций ---------- */

.eyebrow {
  margin: 0 0 14px;
  font-size: 13.5px;
  letter-spacing: .02em;
}
.y-key { color: var(--teal-deep); }
.y-val { color: var(--orange-ink); font-weight: 600; }
.eyebrow--dark .y-key { color: var(--teal); }
.eyebrow--dark .y-val { color: var(--orange); }

/* ---------- Кнопки и бейджи ---------- */

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15.5px;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}
.btn--primary {
  background: var(--orange);
  color: var(--slate);
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(239, 123, 77, .35);
}
.btn--primary:hover {
  background: #f28d64;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(239, 123, 77, .42);
}
.btn--outline {
  border: 1.5px solid var(--line);
  color: var(--ink);
  background: var(--card);
}
.btn--outline:hover {
  border-color: var(--orange);
  color: var(--orange-ink);
  transform: translateY(-2px);
}
.btn--ghost {
  border: 1px solid rgba(255, 255, 255, .3);
  color: #fff;
  padding: 8px 16px;
  font-size: 14px;
}
.btn--ghost:hover { border-color: var(--orange); color: var(--orange); }
.btn--lg { padding: 16px 34px; font-size: 18px; font-family: var(--mono); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 13px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
}
.badge--green { background: var(--green-tint); border-color: #bfe9da; color: var(--green-deep); }
.badge--green .badge__ico { color: var(--green); }
.badge--teal { background: var(--teal-tint); border-color: #bfe4f5; color: var(--teal-deep); }
.badge--teal .badge__ico { color: var(--teal); }
.badge--sm { padding: 2px 10px; font-size: 11.5px; vertical-align: 3px; }

.pulse {
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(24, 190, 148, .5);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(24, 190, 148, .5); }
  70%  { box-shadow: 0 0 0 9px rgba(24, 190, 148, 0); }
  100% { box-shadow: 0 0 0 0 rgba(24, 190, 148, 0); }
}

/* ---------- Хедер ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--slate);
  color: #fff;
}
.topbar__in {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 62px;
}
.brand {
  font-family: var(--mono);
  font-size: 15.5px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.brand__dot {
  width: 8px; height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(24, 190, 148, .5);
  animation: pulse 2.2s ease-out infinite;
}
.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  padding: 8px 12px;
  color: #b9c9d4;
  font-size: 14.5px;
  text-decoration: none;
  border-radius: 8px;
  transition: color .15s ease, background-color .15s ease;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.progress {
  height: 3px;
  background: rgba(255, 255, 255, .12);
}
.progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--teal));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* Scroll-driven: прогресс страницы */
@supports (animation-timeline: scroll()) {
  .progress__bar {
    animation: progress-grow linear both;
    animation-timeline: scroll(root block);
  }
}
@keyframes progress-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@media (max-width: 760px) {
  .nav { display: none; }
  .topbar__cta { margin-left: auto; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(64px, 9vw, 120px) 0 clamp(72px, 9vw, 120px);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #cdd9e2 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.5), transparent 75%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,.5), transparent 75%);
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
}

.hero h1 {
  font-size: clamp(2.5rem, 2rem + 3.4vw, 4.1rem);
  font-weight: 800;
  letter-spacing: -.025em;
}
.hero__role {
  margin: 10px 0 0;
  font-size: clamp(1.25rem, 1.1rem + 1vw, 1.7rem);
  font-weight: 700;
  color: var(--orange-ink);
  letter-spacing: -.01em;
}
.hero__lead {
  margin: 20px 0 0;
  max-width: 54ch;
  font-size: 17.5px;
  color: var(--muted);
}
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

/* Каскад появления hero при загрузке */
@media (prefers-reduced-motion: no-preference) {
  .anim {
    opacity: 0;
    animation: rise .7s cubic-bezier(.22, .61, .36, 1) forwards;
  }
  .anim-1 { animation-delay: .05s; }
  .anim-2 { animation-delay: .14s; }
  .anim-3 { animation-delay: .23s; }
  .anim-4 { animation-delay: .32s; }
  .anim-5 { animation-delay: .41s; }
  .anim-6 { animation-delay: .5s; }
  .anim-card {
    opacity: 0;
    animation: fly-left .8s cubic-bezier(.22, .61, .36, 1) .35s forwards;
  }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fly-left {
  from { opacity: 0; transform: translateX(110px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- App-карточка в hero ---------- */

.appcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--orange);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 26px 28px 20px;
}
.appcard__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--line);
}
.appcard__ico {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  font-size: 24px;
  border-radius: 12px;
  background: linear-gradient(145deg, #fdeacd, #fbd9c8);
}
.appcard__name { margin: 0; font-size: 15.5px; font-weight: 700; }
.appcard__proj { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.appcard__proj span { color: var(--teal-deep); }

.appcard__rows { margin: 6px 0 0; }
.appcard__row {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid #f0f3f6;
}
.appcard__row:last-child { border-bottom: 0; }
.appcard__row dt { font-size: 12.5px; color: var(--muted); }
.appcard__row dd { margin: 0; font-size: 13.5px; }

.ok {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  font-size: 13.5px;
}
.ok--green { color: var(--green-deep); }
.ok--green span { color: var(--green); }
.ok--teal { color: var(--teal-deep); }
.ok--teal span { color: var(--teal); }
.ok + .ok { margin-left: 12px; }

.appcard__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.appcard__tags span {
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 6px;
  background: #eef2f5;
  border: 1px solid var(--line);
  color: var(--muted);
}
.appcard__link {
  color: var(--teal-deep);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
.appcard__link:hover { color: var(--orange-ink); }

.appcard__foot {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

/* Scroll-driven: лёгкий параллакс карточки при уходе hero вверх.
   Параллакс живёт на обёртке, чтобы не перебивать входную анимацию .anim-card */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .appcard-drift {
      animation: card-drift linear both;
      animation-timeline: view(block);
      animation-range: exit 0% exit 100%;
    }
  }
}
@keyframes card-drift {
  to { transform: translateY(-34px) rotate(-1deg); }
}

/* ---------- Секции ---------- */

.section {
  padding: clamp(68px, 9vw, 112px) 0;
}
.section--white { background: var(--card); }

h2 {
  font-size: clamp(1.7rem, 1.3rem + 1.9vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.02em;
}
.section__lead {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 60ch;
}

/* ---------- Результаты: карточки-дифы ---------- */

.diffgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 44px;
}
@media (max-width: 980px) { .diffgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .diffgrid { grid-template-columns: 1fr; } }

.diff {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.diff:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: #d3dce3;
}
.diff__title {
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 14px;
}
.diff__code {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
}
.dline {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  text-decoration: none;
}
.dline--del {
  background: var(--red-tint);
  color: var(--red-deep);
  border-bottom: 1px solid #f5dcdc;
}
.dline--ins {
  background: var(--green-tint);
  color: var(--green-deep);
  font-weight: 700;
}
.diff__note {
  margin: 12px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Опыт: дерево ресурсов ---------- */

.tree {
  position: relative;
  list-style: none;
  margin: 52px 0 0;
  padding: 0;
}
.tree::before,
.tree::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 8px;
  bottom: 40px;
  width: 2px;
  z-index: 0;
}
.tree::before { background: var(--line); }
.tree::after {
  background: linear-gradient(180deg, var(--orange), var(--teal) 55%, var(--green));
  transform-origin: 50% 0;
}

/* Scroll-driven: линия дерева прорастает по мере скролла.
   Узлы серые, пока линия до них не доросла: .is-lit вешает js/main.js
   синхронно с прогрессом линии. Гейт тот же, что у анимации линии,
   поэтому во всех фолбэках (старый браузер / reduced-motion / no-JS)
   линия статична и узлы сразу цветные */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .tree::after {
      animation: rail-grow linear both;
      animation-timeline: view(block);
      animation-range: cover 0% cover 72%;
    }
    html.js .node {
      transition: border-color .45s ease, color .45s ease;
    }
    html.js .node:not(.is-lit) {
      border-color: var(--line);
      color: var(--muted);
    }
  }
}
@keyframes rail-grow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

.tree__item {
  position: relative;
  padding: 0 0 46px 72px;
}
.tree__item:last-child { padding-bottom: 0; }

.node {
  position: absolute;
  left: 0;
  top: 2px;
  z-index: 1;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--card);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-box: trim-both cap alphabetic;
  box-shadow: var(--shadow);
}
.node--orange { border: 2.5px solid var(--orange); color: var(--orange-ink); }
.node--teal   { border: 2.5px solid var(--teal);   color: var(--teal-deep); }
.node--green  { border: 2.5px solid var(--green);  color: var(--green-deep); }

.xp {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 30px;
}
.xp__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
}
.xp__company { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.xp__role { margin: 5px 0 0; color: var(--muted); font-size: 14.5px; }
.xp__dates {
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 12px;
}
.xp__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}
.xp__tags li {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--teal-tint);
  border: 1px solid #cbe8f7;
  color: var(--teal-deep);
}
.xp__list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}
.xp__list li {
  position: relative;
  padding: 7px 0 7px 30px;
  font-size: 15.5px;
}
.xp__list li::before {
  content: "+";
  position: absolute;
  left: 4px;
  top: 6px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--green);
}
/* Этапы внутри одной компании (смена роли) */
.xp__stage {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
}
.xp__stagehead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.xp__stagerole {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .02em;
}
.xp__stage .xp__list { margin-top: 10px; }

.xp--edu { border-left: 4px solid var(--green); }
.xp--solo { margin-top: 44px; border-top: 4px solid var(--orange); }

.xp--lab { border-top: 4px solid var(--teal); }

/* HomeLab: три карточки в ряд */
.labgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 44px;
}
.labgrid .xp__company { font-size: 18px; }
.labgrid .xp__list { margin-top: 14px; }
.labgrid .xp__list li { font-size: 14.5px; }
@media (max-width: 980px) { .labgrid { grid-template-columns: 1fr; } }

/* Каскад пунктов внутри карточки после её появления */
html.js .xp:where(:not(.settled)) .xp__list li {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s ease, transform .5s ease;
  transition-delay: calc(.25s + var(--c, 0) * 70ms);
}
html.js .xp.is-in:where(:not(.settled)) .xp__list li {
  opacity: 1;
  transform: none;
}

@media (max-width: 640px) {
  .tree::before, .tree::after { left: 15px; }
  .node { width: 32px; height: 32px; font-size: 10.5px; }
  .tree__item { padding-left: 50px; }
  .xp { padding: 22px 20px; }
}

/* ---------- Стек ---------- */

.skillgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 44px;
}
@media (max-width: 980px) { .skillgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .skillgrid { grid-template-columns: 1fr; } }

.skillcard {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.skillcard__kind {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 16px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.chips li {
  padding: 6px 13px;
  border-radius: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color .18s ease, transform .18s ease, color .18s ease;
}
.chips li:hover {
  border-color: var(--orange);
  color: var(--orange-ink);
  transform: translateY(-2px);
}

/* Каскад чипов после появления карточки.
   Гейт :where(:not(.settled)) — после завершения reveal (JS вешает .settled
   на [data-reveal]-элемент) правила отпадают, и hover чипов работает как задумано */
html.js .skillcard:where(:not(.settled)) .chips li {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .45s ease, transform .45s ease, border-color .18s ease, color .18s ease;
  transition-delay: calc(.15s + var(--c, 0) * 55ms);
}
html.js .skillcard.is-in:where(:not(.settled)) .chips li {
  opacity: 1;
  transform: none;
  transition-delay: calc(.15s + var(--c, 0) * 55ms), calc(.15s + var(--c, 0) * 55ms), 0s, 0s;
}

/* ---------- Футер / контакты ---------- */

.footer {
  background: var(--slate);
  color: #fff;
  padding: clamp(76px, 10vw, 128px) 0 36px;
  position: relative;
}
.footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .07) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(0deg, rgba(0,0,0,.6), transparent 70%);
  mask-image: linear-gradient(0deg, rgba(0,0,0,.6), transparent 70%);
  pointer-events: none;
}
.footer .container { position: relative; }
.footer__title { color: #fff; margin-bottom: 30px; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 72px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 13px;
  color: #7f97a6;
}
.footer__bottom p { margin: 0; }

/* ---------- Scroll reveal (классы вешает js/main.js) ----------
   После завершения анимации JS добавляет .settled, и все правила ниже
   отпадают: элемент возвращается к базовым стилям, hover-эффекты
   (.diff, .chips li) снова владеют transform/transition. */

html.js [data-reveal]:where(:not(.settled)) {
  opacity: 0;
  transition: opacity .7s ease, transform .7s cubic-bezier(.22, .61, .36, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
html.js [data-reveal="up"]:where(:not(.settled))    { transform: translateY(30px); }
html.js [data-reveal="left"]:where(:not(.settled))  { transform: translateX(-90px); }
html.js [data-reveal="right"]:where(:not(.settled)) { transform: translateX(90px); }
html.js [data-reveal].is-in:where(:not(.settled)) {
  opacity: 1;
  transform: none;
}

/* ---------- Reduced motion: всё статично ---------- */

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal],
  html.js .xp .xp__list li,
  html.js .skillcard .chips li {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .anim, .anim-card { opacity: 1; animation: none; }
  .pulse, .brand__dot { animation: none; }
  .progress { display: none; }
  .diff:hover, .chips li:hover, .btn:hover { transform: none; }
}
