/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #0a0b0c;
  color: #e9eef2;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ===== Local fonts (TTF) ===== */
@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Regular.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Prata";
  src: url("../fonts/Prata-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ===== Design tokens ===== */
:root{
  --c-bg:#0a0b0c;
  --c-surface:#111316;
  --c-line:#1b1e23;
  --c-text:#e9eef2;
  --c-muted:#a7b0ba;
  --c-accent:#33aaff;
  --c-accent-2:#7cc7ff;
  --shadow-1: 0 12px 32px rgba(0,0,0,.35);
  --radius-xl: 18px;
  --radius-full: 999px;

  /* Ограничение ширины изображений (≤350px) по требованию */
  --img-max-w: 350px;
}

/* ===== Containers ===== */
.container{
  width: min(1100px, 92vw);
  margin-inline: auto;
}

/* ===== Header (fixed stripe) ===== */
.site-header{
  position: fixed;
  inset: 0 0 auto 0;
  height: 64px;
  display: flex;
  align-items: center;
  z-index: 20;
  background:
    radial-gradient(1200px 1200px at 10% -200px, rgba(122,162,255,.08), transparent 60%),
    linear-gradient(180deg, rgba(10,11,12,.75), rgba(10,11,12,.35) 40%, rgba(10,11,12,0));
  backdrop-filter: saturate(120%) blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between;
}
.brand{
  font-family: "Prata", serif;
  font-size: 1.25rem;
  color: var(--c-text);
  text-decoration: none;
  letter-spacing: .5px;
}
.nav ul{
  display:flex; gap: 1rem; list-style:none; margin:0; padding:0;
}
.nav a{
  color: var(--c-muted);
  text-decoration:none;
  padding: .4rem .8rem;
  border-radius: 10px;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.nav a:hover{ color: var(--c-text); background: #11161c; transform: translateY(-1px); }
.nav .is-active{ color: var(--c-text); background: #0f1318; }

/* ===== Main spacing (offset for fixed header) ===== */
.page-main{ padding-top: 64px; }

/* ===== Utilities ===== */
.cap-img{
  width: 100%;
  max-width: var(--img-max-w); /* ≤350px */
  display:block;
  border-radius: 14px;
  box-shadow: var(--shadow-1);
}

/* Focus visibly */
a:focus-visible, button:focus-visible { outline: 2px dashed var(--c-accent); outline-offset: 3px; }

/* ===== Media queries ===== */
@media (max-width: 992px){
  .nav ul{ gap: .6rem; }
}
@media (max-width: 640px){
  .site-header { height: 56px; }
  .page-main{ padding-top: 56px; }
  .brand{ font-size: 1.05rem; }
}
@media (max-width: 360px){
  .container{ width: 94vw; }
}
/* --- Overflow guard (горизонталь) --- */
html, body { max-width: 100%; overflow-x: clip; }
@supports not (overflow-x: clip) {
  html, body { overflow-x: hidden; }
}

/* Медицинский минимум против «выпираний» контента */
* { min-width: 0; }
img, svg, canvas, video { max-width: 100%; height: auto; display: block; }

/* На всякий случай: основные контейнеры не дают горизонтальный скролл внутри */
.page-main, .container, section { overflow-x: clip; }
/* ===== Footer ===== */
.footer{
  margin-top: 40px;
  background:
    radial-gradient(1200px 800px at 10% -20%, rgba(124,199,255,.06), transparent 60%),
    linear-gradient(180deg, #0c0f12, #0a0b0c);
  border-top: 1px solid var(--c-line);
  position: relative;
  overflow-x: clip;
}
.footer-container{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.25rem;
  padding: 28px 0;
}
.footer-column a{
  color: var(--c-muted);
  text-decoration: none;
  transition: color .2s ease, text-shadow .2s ease;
}
.footer-column a:hover{
  color: var(--c-text);
  text-shadow: 0 0 12px rgba(120,190,255,.2);
}
.footer-brand{
  font-family: "Prata", serif;
  font-size: 1.2rem;
  margin: 0 0 .35rem;
  color: #eaf7ff;
}

/* появление при скролле */
.footer.animate-on-scroll .footer-container{
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
.footer.is-in .footer-container{
  opacity: 1;
  transform: translateY(0);
}

/* Back to Top button */
.backtotop{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--c-line);
  background: linear-gradient(180deg, #33aaff, #0066ff);
  color: #fff;
  box-shadow: 0 14px 36px rgba(0,102,255,.35);
  cursor: pointer;
  display: grid; place-items: center;
  opacity: 0; transform: translateY(8px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, box-shadow .25s ease;
}
.backtotop:hover{ box-shadow: 0 18px 44px rgba(0,102,255,.5); }
.backtotop.is-visible{
  opacity: 1; transform: translateY(0);
  pointer-events: auto;
}

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