:root {
    --primary: #7A0F78;
    --dark: #4A0059;
    --magenta: #B31273;
    --blue: #2D2452;
    --bg: #F4F4F6;
    --white: #fff;
    --ink: #171326;
    --muted: #6F687A;
    --line: rgba(74, 0, 89, .14);
    --gold: #BFA46A;
    --shadow: 0 24px 70px rgba(45, 36, 82, .16)
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden
}

a {
    text-decoration: none;
    color: inherit
}

.container {
    width: min(1160px, calc(100% - 40px));
    margin: auto
}

.section {
    padding: 108px 0;
    position: relative
}

.narrow {
    max-width: 820px;
    text-align: center
}

.site-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none
}

.blob {
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 999px;
    filter: blur(44px);
    opacity: .18;
    animation: floatBlob 12s ease-in-out infinite alternate
}

.blob-one {
    top: 90px;
    left: -120px;
    background: var(--primary)
}

.blob-two {
    top: 45%;
    right: -150px;
    background: var(--magenta);
    animation-delay: 2s
}

.blob-three {
    bottom: -120px;
    left: 28%;
    background: var(--blue);
    animation-delay: 4s
}

.watermark {
    position: absolute;
    right: -20px;
    top: 110px;
    font-family: 'Playfair Display', serif;
    font-size: clamp(280px, 48vw, 760px);
    font-weight: 800;
    color: rgba(74, 0, 89, .045);
    line-height: .8
}

@keyframes floatBlob {
    to {
        transform: translate3d(28px, -32px, 0) scale(1.08)
    }
}

.nav-wrap {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 16px 0
}

.navbar {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(22px);
    box-shadow: 0 18px 48px rgba(45, 36, 82, .12)
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.brand-logo {
    width: 210px;
    height: 56px;
    overflow: hidden;
    border-radius: 8px;
    
    background: transparent
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block
}

.footer-brand.brand-logo {
    width: 250px;
    height: 68px;
    margin-bottom: 18px
}

.nav-panel {
    display: flex;
    align-items: center;
    gap: 18px
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px
}

.nav-links a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    padding: 0 13px;
    border-radius: 8px;
    color: #3B334B;
    font-size: 14px;
    font-weight: 700
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: rgba(122, 15, 120, .08)
}

.language-switch {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted)
}

.lang-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 800;
    padding: 8px 2px
}

.lang-btn.active {
    color: var(--primary)
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 10px
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--blue);
    margin: 5px 0
}

.hero {
    padding-top: 88px
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.04fr .96fr;
    gap: 56px;
    align-items: center;
    min-height: 620px
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--magenta);
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .16em
}

h1,
h2,
h3 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--blue);
    line-height: 1.08;
    margin: 0;
    letter-spacing: 0
}

h1 {
    font-size: clamp(44px, 6vw, 82px)
}

h2 {
    font-size: clamp(32px, 4vw, 54px)
}

h3 {
    font-size: 24px
}

.hero-subtitle,
.page-hero p,
.section-heading p,
.about-panel p {
    color: var(--muted);
    font-size: 19px;
    max-width: 640px
}

.hero-actions,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px
}

.btn {
    display: inline-flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 800;
    transition: .2s
}

.btn:hover {
    transform: translateY(-2px)
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--dark));
    box-shadow: 0 16px 32px rgba(122, 15, 120, .28)
}

.btn-secondary {
    color: var(--blue);
    background: rgba(255, 255, 255, .78);
    border-color: var(--line)
}

.hero-visual {
    min-height: 500px;
    position: relative
}

.ledger-card,
.mini-card,
.feature-card,
.service-card {
    /*Ensures the card itself doesn't refuse to shrink in a CSS Grid*/
    min-width: 0;
}

.service-card h2,
.service-card p {
    /* Forces long words to break into the next line */
    overflow-wrap: break-word;
    word-wrap: break-word;

    /* Optional: Adds hyphens where the word breaks (works because your JS updates the HTML lang attribute) */
    hyphens: auto; 
    -webkit-hyphens: auto;
}

