/* ============================================================
   Дизайн-система «Маршрут» — общие стили публичной части.
   Подключается на всех страницах: /css/marshrut.css
   Токены: блок :root-переменных внутри .marshrut-home.
   ============================================================ */

.marshrut-home {
    /* Дизайн-система «Маршрут»: бизнес-премиум минимализм.
       Идентичность: тёплая бумага + чернильный синий из логотипа,
       красный — только как «точки маршрута». */
    --mr-ink: #14263A;
    --mr-ink-hover: #1D3550;
    --mr-ink-soft: #5A6B7E;
    --mr-paper: #F7F5F0;
    --mr-surface: #FFFFFF;
    --mr-sky: #E8EFF6;
    --mr-sand: #F1EBE0;
    --mr-red: #E0322C;
    --mr-hairline: rgba(20, 38, 58, 0.10);
    --mr-radius-lg: 32px;
    --mr-radius: 20px;
    --mr-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --mr-shadow-lift: 0 28px 48px -28px rgba(20, 38, 58, 0.22);

    font-family: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--mr-ink);
    background: var(--mr-paper);
    line-height: 1.6;
    font-size: 16px;
}
.marshrut-home * { box-sizing: border-box; }

.mr-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 20px 0;
}
.mr-section {
    max-width: 1160px;
    margin: 0 auto;
    padding: 72px 20px 16px;
}

/* ---------- Типографика ---------- */
.mr-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mr-ink-soft);
    margin-bottom: 20px;
}
.mr-eyebrow::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mr-red);
    flex-shrink: 0;
}
.mr-h2 {
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin: 0 0 14px;
}
.mr-section-head { max-width: 640px; margin-bottom: 44px; }
.mr-section-head p { color: var(--mr-ink-soft); margin: 0; font-size: 1.05rem; }

/* ---------- Кнопки ---------- */
.mr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 30px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 0;
    transition: transform 0.3s var(--mr-ease), box-shadow 0.3s var(--mr-ease), background-color 0.3s var(--mr-ease);
}
.mr-btn-primary { background: var(--mr-ink); color: #fff; }
.mr-btn-primary:hover {
    background: var(--mr-ink-hover);
    transform: translateY(-2px);
    box-shadow: 0 16px 32px -14px rgba(20, 38, 58, 0.45);
}
.mr-btn-primary .mr-btn-arrow { transition: transform 0.3s var(--mr-ease); }
.mr-btn-primary:hover .mr-btn-arrow { transform: translateX(4px); }
.mr-btn-ghost {
    background: transparent;
    color: var(--mr-ink);
    box-shadow: inset 0 0 0 1.5px rgba(20, 38, 58, 0.25);
}
.mr-btn-ghost:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1.5px rgba(20, 38, 58, 0.6);
}

/* ---------- Hero: большой пастельный блок ---------- */
.mr-hero {
    background: var(--mr-sky);
    border-radius: var(--mr-radius-lg);
    padding: clamp(48px, 6vw, 88px) clamp(28px, 5vw, 80px);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 48px;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.mr-hero h1 {
    font-size: clamp(2.2rem, 4.6vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.06;
    margin: 0 0 22px;
}
.mr-hero h1 em { font-style: normal; color: var(--mr-red); white-space: nowrap; }
.mr-hero-lead {
    font-size: 1.1rem;
    color: var(--mr-ink-soft);
    max-width: 460px;
    margin: 0 0 32px;
}
.mr-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.mr-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0 26px;
    row-gap: 16px;
}
.mr-stat { position: relative; padding-right: 26px; }
.mr-stat:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 34px;
    background: var(--mr-hairline);
}
.mr-stat b {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.mr-stat span { font-size: 0.85rem; color: var(--mr-ink-soft); }

/* Hero-визуал: пунктирный маршрут + карточка вызова */
.mr-hero-visual { position: relative; min-height: 420px; }
.mr-route-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mr-route-path {
    fill: none;
    stroke: rgba(20, 38, 58, 0.30);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 1 12;
    animation: mr-route-march 26s linear infinite;
}
@keyframes mr-route-march { to { stroke-dashoffset: -260; } }
.mr-route-pin { animation: mr-pin-pulse 2.6s var(--mr-ease) infinite; transform-origin: center; }
@keyframes mr-pin-pulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.35; }
}

