/* ========================================
   ФИТОНУТРИЕНТЫ — Лендинг
   Mobile-first, scroll-snap, highlight effect
   ======================================== */

:root {
    --bg-dark: #0a0a0f;
    --bg-panel: rgba(20, 20, 30, 0.75);
    --accent-gold: #d4af37;
    --accent-amber: #ffaa33;
    --accent-emerald: #2ecc71;
    --accent-cyan: #00e5ff;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.5);
    --radius: 16px;
    --radius-sm: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden; /* контролируем скролл через snap-container */
    height: 100vh;
    width: 100vw;
}

/* Scroll-snap контейнер */
.snap-container {
    height: 100vh;
    width: 100vw;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* Скрываем скроллбар */
.snap-container::-webkit-scrollbar {
    display: none;
}
.snap-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ========================================
   Экраны
   ======================================== */

.screen {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh; /* dynamic viewport для мобильных */
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-bottom: 100px; /* место для sticky CTA */
}

/* Фоновые слои */
.bg-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/ref.jpg');
    background-size: cover;
    background-position: center center;
    will-change: transform;
}

/* Чёрно-белый слой */
.bg-bw {
    filter: grayscale(100%) brightness(0.35) contrast(1.1);
    z-index: 1;
}

/* Цветной слой — изначально скрыт, управляется через JS */
.bg-color {
    filter: none;
    z-index: 2;
    opacity: 1;
    transform: scale(1);
    /* mask будет задаваться через inline-стили в JS */
    -webkit-mask-image: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), black 0%, transparent var(--hr, 20%));
    mask-image: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), black 0%, transparent var(--hr, 20%));
    transition: -webkit-mask-image 0.8s ease, mask-image 0.8s ease, transform 1.2s ease;
}

/* Glow вокруг highlight */
.bg-glow {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), rgba(212, 175, 55, 0.15) 0%, transparent var(--hr, 25%));
    opacity: 0;
    transition: opacity 0.8s ease, background 0.8s ease;
    mix-blend-mode: screen;
}

.screen.active .bg-glow {
    opacity: 1;
}

/* ========================================
   Контент
   ======================================== */

.content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.content.center {
    align-items: center;
    text-align: center;
}

/* Eyebrow */
.eyebrow {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-amber);
    opacity: 0.9;
}

/* Заголовки */
.title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.8rem, 7vw, 2.6rem);
    font-weight: 600;
    line-height: 1.15;
    color: var(--text-primary);
    text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}

.title.huge {
    font-size: clamp(2rem, 8vw, 3rem);
}

/* Lead */
.lead {
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--text-secondary);
    text-shadow: 0 1px 10px rgba(0,0,0,0.5);
}

/* Обычный текст */
.text {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-secondary);
    text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.text.accent {
    color: var(--accent-cyan);
    font-weight: 500;
}

.text.center {
    text-align: center;
    width: 100%;
}

.text.small {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ========================================
   UI-элементы
   ======================================== */

/* Кнопки */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-amber));
    color: #1a1200;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.35), inset 0 1px 0 rgba(255,255,255,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    margin-top: 8px;
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-primary.large {
    padding: 18px 28px;
    font-size: 1rem;
}

/* Sticky CTA */
.sticky-cta {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-amber));
    color: #1a1200;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 30px rgba(212, 175, 55, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    pointer-events: none;
}

.sticky-cta.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Прогресс-бар */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.08);
    z-index: 101;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-amber));
    transition: width 0.3s ease;
}

/* Индикатор экрана */
.screen-indicator {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 101;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    padding: 6px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
}

.screen-indicator .sep {
    margin: 0 3px;
    opacity: 0.5;
}

#currentScreen {
    color: var(--text-primary);
    font-weight: 600;
}

/* ========================================
   HERO
   ======================================== */

.hero-product {
    position: relative;
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0;
}

.product-glow {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.25) 0%, transparent 70%);
    filter: blur(20px);
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* ========================================
   PAIN
   ======================================== */

.pain-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
}

.pain-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pain-icon {
    font-size: 1.4rem;
    line-height: 1;
}

/* ========================================
   FACT BOX
   ======================================== */

.fact-box {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.08);
    margin: 4px 0;
}

.fact-box.dark {
    background: rgba(0, 0, 0, 0.4);
}

.fact-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.fact-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent-gold);
}

/* ========================================
   CONFLICT — Органы
   ======================================== */

.organs-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
}

.organ {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.organ span {
    font-size: 1.2rem;
}

/* ========================================
   SOLUTION — Компоненты
   ======================================== */

.big-number {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    font-weight: 700;
    color: var(--accent-gold);
    line-height: 1;
    text-shadow: 0 0 40px rgba(212, 175, 55, 0.3);
    width: 100%;
    text-align: center;
}

.big-number .plus {
    font-size: 2.5rem;
    vertical-align: super;
    margin-left: 4px;
}

.components-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.comp-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.comp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

/* ========================================
   TECH — Сравнение
   ======================================== */

.compare-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 4px 0;
}

.compare-item {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.8rem;
}

.compare-item span {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.compare-item small {
    font-size: 0.7rem;
    opacity: 0.7;
}

.compare-item.bad {
    background: rgba(255, 80, 80, 0.12);
    border: 1px solid rgba(255, 80, 80, 0.2);
    color: #ff8888;
}

.compare-item.good {
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.2);
    color: #6ee7a0;
}

