:root{
  --bg: #0a0505;
  --panel: #171012;
  --panel-border: #2a1c1e;
  --card: #15100f;
  --card-border: #2a2020;
  --text: #f2f0ef;
  --text-dim: rgba(242,240,239,0.45);
  --red: #e8352f;
  --green: #3ee08a;
  --radius-lg: 22px;
  --radius-md: 14px;
  font-family: 'Unbounded', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*{ box-sizing: border-box; }

html, body{
  margin:0; padding:0;
  background:
    radial-gradient(ellipse 900px 500px at 50% 100%, rgba(120,10,10,0.35), transparent 70%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

button{ font-family: inherit; cursor:pointer; border:none; background:none; color:inherit; }

.hidden{ display:none !important; }

/* ---------- Анимации ---------- */
@keyframes fadeInUp{
  from{ opacity:0; transform: translateY(16px); }
  to{ opacity:1; transform: translateY(0); }
}
@keyframes fadeIn{
  from{ opacity:0; }
  to{ opacity:1; }
}
@keyframes popIn{
  from{ opacity:0; transform: scale(0.94) translateY(10px); }
  to{ opacity:1; transform: scale(1) translateY(0); }
}
@keyframes shimmer{
  0%{ background-position: -200% 0; }
  100%{ background-position: 200% 0; }
}
.skeleton{
  background: linear-gradient(90deg, #171012 25%, #221718 37%, #171012 63%);
  background-size: 400% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.page{
  display:flex;
  gap: 24px;
  padding: 24px;
  max-width: 1760px;
  margin: 0 auto;
}
@media (max-width: 860px){
  .page{ flex-direction: column; padding: 14px; gap: 16px; }
}

/* ---------- Sidebar ---------- */
.sidebar{
  width: 320px;
  flex-shrink: 0;
  display:flex;
  flex-direction: column;
  gap: 16px;
}
@media (max-width: 860px){
  .sidebar{ width: 100%; }
}

.sidebar-top{
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display:flex;
  align-items:center;
  justify-content: space-between;
}

.icon-btn{ font-size: 18px; color: var(--text); }

.tabs-inline{ display:flex; gap:18px; font-weight:600; }
.tab-link{ color: rgba(242,240,239,0.4); font-size:15px; }
.tab-link.active{ color: var(--red); text-decoration: underline; }

.sidebar-panel{
  display:flex; flex-direction:column; gap:16px;
}

.avatar-block{
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  animation: fadeInUp .5s ease both;
}
.lang-switch{ position:absolute; top:20px; right:22px; text-align:right; font-weight:700; font-size:14px; line-height:1.5; }
.lang{ display:block; color: rgba(242,240,239,0.35); cursor:pointer; }
.lang.active{ color: var(--red); text-decoration: underline; }

.avatar-ph{
  width: 96px; height: 96px;
  border-radius: 14px;
  background: #d9d9d9;
}

.about-text{
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin:0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  animation: fadeInUp .5s ease .06s both;
}

.soft-card{
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align:center;
  font-weight: 600;
  color: rgba(242,240,239,0.8);
  animation: fadeInUp .5s ease .12s both;
}
.soft-card + .soft-card{ animation-delay: .18s; }
.clients-card{ display:flex; flex-direction:column; gap:10px; padding: 18px 0; overflow:hidden; }
.clients-caption{ font-size:12px; color: var(--text-dim); text-align:center; padding: 0 22px; }
.clients-caption:empty{ display:none; }
.clients-marquee{ overflow:hidden; width:100%; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.clients-track{
  display:flex; align-items:center; gap: 30px; width:max-content;
  animation: clients-scroll 22s linear infinite;
}
.clients-marquee:hover .clients-track{ animation-play-state: paused; }
@keyframes clients-scroll{ from{ transform: translateX(0); } to{ transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce){ .clients-track{ animation: none; } }
.client-logo{ height: 22px; max-width: 90px; object-fit: contain; opacity: 0.8; filter: grayscale(1) brightness(1.8); flex-shrink:0; }

.programs-card{ text-align:left; }
.programs-title{ text-align:center; font-weight:700; margin-bottom: 4px; }
.programs-icons{ display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-top: 12px; }
.program-icon{
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(242,240,239,0.06);
  display:flex; align-items:center; justify-content:center;
  color: var(--text);
  transition: transform .15s ease, background .15s ease;
}
.program-icon:hover{ transform: translateY(-2px) scale(1.06); background: rgba(242,240,239,0.12); }
.program-icon img{ width: 20px; height: 20px; object-fit:contain; }

.contact-row{
  width:100%;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display:flex; align-items:center; gap: 14px;
  text-align: left;
  transition: border-color .15s ease, transform .15s ease;
}
.contact-row:hover{ border-color: var(--red); transform: translateY(-2px); }
.contact-row .social-icon{ width: 22px; height: 22px; flex-shrink: 0; }
.contact-text{ display:flex; flex-direction:column; gap: 2px; min-width:0; }
.contact-username{ font-size: 13px; font-weight: 700; color: var(--text); }
.contact-username:empty::before{ content: '—'; color: var(--text-dim); font-weight: 400; }
.contact-desc{ font-size: 11px; color: var(--text-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.social-disabled{ opacity: 0.35; pointer-events: none; }


/* ---------- Content ---------- */
.content{ flex:1; min-width:0; display:flex; flex-direction:column; }

.content-header{
  display:flex; align-items:center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  margin-bottom: 26px;
}
.page-title{ margin:0; font-size: 30px; font-weight: 800; }
@media (max-width: 480px){ .page-title{ font-size: 24px; } }

.cat-tabs{
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 6px;
  display:flex; gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar{ display:none; }
.cat-tab{
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: rgba(242,240,239,0.45);
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.cat-tab.active{ background: #fff; color: #111; }

.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px){ .grid{ grid-template-columns: repeat(2,1fr);} }
@media (max-width: 600px){ .grid{ grid-template-columns: 1fr; } }

.work-card{
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow:hidden;
  cursor:pointer;
  transition: transform .2s ease, border-color .2s ease;
  animation: fadeInUp .5s ease both;
  opacity: 0;
}
.work-card:hover{ transform: translateY(-4px); border-color: var(--red); }

.skeleton-card{
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow:hidden;
}

.work-thumb{
  width:100%; aspect-ratio: 1/1;
  background: #d9d9d9;
  object-fit: cover;
  display:block;
  transition: opacity .25s ease;
}
.work-meta{ padding: 14px 16px; display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.work-title{ font-weight: 700; font-size: 15px; margin:0 0 4px; }
.work-desc{ font-size: 12px; color: var(--text-dim); margin:0; }
.work-date{ font-size: 12px; color: var(--green); text-align:right; white-space:nowrap; }

.site-footer{
  margin-top: 40px;
  display:flex; align-items:center; justify-content:center; gap: 16px;
  padding: 30px 0 10px;
}
.logo{ color: var(--red); font-weight: 900; font-size: 28px; letter-spacing: 1px; }
.footer-social{ display:flex; align-items:center; }
.footer-social .social-icon{ width: 20px; height: 20px; }

/* ---------- Modal ---------- */
.modal-overlay{
  position: fixed; inset:0;
  background: rgba(0,0,0,0.75);
  display:flex; align-items:center; justify-content:center;
  z-index: 100;
  padding: 24px;
  animation: fadeIn .25s ease both;
}
.modal{
  background: #111;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  width: min(1200px, 100%);
  max-height: 90vh;
  overflow-y:auto;
  padding: 24px;
  position: relative;
  animation: popIn .3s cubic-bezier(.2,.7,.3,1) both;
}
.modal-close{
  position:absolute; top:18px; right:18px;
  width:40px; height:40px; border-radius:50%;
  background: var(--red); color:#fff; font-size:22px;
  display:flex; align-items:center; justify-content:center;
  z-index:2;
}
.modal-body{ display:flex; gap: 28px; flex-wrap: wrap; }

.viewer-col{ flex: 1 1 480px; display:flex; flex-direction:column; gap: 12px; min-width: 0; }

@media (max-width: 700px){
  .modal-overlay{ padding: 0; align-items: flex-end; }
  .modal{
    width: 100%; max-height: 95vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 16px;
  }
  .modal-close{ top: 12px; right: 12px; width: 34px; height: 34px; font-size: 18px; }
  .viewer-col{ flex-basis: 100%; }
  .modal-info{ flex-basis: 100% !important; padding-right: 0 !important; }
  .modal-info h2{ font-size: 24px !important; }
}

.viewer{ position:relative; display:flex; align-items:center; }
.viewer-image-wrap{
  width:100%; aspect-ratio: 4/3; background:#d9d9d9; border-radius: var(--radius-lg); overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  position: relative;
  cursor: zoom-in;
}
.viewer-image-wrap img{ width:100%; height:100%; object-fit: cover; display:none; transition: opacity .2s ease; }
.viewer-counter{
  position: absolute; right: 14px; bottom: 14px;
  background: rgba(0,0,0,0.55); color:#fff; font-size: 13px; font-weight:600;
  padding: 4px 11px; border-radius: 999px;
}
.viewer-arrow{
  position:absolute; top:50%; transform: translateY(-50%);
  width:38px; height:38px; border-radius:50%;
  background: rgba(0,0,0,0.5); color:#fff; font-size:16px;
  display:flex; align-items:center; justify-content:center;
  z-index:2;
}
.viewer-arrow.left{ left: 14px; }
.viewer-arrow.right{ right: 14px; }

/* Thumbnail strip — only under the main image, own scroll + custom scrollbar */
.thumbs-wrap{ display:flex; flex-direction:column; gap: 8px; }
.thumbs{
  display:flex; gap: 10px;
  overflow-x:auto;
  scrollbar-width: none;
}
.thumbs::-webkit-scrollbar{ display:none; }
.thumb{
  width: 96px; height: 68px; flex-shrink:0;
  background:#d9d9d9; border-radius: 10px; object-fit: cover;
  border: 2px solid transparent; cursor:pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.thumb:hover{ transform: translateY(-2px); }
.thumb.active{ border-color: var(--red); }

.thumbs-scrollbar{
  height:4px; background: #2a2020; border-radius: 3px; position: relative; cursor: pointer;
}
.thumbs-scrollbar-thumb{
  position:absolute; left:0; top:0; height:100%;
  background: var(--red); border-radius: 3px;
  min-width: 24px;
}

.modal-info{ flex: 1 1 340px; padding-right: 40px; }
.modal-info h2{ font-size: 34px; margin: 4px 0 16px; }
.modal-desc{ color: var(--text-dim); font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.modal-programs{ font-size: 14px; margin-top: 18px; color: var(--text-dim); }
.modal-programs b{ color: var(--text); }

.modal-footer{ margin-top: 20px; display:flex; justify-content:flex-end; }
.modal-date{ font-size: 12px; color: var(--green); }

/* ---------- Lightbox (приближённый просмотр) ---------- */
.lightbox-overlay{
  position: fixed; inset:0;
  background: rgba(8,6,6,0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 200;
  display:flex; align-items:center; justify-content:center;
  animation: fadeIn .25s ease both;
}
.lightbox-image{
  max-width: 92vw; max-height: 82vh;
  object-fit: contain;
  animation: popIn .3s cubic-bezier(.2,.7,.3,1) both;
  transition: opacity .2s ease;
}
.lightbox-close{
  position: fixed; top: 20px; right: 24px;
  width:40px; height:40px; border-radius:50%;
  background: rgba(255,255,255,0.12); color:#fff; font-size:22px;
  display:flex; align-items:center; justify-content:center;
}
.lightbox-nav{
  position: fixed; left:50%; bottom: 36px; transform: translateX(-50%);
  display:flex; align-items:center; gap: 18px;
  background: rgba(20,20,20,0.85);
  border-radius: 999px;
  padding: 10px 20px;
}
.lightbox-arrow{
  width:34px; height:34px; border-radius:50%;
  background: rgba(255,255,255,0.12); color:#fff; font-size:15px;
  display:flex; align-items:center; justify-content:center;
}
.lightbox-counter{ color:#fff; font-weight:700; font-size:14px; min-width: 40px; text-align:center; }
