/* Reset и базовые стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Навигация */
.navbar {
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #4f46e5;
}

/* Кнопка в шапке */
.menu-toggle {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  padding: .55rem .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .18s ease, box-shadow .18s ease;
}
.menu-toggle:hover { background: #f3f4f6; }
.menu-toggle:active { transform: scale(.98); }
.menu-toggle[aria-expanded="true"] { box-shadow: 0 4px 12px rgba(0, 0, 0, .08); }

/* Хедер */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 120px 0 80px;
  text-align: center;
}
.hero h1 { font-size: 3rem; margin-bottom: 1rem; font-weight: 700; }
.hero p { font-size: 1.2rem; opacity: .9; }

/* Хедер: имя + роли */
.hero-name{
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1.1;
  margin-bottom: .6rem;
  background: linear-gradient(90deg, #ffffff 0%, #e7e7ff 60%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(0,0,0,.07);
}
.hero-roles{
  display: flex; flex-wrap: wrap; gap: .5rem .6rem; justify-content: center; margin: 0 auto; max-width: 920px;
}
.hero-roles span{
  display: inline-block; padding: .5rem .75rem; border-radius: 999px; backdrop-filter: blur(4px);
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); color: #fff; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 16px rgba(0,0,0,.08);
  transform: translateY(6px); opacity: 0; animation: heroChipIn .7s ease forwards;
}
.hero-roles span:nth-child(1){ animation-delay: .05s; }
.hero-roles span:nth-child(2){ animation-delay: .15s; }
.hero-roles span:nth-child(3){ animation-delay: .25s; }
@keyframes heroChipIn { from{opacity:0; transform:translateY(8px) scale(.98);} to{opacity:1; transform:translateY(0) scale(1);} }

