/* ===== Fonts (local TTF) ===== */
@font-face {
  font-family: "InterVar";
  src: url("../fonts/Inter-Variable.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Prata";
  src: url("../fonts/Prata-Regular.ttf") format("truetype");
  font-display: swap;
}

/* ===== Reset / Base ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: InterVar, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #1e1b16;
  background: #0e0b09;
  overflow-x: clip; /* предотвращаем горизонтальный скролл */
}
img { display: block; max-width: 100%; height: auto; }

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

/* ===== Header (fixed) ===== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: 64px;
  z-index: 1000;
  background:
    linear-gradient(180deg, rgba(14,11,9,.85), rgba(14,11,9,.65)),
    radial-gradient(1200px 1200px at 10% -200px, #5b3b1f 0%, transparent 60%);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-row {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 700; letter-spacing: .5px;
  color: #1e1b16; background: #f1d3a0;
  box-shadow: 0 2px 10px rgba(241,211,160,.25);
}
.brand-name {
  color: #f6eee2; font-weight: 700; letter-spacing: .2px;
}

/* Nav */
.nav { display: flex; }
.nav-list {
  display: flex; gap: 1rem; list-style: none; padding: 0; margin: 0;
}
.nav-link {
  color: #f6eee2; text-decoration: none; padding: .5rem .75rem; border-radius: 10px;
  transition: transform .2s ease, background-color .2s ease;
}
.nav-link:hover { transform: translateY(-2px); background: rgba(241,211,160,.12); }
.nav-link.is-active { background: rgba(241,211,160,.16); }