.mr-order-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(320px, 88%);
    background: var(--mr-surface);
    border-radius: var(--mr-radius);
    padding: 22px;
    box-shadow: 0 40px 70px -35px rgba(20, 38, 58, 0.35);
    animation: mr-float 7s ease-in-out infinite;
}
@keyframes mr-float {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-50%, calc(-50% - 10px)); }
}
.mr-order-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mr-ink-soft);
    margin-bottom: 16px;
}
.mr-live {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #17A96B;
    animation: mr-pin-pulse 1.8s ease-in-out infinite;
}
.mr-order-subject {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--mr-hairline);
    margin-bottom: 16px;
}
.mr-order-subject-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: var(--mr-sky);
    color: var(--mr-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mr-order-subject-icon svg { width: 18px; height: 18px; }
.mr-order-tutor { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.mr-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--mr-ink);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.mr-order-tutor .mr-name { font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.mr-order-tutor .mr-meta { font-size: 0.83rem; color: var(--mr-ink-soft); }
.mr-order-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--mr-ink-soft);
}
.mr-order-eta { font-weight: 600; color: var(--mr-ink); }

.mr-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--mr-surface);
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 18px 36px -18px rgba(20, 38, 58, 0.3);
    animation: mr-float-chip 6s ease-in-out infinite;
}
.mr-chip .mr-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mr-red); }
.mr-chip-1 { top: 6%; right: 4%; }
.mr-chip-2 { bottom: 8%; left: 2%; animation-delay: -3s; }
@keyframes mr-float-chip {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ---------- Строка поиска ---------- */
.mr-search-float {
    max-width: 940px;
    margin: -36px auto 0;
    position: relative;
    z-index: 10;
    padding: 0 20px;
}
.mr-search-box {
    background: var(--mr-surface);
    padding: 10px;
    border-radius: 999px;
    box-shadow: 0 30px 60px -30px rgba(20, 38, 58, 0.35);
    display: flex;
    gap: 4px;
    align-items: center;
}
.mr-input-wrap { flex: 1; min-width: 0; position: relative; }
.mr-input-wrap:first-child::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 28px;
    background: var(--mr-hairline);
}
.mr-input-wrap svg {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 19px; height: 19px;
    color: var(--mr-ink-soft);
    pointer-events: none;
}
.mr-input-wrap input {
    width: 100%;
    padding: 15px 16px 15px 50px;
    border: 0;
    background: transparent;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.98rem;
    color: var(--mr-ink);
    outline: none;
}
.mr-input-wrap input::placeholder { color: var(--mr-ink-soft); }
.mr-search-box .mr-btn { padding: 15px 30px; flex-shrink: 0; }

/* ---------- Как это работает: остановки маршрута ---------- */
.mr-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    counter-reset: mr-stop;
}
.mr-step { position: relative; padding-top: 34px; }
.mr-step::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 30px;
    right: -28px;
    border-top: 2px dashed rgba(20, 38, 58, 0.18);
}
.mr-step:last-child::before { display: none; }
.mr-step-marker {
    counter-increment: mr-stop;
    position: absolute;
    top: 0;
    left: 0;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--mr-paper);
    border: 2px solid var(--mr-ink);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mr-step-marker::after {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--mr-red);
    transform: scale(0);
    transition: transform 0.3s var(--mr-ease);
}
.mr-step:hover .mr-step-marker::after { transform: scale(1); }
.mr-step h3 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
}
.mr-step h3 small {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--mr-ink-soft);
    margin-bottom: 6px;
}
.mr-step p { color: var(--mr-ink-soft); font-size: 0.95rem; margin: 0; }

