/*
 * Оформление сайта «СОПУТНИК».
 *
 * Палитра и шрифты взяты из приложения: лазурный скин (синий бархат и золото)
 * плюс тёплый янтарь свечи. Сайт и приложение должны читаться как одно целое,
 * поэтому цвета здесь не подбирались заново, а перенесены из кода приложения.
 */

@font-face {
    font-family: 'Ruslan Display';
    src: url('/assets/fonts/ruslan_display.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'Old Standard';
    src: url('/assets/fonts/old_standard.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Old Standard';
    src: url('/assets/fonts/old_standard_bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: 'Old Standard';
    src: url('/assets/fonts/old_standard_italic.ttf') format('truetype');
    font-style: italic;
    font-display: swap;
}

:root {
    --night: #050d1c;
    --velvet: #081428;
    --velvet-2: #0d2044;
    --panel: #0b1c39;
    --panel-2: #102a52;
    --gold: #e6bd63;
    --gold-hi: #f7e3ac;
    --gold-dim: #a98436;
    --core: #fff3d2;
    --warm: #ffc46b;
    --amber: #e08a2b;
    --deep: #8a4a12;
    --vermilion: #d42a1c;
    --text: #e9e2d2;
    --dim: #a9b4c9;
    --wrap: 1160px;
    --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background:
        radial-gradient(1200px 700px at 50% -10%, #14315e 0%, transparent 60%),
        radial-gradient(900px 600px at 90% 20%, #0d2450 0%, transparent 55%),
        linear-gradient(180deg, var(--velvet) 0%, var(--night) 100%);
    background-attachment: fixed;
    color: var(--text);
    font: 400 18px/1.65 'Old Standard', Georgia, serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); }

.wrap { width: min(100% - 40px, var(--wrap)); margin: 0 auto; }
.center { text-align: center; }
.dim { color: var(--dim); }

/* ——— Искры: тот же дым над свечой, что в приложении ——— */
.embers {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ——— Шапка ——— */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px max(20px, calc((100vw - var(--wrap)) / 2));
    background: rgba(6, 15, 32, 0.72);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(230, 189, 99, 0.18);
}
.topbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Ruslan Display', 'Old Standard', serif;
    font-size: 22px;
    letter-spacing: 0.04em;
    color: var(--gold-hi);
}
.topbar__cross { width: 22px; height: 22px; filter: drop-shadow(0 0 6px rgba(255, 196, 107, .5)); }
.topbar__nav { display: flex; align-items: center; gap: 22px; font-size: 16px; }
.topbar__nav a { color: var(--dim); }
.topbar__nav a:hover { color: var(--gold); }
.topbar__cta {
    padding: 7px 16px;
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius);
    color: var(--gold) !important;
    background: rgba(230, 189, 99, 0.07);
}
.topbar__cta:hover { background: rgba(230, 189, 99, 0.16); }

/* ——— Первый экран ——— */
.hero {
    position: relative;
    padding: 70px 0 90px;
    overflow: hidden;
}
.hero__halo {
    position: absolute;
    top: -180px;
    left: 50%;
    width: 1100px;
    height: 1100px;
    margin-left: -550px;
    background: radial-gradient(circle,
        rgba(255, 196, 107, 0.16) 0%,
        rgba(224, 138, 43, 0.08) 32%,
        transparent 66%);
    animation: breathe 9s ease-in-out infinite;
    pointer-events: none;
}
.hero__grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 40px;
    align-items: center;
}
.hero__title {
    margin: 0;
    font-family: 'Ruslan Display', serif;
    font-size: clamp(48px, 8vw, 92px);
    line-height: 1;
    letter-spacing: 0.06em;
    color: var(--gold-hi);
    text-shadow: 0 0 34px rgba(255, 196, 107, 0.35), 0 2px 0 rgba(0, 0, 0, 0.5);
}
.hero__subtitle {
    margin: 10px 0 0;
    font-size: clamp(18px, 2.4vw, 24px);
    color: var(--dim);
    font-style: italic;
}
.hero__lead { font-size: 20px; margin: 0 0 26px; max-width: 33em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__meta { margin-top: 18px; color: var(--dim); font-size: 15px; }
.hero__scroll {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    font-size: 26px;
    color: var(--gold-dim);
    animation: nudge 2.4s ease-in-out infinite;
}

/* Крест: тело из приложения, сияние — средствами страницы. */
.crossbox {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
}
.crossbox__svg {
    position: relative;
    width: min(74%, 380px);
    filter:
        drop-shadow(0 0 18px rgba(255, 196, 107, 0.55))
        drop-shadow(0 0 60px rgba(224, 138, 43, 0.35));
    animation: breathe 7s ease-in-out infinite;
}
/* Волна света от средокрестия — как на экране «Сияющий крест». */
.crossbox__wave {
    position: absolute;
    width: 62%;
    aspect-ratio: 1;
    top: 31%;
    border-radius: 50%;
    background: radial-gradient(circle,
        transparent 26%,
        rgba(255, 243, 210, 0.05) 40%,
        rgba(255, 243, 210, 0.16) 50%,
        rgba(255, 243, 210, 0.04) 60%,
        transparent 74%);
    filter: blur(6px);
    animation: wave 14s ease-out infinite;
    pointer-events: none;
}
.cross { display: block; }

@keyframes breathe {
    0%, 100% { opacity: 0.93; transform: scale(1); }
    50%      { opacity: 1;    transform: scale(1.018); }
}
@keyframes wave {
    0%   { transform: scale(0.12); opacity: 0; }
    8%   { opacity: 0.85; }
    64%  { transform: scale(1.7);  opacity: 0; }
    100% { transform: scale(1.7);  opacity: 0; }
}
@keyframes nudge {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.6; }
    50%      { transform: translate(-50%, 8px); opacity: 1; }
}

/* ——— Кнопки ——— */
.btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 14px 30px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font: 400 19px/1.2 'Old Standard', Georgia, serif;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn small { font-size: 13px; opacity: 0.75; }
.btn--gold {
    color: #26170a;
    background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 55%, var(--gold-dim) 100%);
    box-shadow: 0 8px 26px rgba(224, 138, 43, 0.28);
}
.btn--gold:hover {
    color: #26170a;
    transform: translateY(-2px);
    box-shadow: 0 12px 34px rgba(255, 196, 107, 0.42);
}
.btn--ghost {
    color: var(--gold);
    border-color: var(--gold-dim);
    background: rgba(230, 189, 99, 0.06);
}
.btn--ghost:hover { background: rgba(230, 189, 99, 0.15); transform: translateY(-2px); }
.btn--big { padding: 18px 42px; font-size: 22px; }

