:root {
    --bg-deep: #0b0704;
    --bg-dark-wood: #160d06;
    --gold-bright: #f5d061;
    --gold-primary: #d4af37;
    --gold-antique: #9c7a23;
    --gold-dim: rgba(212, 175, 55, 0.25);
    --crimson-accent: #8b1e1e;
    --robe-blue: #1c3545;
    --parchment-light: #f6ecd9;
    --parchment-muted: #cbb893;
    --font-display: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
    --font-slavonic: 'Ruslan Display', 'Cormorant Garamond', serif;
    --font-scripture: 'Cormorant Garamond', Georgia, serif;
    --font-ui: 'Inter', -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg-deep);
    color: var(--parchment-light);
    font-family: var(--font-scripture);
}

body {
    background: radial-gradient(circle at 50% 15%, #2a1b0a 0%, #110904 55%, #070402 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.65;
}

/* Канвас с золотыми искрами */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

/* Мягкие божественные свечения на фоне */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(130px);
    pointer-events: none;
    z-index: 0;
}

.glow-1 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.16) 0%, transparent 70%);
    top: -100px;
    left: 15%;
}

.glow-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(28, 53, 69, 0.22) 0%, transparent 70%);
    bottom: 5%;
    right: 10%;
}

/* Шапка */
.sacred-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(14, 9, 5, 0.82);
    border-bottom: 1px solid var(--gold-dim);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.header-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-slavonic);
    font-size: 1.35rem;
    letter-spacing: 0.08em;
    color: var(--parchment-light);
}

.cross-symbol {
    color: var(--gold-bright);
    font-size: 1.6rem;
    text-shadow: 0 0 12px rgba(245, 208, 97, 0.7);
}

.gold-accent {
    color: var(--gold-primary);
}

.sacred-nav {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--parchment-muted);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--gold-bright);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--gold-bright);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Основной контейнер */
.main-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

/* Секция 1: Алтарь с Иконой */
.hero-shrine {
    padding: 2rem 0 5rem;
}

.shrine-grid {
    display: grid;
    grid-template-columns: 440px 1fr;
    gap: 4rem;
    align-items: center;
}

/* Рама Иконы + Анимированный Нимб */
.icon-frame-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
}

.halo-rings {
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 460px;
    height: 460px;
    pointer-events: none;
    z-index: 0;
}

.halo-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px dashed rgba(245, 208, 97, 0.35);
    box-shadow: 0 0 60px rgba(212, 175, 55, 0.25), inset 0 0 40px rgba(212, 175, 55, 0.15);
    animation: rotateHalo 50s linear infinite;
}

.ring-middle {
    inset: 35px;
    border: 2px solid rgba(212, 175, 55, 0.22);
    animation: rotateHaloReverse 35s linear infinite;
}

.halo-rays {
    position: absolute;
    inset: -30px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 208, 97, 0.28) 0%, rgba(212, 175, 55, 0.08) 45%, transparent 70%);
    animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes rotateHalo {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotateHaloReverse {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(0.96); opacity: 0.75; }
    50% { transform: scale(1.06); opacity: 1; }
}

.icon-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    border-radius: 14px;
    padding: 12px;
    background: linear-gradient(145deg, #4b3413, #1e1206, #69491a);
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.85),
        0 0 35px rgba(212, 175, 55, 0.28),
        inset 0 0 2px rgba(255, 230, 150, 0.8);
    border: 2px solid var(--gold-primary);
    transition: transform 0.2s ease-out, box-shadow 0.3s ease;
    transform-style: preserve-3d;
    overflow: hidden;
}

.icon-card:hover {
    box-shadow: 
        0 30px 75px rgba(0, 0, 0, 0.9),
        0 0 55px rgba(245, 208, 97, 0.45);
}

.sacred-icon-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.6);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.icon-glare {
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, rgba(255,255,255,0) 30%, rgba(255, 235, 160, 0.18) 48%, rgba(255,255,255,0) 65%);
    pointer-events: none;
    mix-blend-mode: overlay;
    transition: opacity 0.3s;
}

/* Угловые византийские узоры на окладе */
.corner-ornament {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 2px solid var(--gold-bright);
    z-index: 3;
    pointer-events: none;
}
.corner-ornament.tl { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.corner-ornament.tr { top: 6px; right: 6px; border-left: none; border-bottom: none; }
.corner-ornament.bl { bottom: 6px; left: 6px; border-right: none; border-top: none; }
.corner-ornament.br { bottom: 6px; right: 6px; border-left: none; border-top: none; }

/* Правая часть первого экрана */
.church-slavonic-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border: 1px solid var(--gold-primary);
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold-bright);
    font-family: var(--font-slavonic);
    font-size: 0.95rem;
    letter-spacing: 0.18em;
    border-radius: 4px;
    margin-bottom: 1.2rem;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

