/* Базовые стили публичной части сайта */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--p-text-700);
    background-color: var(--p-bg-alt);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Навигация */
nav {
    background: linear-gradient(135deg, var(--p-brand) 0%, var(--p-brand-2) 100%);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    box-sizing: border-box;
}

/* Логотип */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
}

/* Диод */
.logo-icon {
    height: 30px;
    width: 23px;
    margin-right: 0.15rem;
    filter:
        drop-shadow(0 0 1px rgba(255, 247, 185, .95))
        drop-shadow(0 0 6px rgba(255, 247, 185, .75))
        drop-shadow(0 0 14px rgba(255, 230, 120, .55));
    transition: filter .25s ease, transform .25s ease;
    animation: ledPulse 2.4s ease-in-out infinite;
}

/* Текст логотипа */
.logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    color: #fff;
    text-shadow: 6px 0 10px rgba(0, 0, 0, .58);
    animation: textPulse 2.4s ease-in-out infinite;
}

.logo:hover .logo-icon {
    filter:
        drop-shadow(0 0 2px rgba(255, 247, 185, 1))
        drop-shadow(0 0 10px rgba(255, 247, 185, .95))
        drop-shadow(0 0 22px rgba(255, 230, 120, .85));
    transform: translateY(-1px) scale(1.04);
    animation-duration: 1.4s;
}

.logo:hover .logo-text {
    text-shadow: 10px 0 20px rgba(0, 0, 0, .8);
    animation-duration: 1.4s;
}

/* Анимации */
@keyframes ledPulse {
    0%, 100% {
        filter:
        drop-shadow(0 0 1px rgba(255, 247, 185, .9))
        drop-shadow(0 0 6px rgba(255, 247, 185, .7))
        drop-shadow(0 0 14px rgba(255, 230, 120, .5));
        transform: translateY(0) scale(1);
    }
    50% {
        filter:
        drop-shadow(0 0 3px rgba(255, 247, 185, 1))
        drop-shadow(0 0 12px rgba(255, 247, 185, .95))
        drop-shadow(0 0 26px rgba(255, 230, 120, .9));
        transform: translateY(-0.5px) scale(1.03);
    }
}

@keyframes textPulse {
    0%, 100% { text-shadow: 6px 0 10px rgba(0, 0, 0, .58); }
    50%      { text-shadow: 9px 0 18px rgba(0, 0, 0, .78); }
}

/* Кнопка бургер-меню (скрыта на десктопе) */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.burger-line {
    width: 25px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Анимация бургера при открытии */
.burger-menu.active .burger-line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.burger-menu.active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Навигационные ссылки */
.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    transition: opacity 0.3s;
    font-weight: 500;
}

.nav-links a:hover{
    opacity: 1;
    text-shadow: 0 0 6px rgba(0,0,0,.24);
}

.nav-links a.active {
    opacity: 1;
    font-weight: bold;
    color: var(--p-accent);
    text-shadow:
        0 1px 3px rgba(0,0,0,0.3),
        -1px -1px 0 rgba(0,0,0,0.4),
        1px -1px 0 rgba(0,0,0,0.4),
        -1px 1px 0 rgba(0,0,0,0.4),
        1px 1px 0 rgba(0,0,0,0.4);
}

/* Контент */
.main-content {
    margin-top: 80px;
    padding: 0;
    flex: 1 0 auto;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box;
}

/* Заголовки секций */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h1 {
    font-size: 2.5rem;
    color: var(--p-text-700);
    margin-bottom: 1rem;
    font-weight: 700;
}

.section-header p {
    font-size: 1.2rem;
    color: var(--p-text-500);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Footer */
footer { flex-shrink: 0; }

/* Кнопки */
.btn {
    display: inline-block;
    background: var(--p-brand);
    color: #333;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color .2s ease, transform .1s ease;
    border: none;
    cursor: pointer;
}

.btn:active{ transform: translateY(1px); }
.btn:hover { background: var(--p-brand-2); color: #333; }
.btn-primary { background: var(--p-brand); }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-secondary:hover { background: var(--p-accent); color: #333; }
.btn-success { background: var(--p-success); }
.btn-danger { background: #dc3545; }

.btn-hero {
    background: white;
    color: #333;
    font-size: 20px;
    padding: 1rem 2rem;
    border: 2px solid var(--p-accent);
}
.btn-hero:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 163, 141, 0.60);
}

/* Убираем outline при клике мышкой, но оставляем при навигации клавиатурой (Tab) */
.btn:focus,
.nav-links a:focus {
    outline: none;
}

/* Показываем outline только при навигации клавиатурой для доступности */
.btn:focus-visible,
.nav-links a:focus-visible {
    outline: 2px solid var(--p-brand);
    outline-offset: 2px;
}

/* Кнопка отправки: второй спан скрыт по умолчанию */
button[type="submit"] .btn-loading { display: none; }
button[type="submit"].is-loading .btn-text { display: none; }
button[type="submit"].is-loading .btn-loading { display: inline; }

/* Utilities */
.hidden { display: none !important; }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === Progress Bar (индикатор прокрутки) === */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--p-brand), var(--p-brand-2));
  z-index: 10001;
  transition: width 0.1s ease-out;
  border-radius: 0 2px 2px 0;
}

/* === Кнопка "Наверх" === */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--p-brand);
  color: #333;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.48);
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--p-brand-2);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.60);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}