:root {
    --bg: #f7f4ef;
    --surface: #fffdf9;
    --surface-soft: #fcf7ef;
    --text: #252321;
    --muted: #6a635b;
    --accent: #b6672d;
    --accent-soft: #e9c7a9;
    --line: rgba(58, 48, 37, 0.12);
    --radius: 18px;
    --shadow-sm: 0 10px 24px rgba(39, 25, 10, 0.06);
    --shadow-md: 0 22px 44px rgba(37, 25, 13, 0.1);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", "Noto Sans", "Noto Sans Devanagari", -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

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

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.ambient__orb {
    position: absolute;
    filter: blur(38px);
    opacity: 0.32;
    border-radius: 50%;
    animation: floatOrb 14s ease-in-out infinite;
}

.ambient__orb--one {
    width: 340px;
    height: 340px;
    background: #f0b78a;
    top: -90px;
    right: -60px;
}

.ambient__orb--two {
    width: 280px;
    height: 280px;
    background: #f1d3b6;
    bottom: 8%;
    left: -80px;
    animation-delay: -5s;
}

@keyframes floatOrb {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-14px);
    }
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(12px);
    background: rgba(247, 244, 239, 0.88);
    border-bottom: 1px solid var(--line);
}

.topbar__inner {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand__symbol {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: linear-gradient(145deg, #fff, #f4ebe0);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
    font-weight: 700;
}

.brand h1 {
    margin: 0;
    font-size: 0.98rem;
}

.brand p {
    margin: 0;
    color: var(--muted);
    font-size: 0.77rem;
}

.section-nav {
    display: flex;
    gap: 8px;
}

.section-nav button,
.hero__button,
.switcher button {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    padding: 9px 14px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease, background .24s ease;
}

.section-nav button:hover,
.hero__button:hover,
.switcher button:hover {
    transform: translateY(-1px);
    border-color: rgba(182, 103, 45, 0.45);
    box-shadow: 0 8px 18px rgba(182, 103, 45, 0.13);
}

.section-nav button.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-toggle {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease, background .24s ease;
}

.lang-toggle:hover {
    transform: translateY(-1px);
    background: rgba(182, 103, 45, 0.08);
}

.lang-toggle__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.lang-toggle__icon svg {
    display: block;
}

main {
    padding: 28px 0 44px;
}

.hero,
.timeline,
.books,
.advaita,
.footer {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.04fr 0.96fr;
    gap: 26px;
    align-items: center;
    padding: 36px;
    box-shadow: var(--shadow-md);
}

.hero__glow {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    right: -80px;
    top: -100px;
    background: radial-gradient(circle, rgba(244, 169, 109, 0.34) 0%, rgba(244, 169, 109, 0) 70%);
}

.kicker {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero h2 {
    margin: 0 0 14px;
    line-height: 1.08;
    font-size: clamp(2rem, 4.7vw, 3.6rem);
}

.hero__subtitle {
    margin: 0;
    max-width: 62ch;
    color: var(--muted);
}

.hero__chips {
    margin: 18px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero__chips span {
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    border-radius: 999px;
    font-size: 0.78rem;
    padding: 6px 12px;
}

.hero__button {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.hero__image-wrap img {
    border-radius: 20px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}


/* СТИЛИ ДЛЯ ТАБЛИЦ*/
/* Стили для таблиц в модальных окнах — светлые, элегантные */
.modal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.modal-table th,
.modal-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border: 1px solid #e2e8f0;
}

.modal-table th {
    background: #f8fafc;
    color: #1e293b;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #c9a03d;
}

.modal-table td {
    color: #334155;
    background: #ffffff;
}

.modal-table tr:hover td {
    background: #fefce8;
}

/* Санскритские шрифты в первом столбце */
.modal-table td:first-child,
.modal-table th:first-child {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 500;
    color: #b45309;
}

/* Адаптив для мобильных */
@media (max-width: 640px) {
    .modal-table th,
    .modal-table td {
        padding: 0.5rem 0.5rem;
        font-size: 0.75rem;
    }

    .modal-table td:first-child,
    .modal-table th:first-child {
        font-size: 0.8rem;
    }
}
/* КОНЕЦ СТИЛЕЙ ДЛЯ ТАБЛИЦ*/


/* Стили для ссылок в модальных окнах */
.modal-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #c9a03d;
    color: #1e293b;
    text-decoration: none;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.modal-link:hover {
    background: #b88b2a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 160, 61, 0.3);
}

.modal-link:active {
    transform: translateY(0);
}

/* Для тёмной темы */
.design-b .modal-link {
    background: #c9a03d;
    color: #0f172a;
}

.design-b .modal-link:hover {
    background: #d4af37;
}
/* КОНЕЦ ССЫЛОК*/

.timeline,
.books,
.advaita {
    margin-top: 32px;
    padding: 30px;
}

.section-head {
    max-width: 760px;
    margin-bottom: 22px;
}

.section-head h3 {
    margin: 0 0 9px;
    font-size: clamp(1.65rem, 3vw, 2.35rem);
}

.section-head p {
    margin: 0;
    color: var(--muted);
}

.timeline__layout {
    position: relative;
    display: grid;
    gap: 16px;
    padding-left: 18px;
}

.timeline__line {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), rgba(182, 103, 45, 0.14));
}

.timeline__item,
.book-card,
.advaita-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    transition: transform .26s ease, box-shadow .26s ease, border-color .26s ease;
    transform-style: preserve-3d;
}

.timeline__item {
    padding: 14px 16px;
    position: relative;
}

.timeline__item::before {
    content: "";
    position: absolute;
    left: -24px;
    top: 18px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(182, 103, 45, 0.2);
}

.timeline__item:hover,
.book-card:hover,
.advaita-card:hover {
    transform: translateY(-2px);
    border-color: rgba(182, 103, 45, 0.32);
    box-shadow: 0 16px 30px rgba(62, 40, 17, 0.08);
}

.is-modal-trigger {
    cursor: pointer;
}

h2.is-modal-trigger,
h3.is-modal-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

h2.is-modal-trigger::after,
h3.is-modal-trigger::after {
    content: "↗";
    font-size: 0.66em;
    color: var(--accent);
    opacity: 0.7;
    transform: translateY(-1px);
    transition: transform .2s ease, opacity .2s ease;
}

h2.is-modal-trigger:hover::after,
h3.is-modal-trigger:hover::after {
    opacity: 1;
    transform: translate(2px, -3px);
}

.timeline__item h4,
.book-card h4,
.advaita-card h4 {
    margin: 0 0 8px;
    font-size: 1.03rem;
}

.timeline__item p,
.book-card p,
.advaita-card p {
    margin: 0;
    color: var(--muted);
}

.books__grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.book-card,
.advaita-card {
    padding: 12px;
}

.book-card img,
.advaita-card img {
    border-radius: 10px;
    margin-bottom: 10px;
}
.books__note {
    margin-top: 3rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: center;
}
.advaita__grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.footer {
    margin-top: 32px;
    padding: 22px;
}

.footer blockquote {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 1.18rem;
}

.footer p {
    margin: 0;
    color: var(--muted);
}

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .75s ease, transform .75s ease;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

.language-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
}