/* ——— Разделитель-ромб ——— */
.lozenge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 14px 0 22px;
}
.lozenge span {
    height: 1px;
    width: min(140px, 22vw);
    background: linear-gradient(90deg, transparent, rgba(230, 189, 99, 0.55), transparent);
}
.lozenge i {
    width: 8px;
    height: 8px;
    background: var(--gold);
    transform: rotate(45deg);
    box-shadow: 0 0 10px rgba(230, 189, 99, 0.7);
}

/* ——— Секции ——— */
.section {
    position: relative;
    z-index: 1;
    padding: 76px 0;
    /* Шапка липкая и перекрыла бы заголовок, к которому ведёт якорь. */
    scroll-margin-top: 76px;
}
.section--page { padding-top: 48px; }
.section__narrow { max-width: 760px; }
.section__title {
    margin: 0;
    text-align: center;
    font-family: 'Ruslan Display', serif;
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: 0.05em;
    color: var(--gold-hi);
    text-shadow: 0 0 24px rgba(255, 196, 107, 0.25);
}
.section__lead { text-align: center; color: var(--dim); margin-top: -6px; }
.prose p { margin: 0 0 16px; }
.prose--dim { color: var(--dim); }

/* ——— Карточки возможностей ——— */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 26px;
}
.card {
    position: relative;
    padding: 26px 24px;
    background: linear-gradient(180deg, rgba(13, 32, 68, 0.92), rgba(8, 20, 40, 0.92));
    border: 1px solid rgba(230, 189, 99, 0.22);
    border-radius: var(--radius);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
/* Филигрань по углам — та же рамка, что у образов в приложении. */
.card::before, .card::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gold);
    opacity: 0.85;
}
.card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.card::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.card:hover {
    transform: translateY(-4px);
    border-color: rgba(230, 189, 99, 0.5);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 30px rgba(224, 138, 43, 0.12);
}
.card h3 {
    margin: 14px 0 8px;
    font-family: 'Ruslan Display', serif;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: var(--gold);
}
.card p { margin: 0; color: var(--dim); font-size: 17px; }
.card__icon { width: 42px; height: 42px; color: var(--gold); }
.card__icon svg { width: 100%; height: 100%; filter: drop-shadow(0 0 8px rgba(255, 196, 107, .35)); }