/* Кнопки в герое */
.hero-actions{ margin-top:1.25rem; display:flex; gap:.75rem; justify-content:center; flex-wrap:wrap; }
.btn{ display:inline-block; padding:.7rem 1rem; border-radius:10px; background:#fff; color:#4f46e5; text-decoration:none; font-weight:700; }
.btn-outline{ background:transparent; color:#fff; border:2px solid rgba(255,255,255,.85); }

/* Основные кнопки */
.btn{ display:inline-block; padding:.7rem 1.2rem; border-radius:12px; font-weight:700; text-decoration:none; cursor:pointer; transition: transform .15s ease, box-shadow .2s ease; }
.btn:active{ transform: scale(.97); }

/* Главная кнопка */
.btn-primary{
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color:#fff; border:none; box-shadow:0 4px 12px rgba(0,0,0,.12);
}
.btn-primary:hover{
  background: linear-gradient(135deg, #6d75f1 0%, #8452b8 100%);
  box-shadow:0 6px 16px rgba(0,0,0,.16);
}
.btn-primary:focus{ outline:2px solid #c7d2fe; outline-offset:2px; }

/* Секции */
.section { padding: 80px 0; }
.bg-light { background: #f8fafc; }
.section h2 { font-size: 2.5rem; margin-bottom: 2rem; text-align: center; color:#1f2937; }
.content { max-width:800px; margin:0 auto; font-size:1.1rem; line-height:1.8; }

/* Обо мне */
.about-grid { display:grid; grid-template-columns: 1.15fr 0.85fr; gap:32px; align-items:center; margin-top:24px; }
.about-text{ display:flex; flex-direction:column; justify-content:center; }
.about-photo{ margin:0; }
.about-photo img{
  width:100%; height:auto; display:block; border-radius:16px; box-shadow:0 10px 20px rgba(0,0,0,.08);
  background:#f3f4f6; object-fit:cover; aspect-ratio:4/5;
}
@media (hover:hover){
  .about-photo img{ transition:transform .35s ease, box-shadow .35s ease; }
  .about-photo img:hover{ transform:translateY(-2px); box-shadow:0 16px 28px rgba(0,0,0,.12); }
}
@media (max-width:900px){ .about-grid{ grid-template-columns:1fr; } .about-photo{ order:2; } }

/* Таймлайны */
.timeline{ max-width:900px; margin:0 auto; }
.timeline-item{
  position:relative; background:#fff; padding:2rem; margin:1rem 0; border-radius:12px;
  box-shadow:0 4px 6px rgba(0,0,0,.05); border-left:4px solid #4f46e5;
}
.timeline-item h3{ color:#4f46e5; margin-bottom:.5rem; }
.timeline-item p{ margin:0; }
.timeline-year{ position:absolute; top:12px; right:16px; font-weight:600; color:#334155; opacity:.6; }

/* Опыт: ролевые карточки */
.roles-grid{ display:grid; grid-template-columns:repeat(2, minmax(280px, 1fr)); gap:24px; margin-top:24px; }
.role-card{
  background:#fff; border:1px solid #eef2f7; border-radius:16px; padding:20px 22px;
  box-shadow:0 4px 10px rgba(0,0,0,.04); transition: transform .25s ease, box-shadow .25s ease;
}
.role-card:hover{ transform:translateY(-3px); box-shadow:0 8px 18px rgba(0,0,0,.08); }
.role-header{ display:flex; align-items:center; gap:14px; margin-bottom:12px; }
.role-icon{
  width:42px; height:42px; display:grid; place-items:center; background:#eef2ff; color:#4f46e5; border-radius:12px; font-size:22px;
}
.role-title{ margin:0; color:#1f2937; font-size:1.2rem; line-height:1.2; }
.role-subtitle{ margin:4px 0 0 0; color:#6b7280; font-size:.95rem; }
.role-list{ list-style:none; margin:10px 0 0 0; padding:0; display:grid; gap:10px; }
.role-list li{ position:relative; padding-left:28px; line-height:1.6; }
.role-list li::before{
  content:""; position:absolute; left:0; top:8px; width:16px; height:16px; border-radius:50%;
  background:#eef2ff; border:2px solid #4f46e5; box-shadow:0 1px 0 rgba(0,0,0,.04) inset;
}
@media (max-width:900px){ .roles-grid{ grid-template-columns:1fr; } }

/* === Личный проект: онлайн-группа === */
.project-header{ text-align:center; margin-bottom:18px; }
.project-kicker{
  display:inline-block; font-size:.85rem; letter-spacing:.02em; color:#4f46e5; background:#eef2ff; border:1px solid #e0e7ff;
  padding:4px 10px; border-radius:999px; margin-bottom:10px; font-weight:700;
}
.project-subtitle{ max-width:760px; margin:8px auto 0; color:#4b5563; font-size:1.05rem; }

/* Бейджи */
.pill-list{
  display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin:18px 0 8px; list-style:none; padding:0;
}
.pill{
  background:#fff; border:1px solid #e5e7eb; border-radius:999px; padding:8px 12px; box-shadow:0 2px 6px rgba(0,0,0,.04); color:#111827;
}
.pill strong{ color:#111827; }

/* Карточка секции (одна) */
.project-grid{ display:grid; grid-template-columns: 1fr; gap:20px; margin-top:22px; }
.project-card{
  background:#fff; border:1px solid #eef2f7; border-radius:16px; padding:22px 24px; box-shadow:0 4px 10px rgba(0,0,0,.05);
}
.project-card h3{ margin-bottom:12px; font-size:1.2rem; color:#1f2937; }

/* ===== Список внутри карточки (исправленная выравниловка) ===== */
.checklist{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:8px;
}
/* каждая строка — flex: иконка + текст */
.checklist li{
  display:flex;
  align-items:center;      /* выравниваем маркер и текст по центру строки */
  gap:10px;                /* расстояние между кружком и текстом */
  line-height:1.55;
  color:#374151;
  font-size:1rem;
}
/* зелёный кружок — inline, НЕ absolute */
.checklist li::before{
  content:"";
  width:14px;
  height:14px;
  border-radius:50%;
  background:#dcfce7;
  border:2px solid #10b981;
  box-shadow:0 1px 0 rgba(0,0,0,.04) inset;
  flex:0 0 14px;           /* фиксированная ширина, не схлопывается */
}

/* 2 колонки на широких экранах (если нужно) */
@media (min-width: 1000px){
  .checklist--balanced{ columns: 2; column-gap: 28px; }
  .checklist--balanced li{ break-inside: avoid; }
}

/* Доп. буллеты (если используешь .bullets) */
.bullets{ list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.bullets li{
  position:relative; padding-left:22px; line-height:1.6; color:#374151; font-size:1rem;
}
.bullets li::before{
  content:""; position:absolute; left:6px; top:12px; width:8px; height:8px; border-radius:50%; background:#c7d2fe;
}

/* CTA и примечание */
.project-cta{ display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
.project-note{ margin-top:10px; font-size:.92rem; color:#6b7280; }

/* Адаптив */
@media (max-width: 900px){ .project-grid{ grid-template-columns:1fr; } }

/* Контакты */
.contact-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(250px,1fr)); gap:2rem; margin-top:2rem; }
.contact-item{
  text-align:center; padding:2rem; background:#fff; border-radius:12px; box-shadow:0 4px 6px rgba(0,0,0,.05);
}
.contact-item h3{ color:#4f46e5; margin-bottom:1rem; }

/* Футер */
.footer{ background:#1f2937; color:#fff; text-align:center; padding:2rem 0; }

/* Адаптив */
@media (max-width:768px){
  .hero h1{ font-size:2rem; }
  .section h2{ font-size:2rem; }
}

/* Оф-кэнвас меню + анимации */
.offcanvas{ position:fixed; inset:0; z-index:1100; display:none; }
.offcanvas[aria-hidden="false"]{ display:block; }
.offcanvas-backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.45); opacity:0; transition:opacity .28s ease; }
.offcanvas[aria-hidden="false"] .offcanvas-backdrop{ opacity:1; }
.offcanvas-panel{
  position:absolute; right:0; top:0; height:100%; width:min(360px,90vw); background:#ffffff; box-shadow:-8px 0 28px rgba(0,0,0,.18);
  padding:18px 18px 24px; display:flex; flex-direction:column; transform:translateX(100%); opacity:0; transition: opacity .28s ease, transform .28s ease;
}
.offcanvas[aria-hidden="false"] .offcanvas-panel{ transform:translateX(0); opacity:1; }
.offcanvas-close{ align-self:flex-end; border:none; background:#f3f4f6; width:36px; height:36px; border-radius:10px; cursor:pointer; font-size:22px; }
.offcanvas-nav{ margin-top:8px; display:flex; flex-direction:column; gap:10px; }
.offcanvas-nav a{
  padding:.8rem 1rem; border-radius:10px; text-decoration:none; color:#1f2937; font-weight:600; border:1px solid #eef2f7; background:#fff;
  opacity:0; transform:translateX(8px); transition: opacity .22s ease, transform .22s ease;
}
.offcanvas.open .offcanvas-nav a{ opacity:1; transform:none; transition-delay: var(--stagger, 0ms); }
body.no-scroll{ overflow:hidden; }

/* === Лайтбокс === */
.modal[aria-hidden="false"]{ display:block; }
.modal{ position:fixed; inset:0; display:none; z-index:10000; }
.modal-backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.85); opacity:0; transition:opacity .28s ease; }
.modal[aria-hidden="false"] .modal-backdrop{ opacity:1; }

/* компактное превью */
.modal-content{
  position:relative; max-width:90vw; max-height:90vh; margin:auto; background:#fff; border-radius:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.4); display:flex; flex-direction:column; opacity:0; transform:scale(.96);
  transition: opacity .24s ease, transform .24s ease;
}
.modal[aria-hidden="false"] .modal-content{ opacity:1; transform:none; }

.viewer-area{ flex:1; display:flex; justify-content:center; align-items:center; padding:16px; overflow:hidden; }
#viewerImage, #viewerPdf{
  max-width:100%; max-height:80vh; width:auto; height:auto; object-fit:contain; background:transparent;
}
#viewerImage{ cursor: zoom-in; }
.viewer-caption{
  padding:10px 14px; font-size:.95rem; text-align:center; color:#374151; border-top:1px solid #e5e7eb;
}
.modal-close{
  position:absolute; top: clamp(8px, 2vw, 20px); right: clamp(8px, 2vw, 20px);
  width:40px; height:40px; border-radius:999px; border:none; background: rgba(255,255,255,.2);
  color:#fff; font-size:22px; cursor:pointer; backdrop-filter: blur(4px);
}
.modal-close:hover{ background: rgba(255,255,255,.3); }
@supports not (height: 100dvh){
  .modal-content{ height: 100vh; }
  .viewer-area{ height: calc(100vh - 2 * clamp(8px, 3vw, 24px) - 36px); }
}

/* Карусель дипломов */
.carousel{ position:relative; margin-top:1rem; }
.carousel-track{
  display:grid; grid-auto-flow:column; grid-auto-columns:minmax(260px,32%); gap:16px; overflow-x:auto; scroll-snap-type:x mandatory; padding:8px 48px;
}
.carousel-item{
  scroll-snap-align:start; background:#fff; border-radius:12px; box-shadow:0 4px 10px rgba(0,0,0,.06);
  overflow:hidden; border:1px solid #eef2f7; cursor:zoom-in;
}
.carousel-item .thumb{ width:100%; height:180px; object-fit:cover; display:block; }
.carousel-item .meta{ padding:12px 14px; font-size:.95rem; }
.carousel-item .badge{
  display:inline-block; font-size:.75rem; background:#eef2ff; color:#4f46e5; padding:2px 8px; border-radius:999px; margin-right:8px;
}
.carousel-btn{
  position:absolute; top:50%; transform:translateY(-50%); width:36px; height:36px; border-radius:999px; border:none; background:#ffffffcc;
  box-shadow:0 2px 8px rgba(0,0,0,.15); font-size:22px; line-height:36px; text-align:center; cursor:pointer; z-index:2;
}
.carousel-btn.prev{ left:6px; } .carousel-btn.next{ right:6px; }
.carousel-thumbs{ display:grid; grid-auto-flow:column; grid-auto-columns:72px; gap:10px; overflow-x:auto; margin-top:16px; padding-bottom:4px; }
.thumb-item{ border:2px solid transparent; border-radius:8px; overflow:hidden; cursor:pointer; }
.thumb-item[aria-current="true"]{ border-color:#4f46e5; }
.thumb-item img, .thumb-item .pdf-thumb{ width:100%; height:56px; object-fit:cover; display:block; }

/* курсор для превью-ссылок */
a[data-preview]{ cursor: zoom-in; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .offcanvas-backdrop, .offcanvas-panel, .offcanvas-nav a, .menu-toggle, .modal-backdrop, .modal-content{
    transition:none !important; animation:none !important;
  }
}

/* === Форма обратной связи === */
.contact-form{
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.contact-form label{
  display:flex; flex-direction:column; font-weight:600; color:#1f2937; font-size:1rem;
}
.contact-form input,
.contact-form textarea{
  margin-top: .4rem; padding:.75rem 1rem; border:1px solid #d1d5db; border-radius:10px;
  font-size:1rem; font-family:inherit; line-height:1.4; resize:vertical;
}
.contact-form input:focus,
.contact-form textarea:focus{
  outline:none; border-color:#4f46e5; box-shadow:0 0 0 3px rgba(79,70,229,.2);
}
/* кнопка формы */
.contact-form button[type="submit"]{
  padding:.9rem 1.2rem; width:100%; border-radius:12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color:#fff; font-size:1.1rem; font-weight:700; border:none; cursor:pointer;
  transition: background .25s ease, box-shadow .25s ease, transform .15s ease;
}
.contact-form button[type="submit"]:hover{
  background: linear-gradient(135deg, #6d75f1 0%, #8452b8 100%); box-shadow:0 4px 12px rgba(0,0,0,.15);
}
.contact-form button[type="submit"]:active{ transform: scale(.98); }

.project-footer{ margin-top:26px; text-align:center; }
.project-footer .btn-primary{ padding:.85rem 1.6rem; font-size:1.1rem; }
.project-footer .project-note{ margin-top:12px; font-size:.92rem; color:#6b7280; }