.ledger-card,
.mini-card,
.feature-card,
.service-card,
.pricing-table,
.about-panel,
.value-card,
.contact-details,
.contact-form,
.accordion-item {
    border: 1px solid rgba(255, 255, 255, .8);
    background: rgba(255, 255, 255, .78);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    border-radius: 8px
}

.ledger-card {
    position: absolute;
    inset: 68px 58px auto 20px;
    padding: 38px;
    min-height: 330px
}

.ledger-card span,
.service-card span {
    color: var(--magenta);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .15em
}

.ledger-card strong {
    display: block;
    margin: 18px 0;
    font-family: 'Playfair Display', serif;
    font-size: 42px;
    line-height: 1.08;
    color: var(--blue);
    overflow-wrap: break-word;
    hyphens: auto
}

[lang=ru] .ledger-card {
    inset: 68px 18px auto 0;
    padding: 34px
}

[lang=ru] .ledger-card strong {
    font-size: clamp(30px, 2.25vw, 36px);
    line-height: 1.12
}

.ledger-card p {
    color: var(--muted);
    margin: 0
}

.mini-card {
    position: absolute;
    display: grid;
    gap: 2px;
    min-width: 140px;
    padding: 18px;
    animation: floatCard 5s ease-in-out infinite alternate
}

.mini-card b {
    color: var(--primary);
    font-size: 24px
}

.mini-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700
}

/* 1. Push the floating cards outward to clear the main text */
.mini-one { 
    top: -10px; 
    right: -15px; 
}

.mini-two { 
    bottom: 0px; 
    left: -35px; /* Pushes the ZUS card left, off the paragraph */
}

.mini-three { 
    bottom: -15px; 
    right: 15px; 
}

/* 2. Optimize the main card specifically for the heavier Russian text */
[lang="ru"] .ledger-card {
    inset: 50px 0 auto 0; /* Gives the card maximum width in its grid column */
    padding: 28px; /* Slightly reduced padding to maximize text space */
    min-height: 380px; /* Ensures the background covers the expanded text */
}

/* Optional: Prevent the awkward hyphenation in the main title */
[lang="ru"] .ledger-card strong {
    hyphens: none;
    -webkit-hyphens: none;
    font-size: clamp(28px, 2.2vw, 34px); /* Slightly smaller to fit the long words */
}

@keyframes floatCard {
    to {
        transform: translateY(-16px)
    }
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--line)
}

.trust-grid div {
    background: rgba(255, 255, 255, .82);
    padding: 26px
}

.trust-grid strong {
    display: block;
    color: var(--blue);
    font-size: 20px
}

.trust-grid span,
.feature-card p,
.service-card p,
.value-card p {
    color: var(--muted)
}

.split,
.about-grid,
.contact-grid {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 48px;
    align-items: start
}

.feature-grid,
.service-grid,
.values-grid {
    display: grid;
    gap: 20px
}

.feature-grid {
    grid-template-columns: repeat(3, 1fr)
}

.service-grid {
    grid-template-columns: repeat(3, 1fr)
}

.values-grid {
    grid-template-columns: repeat(2, 1fr)
}

.feature-card,
.service-card,
.value-card {
    padding: 30px;
    transition: .2s
}

.feature-card:hover,
.service-card:hover,
.value-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 80px rgba(45, 36, 82, .2)
}

.icon,
.service-card span {
    display: inline-flex;
    color: var(--gold);
    margin-bottom: 18px
}

.page-hero {
    padding-top: 88px;
    padding-bottom: 64px
}

.page-hero h1 {
    margin-bottom: 22px
}

.page-hero .eyebrow {
    width: fit-content;
    margin-left: auto;
    margin-right: auto
}

.page-hero p:not(.eyebrow) {
    margin-left: auto;
    margin-right: auto
}