/* ——— Экраны ——— */
.section--screens { background: rgba(4, 10, 22, 0.35); }
.screens {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 28px;
    margin-top: 30px;
}
.screen { margin: 0; text-align: center; }
.phone {
    position: relative;
    padding: 8px;
    border-radius: 22px;
    background: linear-gradient(160deg, #1b2b4b, #060e1e);
    border: 1px solid rgba(230, 189, 99, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    transition: transform .3s ease, box-shadow .3s ease;
}
.phone img { display: block; width: 100%; height: auto; border-radius: 15px; }
.screen:hover .phone {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(224, 138, 43, 0.18);
}
.screen figcaption { margin-top: 14px; display: block; }
.screen strong {
    display: block;
    font-family: 'Ruslan Display', serif;
    font-weight: 400;
    font-size: 19px;
    color: var(--gold);
    letter-spacing: 0.03em;
}
.screen span { color: var(--dim); font-size: 15px; }

/* ——— Скачивание и «поделиться» ——— */
.download { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 34px; align-items: start; }
.download__body .section__title, .download__body .lozenge { text-align: left; justify-content: flex-start; }
.steps { margin: 22px 0 0; padding-left: 20px; color: var(--dim); font-size: 16px; }
.steps li { margin-bottom: 8px; }
.download__share {
    padding: 26px;
    background: linear-gradient(180deg, rgba(13, 32, 68, 0.9), rgba(8, 20, 40, 0.9));
    border: 1px solid rgba(230, 189, 99, 0.22);
    border-radius: var(--radius);
}
.download__share h3 {
    margin: 0 0 4px;
    font-family: 'Ruslan Display', serif;
    font-weight: 400;
    font-size: 22px;
    color: var(--gold);
}
.download__share p { margin: 0 0 16px; color: var(--dim); font-size: 16px; }
.share { display: flex; flex-wrap: wrap; gap: 10px; }
.share__btn {
    padding: 9px 16px;
    font: 400 16px 'Old Standard', Georgia, serif;
    color: var(--gold);
    background: rgba(230, 189, 99, 0.07);
    border: 1px solid rgba(230, 189, 99, 0.35);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}
.share__btn:hover { background: rgba(230, 189, 99, 0.18); transform: translateY(-2px); }
.share__qr { display: flex; align-items: center; gap: 12px; margin-top: 20px; color: var(--dim); }
.share__qr img { border-radius: 12px; border: 1px solid rgba(230, 189, 99, 0.3); }

/* ——— Отзывы ——— */
.reviews { display: grid; gap: 16px; margin: 26px 0; }
.reviews--teaser { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.review {
    padding: 22px 24px;
    background: rgba(11, 28, 57, 0.75);
    border-left: 2px solid var(--gold-dim);
    border-radius: var(--radius);
}
.review__text { margin: 0 0 12px; }
.review__sign {
    margin: 0;
    color: var(--gold);
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.review__sign span { color: var(--dim); font-style: italic; }
.review__reply {
    margin: 14px 0 0;
    padding: 12px 14px;
    background: rgba(230, 189, 99, 0.07);
    border-radius: var(--radius);
    font-size: 16px;
    color: var(--text);
}
.review__reply strong { color: var(--gold); }

/* ——— Формы ——— */
.form { display: grid; gap: 16px; margin: 26px 0 40px; }
/* Кнопка в сетке иначе растягивается во всю ширину и читается полосой. */
.form .btn, .admin__card form .btn { justify-self: start; }
.field { display: grid; gap: 6px; }
.field > span { color: var(--gold); font-size: 16px; }
.field > span i { color: var(--dim); font-style: italic; font-size: 14px; }
.field small { color: var(--dim); font-size: 14px; }
input[type=text], input[type=email], input[type=password], textarea, select {
    width: 100%;
    padding: 12px 14px;
    font: 400 17px/1.5 'Old Standard', Georgia, serif;
    color: var(--text);
    background: rgba(5, 13, 28, 0.75);
    border: 1px solid rgba(230, 189, 99, 0.28);
    border-radius: var(--radius);
    transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(230, 189, 99, 0.12);
}
textarea { resize: vertical; }
.form__trap { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.check { display: flex; align-items: center; gap: 10px; color: var(--dim); }

.notice {
    padding: 14px 18px;
    border-radius: var(--radius);
    border-left: 3px solid var(--gold);
    background: rgba(230, 189, 99, 0.08);
    margin: 18px 0;
}
.notice p { margin: 0 0 6px; }
.notice--good { border-left-color: #6fbf73; background: rgba(111, 191, 115, 0.1); }
.notice--bad { border-left-color: var(--vermilion); background: rgba(212, 42, 28, 0.12); }

/* ——— Документы ——— */
.doc h2 {
    margin: 34px 0 10px;
    font-family: 'Ruslan Display', serif;
    font-weight: 400;
    font-size: 24px;
    letter-spacing: 0.03em;
    color: var(--gold);
}
.doc p, .doc li { color: var(--text); }
.doc__meta { color: var(--dim); font-size: 16px; }
.doc__summary {
    margin: 22px 0;
    padding: 20px 22px;
    background: rgba(230, 189, 99, 0.07);
    border: 1px solid rgba(230, 189, 99, 0.22);
    border-radius: var(--radius);
}
.doc__summary p { margin: 0; }
.doc code {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.86em;
    color: var(--warm);
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 5px;
    border-radius: 3px;
}
.doc__table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 16px; }
.doc__table th, .doc__table td {
    padding: 12px 14px;
    border: 1px solid rgba(230, 189, 99, 0.2);
    vertical-align: top;
    text-align: left;
}
.doc__table th { color: var(--gold); font-weight: 400; background: rgba(230, 189, 99, 0.06); }

/* ——— Подвал ——— */
.footer {
    position: relative;
    z-index: 1;
    margin-top: 40px;
    padding: 50px 0 26px;
    background: rgba(4, 10, 22, 0.6);
    border-top: 1px solid rgba(230, 189, 99, 0.2);
}
.footer__grid {
    display: grid;
    grid-template-columns: 120px repeat(3, 1fr);
    gap: 30px;
}
.footer__pilgrim { width: 96px; height: 96px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .6)); }
.footer__col h3 {
    margin: 0 0 12px;
    font-family: 'Ruslan Display', serif;
    font-weight: 400;
    font-size: 19px;
    color: var(--gold);
    letter-spacing: 0.03em;
}
.footer__col a { display: block; margin-bottom: 7px; color: var(--dim); font-size: 16px; }
.footer__col a:hover { color: var(--gold); }
.footer__name { margin: 0 0 6px; color: var(--text); }
.footer__note { color: var(--dim); font-size: 15px; margin-top: 10px; }
.footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid rgba(230, 189, 99, 0.14);
    color: var(--dim);
    font-size: 15px;
}

/* ——— Появление при прокрутке ——— */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .7s ease, transform .7s ease;
    transition-delay: var(--delay, 0ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ——— Админка ——— */
.admin { font-size: 17px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login__box {
    width: min(100%, 380px);
    display: grid;
    gap: 16px;
    padding: 32px;
    background: rgba(11, 28, 57, 0.9);
    border: 1px solid rgba(230, 189, 99, 0.25);
    border-radius: var(--radius);
}
.login__box h1 {
    margin: 0;
    font-family: 'Ruslan Display', serif;
    font-weight: 400;
    font-size: 26px;
    color: var(--gold);
    text-align: center;
}
.login__note { text-align: center; margin: 0; font-size: 15px; }
.admin__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px max(20px, calc((100vw - 1000px) / 2));
    background: rgba(6, 15, 32, 0.9);
    border-bottom: 1px solid rgba(230, 189, 99, 0.2);
    color: var(--gold);
}
.admin__top nav { display: flex; gap: 18px; font-size: 16px; }
.admin__body { width: min(100% - 40px, 1000px); margin: 26px auto 60px; }
.admin__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.admin__stats div {
    padding: 16px;
    text-align: center;
    background: rgba(11, 28, 57, 0.8);
    border: 1px solid rgba(230, 189, 99, 0.2);
    border-radius: var(--radius);
}
.admin__stats b { display: block; font-size: 28px; color: var(--gold-hi); }
.admin__stats span { color: var(--dim); font-size: 15px; }
.admin__card {
    padding: 24px;
    margin-bottom: 22px;
    background: rgba(8, 20, 40, 0.8);
    border: 1px solid rgba(230, 189, 99, 0.18);
    border-radius: var(--radius);
}
.admin__card h2 {
    margin: 0 0 16px;
    font-family: 'Ruslan Display', serif;
    font-weight: 400;
    font-size: 24px;
    color: var(--gold);
}
.admin__card form { display: grid; gap: 14px; max-width: 620px; }
.admin__review {
    padding: 16px;
    margin-bottom: 14px;
    background: rgba(11, 28, 57, 0.7);
    border-left: 2px solid var(--gold-dim);
    border-radius: var(--radius);
}
.admin__review--hidden { opacity: 0.62; border-left-color: var(--vermilion); }
.admin__review header { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; }
.admin__review header span { color: var(--dim); font-size: 15px; }
.admin__contact { color: var(--warm) !important; }
.admin__flag { margin-left: auto; font-style: italic; }
.admin__reply { color: var(--warm); font-size: 16px; }
.admin__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.admin__actions form { display: flex; gap: 8px; margin: 0; }
.admin__replyform { flex: 1 1 320px; }
.admin__actions button {
    padding: 7px 14px;
    font: 400 15px 'Old Standard', Georgia, serif;
    color: var(--gold);
    background: rgba(230, 189, 99, 0.08);
    border: 1px solid rgba(230, 189, 99, 0.3);
    border-radius: var(--radius);
    cursor: pointer;
}
.admin__actions button.danger { color: #ff9d92; border-color: rgba(212, 42, 28, 0.5); }
.admin__upload { margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(230, 189, 99, 0.15); }

/* ——— Узкие экраны ——— */
@media (max-width: 900px) {
    .hero__grid { grid-template-columns: 1fr; text-align: center; }
    .hero__lead { margin-left: auto; margin-right: auto; }
    .hero__actions { justify-content: center; }
    .crossbox { max-width: 320px; margin: 10px auto 0; }
    .download { grid-template-columns: 1fr; }
    .download__body .section__title { text-align: center; }
    .download__body .lozenge { justify-content: center; }
    .footer__grid { grid-template-columns: 1fr 1fr; }
    .topbar__nav a:not(.topbar__cta) { display: none; }
}
@media (max-width: 560px) {
    body { font-size: 17px; }
    .section { padding: 54px 0; }
    .footer__grid { grid-template-columns: 1fr; }
    .footer__pilgrim { width: 72px; height: 72px; }
    .review__sign { flex-direction: column; gap: 2px; }
}

/* Кому движение мешает — тому его не будет. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero__halo, .crossbox__svg, .crossbox__wave, .hero__scroll { animation: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .embers { display: none; }
}
