/* =========== Локальные шрифты (поместите файлы в /assets/fonts/) =========== */
@font-face {
  font-family: "PlayfairDisplay";
  src: url("../fonts/PlayfairDisplay-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ====================== CSS Reset (мягкий) ====================== */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }

/* ====================== Переменные темы ====================== */
:root{
  --bg: #0b1220;              /* глубокий морской */
  --bg-2:#0f1a31;             /* темнее для градиентов */
  --ink: #e8f0ff;             /* светлый текст */
  --ink-dim:#c0c9df;          /* приглушённый текст */
  --accent:#2e7de9;           /* сапфировый */
  --accent-2:#67a7ff;         /* светлый сапфир */
  --gold:#d2b48c;             /* мягкое золото */
  --muted:#1a2440;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
  --radius: 18px;
  --wrap: 1200px;
}

/* ====================== База ====================== */
body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(103,167,255,.15), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(46,125,233,.12), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  line-height: 1.6;
}

.wrap{ width: min(100%, var(--wrap)); margin-inline: auto; padding: 16px; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ====================== Доступность ====================== */
.visually-hidden{
  position: absolute !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  width: 1px !important; height: 1px !important;
  margin: -1px !important; overflow: hidden !important; white-space: nowrap !important;
}

/* ====================== Хэдер (фикс.) ====================== */
.site-header{
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  background: rgba(11,18,32,.7);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(103,167,255,.18);
  transition: box-shadow .3s ease, background-color .3s ease;
}
.site-header.scrolled{ box-shadow: var(--shadow); background: rgba(11,18,32,.9); }

.site-header .wrap{ display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand{
  font-family: PlayfairDisplay, serif;
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: .5px;
  color: #fff;
}
.main-nav ul{ display: flex; gap: clamp(10px, 2vw, 24px); }
.nav-link{
  padding: 10px 14px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(46,125,233,.12), rgba(46,125,233,.05));
  border: 1px solid rgba(103,167,255,.24);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.nav-link:hover{ transform: translateY(-2px); box-shadow: 0 8px 22px rgba(46,125,233,.25); background: rgba(46,125,233,.16); }

/* ====================== Main / Footer ====================== */
.site-main{ padding-top: 76px; }
.site-footer{
  border-top: 1px solid rgba(103,167,255,.18);
  margin-top: 40px;
  background: rgba(11,18,32,.6);
}
.site-footer .wrap{ text-align: center; color: var(--ink-dim); font-size: 14px; }

/* ====================== Картины/фигуры ====================== */
figure{ margin: 0; }
figcaption{ color: var(--ink-dim); font-size: 14px; margin-top: 10px; }

/* ====================== Ограничение изображений ====================== */
img{
  display: block;
  width: 100%;
  max-width: 350px; /* требование: не больше 350px */
  height: auto;
  border-radius: calc(var(--radius) - 6px);
}

/* ====================== Анимации появления ====================== */
.reveal{ opacity: 0; transform: translateY(16px) scale(.98); transition: opacity .7s ease, transform .7s ease; }
.reveal.reveal-visible{ opacity: 1; transform: none; }

/* ====================== Плавающие микродвижения ====================== */
@keyframes floatY { from { transform: translateY(0); } 50% { transform: translateY(-6px); } to { transform: translateY(0); } }
.float-slow { animation: floatY 8s ease-in-out infinite; }
.float-mid  { animation: floatY 6.5s ease-in-out infinite; }
.float-fast { animation: floatY 5.5s ease-in-out infinite; }

/* ====================== Hover-блик «glint» ====================== */
.glint{
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(210,180,140,.08), rgba(210,180,140,0));
  border: 1px solid rgba(210,180,140,.25);
}
.glint::after{
  content: ""; position: absolute; inset: -40% -60% auto auto; width: 160%; height: 160%;
  background: conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.0), rgba(255,255,255,.28), rgba(255,255,255,0));
  transform: translateX(-120%) rotate(15deg);
  transition: transform .8s ease;
  pointer-events: none;
}
.glint:hover::after{ transform: translateX(0) rotate(15deg); }