.sacred-main-title {
    font-family: var(--font-slavonic);
    font-size: clamp(2.4rem, 4.5vw, 3.8rem);
    line-height: 1.15;
    letter-spacing: 0.04em;
    margin-bottom: 1.5rem;
    color: var(--parchment-light);
    text-shadow: 0 4px 25px rgba(0, 0, 0, 0.9);
}

.gold-gradient-text {
    background: linear-gradient(135deg, #fff3c4 0%, #f5d061 35%, #d4af37 70%, #9c7a23 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 12px rgba(212, 175, 55, 0.35));
}

.sacred-subtitle {
    font-size: 1.45rem;
    font-style: italic;
    color: var(--parchment-muted);
    margin-bottom: 2.2rem;
    border-left: 3px solid var(--gold-primary);
    padding-left: 1.25rem;
}

.hero-actions {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

/* Кнопки */
.sacred-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.95rem 2rem;
    background: linear-gradient(135deg, #d4af37 0%, #9c7a23 100%);
    color: #0e0803;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    border: 1px solid #ffe89e;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.sacred-btn-primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #f5d061 0%, #b8912b 100%);
    box-shadow: 0 14px 30px rgba(245, 208, 97, 0.45);
}

.sacred-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.95rem 1.8rem;
    background: rgba(212, 175, 55, 0.08);
    color: var(--gold-bright);
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    border: 1px solid var(--gold-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sacred-btn-secondary:hover {
    background: rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
    transform: translateY(-2px);
}

.sacred-btn-small {
    padding: 0.5rem 1rem;
    background: rgba(212, 175, 55, 0.14);
    color: var(--gold-bright);
    border: 1px solid var(--gold-primary);
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.25s;
}

.sacred-btn-small:hover {
    background: var(--gold-primary);
    color: #0e0803;
}

.blessing-toast {
    margin-top: 1.5rem;
    padding: 0.9rem 1.25rem;
    background: rgba(28, 53, 69, 0.55);
    border: 1px solid var(--gold-bright);
    border-radius: 8px;
    color: #fff3c4;
    font-size: 1.1rem;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.25);
    animation: fadeIn 0.4s ease;
}

.hidden {
    display: none !important;
}

/* Секция 2: Священное Писание (Фолиант) */
.scripture-section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-cross {
    display: block;
    font-size: 2rem;
    color: var(--gold-primary);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.section-title {
    font-family: var(--font-slavonic);
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    color: var(--gold-bright);
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.section-desc {
    font-size: 1.25rem;
    color: var(--parchment-muted);
    font-style: italic;
}

.scripture-controls {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.chapter-tabs {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.chapter-tab {
    padding: 0.6rem 1.2rem;
    background: rgba(22, 13, 6, 0.8);
    border: 1px solid var(--gold-dim);
    color: var(--parchment-muted);
    font-family: var(--font-slavonic);
    font-size: 1rem;
    letter-spacing: 0.06em;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.chapter-tab:hover, .chapter-tab.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.28), rgba(156, 122, 35, 0.15));
    border-color: var(--gold-bright);
    color: var(--gold-bright);
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.25);
}

.sacred-input {
    padding: 0.65rem 1.1rem;
    background: rgba(12, 7, 3, 0.85);
    border: 1px solid var(--gold-dim);
    border-radius: 6px;
    color: var(--parchment-light);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    min-width: 260px;
    outline: none;
    transition: border-color 0.25s;
}

.sacred-input:focus {
    border-color: var(--gold-bright);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
}

/* Стили Фолианта */
.glass-gold-panel {
    background: linear-gradient(160deg, rgba(30, 19, 9, 0.88) 0%, rgba(15, 9, 4, 0.94) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 14px;
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.85),
        inset 0 0 40px rgba(212, 175, 55, 0.06);
}

.bible-foliant {
    padding: 14px;
    position: relative;
}

.foliant-border {
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    padding: 3rem 3.5rem;
    position: relative;
    background: 
        radial-gradient(circle at top center, rgba(212, 175, 55, 0.08), transparent 60%);
}

.foliant-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.foliant-chapter-label {
    font-family: var(--font-slavonic);
    color: var(--gold-primary);
    letter-spacing: 0.25em;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.4rem;
}

.foliant-chapter-title {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    color: var(--parchment-light);
    font-weight: 700;
}

.divider-gold {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.2rem;
    color: var(--gold-primary);
}

.divider-gold::before,
.divider-gold::after {
    content: '';
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
    margin: 0 15px;
}

/* Стихи Писания */
.verses-container {
    column-count: 2;
    column-gap: 3.5rem;
    column-rule: 1px solid rgba(212, 175, 55, 0.18);
    font-size: 1.32rem;
    line-height: 1.75;
    color: var(--parchment-light);
    text-align: justify;
}

.verse-item {
    margin-bottom: 1.35rem;
    break-inside: avoid-column;
    position: relative;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    transition: background 0.25s ease;
}

.verse-item:hover {
    background: rgba(212, 175, 55, 0.07);
}

.verse-num {
    font-family: var(--font-slavonic);
    font-size: 0.95rem;
    color: var(--gold-bright);
    margin-right: 0.45rem;
    vertical-align: super;
    opacity: 0.85;
    user-select: none;
}

/* Киноварная/Золотая Буквица для первого стиха главы */
.verse-item.first-verse::first-letter {
    float: left;
    font-family: var(--font-slavonic);
    font-size: 4.2rem;
    line-height: 0.85;
    padding: 0.2rem 0.65rem 0.1rem 0;
    color: var(--gold-bright);
    text-shadow: 0 2px 15px rgba(212, 175, 55, 0.5), 2px 2px 0px var(--crimson-accent);
}

.foliant-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(212, 175, 55, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.foliant-nav-btn {
    background: transparent;
    border: 1px solid var(--gold-dim);
    color: var(--gold-bright);
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s;
}

.foliant-nav-btn:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold-bright);
}

.foliant-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.foliant-page-indicator {
    font-family: var(--font-slavonic);
    color: var(--parchment-muted);
    letter-spacing: 0.15em;
}

/* Секция 3: Заповеди */
.commandments-section {
    padding: 4rem 0 2rem;
}

.tablets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 2rem;
}

.tablet-card {
    padding: 2.2rem 2rem;
    text-align: center;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tablet-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(212, 175, 55, 0.22);
    border-color: var(--gold-bright);
}

.tablet-num {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.2rem;
    border-radius: 50%;
    border: 1px solid var(--gold-primary);
    background: rgba(212, 175, 55, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-slavonic);
    font-size: 1.3rem;
    color: var(--gold-bright);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.25);
}

