/*
 * Final visual polish layer.
 * Kept separate from the legacy styles so it can be reviewed or removed as
 * one unit while other sessions continue to work on page content and logic.
 */

:root {
    --ui-ink: #12213d;
    --ui-muted: #52627d;
    --ui-blue: #1259df;
    --ui-blue-dark: #0a48c9;
    --ui-surface: #ffffff;
    --ui-subtle: #f6f9fe;
    --ui-line: #dbe5f2;
    --ui-shadow: 0 14px 36px rgba(18, 33, 61, .08);
}

body {
    color: var(--ui-ink);
    background: var(--ui-surface);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px #0b3b91;
}

/* Keep the skip link available to keyboards without creating RTL overflow. */
.skip-link {
    position: fixed;
    z-index: 1000;
    top: 0;
    right: 50%;
    left: auto;
    width: max-content;
    max-width: calc(100vw - 24px);
    padding: 8px 12px;
    background: #fff;
    color: var(--ui-blue-dark);
    transform: translate(50%, -150%);
}

.skip-link:focus {
    top: 12px;
    right: 50%;
    left: auto;
    transform: translateX(50%);
}

.site-header {
    border-bottom: 1px solid rgba(219, 229, 242, .86);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 1px 0 rgba(18, 33, 61, .02);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.brand {
    color: var(--ui-ink);
    letter-spacing: -.02em;
}

.main-nav a {
    color: #34445f;
    transition: color .18s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    color: var(--ui-blue);
}

.main-nav a.active {
    color: var(--ui-blue-dark);
    border-bottom-color: var(--ui-blue);
}

.button {
    border-radius: 9px;
    color: #fff;
    box-shadow: 0 6px 16px rgba(18, 89, 223, .16);
}

.button:hover {
    box-shadow: 0 10px 24px rgba(18, 89, 223, .24);
}

.button-outline {
    border-color: #b9cbea;
    color: var(--ui-blue-dark);
    box-shadow: none;
}

.home-page #features,
#how-it-works,
#faq,
#downloads {
    scroll-margin-top: 104px;
}

.hero {
    position: relative;
    border-bottom: 1px solid #e9eff8;
    background:
        radial-gradient(circle at 82% 38%, rgba(18, 89, 223, .10), transparent 34%),
        linear-gradient(180deg, #fbfdff 0%, #f4f8fe 100%);
}

.hero::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(18, 89, 223, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(18, 89, 223, .025) 1px, transparent 1px);
    background-size: 32px 32px;
    content: "";
    mask-image: linear-gradient(to right, transparent, #000 55%, #000);
}

.hero-copy,
.hero-art {
    position: relative;
    z-index: 1;
}

.hero h1 {
    max-width: 720px;
    color: var(--ui-ink);
    text-wrap: balance;
}

.hero-lead,
.section-lead {
    color: var(--ui-muted);
}

.benefit-row > div {
    padding: 8px 0;
}

.benefit-row small {
    color: var(--ui-muted);
}

.home-page #features {
    background: #fff;
}

.home-page #features h2,
.converter-tools h2,
.how-section h2,
.platforms h2,
.faq-section h2 {
    color: var(--ui-ink);
    letter-spacing: -.025em;
    text-wrap: balance;
}

.home-page #features .feature {
    border-color: var(--ui-line);
    box-shadow: 0 8px 24px rgba(18, 33, 61, .055);
}

.home-page #features .feature:hover {
    border-color: #aac3ea;
    box-shadow: var(--ui-shadow);
}

.home-page #features .feature-icon {
    color: var(--ui-blue-dark);
    background: #edf4ff;
}

.converter-tools {
    border-block: 1px solid #e6edf7;
    background: var(--ui-subtle);
}

.converter-tools .container {
    max-width: 1120px;
}

.tool-chip-list li {
    border: 1px solid var(--ui-line);
    background: #fff;
    color: #34445f;
    box-shadow: 0 3px 10px rgba(18, 33, 61, .035);
}

