/* ===== Fonts (local TTF) ===== */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ===== Base / Reset ===== */
* { box-sizing: border-box; }
html:focus-within { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #222;
  background: #fffef7;
  line-height: 1.6;
}
img, picture { display: block; max-width: 100%; height: auto; }
img { max-width: 350px; } /* Ограничение ширины изображений согласно ТЗ */
a { color: #1b73e8; text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
:focus-visible { outline: 3px solid #ffb300; outline-offset: 2px; }

/* Containers */
.container {
  width: min(1160px, 92%);
  margin: 0 auto;
}


.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}
.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: #1f1f1f;
}
.site-nav { margin-left: auto; }
.nav-list { display: flex; gap: 16px; list-style: none; padding: 0; margin: 0; }
.nav-link {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 10px;
}
.nav-link:hover,
.nav-link:focus { background: #fff3c8; }
.nav-link.is-active { background: #ffecb3; }

/* Burger */
.burger {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;
  border: 0; background: transparent; padding: 0;
}
.burger-box { display: inline-flex; flex-direction: column; gap: 5px; }
.burger-line { width: 26px; height: 3px; background: #333; border-radius: 2px; }

/* Mobile nav */
@media (max-width: 768px) {
  .burger { display: inline-flex; align-items: center; justify-content: center; }
  .site-nav {
    position: fixed;
    inset: 0 0 auto 0;
    top: 56px;
    background: #fffef7;
    transform: translateY(-8px);
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
    padding: 16px 0;
    border-bottom: 1px solid #eee3b8;
  }
  .site-nav.is-open {
    opacity: 1; pointer-events: auto; transform: none;
  }
  .nav-list { flex-direction: column; padding: 12px 16px; }
  body.nav-lock { overflow: hidden; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border-radius: 999px; font-weight: 600;
  padding: 12px 22px; border: 2px solid transparent; cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.btn-primary { background: #ffb300; color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: #ffca28; transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: #ffd54f; color: #333; }
.btn-ghost:hover, .btn-ghost:focus { background: #fff3c8; }

/* ===== Reveal Animation (IO) ===== */
.reveal { opacity: 0; transform: translateY(20px); }
.is-visible { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s ease; }

/* ===== Footer (унифицированный) ===== */
.footer {
  background: #fff7d6;
  border-top: 1px solid #eee3b8;
  margin-top: 60px;
}
.footer-container {
  display: grid;
  grid-template-columns: 1.2fr .8fr auto;
  gap: 20px;
  padding: 28px 0;
}
.footer-brand { font-weight: 700; margin: 0 0 8px; }
.footer-column a { color: #1b73e8; }
.btn-top {
  border: 2px solid #ffca28; background: #fffaf0; color: #333;
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
}
.btn-top:hover, .btn-top:focus { background: #fff3c8; }

@media (max-width: 768px) {
  .footer-container { grid-template-columns: 1fr; text-align: center; }
}

/* ===== Motion preferences ===== */
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  .is-visible { transition: none !important; }
}
/* ===== Header (fixed) ===== */
.site-header {
  position: fixed;           /* было: sticky */
  inset: 0 0 auto 0;         /* top:0; left/right:0 */
  z-index: 1000;
  background: #ffffffcc;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #eee3b8;
  transform: translateZ(0);  /* избегаем артефактов на iOS */
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}
.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: #1f1f1f;
}

/* Тень появляется после прокрутки (класс навешивает JS) */
.site-header.is-scrolled {
  box-shadow: 0 8px 22px rgba(0,0,0,.06);
}

/* Отступ сверху для контента: используем CSS-переменную, которую зададим из JS */
#main-content {
  padding-top: var(--header-h, 64px);
}
/* ===== How-to — Section 6: OFFLINE & BATTERY TIPS ===== */
.ht-offline {
  background: #fff8e6;
  padding: clamp(48px, 6vw, 96px) 0;
  border-top: 1px solid #f0e2ac;
}
.offline-head { text-align: center; margin-bottom: clamp(22px, 3vw, 36px); }
.offline-head h2 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 1.1rem + 1.5vw, 2.2rem);
  color: #1f1f1f;
}
.offline-sub { margin: 0 auto; max-width: 62ch; color: #474747; }

.off-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: clamp(16px, 3vw, 28px);
  align-items: stretch;
}
@media (max-width: 1024px) { .off-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px)  { .off-grid { grid-template-columns: 1fr; } }

.off-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  background: #fff;
  border: 1px solid #f1e5b2;
  border-radius: 18px;
  padding: clamp(14px, 2.2vw, 20px);
  box-shadow: 0 10px 28px rgba(255,179,0,.10);
  position: relative;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.off-card:hover,
.off-card:focus-within { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(255,179,0,.18); }

.off-media {
  width: 84px; height: 84px; border-radius: 16px; overflow: hidden;
  border: 2px solid #ffecb3; flex-shrink: 0;
}
.off-media img { width: 100%; height: 100%; object-fit: cover; } /* ⛔ no image animations */

.off-title {
  margin: 0 0 6px; font-size: 1.06rem; color: #1f1f1f;
  position: relative; display: inline-block; padding-bottom: 4px;
}
.off-title::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, #ffe08a, #ffcb5e);
  transform-origin: left center; transform: scaleX(0);
  animation: tip-underline .6s ease forwards .15s;
}
.off-body p { margin: 0 0 8px; color: #333; }
.off-points { margin: 0; padding-left: 18px; color: #333; }
.off-points li { margin: 6px 0; }

/* Reuse switches from gestures */
.off-form { display: grid; gap: 8px; margin-top: 6px; }

/* CTA */
.off-cta {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  margin-top: clamp(16px, 3vw, 28px);
}

/* ===== Container-only animations ===== */
@keyframes panel-glow-kf {
  0%,100% { border-color: #f1e5b2; }
  50%     { border-color: #ffd980; }
}
.panel-glow { animation: panel-glow-kf 3s ease-in-out infinite; }

/* лёгкая «искрящаяся» линия по карточке при hover */
@keyframes spark-line-kf {
  0%   { transform: translateX(-120%); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}
.off-card::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(255,224,138,.0) 30%, rgba(255,224,138,.35) 50%, rgba(255,224,138,.0) 70%);
  transform: translateX(-120%); opacity: 0; pointer-events: none;
}
.off-card:hover::after,
.off-card:focus-within::after { animation: spark-line-kf .9s ease; }

/* underline animation for titles */
@keyframes tip-underline { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  .panel-glow,
  .off-card::after,
  .off-title::after { animation: none !important; }
}
/* ===== Global footer (unique) ===== */
.site-footer{
  position: relative;
  background: linear-gradient(180deg,#fff8e6,#fffdf3);
  border-top: 1px solid #f0e2ac;
  padding: clamp(28px,4vw,44px) 0;
  overflow: hidden; /* чтобы декоративный свечащийся штрих не вылезал */
}
.footer-inner{
  display: grid;
  grid-template-columns: 1.2fr .8fr auto;
  gap: clamp(16px,3vw,28px);
  align-items: start;
}
@media (max-width: 880px){
  .footer-inner{ grid-template-columns: 1fr 1fr; }
  .foot-cta{ justify-self: start; }
}
@media (max-width: 560px){
  .footer-inner{ grid-template-columns: 1fr; }
}

.foot-logo{
  font-weight: 800;
  font-size: clamp(1.2rem,1rem + .8vw,1.4rem);
  color: #1f1f1f;
  text-decoration: none;
}
.foot-slogan{ margin: 6px 0 0; color:#474747; max-width: 52ch; }
.foot-contact a{ font-weight: 600; }

.foot-nav ul{ list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.foot-nav a{
  display:inline-block;
  padding:6px 10px;
  border:1px solid #f1e5b2;
  border-radius: 999px;
  background:#fff;
  color:#1f1f1f;
  text-decoration:none;
  box-shadow:0 6px 14px rgba(255,179,0,.10);
  transition: transform .15s ease, box-shadow .2s ease;
}
.foot-nav a:hover,
.foot-nav a:focus-visible{
  transform: translateY(-1px);
  box-shadow:0 10px 22px rgba(255,179,0,.16);
  outline: 2px solid #ffcb5e;
  outline-offset: 1px;
}

.foot-cta{ display:grid; gap:10px; justify-items:end; }
@media (max-width:560px){ .foot-cta{ justify-items:start; } }
.btn-top{
  cursor:pointer;
  padding:10px 14px;
  border-radius: 999px;
  border:2px solid #ffcb5e;
  background:#fff8d0;
  font-weight:700;
  color:#1f1f1f;
  box-shadow:0 8px 20px rgba(255,179,0,.16);
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn-top:hover,
.btn-top:focus-visible{
  transform: translateY(-1px);
  box-shadow:0 12px 28px rgba(255,179,0,.22);
  outline: 3px solid #1b73e8;
  outline-offset: 2px;
}
.foot-meta{ color:#6b5f2e; }

/* Decorative comet sweep across the footer (container-only animation) */
.site-footer::after{
  content:""; position:absolute; inset:0;
  background: linear-gradient(120deg, rgba(255,224,138,.0) 30%, rgba(255,224,138,.35) 50%, rgba(255,224,138,.0) 70%);
  transform: translateX(-120%);
  opacity:0; pointer-events:none;
}
.site-footer:hover::after,
.site-footer:focus-within::after{
  animation: footer-sweep .9s ease;
  opacity:1;
}
@keyframes footer-sweep{
  from{ transform: translateX(-120%); }
  to  { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce){
  .site-footer::after{ animation: none !important; }
}