/* ---------- Преимущества: borderless-карточки ---------- */
.mr-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.mr-feature-card {
    background: var(--mr-surface);
    padding: 30px 26px;
    border-radius: var(--mr-radius);
    transition: transform 0.35s var(--mr-ease), box-shadow 0.35s var(--mr-ease);
}
.mr-feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--mr-shadow-lift);
}
.mr-feature-icon {
    width: 52px; height: 52px;
    background: var(--mr-sky);
    color: var(--mr-ink);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    transition: background-color 0.35s var(--mr-ease), color 0.35s var(--mr-ease);
}
.mr-feature-card:hover .mr-feature-icon { background: var(--mr-ink); color: #fff; }
.mr-feature-icon svg { width: 24px; height: 24px; }
.mr-feature-card h3 { margin: 0 0 8px; font-size: 1.08rem; font-weight: 700; letter-spacing: -0.01em; }
.mr-feature-card p { color: var(--mr-ink-soft); font-size: 0.92rem; margin: 0; }

/* ---------- Предметы ---------- */
.mr-subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}
.mr-subject-card {
    position: relative;
    background: var(--mr-surface);
    padding: 16px 40px 16px 18px;
    border-radius: 18px;
    text-decoration: none;
    color: var(--mr-ink);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    transition: transform 0.3s var(--mr-ease), box-shadow 0.3s var(--mr-ease);
}
.mr-subject-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--mr-shadow-lift);
}
.mr-subject-icon {
    width: 42px; height: 42px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mr-ink);
    flex-shrink: 0;
}
.mr-subject-icon svg { width: 20px; height: 20px; }
.mr-subject-arrow {
    position: absolute;
    right: 18px;
    top: 50%;
    opacity: 0;
    transform: translateY(-50%) translateX(-8px);
    transition: opacity 0.3s var(--mr-ease), transform 0.3s var(--mr-ease);
    color: var(--mr-ink);
}
.mr-subject-card:hover .mr-subject-arrow { opacity: 1; transform: translateY(-50%); }
/* ---------- Отзывы ---------- */
.mr-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.mr-review-card {
    background: var(--mr-surface);
    padding: 30px 28px;
    border-radius: var(--mr-radius);
    display: flex;
    flex-direction: column;
    transition: transform 0.35s var(--mr-ease), box-shadow 0.35s var(--mr-ease);
}
.mr-review-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--mr-shadow-lift);
}
.mr-review-quote {
    font-size: 2.4rem;
    line-height: 1;
    font-weight: 800;
    color: var(--mr-red);
    height: 26px;
}
.mr-review-text { color: var(--mr-ink); margin: 0 0 24px; line-height: 1.65; font-size: 0.97rem; }
.mr-review-author { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.mr-review-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--mr-sky);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--mr-ink);
    font-size: 0.85rem;
    flex-shrink: 0;
}
.mr-review-name { font-weight: 600; font-size: 0.95rem; }
.mr-review-role { font-size: 0.84rem; color: var(--mr-ink-soft); }

/* ---------- Финальный CTA ---------- */
.mr-cta-band {
    background: var(--mr-ink);
    color: #fff;
    border-radius: var(--mr-radius-lg);
    padding: clamp(48px, 6vw, 80px) clamp(28px, 5vw, 80px);
    position: relative;
    overflow: hidden;
    text-align: center;
}
.mr-cta-band .mr-eyebrow { color: rgba(255, 255, 255, 0.65); justify-content: center; }
.mr-cta-band h2 {
    font-size: clamp(1.8rem, 3.6vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.12;
    margin: 0 auto 16px;
    max-width: 640px;
}
.mr-cta-band p {
    color: rgba(255, 255, 255, 0.7);
    max-width: 480px;
    margin: 0 auto 32px;
}
.mr-cta-band .mr-btn-primary { background: #fff; color: var(--mr-ink); }
.mr-cta-band .mr-btn-primary:hover { background: var(--mr-paper); box-shadow: 0 16px 32px -14px rgba(0, 0, 0, 0.5); }
.mr-cta-band .mr-btn-ghost { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35); }
.mr-cta-band .mr-btn-ghost:hover { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.8); }
.mr-cta-route {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.35;
}
.mr-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; position: relative; }
.mr-footer-pad { height: 88px; }

