/* ========== Local Fonts (TTF in /fonts) ========== */
@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/PlayfairDisplay-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ========== Reset ========== */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #0e1218;
  background: #ffffff;
  line-height: 1.6;
}
/* Media sizing: shrink on small screens, cap at 350px */
img,
video {
  display: block;
  height: auto;
  width: min(100%, 350px);   /* вместо max-width — гарантирует, что на мобилках не вылезает */
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid #5dd6ff; outline-offset: 2px; }

.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

/* ========== Skip link ========== */
.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus { position: fixed; left: 1rem; top: 1rem; z-index: 9999; width: auto; height: auto; background: #0b0f14; color: #fff; padding: .5rem .75rem; border-radius: .5rem; }

/* ========== Header ========== */
.site-header {
  position: fixed;           /* было: sticky */
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: #0b0f14; color: #eaf7ff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  padding-top: var(--safe-top); /* чтобы не конфликтовать с челкой iOS */
}

.header-inner {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1rem; min-height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; letter-spacing: .2px; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #ff8ec3, #ffd36e); color: #0b0f14; font-size: 16px; font-weight: 700; }
.brand-text { white-space: nowrap; }

.nav { justify-self: end; }
.nav-toggle {
  display: none; background: transparent; border: 0; padding: .25rem; cursor: pointer; color: inherit;
}
.nav-toggle-bar { display: block; width: 24px; height: 2px; background: currentColor; margin: 5px 0; border-radius: 2px; }
.nav-menu { display: flex; gap: 1rem; align-items: center; }
.nav-link { padding: .5rem .75rem; border-radius: 999px; transition: transform .2s ease, background-color .2s ease; }
.nav-link:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }
.nav-link.is-active { background: rgba(255,255,255,.16); }

/* ========== Main and Sections ========== */
.site-main { display: block; }
.section { position: relative; padding: clamp(72px, 8vw, 120px) 0; isolation: isolate; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.1rem; border-radius: 14px; border: 2px solid transparent;
  font-weight: 600; letter-spacing: .2px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
  will-change: transform;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: linear-gradient(135deg, #ff8ec3, #ffd36e); color: #0b0f14; }
.btn-primary:hover { box-shadow: 0 10px 20px rgba(255, 140, 180, .25); }
.btn-ghost { background: transparent; border-color: #ffd36e; color: #ffd36e; }
.btn-ghost:hover { background: rgba(255, 211, 110, .12); }

/* ========== Footer ========== */
.site-footer {
  background: #0b0f14; color: #cde9f7; padding: 32px 0; border-top: 1px solid rgba(255,255,255,.08);
}
.footer-inner {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 1rem;
}
.footer-brand { display: flex; flex-direction: column; gap: .25rem; }
.back-to-top {
  justify-self: end; padding: .5rem .75rem; border-radius: 999px;
  background: rgba(255,255,255,.08);
}
.back-to-top:hover { background: rgba(255,255,255,.16); }

/* ========== Utilities ========== */
.visually-hidden,
.sr-only { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; border: 0; }

/* ========== Responsive ========== */
@media (max-width: 960px) {
  .nav-toggle { display: inline-block; }
  .nav-menu {
    position: fixed; inset: 64px 0 auto 0; background: #0b0f14; padding: 16px;
    display: grid; gap: .5rem; transform: translateY(-10%); opacity: 0; pointer-events: none; transition: transform .2s ease, opacity .2s ease;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .nav-menu.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
}
@media (max-width: 560px) {
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .back-to-top { justify-self: center; }
}
/* --- Mobile-safe sizing & no side cut --- */
html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;        /* убираем горизонтальный скролл от наклонных карточек и т.д. */
}

/* safe-area для iOS с челкой */
:root{
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

/* контейнер на мобильных считем от окна, а не от процентов */
.container { width: min(1120px, 92vw); }

/* учитываем safe-area */
body { padding-left: var(--safe-left); padding-right: var(--safe-right); }
.site-header { padding-top: var(--safe-top); }
.site-footer { padding-bottom: calc(32px + var(--safe-bottom)); }

/* мобильное меню — ниже шапки + safe-area снизу */
@media (max-width: 960px) {
  .nav-menu { top: calc(64px + var(--safe-top)); padding-bottom: var(--safe-bottom); }
}
:root { --header-h: 64px; }
.container {
  box-sizing: border-box;       /* важно */
  width: min(1120px, 92vw);
  padding-left: 16px;
  padding-right: 16px;
}
/* Fluid container that never exceeds viewport */
.container{
  box-sizing: border-box;       /* паддинги входят в ширину */
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* respect notches on iOS */
@supports (padding: max(0px)) {
  .container{
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}
@media (max-width: 960px) { .section .container { overflow-x: hidden; } }
.container { box-sizing: border-box; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
/* ===== Footer ===== */
.site-footer {
  background: #0b0f14; color: #cfe9ff;
  border-top: 1px solid rgba(255,255,255,.08);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding-top: 14px; padding-bottom: 14px;
}
.footer-brand span { display:block; font-size: .95rem; color: #a7c6e6; }
.footer-nav { display: inline-flex; gap: 10px; align-items: center; justify-self: center; }
.foot-link { color: #eaf7ff; text-decoration: none; font-weight: 600; }
.foot-link:hover { text-decoration: underline; }
.sep { opacity: .5; }

.footer-meta { justify-self: end; color: #a7c6e6; }

.back-to-top {
  appearance: none; border: 1px solid rgba(255,255,255,.25);
  background: transparent; color: #eaf7ff; font-weight: 700;
  padding: .35rem .7rem; border-radius: 999px; cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.back-to-top:hover { transform: translateY(-1px); background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.35); }
.back-to-top:focus-visible { outline: 2px solid #ffd36e; outline-offset: 2px; }

@media (max-width: 960px){
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-meta { justify-self: center; }
}
/* Anchor offsets for fixed header */
.anchor-target {
  position: relative;
  display: block;
  height: 0;           /* не ломаем поток */
  margin: 0;
  padding: 0;
  scroll-margin-top: calc(var(--header-h) + 12px);
}