.service-card {
    min-height: 280px
}

.cta-section {
    padding-top: 40px
}

.cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 44px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--dark) 58%, var(--primary));
    box-shadow: var(--shadow)
}

.cta-inner h2 {
    color: #fff;
    max-width: 780px
}

.cta-inner .eyebrow {
    color: #E6C985
}

.cta-inner .btn-primary {
    background: #fff;
    color: var(--dark);
    box-shadow: none
}

.pricing-stack {
    display: grid;
    gap: 28px
}

.pricing-table {
    overflow: hidden;
    background: rgba(255, 255, 255, .86)
}

.pricing-table h2 {
    padding: 28px 30px;
    color: #fff;
    background: linear-gradient(135deg, var(--dark), var(--primary));
    font-size: 28px
}

table {
    width: 100%;
    border-collapse: collapse
}

td {
    padding: 18px 30px;
    border-bottom: 1px solid var(--line);
    color: #382F47
}

td:last-child {
    text-align: right;
    color: var(--primary);
    font-weight: 800;
    white-space: nowrap
}

.about-panel,
.contact-details,
.contact-form {
    padding: 34px
}

.about-panel h2 {
    margin-bottom: 22px
}

.muted,
.form-note {
    color: var(--muted)
}

.contact-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--line)
}

.contact-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .14em
}

.contact-item a,
.contact-item strong {
    color: var(--blue);
    font-size: 19px;
    font-weight: 800
}

.contact-form {
    display: grid;
    gap: 18px
}

label span {
    display: block;
    margin-bottom: 8px;
    color: var(--blue);
    font-weight: 800
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 15px;
    background: rgba(255, 255, 255, .86);
    color: var(--ink);
    outline: none
}

.qr-card {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 18px;
    align-items: center;
    margin-top: 24px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .7)
}

.qr-card img {
    width: 132px;
    height: 132px;
    object-fit: cover;
    border-radius: 8px;
    border: 8px solid #fff;
    box-shadow: 0 12px 28px rgba(45, 36, 82, .12)
}

.map-wrap {
    margin-top: 28px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow)
}

.map-wrap iframe {
    display: block;
    width: 100%;
    height: 420px;
    border: 0
}

.faq-list {
    max-width: 900px;
    display: grid;
    gap: 16px
}

.accordion-trigger {
    width: 100%;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    background: transparent;
    padding: 0 26px;
    color: var(--blue);
    font-weight: 800;
    cursor: pointer;
    text-align: left
}

.accordion-trigger span {
    font-size: 18px
}

.accordion-trigger b {
    color: var(--primary);
    font-size: 26px;
    transition: .2s
}

.accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height .28s
}

.accordion-panel p {
    margin: 0;
    padding: 0 26px 24px;
    color: var(--muted)
}

.accordion-item.open .accordion-panel {
    max-height: 180px
}

.accordion-item.open b {
    transform: rotate(45deg)
}

.footer {
    margin-top: 40px;
    padding: 64px 0 26px;
    color: rgba(255, 255, 255, .78);
    background: #211A3F
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr .7fr 1fr;
    gap: 48px
}

.footer h3 {
    font-family: Inter, Arial, sans-serif;
    color: #fff;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .14em;
    margin-bottom: 16px
}

.footer p {
    color: rgba(255, 255, 255, .68)
}

.footer a {
    display: block;
    margin: 9px 0;
    color: rgba(255, 255, 255, .78)
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    margin-top: 42px;
    padding-top: 24px;
    font-size: 14px
}

.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 16px 34px rgba(74, 0, 89, .28);
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: .2s
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: .7s
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0)
}