/* Burger (mobile only) */
.burger {
  display: none;
  background: transparent; border: 0; padding: .4rem; border-radius: 8px; cursor: pointer;
}
.burger-line { display: block; width: 24px; height: 2px; background: #f6eee2; margin: 5px 0; border-radius: 2px; }

/* ===== Main base spacing ===== */
.site-main { padding-top: 64px; } /* отступ под фиксированный хедер */
.section { padding: clamp(56px, 7vw, 88px) 0; }

/* ===== Buttons ===== */
.btn {
  --btn-bg: #f1d3a0;
  --btn-fg: #1e1b16;
  display: inline-block; text-decoration: none;
  padding: .8rem 1.1rem; border-radius: 12px;
  font-weight: 700; letter-spacing: .2px;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
  box-shadow: 0 6px 18px rgba(241,211,160,.18);
  background: var(--btn-bg); color: var(--btn-fg);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(241,211,160,.26); }
.btn:active { transform: translateY(0); }
.btn-primary {}
.btn-ghost { --btn-bg: transparent; --btn-fg: #f6eee2; border: 1px solid rgba(246,238,226,.24); box-shadow: none; }
.btn-ghost:hover { background: rgba(246,238,226,.08); }

/* ===== Footer ===== */
.site-footer {
  position: relative;
  background:
    radial-gradient(900px 900px at 110% -200px, #5b3b1f 0%, transparent 70%),
    linear-gradient(180deg, #1a1410, #0e0b09);
  color: #e9e1d6;
  border-top: 1px solid rgba(255,255,255,.08);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem;
  padding: 36px 0 64px;
}
.foot-name { font-family: Prata, serif; font-size: 1.25rem; margin: 0 0 .25rem; }
.foot-tag { opacity: .8; margin: 0; }
.foot-links a, .foot-info a { color: #e9e1d6; text-decoration: none; }
.foot-links a:hover, .foot-info a:hover { text-decoration: underline; }
.backtotop {
  position: absolute; right: 16px; bottom: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(246,238,226,.3); background: rgba(246,238,226,.05);
  color: #f6eee2; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.backtotop.is-visible { opacity: 1; pointer-events: auto; transform: translateY(-4px); }

/* ===== Reveal animation ===== */
[data-reveal] { opacity: 0; transform: translateY(12px); }
.revealed { opacity: 1; transform: translateY(0); transition: opacity .6s ease, transform .6s ease; }

/* ===== Media queries (full responsive set) ===== */
@media (max-width: 1200px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 992px) {
  .nav-list { gap: .5rem; }
}
@media (max-width: 768px) {
  .burger { display: inline-block; }
  .nav { position: fixed; inset: 64px 0 auto 0; background: rgba(14,11,9,.98); transform: translateY(-100%); transition: transform .25s ease; }
  .nav.is-open { transform: translateY(0); }
  .nav-list { flex-direction: column; padding: 1rem; }
  .foot-grid { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
  .brand-mark { width: 32px; height: 32px; }
}
@media (max-width: 360px) {
  .brand-name { font-size: .95rem; }
}
/* Base */
html, body { height: 100%; overflow-x: hidden; } /* было clip — мог давать скролл в некоторых браузерах */
body {
  margin: 0;
  font-family: InterVar, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #1e1b16;
  background: #0e0b09;
}

/* Layout helpers */
.container{
  width: min(1200px, 100%);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 24px); /* добавили внутренние отступы, чтобы текст не упирался */
}
@media (max-width: 1024px){
  .burger{ display: inline-block; }

  /* скрываем меню под хедером, пока оно закрыто */
  .nav{
    position: fixed;
    inset: 64px 0 auto 0;
    z-index: 1001;
    background: rgba(14,11,9,.98);
    transform: translateY(-110%);
    transition: transform .25s ease;
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    will-change: transform;
  }
  .nav.is-open{ transform: translateY(0); }

  .nav-list{
    flex-direction: column;
    padding: .75rem 1rem 1.25rem;
    gap: .25rem;
  }
}
@media (max-width: 1024px){
  .burger{ display: inline-block; }

  /* Полностью прячем меню до открытия — ничего не «торчит» */
  .nav{
    position: fixed;
    inset: 64px 0 auto 0;
    z-index: 1001;
    background: rgba(14,11,9,.98);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;

    /* прячем надёжно */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    /* лёгкая анимация при открытии */
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .25s ease, visibility 0s linear .25s;
  }

  .nav.is-open{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
  }

  .nav-list{
    flex-direction: column;
    padding: .9rem 1rem 1.2rem;
    gap: .25rem;
  }
  .nav-link{
    display: block;
    padding: .75rem 1rem;
    border-radius: 10px;
  }
}
/* ==== Global Footer (TuneForge-like format) ==== */
.footer{
  position: relative;
  background:
    radial-gradient(900px 900px at 110% -200px, #5b3b1f 0%, transparent 70%),
    linear-gradient(180deg, #1a1410, #0e0b09);
  color: #e9e1d6;
  border-top: 1px solid rgba(255,255,255,.08);

  /* анимация появления */
  opacity: 0;
  transform: translateY(12px);
}
.footer.revealed{
  opacity: 1;
  transform: translateY(0);
  transition: opacity .6s ease, transform .6s ease;
}

.footer-container{
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  padding: 36px 0 64px;
}

.footer-brand{
  font-family: Prata, serif;
  font-size: 1.25rem;
  margin: 0 0 .25rem;
  color: #f6eee2;
}
.footer a{
  color: #e9e1d6;
  text-decoration: none;
  transition: color .2s ease, opacity .2s ease;
}
.footer a:hover{ color: #f1d3a0; opacity: .95; }

.footer-column p{ margin: 0 0 .35rem; }
.footer-links{
  display: grid;
  gap: .35rem;
  align-content: start;
}

/* плавающая кнопка наверх переиспользует прежние стили */
.footer .backtotop{
  position: absolute; right: 16px; bottom: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(246,238,226,.3); background: rgba(246,238,226,.05);
  color: #f6eee2; cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.footer .backtotop.is-visible{ opacity: 1; pointer-events: auto; transform: translateY(-4px); }

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