/* ====================== Медиа-запросы (адаптив сразу для всех) ====================== */
@media (max-width: 1200px){
  :root{ --wrap: 1100px; }
}
@media (max-width: 1024px){
  :root{ --wrap: 920px; }
}
@media (max-width: 880px){
  .main-nav ul{ gap: 10px; }
  .nav-link{ padding: 8px 12px; }
}
@media (max-width: 720px){
  :root{ --wrap: 640px; }
  .site-main{ padding-top: 68px; }
}
@media (max-width: 520px){
  :root{ --wrap: 480px; }
  .brand{ font-size: 20px; }
  .nav-link{ padding: 6px 10px; font-size: 14px; }
}
@media (max-width: 390px){
  :root{ --wrap: 360px; }
}
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}
/* ====== Переменная высоты хедера (для мобильной панели) ====== */
:root { --header-h: 76px; }
@media (max-width: 720px){ :root{ --header-h: 68px; } }

/* ====== Кнопка-бургер (показываем на мобильных) ====== */
.burger{
  display: none; /* по умолчанию скрыт на десктопе */
  width: 44px; height: 44px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(46,125,233,.12), rgba(46,125,233,.05));
  border: 1px solid rgba(103,167,255,.24);
  box-shadow: var(--shadow);
  align-items: center; justify-content: center;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.burger:hover{ transform: translateY(-1px); box-shadow: 0 10px 28px rgba(46,125,233,.25); }

/* Иконка "три полоски" */
.burger-lines,
.burger-lines::before,
.burger-lines::after{
  content: ""; display: block; position: relative;
  width: 20px; height: 2px; background: #fff; border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease, background .25s ease;
}
.burger-lines::before{ position: absolute; top: -6px; left: 0; }
.burger-lines::after { position: absolute; top:  6px; left: 0; }

/* Состояние "крестик" */
.burger[aria-expanded="true"] .burger-lines{ background: transparent; }
.burger[aria-expanded="true"] .burger-lines::before{
  transform: translateY(6px) rotate(45deg);
}
.burger[aria-expanded="true"] .burger-lines::after{
  transform: translateY(-6px) rotate(-45deg);
}

/* ====== Мобильная панель навигации ====== */
@media (max-width: 880px){
  .burger{ display: inline-flex; }

  /* переносим меню в фиксированную панель */
  .main-nav{
    position: fixed;
    top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: rgba(11,18,32,.98);
    backdrop-filter: blur(6px);
    transform: translateY(-8%);
    opacity: 0; pointer-events: none;
    transition: transform .35s ease, opacity .35s ease;
  }
  .main-nav.open{
    transform: translateY(0);
    opacity: 1; pointer-events: auto;
  }

  .main-nav ul{
    display: flex; flex-direction: column;
    gap: 10px; padding: 18px 16px 40px;
  }
  .nav-link{
    display: block;
    font-size: 18px;
    border-radius: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(46,125,233,.14), rgba(46,125,233,.06));
    border: 1px solid rgba(103,167,255,.24);
  }
}

/* ====== Затенение фона под меню ====== */
.nav-dim{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 900; /* ниже хедера (1000), выше контента */
}
.nav-dim[hidden]{ display: none; }

/* когда меню открыто — блокируем прокрутку */
html.no-scroll, body.no-scroll{ overflow: hidden; }
/* ===== Footer (общий для всех страниц) ===== */
.container { width: min(100%, var(--wrap)); margin-inline: auto; padding: 16px; }

.footer{
  border-top: 1px solid rgba(103,167,255,.18);
  background: rgba(11,18,32,.70);
  backdrop-filter: blur(8px);
}

.footer-container{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(12px, 2vw, 20px);
  align-items: start;
}

.footer-column p,
.footer-column a{ font-size: 14px; color: var(--ink-dim); }

.footer a:hover{ color: #fff; text-decoration: underline; }

.footer-brand{
  font-family: PlayfairDisplay, serif;
  font-size: clamp(18px, 2vw, 22px);
  color: #fff;
  margin-bottom: 6px;
}

.footer-links{
  display: grid;
  gap: 8px;
  justify-items: end;
}

@media (max-width: 640px){
  .footer-container{
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .footer-links{ justify-items: start; }
}

/* Делаем animate-on-scroll совместимым с нашей системой reveal */
.animate-on-scroll,
.reveal{
  opacity: 0;
  transform: translateY(16px) scale(.98);
  transition: opacity .7s ease, transform .7s ease;
}
.animate-on-scroll.reveal-visible,
.reveal.reveal-visible{
  opacity: 1;
  transform: none;
}