.tablet-card h4 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--gold-bright);
    margin-bottom: 0.85rem;
}

.tablet-card p {
    font-size: 1.15rem;
    color: var(--parchment-muted);
}

/* Модальное окно Свитка Текста */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 3, 1, 0.85);
    backdrop-filter: blur(10px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-window {
    width: 100%;
    max-width: 780px;
    padding: 2rem;
    border: 1px solid var(--gold-primary);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--gold-dim);
}

.modal-header h3 {
    font-family: var(--font-display);
    color: var(--gold-bright);
    font-size: 1.4rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--parchment-muted);
    font-size: 1.4rem;
    cursor: pointer;
}

.modal-hint {
    font-family: var(--font-ui);
    font-size: 0.92rem;
    color: var(--parchment-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.telegraph-fetch-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.telegraph-fetch-bar .sacred-input {
    flex: 1;
}

.fetch-status {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--gold-bright);
    margin-bottom: 0.75rem;
}

.sacred-textarea {
    width: 100%;
    background: rgba(10, 6, 3, 0.9);
    border: 1px solid var(--gold-dim);
    border-radius: 8px;
    padding: 1rem;
    color: var(--parchment-light);
    font-family: var(--font-scripture);
    font-size: 1.15rem;
    line-height: 1.55;
    resize: vertical;
    outline: none;
}

.sacred-textarea:focus {
    border-color: var(--gold-bright);
}

.modal-footer {
    margin-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Подвал */
.sacred-footer {
    text-align: center;
    padding: 3rem 1.5rem 4rem;
    border-top: 1px solid var(--gold-dim);
    background: rgba(8, 4, 2, 0.9);
    position: relative;
    z-index: 2;
}

.footer-ornament {
    color: var(--gold-primary);
    font-size: 1.4rem;
    letter-spacing: 0.5em;
    margin-bottom: 0.8rem;
}

.footer-title {
    font-family: var(--font-slavonic);
    color: var(--gold-bright);
    letter-spacing: 0.15em;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.footer-copy {
    color: var(--parchment-muted);
    font-size: 1rem;
    opacity: 0.8;
}

/* Анимации появления при скролле */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Адаптивность */
@media (max-width: 960px) {
    .shrine-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }
    .sacred-subtitle {
        border-left: none;
        padding-left: 0;
    }
    .hero-actions {
        justify-content: center;
    }
    .verses-container {
        column-count: 1;
    }
    .foliant-border {
        padding: 2rem 1.5rem;
    }
}