.tool-chip-list i {
    color: #147a5c;
}

.how-section .step-icon {
    border-color: #cfdcef;
    background: #fff;
    box-shadow: 0 7px 20px rgba(18, 33, 61, .06);
}

.how-section .step p {
    color: var(--ui-muted);
}

.platform-card {
    display: flex;
    flex-direction: column;
    border-color: var(--ui-line);
    background: #fff;
    box-shadow: 0 8px 24px rgba(18, 33, 61, .055);
}

.platform-card p {
    flex: 1;
    color: var(--ui-muted);
}

.platform-card .button {
    align-self: center;
}

.faq-section {
    border-top: 1px solid #edf1f7;
    background: var(--ui-subtle);
}

.faq-list details {
    border-color: var(--ui-line);
    background: #fff;
    box-shadow: 0 4px 14px rgba(18, 33, 61, .035);
}

.faq-list details[open] {
    border-color: #b2c8e9;
    box-shadow: 0 8px 22px rgba(18, 33, 61, .06);
}

.faq-list summary {
    color: var(--ui-ink);
}

.site-footer {
    border-top-color: var(--ui-line);
    background: #fff;
}

.footer-main h3 {
    color: var(--ui-ink);
}

.footer-main p,
.footer-main a {
    color: var(--ui-muted);
}

.footer-main a:hover,
.footer-main a:focus-visible {
    color: var(--ui-blue-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 1023px) {
    .site-header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .main-nav {
        border-left: 1px solid var(--ui-line);
    }
}

@media (max-width: 767px) {
    .hero {
        background: linear-gradient(180deg, #fbfdff 0%, #f3f7fd 100%);
    }

    .hero::before {
        display: none;
    }

    .hero-grid {
        padding-top: 38px;
    }

    .hero h1 {
        font-size: clamp(2.15rem, 10vw, 2.75rem);
        line-height: 1.08;
    }

    .benefit-row > div {
        min-width: calc(50% - 12px);
    }

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

    .step:not(:last-child)::after {
        display: none;
    }

    .step p {
        max-width: 230px;
        font-size: 14px;
    }

    .footer-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 24px;
    }
}

@media (max-width: 480px) {
    .container {
        width: calc(100% - 32px);
    }

    .benefit-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .benefit-row > div {
        min-width: 0;
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-brand {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .main-nav a,
    .button,
    .home-page #features .feature {
        transition: none;
    }

    .button:hover,
    .home-page #features .feature:hover {
        transform: none;
    }
}

/* Keep the mobile drawer inside both LTR and RTL viewports. */
@media (max-width: 1023px) {
    .main-nav {
        transform: none;
        clip-path: inset(0 0 0 100%);
        transition: clip-path .28s ease, visibility .28s ease;
    }

    .main-nav.open {
        transform: none;
        clip-path: inset(0);
    }

    [dir="rtl"] .main-nav {
        inset: 0 auto 0 0;
        border-right: 1px solid var(--ui-line);
        border-left: 0;
        box-shadow: 18px 0 42px rgba(7, 23, 70, .15);
        clip-path: inset(0 100% 0 0);
    }

    [dir="rtl"] .main-nav.open {
        clip-path: inset(0);
    }
}

/* Keep long legal tables of contents useful without burying mobile content. */
@media (max-width: 767px) {
    .legal-summary {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 16px;
        padding: 10px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
        scroll-snap-type: inline proximity;
    }

    .legal-summary strong,
    .legal-summary a {
        flex: 0 0 auto;
        margin: 0;
        white-space: nowrap;
    }

    .legal-summary strong {
        padding: 8px 10px;
    }

    .legal-summary a {
        padding: 8px 12px;
        border: 1px solid var(--ui-line);
        border-radius: 999px;
        background: var(--ui-subtle);
        scroll-snap-align: start;
    }
}
