/* Third pass: visual QA fixes and a shorter checkout flow. */

:root {
    --v3-header-height: 5.25rem;
    --v3-radius: 1rem;
}

html { scroll-padding-top: calc(var(--v3-header-height) + 1.25rem); }

body {
    overflow-x: clip;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    background: #f4f0e8;
}

.ambient-scene {
    background:
        radial-gradient(ellipse 42rem 34rem at 7% 12%, rgba(211, 124, 54, .16), transparent 72%),
        radial-gradient(ellipse 50rem 36rem at 88% 8%, rgba(255, 255, 255, .86), transparent 70%),
        radial-gradient(ellipse 44rem 36rem at 82% 58%, rgba(88, 116, 132, .09), transparent 72%),
        linear-gradient(145deg, #f7f3ec 0%, #f1ece2 52%, #f6f2ea 100%);
    background-size: auto;
}
.ambient-scene::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .16;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}
/* Мягкость орбов достигается прозрачным краем градиента, а не filter:blur —
   анимированный blur на areas по 30rem+ репейнтит пол-экрана каждый кадр */
.ambient-orb {
    filter: none;
    opacity: .55;
    animation-duration: 24s;
    will-change: transform;
}
.ambient-orb-a { width: 30rem; height: 30rem; left: -10rem; top: 10rem; background: radial-gradient(circle at 40% 40%, rgba(216, 137, 79, .34), rgba(216, 137, 79, .05) 62%, transparent 70%); }
.ambient-orb-b { width: 36rem; height: 36rem; right: -13rem; top: 28rem; background: radial-gradient(circle at 45% 45%, rgba(124, 155, 173, .26), rgba(124, 155, 173, .04) 60%, transparent 70%); }
.ambient-orb-c { width: 28rem; height: 28rem; left: 38%; top: 34rem; background: radial-gradient(circle, rgba(223, 174, 121, .22), transparent 66%); }
.contour-map, .map-coordinate { display: none !important; }

.skip-link {
    position: fixed;
    top: .75rem;
    left: .75rem;
    z-index: 120;
    padding: .75rem 1rem;
    border-radius: .7rem;
    color: #fff;
    background: #25241f;
    transform: translateY(-150%);
    transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }
.lb-close, .modal .close-btn { appearance: none; }

.header {
    top: .75rem;
    left: 50%;
    width: calc(100% - 2rem);
    max-width: none;
    min-height: var(--v3-header-height);
    margin: 0;
    padding: 0;
    border-radius: 1rem;
    transform: translateX(-50%);
    transform-origin: top center;
    transition:
        transform .26s cubic-bezier(.25, 1, .5, 1),
        background-color .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}

.header-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    width: 100%;
    max-width: none;
    min-height: var(--v3-header-height);
    padding-inline: 1.25rem;
}
.header .logo { justify-self: start; }
.header .nav { justify-self: center; }
.header .header-right { justify-self: end; }
.header .nav a { padding-block: .8rem; }
.header.is-scrolled {
    transform: translateX(-50%) translateY(-.3rem) scale(.88);
    background: rgba(251, 249, 244, .96);
    border-color: rgba(37, 36, 31, .16);
    box-shadow: 0 1rem 3rem rgba(55, 46, 34, .14);
}
.section, .trust-section { scroll-margin-top: calc(var(--v3-header-height) + 1.25rem); }
.section-heading { margin-bottom: clamp(2rem, 3vw, 3.25rem); }
.section-heading .section-title { line-height: .98; text-wrap: balance; }
.section-heading > p { text-wrap: pretty; }

/* Hero: keep the product visual inside the viewport at ordinary laptop widths. */
.hero { min-height: auto; padding-top: clamp(7.5rem, 9vw, 8.75rem); padding-bottom: 5.5rem; }
.hero-container {
    width: 100%;
    max-width: none;
    grid-template-columns: minmax(31rem, .85fr) minmax(36rem, 1.15fr);
    gap: clamp(3rem, 3.5vw, 4rem);
    padding-inline: clamp(1.5rem, 3vw, 4rem);
}
.hero-text { align-items: flex-start; }
.hero-eyebrow { margin-inline: 0; }
.hero h1 { font-size: clamp(3.7rem, 5.5vw, 5.9rem); }
.hero-stats { margin: 2.35rem 0 0; gap: 2rem; }
.hero-actions { width: 100%; margin-top: 2.1rem; gap: .5rem; justify-content: flex-start; }
.hero-actions .btn { padding-inline: 1.15rem; }
.hero-visual { padding: 0; }
.hero-visual::before, .hero-visual::after,
.hero-window-label, .hero-float-card { display: none !important; }
.hero-img {
    max-width: 64rem;
    transform: none;
    border-color: rgba(27, 30, 34, .16);
    border-radius: .85rem;
    box-shadow: 0 2.5rem 5.5rem rgba(51, 43, 32, .2), 0 .5rem 1.5rem rgba(51, 43, 32, .08);
}
.hero-visual { width: 100%; justify-self: end; }