/* ---------- Позиционирование: живой учитель ---------- */
.mr-plate {
    background: var(--mr-sand);
    border-radius: var(--mr-radius-lg);
    padding: clamp(40px, 5vw, 72px);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 48px;
    align-items: center;
}
.mr-plate .mr-section-head { margin-bottom: 0; }
.mr-quote-card {
    background: var(--mr-surface);
    border-radius: var(--mr-radius);
    padding: 32px;
    box-shadow: 0 30px 60px -35px rgba(20, 38, 58, 0.25);
}
.mr-quote-text {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.55;
    margin: 0 0 18px;
}
.mr-quote-sign {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--mr-ink-soft);
}
.mr-pin-mini { width: 14px; height: 20px; flex-shrink: 0; }

/* ---------- География: карта с пинами ---------- */
.mr-geo-card {
    background: var(--mr-surface);
    border-radius: var(--mr-radius-lg);
    padding: clamp(36px, 4.5vw, 64px);
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 48px;
    align-items: center;
}
.mr-geo-card .mr-section-head { margin-bottom: 0; }
.mr-geo-map { width: 100%; height: auto; display: block; }
.mr-geo-map text {
    font-family: 'Golos Text', sans-serif;
    font-size: 13px;
    font-weight: 600;
    fill: var(--mr-ink-soft);
}
.mr-map-pin-g { animation: mr-pin-bob 5s ease-in-out infinite; }
@keyframes mr-pin-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ---------- Scroll-reveal ---------- */
.mr-reveal {
    opacity: 0;
    transform: translateY(24px);
    /* easeOutExpo — быстрый вылет, мягкая посадка */
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--d, 0s);
}
.mr-reveal.is-in { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .mr-reveal { opacity: 1; transform: none; transition: none; }
    .mr-order-card, .mr-chip, .mr-route-path, .mr-route-pin, .mr-live { animation: none; }
    .marshrut-home * { transition-duration: 0.01ms !important; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
    .mr-hero { grid-template-columns: 1fr; gap: 24px; }
    .mr-plate, .mr-geo-card { grid-template-columns: 1fr; gap: 32px; }
    .mr-geo-map text { font-size: 15px; }
    .mr-hero-visual { min-height: 360px; }
    .mr-steps { grid-template-columns: 1fr; gap: 32px; }
    .mr-step { padding-top: 0; padding-left: 44px; }
    .mr-step::before {
        top: 26px;
        bottom: -32px;
        left: 10px;
        right: auto;
        border-top: 0;
        border-left: 2px dashed rgba(20, 38, 58, 0.18);
    }
}
@media (max-width: 768px) {
    .mr-section { padding: 52px 20px 8px; }
    .mr-hero-actions .mr-btn { width: 100%; }
    .mr-search-float { margin-top: -28px; }
    .mr-search-box { flex-direction: column; border-radius: 24px; gap: 0; }
    .mr-search-box .mr-input-wrap { width: 100%; }
    .mr-input-wrap:first-child::after {
        left: 20px; right: 20px;
        top: auto; bottom: 0;
        width: auto; height: 1px;
        transform: none;
    }
    .mr-search-box .mr-btn { width: 100%; margin-top: 8px; }
    .mr-chip-1 { top: 2%; right: 0; }
    .mr-chip-2 { bottom: 2%; left: 0; }
    .mr-stat { padding-right: 24px; }
    .mr-stat:not(:last-child)::after { display: none; }
    .mr-footer-pad { height: 56px; }
}