.language-modal.is-open {
    display: block;
}

.language-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 14, 12, 0.62);
}

.language-modal__panel {
    position: relative;
    width: min(560px, calc(100% - 36px));
    margin: 13vh auto 0;
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--line);
    padding: 24px;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.22);
}

.language-modal__panel h2 {
    margin: 0 0 8px;
}

.language-modal__panel p {
    margin: 0 0 16px;
    color: var(--muted);
}

.language-modal__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.lang-choice {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    padding: 10px;
    cursor: pointer;
    transition: transform .24s ease, border-color .24s ease;
}

.lang-choice:hover {
    transform: translateY(-1px);
    border-color: rgba(182, 103, 45, 0.4);
}

.lang-choice:focus-visible,
.lang-toggle:focus-visible,
.info-modal__close:focus-visible,
.info-modal__nav-btn:focus-visible,
.section-nav button:focus-visible,
.hero__button:focus-visible {
    outline: 2px solid rgba(182, 103, 45, 0.36);
    outline-offset: 2px;
}

.info-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
}

.info-modal.is-open {
    display: block;
}

.info-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 11, 10, 0.72);
}

.info-modal__panel {
    position: relative;
    width: min(780px, calc(100% - 32px));
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    margin: 40px auto 0;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.3);
    padding: 22px;
}

.info-modal__nav {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin: 0 42px 8px 0;
}

.info-modal__nav-btn {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 0.78rem;
    padding: 8px 12px;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease;
}

.info-modal__nav-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(182, 103, 45, 0.4);
}

.info-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.info-modal__panel h3 {
    margin: 0 0 12px;
    padding-right: 42px;
    font-size: clamp(1.35rem, 2.5vw, 1.95rem);
}

.info-modal__gallery {
    margin-bottom: 14px;
}

/*КАРТИНКИ В МОДАЛКАХ*/
.info-modal__gallery > img {
    width: 100%;
    height: min(55vh, 520px);
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--line);
}

.info-modal__thumbs {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.info-modal__thumb {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.78;
    transition: opacity .2s ease, border-color .2s ease, transform .2s ease;
}

/*МИНИАТЮРЫ В МОДАЛКАХ*/
.info-modal__thumb img {
    width: 100%;
    height: 48px;
    object-fit: cover;
}

.info-modal__thumb:hover {
    transform: translateY(-1px);
}

.info-modal__thumb.is-active {
    opacity: 1;
    border-color: rgba(182, 103, 45, 0.55);
}

.info-modal__body p {
    margin: 0;
    color: var(--muted);
}

.info-modal__body p + p {
    margin-top: 14px;
}

@media (max-width: 1050px) {
    .topbar__inner {
        grid-template-columns: 1fr auto;
        gap: 10px;
        padding: 10px 14px;
    }

    .brand p {
        display: none !important;
    }

    .brand h1 {
        font-size: 0.88rem;
        line-height: 1.2;
    }

    .brand {
        align-items: center;
    }

    .section-nav {
        grid-column: 1 / -1;
        order: 3;
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .section-nav::-webkit-scrollbar {
        display: none;
    }

    .section-nav button {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .controls {
        justify-content: flex-end;
    }

    .advaita__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .container {
        width: min(1120px, calc(100% - 24px));
    }

    .section-nav {
        overflow-x: auto;
    }

    .books__grid,
    .advaita__grid,
    .language-modal__actions {
        grid-template-columns: 1fr;
    }

    .hero,
    .timeline,
    .books,
    .advaita,
    .footer {
        padding: 18px;
    }

    .info-modal__panel {
        margin-top: 20px;
        max-height: calc(100vh - 40px);
        padding: 16px 16px 56px;
    }

    .info-modal__nav {
        margin-right: 0;
        justify-content: space-between;
    }

    .info-modal__close {
        position: fixed;
        top: auto;
        right: 14px;
        bottom: 14px;
        z-index: 100;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
    }

    .info-modal__thumbs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