/* Features: reduce dead space while preserving the asymmetric editorial grid. */
#features { padding-top: 5.5rem; padding-bottom: 6.5rem; }
.features-grid { box-shadow: 0 1.5rem 4rem rgba(53, 44, 31, .08); }
.feature-card { min-height: 12.5rem; padding: clamp(1.7rem, 2.4vw, 2.4rem); }
.feature-card h3 { margin-top: 1.7rem; }
.feature-card p { max-width: 58ch; font-size: .93rem; line-height: 1.65; }

/* Gallery: the fourth image no longer hangs into the next section. */
#capabilities { padding-bottom: 6.5rem; }
.gallery { position: relative; grid-template-rows: 14rem 14rem; }
.gallery-item:nth-child(4) {
    position: relative;
    right: auto;
    bottom: auto;
    width: auto;
    transform: none;
    border: 0;
    z-index: auto;
}
.gallery-item:first-child img { min-height: 29rem; }
.gallery-item img { min-height: 14rem; }

/* Rewards: no giant empty canvas when the API returns no history. */
#rewards { min-height: 0; }
#rewards > .container {
    display: grid;
    grid-template-columns: minmax(18rem, .75fr) minmax(0, 1.25fr);
    gap: 2rem 5rem;
    align-items: start;
}
#rewards .section-heading { grid-row: 1 / span 3; }
#rewards .reward-rules { grid-column: 2; margin: 0; }
#rewards .reward-cards { align-items: stretch; }
#rewards .reward-card { min-height: 8.5rem; }
#rewards #rewards-loading,
#rewards #rewards-history,
#rewards #trophy-holders-section,
#rewards > .container > .reveal:not(.section-heading):not(.reward-rules) {
    grid-column: 2;
    margin-block: 0 !important;
}
#rewards #rewards-loading { min-height: 3rem; }

/* Reviews: balanced card sizes and readable long copy. */
.reviews-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 1rem; }
.review-card { min-width: 0; min-height: 0; padding: 1.6rem !important; }
.review-card:first-child { grid-column: 1 / -1 !important; columns: 2; column-gap: 3rem; }
.review-card:first-child .review-header { column-span: all; }
.review-card p { overflow-wrap: anywhere; color: #4d5563 !important; font-size: .94rem !important; line-height: 1.7 !important; }

/* Pricing: one compact row on wide screens instead of a two-screen table. */
#pricing { padding-top: 6rem; padding-bottom: 6.5rem; }
.pricing-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; }
.price-card,
.price-card:nth-child(4),
.price-card:nth-child(5) {
    grid-column: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    min-height: 28rem;
    padding: 1.45rem;
    border-radius: 1rem;
}
.price-card:nth-child(4) .price-head,
.price-card:nth-child(4) .price-amount,
.price-card:nth-child(4) .price-old,
.price-card:nth-child(4) .price-per-day,
.price-card:nth-child(4) .price-features,
.price-card:nth-child(4) .btn { grid-column: auto; grid-row: auto; }
.price-head { min-height: 5rem; }
.price-head h3 { font-size: 1.25rem; }
.price-amount { margin-top: 1.25rem; font-size: clamp(2rem, 2.8vw, 2.65rem); }
.price-features { margin-top: 1.25rem; }
.price-features li { align-items: flex-start; font-size: .78rem; line-height: 1.45; }
.price-card .btn { min-height: 2.8rem; }