.compare-arrow {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* ========================================
   TECH 3 — Путь
   ======================================== */

.path-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 0;
}

.path-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.path-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border-radius: 50%;
    font-size: 1.2rem;
    border: 1px solid rgba(255,255,255,0.08);
}

.path-step.skip .path-icon {
    opacity: 0.4;
}

.path-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.path-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-emerald));
    max-width: 40px;
    border-radius: 1px;
}

.path-line.dashed {
    background: repeating-linear-gradient(90deg, var(--text-muted), var(--text-muted) 4px, transparent 4px, transparent 8px);
    opacity: 0.3;
}

/* ========================================
   SCIENCE — Карточки исследований
   ======================================== */

.study-card {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.06);
    border-left: 3px solid var(--accent-cyan);
}

.study-journal {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-cyan);
    font-weight: 600;
    margin-bottom: 2px;
}

.study-authors {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.study-text {
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

/* ========================================
   EFFECT — Сосуды
   ======================================== */

.vessel-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 8px 0;
}

.vessel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.vessel span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.vessel-inner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid;
    position: relative;
    overflow: hidden;
}

.vessel-inner.damaged {
    border-color: #e74c3c;
    background: radial-gradient(circle at 30% 30%, #e74c3c 0%, #8b0000 100%);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.3);
}

.vessel-inner.damaged::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(0,0,0,0.3) 4px, rgba(0,0,0,0.3) 8px);
}

.vessel-inner.healthy {
    border-color: var(--accent-emerald);
    background: radial-gradient(circle at 30% 30%, #2ecc71 0%, #006600 100%);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.3);
}

.vessel-arrow {
    font-size: 1.4rem;
    color: var(--text-muted);
}

/* ========================================
   PROOFREADING
   ======================================== */

.proofreading-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 8px 0;
}

.dna-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.dna-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.dna-bar {
    width: 60px;
    height: 12px;
    border-radius: 6px;
}

.dna-bar.error {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
    position: relative;
}

.dna-bar.error::after {
    content: '✕';
    position: absolute;
    right: -18px;
    top: 50%;
    transform: translateY(-50%);
    color: #e74c3c;
    font-size: 0.8rem;
}

.dna-bar.fixed {
    background: linear-gradient(90deg, var(--accent-emerald), #27ae60);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
    position: relative;
}

.dna-bar.fixed::after {
    content: '✓';
    position: absolute;
    right: -18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-emerald);
    font-size: 0.8rem;
}

.dna-arrow {
    font-size: 1.4rem;
    color: var(--accent-cyan);
    font-weight: 700;
}

/* ========================================
   CONCLUSION
   ======================================== */

.final-mark {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    line-height: 1;
    margin-top: -8px;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

/* ========================================
   CTA — Форма
   ======================================== */

.cta-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.form-group {
    width: 100%;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus {
    border-color: var(--accent-gold);
    background: rgba(255,255,255,0.1);
}

.form-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    width: 100%;
    margin-top: 4px;
}

.messengers {
    display: flex;
    gap: 8px;
    width: 100%;
}

.msg-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.1);
    transition: background 0.2s;
}

.msg-btn.max {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.3);
    color: #f0d878;
}

.msg-btn.vk {
    background: rgba(0, 119, 255, 0.15);
    border-color: rgba(0, 119, 255, 0.3);
    color: #7aaaff;
}

.msg-btn.phone {
    background: rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.3);
    color: #6ee7a0;
}

/* Карточка консультанта */
.consultant-card {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.08);
    text-align: center;
}

.consultant-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.consultant-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Источники */
.sources-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.sources-toggle svg {
    transition: transform 0.3s ease;
}

.sources-toggle.open svg {
    transform: rotate(180deg);
}

.sources-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.sources-list.open {
    max-height: 500px;
    opacity: 1;
}

.sources-list ol {
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sources-list li {
    font-size: 0.65rem;
    line-height: 1.4;
    color: var(--text-muted);
}

/* ========================================
   Анимации появления
   ======================================== */

.screen .content > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.screen.active .content > * {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger-задержки */
.screen.active .content > *:nth-child(1) { transition-delay: 0.1s; }
.screen.active .content > *:nth-child(2) { transition-delay: 0.2s; }
.screen.active .content > *:nth-child(3) { transition-delay: 0.3s; }
.screen.active .content > *:nth-child(4) { transition-delay: 0.4s; }
.screen.active .content > *:nth-child(5) { transition-delay: 0.5s; }
.screen.active .content > *:nth-child(6) { transition-delay: 0.6s; }
.screen.active .content > *:nth-child(7) { transition-delay: 0.7s; }
.screen.active .content > *:nth-child(8) { transition-delay: 0.8s; }

/* ========================================
   Responsive tweaks
   ======================================== */

@media (max-height: 700px) {
    .screen {
        padding-bottom: 90px;
    }
    .title {
        font-size: clamp(1.5rem, 6vw, 2.2rem);
    }
    .hero-product {
        height: 120px;
    }
    .product-glow {
        width: 110px;
        height: 110px;
    }
    .big-number {
        font-size: 3rem;
    }
}

@media (min-width: 768px) {
    .content {
        max-width: 480px;
    }
    .title {
        font-size: clamp(2.2rem, 5vw, 3rem);
    }
}