@media(max-width:980px) {
    .nav-toggle {
        display: block
    }

    .brand-logo {
        width: 176px;
        height: 48px
    }

    .nav-panel {
        position: absolute;
        top: calc(100% + 10px);
        left: 20px;
        right: 20px;
        display: none;
        padding: 18px;
        border-radius: 8px;
        background: rgba(255, 255, 255, .95);
        box-shadow: var(--shadow)
    }

    .nav-panel.open {
        display: block
    }

    .nav-links {
        display: grid
    }

    .language-switch {
        margin-top: 12px
    }

    .hero-grid,
    .split,
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr
    }

    .hero-grid {
        min-height: auto
    }

    .hero-visual {
        min-height: 430px
    }

    .feature-grid,
    .service-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .cta-inner {
        align-items: flex-start;
        flex-direction: column
    }
}

@media(max-width:680px) {
    .container {
        width: min(100% - 28px, 1160px)
    }

    .section {
        padding: 76px 0
    }

    h1 {
        font-size: 42px
    }

    h2 {
        font-size: 32px
    }

    .hero {
        padding-top: 48px
    }

    .hero-visual {
        min-height: 470px
    }

    .ledger-card {
        inset: 48px 0 auto 0;
        padding: 28px
    }

    .ledger-card strong {
        font-size: 34px
    }

    [lang=ru] .ledger-card {
        inset: 48px 0 auto 0;
        padding: 26px
    }

    [lang=ru] .ledger-card strong {
        font-size: 30px
    }

    .mini-one {
        right: 0;
        top: 0
    }

    .mini-two {
        left: 0;
        bottom: 86px
    }

    .mini-three {
        right: 0;
        bottom: 22px
    }

    .trust-grid,
    .feature-grid,
    .service-grid,
    .values-grid,
    .footer-grid {
        grid-template-columns: 1fr
    }

    .cta-inner,
    .about-panel,
    .contact-details,
    .contact-form {
        padding: 28px
    }

    td {
        padding: 15px 18px
    }

    .footer-bottom {
        flex-direction: column
    }

    .qr-card {
        grid-template-columns: 1fr
    }

    .qr-card img {
        width: 150px;
        height: 150px
    }
}

html[lang="ru"] .service-card h2,
html[lang="ru"] .feature-card h2 {
    font-size: 26px; 
    letter-spacing: -0.02em;
    hyphens: none; 
    -webkit-hyphens: none;
}

.service-card h2,
.feature-card h2 {
    font-size: 32px; 
    line-height: 1.1;
    hyphens: none; 
    -webkit-hyphens: none;
}

@media (max-width: 768px) {
    /* 1. Handle the wrapper and iOS safe areas (notches) */
    .nav-wrap {
        width: 100%;
        box-sizing: border-box;
        padding-top: calc(16px + env(safe-area-inset-top));
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* 2. Restore the "floating pill" shape for the navbar */
    .navbar {
        width: calc(100% - 32px) !important; /* Creates the side margins */
        margin: 0 auto !important; /* Centers it perfectly */
        box-sizing: border-box;
        display: flex;
        justify-content: space-between;
        align-items: center;
        overflow: visible !important; /* Ensures the dropdown menu isn't cut off */
    }
    
    /* 3. Fix the Safari logo stretching bug */
    .brand-logo {
        width: 140px;      
        height: 48px;      
        overflow: hidden;
        min-width: 0 !important; 
        flex-shrink: 1;
    }
    
    .brand-logo img {
        width: 100%;       
        height: 100%;     
        object-fit: contain; 
    }
}

/* 1. Bulletproof iOS horizontal overflow fix at the root */
html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    /* Prevents iOS from auto-zooming on orientation change or form focus */
    -webkit-text-size-adjust: 100%; 
}

/* 2. Create a definitive viewport trap for the main content */
/* This stops the floating .hero-visual elements from triggering iOS scaling */
main {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* 1. Force the parent wrappers to never clip the dropdown */
.nav-wrap, .navbar {
    overflow: visible !important;
}

/* 2. Give the menu a safe max-height so it scrolls ONLY if the phone screen is super short */
@media (max-width: 980px) {
    .nav-panel {
        max-height: 75vh; 
        overflow-y: auto !important; 
    }
}