/* Footer information was technically present but too dim. */
.footer { color: #ddd7cd; }
.footer .footer-brand-line { color: #f7f3eb !important; }
.footer p, .footer a, .footer-legal-list, .footer-bottom, .footer .legal { color: #d4cec4 !important; }
.footer .footer-tagline { color: #ddd7cd !important; }
.footer .footer-legal-list b { color: #f5f1e9 !important; }
.footer h4 { color: #fff !important; }
.footer .footer-socials a { color: #f4eee5 !important; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.1); }
.footer .footer-bottom { border-color: rgba(255,255,255,.16); }
.footer a:hover { color: #f0a063 !important; }

/* Checkout: one short card, one required field, optional details below. */
#modal-email { padding: 1rem; align-items: center; }
#modal-email .modal-content.checkout-modal {
    width: min(34rem, calc(100vw - 2rem));
    max-width: 34rem;
    max-height: min(46rem, calc(100dvh - 2rem));
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 1.25rem;
    background: #fffdf8;
    box-shadow: 0 2rem 6rem rgba(20, 18, 15, .3);
}
#modal-email .modal-handle { display: none; }
#modal-email .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid rgba(37,36,31,.12);
    border-radius: .8rem;
    color: #25241f;
    background: rgba(255,255,255,.8);
    font: 400 1.45rem/1 Arial, sans-serif;
    cursor: pointer;
}
#modal-email .close-btn:hover { background: #f1ece3; transform: none; }
#modal-email .checkout-shell { display: block; min-height: 0; }
#modal-email .checkout-summary {
    display: block;
    padding: 1.6rem 4.5rem 1.35rem 1.6rem;
    color: #25241f;
    background: linear-gradient(135deg, #f5eee3, #ece4d7);
    overflow: visible;
}
#modal-email .checkout-summary::after { display: none; }
#modal-email .checkout-titlebar { display: block; }
#modal-email .checkout-kicker { color: #ae5c20; font-size: .67rem; }
#modal-email .checkout-summary h2 {
    max-width: none;
    margin: .55rem 0 0;
    color: #25241f;
    font-size: 1.75rem;
    line-height: 1.05;
    letter-spacing: -.035em;
}
#modal-email .checkout-summary p { display: block; max-width: 31rem; margin: .7rem 0 0; color: #62605a; font-size: .88rem; line-height: 1.55; }
#modal-email .checkout-plan {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: .2rem 1rem;
    margin-top: 1rem;
    padding: .9rem 1rem;
    border: 1px solid rgba(37,36,31,.11);
    border-radius: .85rem;
    background: rgba(255,255,255,.62);
    backdrop-filter: none;
}
#modal-email .checkout-plan span { grid-column: 1 / -1; color: #79756d; font-size: .62rem; }
#modal-email .checkout-plan strong { color: #25241f; font-size: 1.05rem; }
#modal-email .checkout-plan small { color: #ae5c20; font-size: 1rem; font-weight: 750; }
#modal-email .checkout-benefits { display: none; }
#modal-email .checkout-benefit { padding: 0; color: #67635c; background: transparent; font-size: .7rem; }
#modal-email .checkout-benefit i { color: #bc6b24; }
#modal-email .checkout-form { padding: 1.35rem 1.6rem 1.6rem; overflow: visible; background: #fffdf8; }
#modal-email .checkout-section-title { margin-bottom: .7rem; }
#modal-email .checkout-section-title h3 { font-size: 1.05rem; }
#modal-email .checkout-section-title span { font-size: .68rem; }
#modal-email .checkout-assurance { display: block; margin-bottom: 1rem; font-size: .7rem; line-height: 1.6; }
#modal-email .checkout-assurance span { display: block; }
#modal-email .payment-provider { display: none; }
#modal-email .checkout-grid { display: block; }
#modal-email .email-field label { margin-bottom: .45rem; font-size: .78rem; }
#modal-email .email-field input { min-height: 3.25rem; padding: .8rem 1rem; font-size: 1rem; border-radius: .75rem; }
#modal-email .email-error { min-height: 0; }
.checkout-optional { margin-top: .8rem; border-top: 1px solid rgba(37,36,31,.1); }
.checkout-optional summary { padding: .85rem 0; color: #55524c; font-size: .76rem; font-weight: 650; cursor: pointer; }
.checkout-optional summary span { color: #989189; font-weight: 400; }
.checkout-optional[open] summary { color: #25241f; }
.checkout-optional .email-field { padding-bottom: .75rem; }
#modal-email .checkout-tg-link { display: none; }
#modal-email #tg-link-label { color: #35332e !important; font-size: .75rem; }
#modal-email .tg-link-sub { color: #817b72; font-size: .66rem; }
#modal-email .checkout-tg-btn { min-height: 2.5rem; padding: .6rem .8rem; font-size: .7rem; }
#modal-email .email-actions { display: block; margin-top: 1rem; }
#modal-email .email-actions .btn { width: 100%; min-height: 3.25rem; }
#modal-email .email-actions .btn-secondary { display: none; }
#modal-email .email-note { margin-top: .75rem; color: #817b72; font-size: .62rem; line-height: 1.5; }

:where(a, button, input, summary):focus-visible {
    outline: 3px solid rgba(188,107,36,.5);
    outline-offset: 3px;
}

@media (max-width: 1180px) {
    .hero-container { grid-template-columns: 1fr 1fr; }
    .pricing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .price-card, .price-card:nth-child(4), .price-card:nth-child(5) { min-height: 27rem; }
}

@media (max-width: 900px) {
    :root { --v3-header-height: 4.65rem; }
    .header { width: calc(100% - 1rem); top: .5rem; }
    .hero { padding-top: 6.5rem; }
    .hero-container { grid-template-columns: 1fr; }
    .hero-visual { max-width: 48rem; margin-inline: auto; }
    .gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto;
    }
    .gallery-item,
    .gallery-item:first-child,
    .gallery-item:nth-child(4) { grid-row: auto; }
    .gallery-item img,
    .gallery-item:first-child img { min-height: 0; aspect-ratio: 16 / 9; }
    #rewards > .container { display: block; }
    #rewards .reward-rules { margin-top: 2rem; }
    .reviews-grid { grid-template-columns: 1fr !important; }
    .review-card:first-child { grid-column: auto !important; columns: auto; }
    .pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: row;
        grid-auto-columns: auto;
        overflow: visible;
        padding-bottom: 0;
    }
}

@media (max-width: 640px) {
    :root { --v3-header-height: 4.15rem; }
    html { scroll-padding-top: calc(var(--v3-header-height) + .75rem); }
    .header { min-height: var(--v3-header-height); }
    .header.is-scrolled { transform: translateX(-50%) translateY(-.2rem) scale(.94); }
    .header-content { min-height: var(--v3-header-height); }
    .hero { padding-top: 5.75rem; padding-bottom: 4rem; }
    .hero h1 { font-size: clamp(3.1rem, 15vw, 4.2rem); }
    .hero-text > p { font-size: 1rem; }
    .hero-proof { display: grid; gap: .6rem; }
    .hero-float-card { display: none; }
    .section, .trust-section { padding-block: 4.5rem; }
    .section-heading .section-title { font-size: clamp(2.35rem, 12vw, 3.25rem); }
    .features-grid { display: block; }
    .feature-card { min-height: 0; padding: 1.5rem; border-bottom: 1px solid rgba(37,36,31,.12); }
    .feature-card:last-child { border-bottom: 0; }
    .gallery { display: grid; grid-template-columns: 1fr; grid-template-rows: auto; gap: .75rem; }
    .gallery-item, .gallery-item:first-child { grid-row: auto; }
    .gallery-item img, .gallery-item:first-child img { min-height: 0; aspect-ratio: 16 / 9; }
    .reward-cards { grid-template-columns: 1fr; }
    .reviews-external > div { display: grid !important; }
    .pricing-grid {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(16.5rem, 82vw);
        grid-template-columns: none;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 1rem;
        padding: 0 1rem .8rem;
        margin-inline: -1rem;
    }
    .price-card, .price-card:nth-child(4), .price-card:nth-child(5) { min-height: 26rem; scroll-snap-align: start; }
    #modal-email { padding: 0; align-items: flex-end; }
    #modal-email .modal-content.checkout-modal {
        width: 100%;
        max-width: none;
        max-height: calc(100dvh - .5rem);
        border-radius: 1.15rem 1.15rem 0 0;
    }
    #modal-email .checkout-summary { padding: 1.35rem 4.25rem 1.1rem 1.15rem; }
    #modal-email .checkout-summary h2 { font-size: 1.55rem; }
    #modal-email .checkout-summary p { font-size: .8rem; }
    #modal-email .checkout-form { padding: 1.15rem 1.15rem calc(1.5rem + env(safe-area-inset-bottom)); }
    #modal-email .checkout-tg-link { align-items: center; }
    #modal-email .checkout-tg-btn { min-width: 6.2rem; min-height: 2.75rem; }
}

@media (hover: hover) {
    .checkout-optional summary:hover { color: #bc6b24; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-float-card, .ambient-orb, .ambient-contours path { animation: none !important; }
    .header { transition: none; }
}
