/* ============================================================
   ImportFlow — Landing Page Stylesheet
   Israeli-SaaS style: white pages, light-blue tinted sections,
   pill buttons, big-radius soft-shadow cards, navy accents.
   RTL-first: logical properties only.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
    /* Surfaces */
    --surface: #ffffff;
    --tint: #f1f6fc;
    --tint-strong: #e3eefb;
    --navy: #0f2147;
    --navy-soft: #16295a;

    /* Brand */
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --sky: #38bdf8;
    /* Gradient end is teal-700, not bright cyan: white text on any point of
       the gradient must hold >= 4.5:1 (buttons, CTA panel, step numbers),
       and .grad heading text must hold >= 3:1 on white/tint. #0e7490 = 5.36:1. */
    --grad-a: #2563eb;
    --grad-b: #0e7490;

    /* Text */
    --text: #1e2a3b;
    --text-muted: #5b6b82;
    --text-on-navy: #dbe7f5;

    /* Lines & shadows */
    --line: #dbe7f5;
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --radius-pill: 999px;
    --shadow-card: 0 6px 24px rgba(15, 33, 71, 0.07), 0 2px 6px rgba(15, 33, 71, 0.05);
    --shadow-card-lg: 0 24px 60px rgba(15, 33, 71, 0.12), 0 6px 18px rgba(15, 33, 71, 0.06);
    --shadow-nav: 0 4px 20px rgba(15, 33, 71, 0.08);

    /* Spacing scale */
    --space-1: 0.5rem;
    --space-2: 0.75rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2.5rem;
    --space-6: 4rem;
    --space-7: 6rem;

    /* Type */
    --font-sans: 'Alef', -apple-system, 'Segoe UI', 'Arial Hebrew', 'Noto Sans Hebrew', Arial, sans-serif;

    /* Legacy aliases (retained per brief — do not remove) */
    --ink-900: var(--navy);
    --ink-700: var(--text);
    --ink-500: var(--text-muted);
    --ink-200: var(--line);
    --ink-050: var(--tint);
}

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
    font-family: 'Alef';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/alef-400-hebrew.woff2') format('woff2');
    unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

@font-face {
    font-family: 'Alef';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/alef-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}

@font-face {
    font-family: 'Alef';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/alef-700-hebrew.woff2') format('woff2');
    unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

@font-face {
    font-family: 'Alef';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/alef-700-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-padding-block-start: 5.5rem;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

img {
    max-inline-size: 100%;
    block-size: auto;
    display: block;
}

h1,
h2,
h3 {
    line-height: 1.25;
    color: var(--navy);
    margin-block: 0 var(--space-3);
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.1rem, 5.5vw, 3.4rem);
}

h2 {
    font-size: clamp(1.6rem, 3.6vw, 2.4rem);
}

h3 {
    font-size: 1.25rem;
}

p {
    margin-block: 0 var(--space-3);
}

a {
    color: var(--blue);
}

:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
    border-radius: 4px;
}

.container {
    inline-size: min(100% - 2.5rem, 72rem);
    margin-inline: auto;
}

.section {
    padding-block: var(--space-7);
}

.section--tint {
    background: var(--tint);
}

/* Skip link */
.skip-link {
    position: absolute;
    inset-block-start: -100px;
    inset-inline-start: 1rem;
    z-index: 100;
    background: var(--navy);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-pill);
    transition: inset-block-start 0.15s ease;
}

.skip-link:focus {
    inset-block-start: 1rem;
}

/* Gradient word inside headings */
.grad {
    background: linear-gradient(120deg, var(--grad-a), var(--grad-b));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Section heads: centered, eyebrow pill + heading + lede */
.section-head {
    max-inline-size: 46rem;
    margin-inline: auto;
    text-align: center;
    margin-block-end: var(--space-6);
}

.section-head p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Pills & buttons */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-pill);
    background: var(--tint-strong);
    color: var(--blue-dark);
    font-size: 0.9rem;
    font-weight: 700;
    margin-block-end: var(--space-3);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.9rem;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn--primary {
    background: linear-gradient(120deg, var(--grad-a), var(--grad-b));
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.42);
}

.btn--ghost {
    background: transparent;
    color: var(--blue-dark);
    border-color: var(--line);
}

.btn--ghost:hover {
    background: var(--tint);
}

.btn--nav {
    padding: 0.55rem 1.4rem;
    font-size: 0.95rem;
}

.btn[disabled] {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

/* ---------- Sticky nav ---------- */
.site-nav {
    position: sticky;
    inset-block-start: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-block-end: 1px solid transparent;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.site-nav.is-scrolled {
    box-shadow: var(--shadow-nav);
    border-color: var(--line);
}

/* Constant height: condensing must never change the nav's in-flow size,
   or the whole page shifts (CLS). The condensed feel comes from the shadow
   plus a transform-only brand scale. */
.site-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    block-size: 4.4rem;
}

.site-nav .brand {
    transition: transform 0.2s ease;
    /* RTL page: the brand sits at the physical right edge
       (transform-origin has no logical keywords). */
    transform-origin: right center;
}

.site-nav.is-scrolled .brand {
    transform: scale(0.9);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--navy);
    text-decoration: none;
}

.brand__mark {
    inline-size: 2.1rem;
    block-size: 2.1rem;
    border-radius: 0.7rem;
    background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.site-nav__links {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav__links a:not(.btn) {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.98rem;
}

.site-nav__links a:not(.btn):hover {
    color: var(--blue);
}

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(60rem 30rem at 50% -10%, var(--tint-strong), transparent 70%),
        var(--surface);
    padding-block: var(--space-6) var(--space-7);
    text-align: center;
}

.hero__lede {
    max-inline-size: 42rem;
    margin-inline: auto;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-muted);
}

.hero__ctas {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-block: var(--space-4) var(--space-6);
}

/* Browser-chrome frame around screenshots */
.frame {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card-lg);
    overflow: hidden;
}

.frame__bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    background: var(--tint);
    border-block-end: 1px solid var(--line);
}

.frame__dot {
    inline-size: 0.65rem;
    block-size: 0.65rem;
    border-radius: 50%;
    background: var(--line);
}

.frame__dot:first-child {
    background: #fca5a5;
}

.frame__dot:nth-child(2) {
    background: #fcd34d;
}

.frame__dot:nth-child(3) {
    background: #86efac;
}

.hero .frame {
    max-inline-size: 62rem;
    margin-inline: auto;
}

/* ---------- Feature rows ---------- */
.feature-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    align-items: center;
    padding-block: var(--space-5);
}

.feature-row__text .pill {
    margin-block-end: var(--space-2);
}

.feature-row__text p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

@media (min-width: 56rem) {
    .feature-row {
        grid-template-columns: 5fr 6fr;
    }

    /* Alternate screenshot side on even rows */
    .feature-row:nth-of-type(even) .feature-row__text {
        order: 2;
    }

    .feature-row:nth-of-type(even) .feature-row__media {
        order: 1;
    }
}

/* ---------- «More features» grid ---------- */
.more-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: var(--space-4);
}

.more-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.more-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-lg);
}

.more-card .frame {
    box-shadow: none;
    border-radius: var(--radius-sm);
}

.more-card h3 {
    margin-block: var(--space-2) 0;
}

.more-card p {
    color: var(--text-muted);
    font-size: 0.98rem;
    margin: 0;
}

/* ---------- Navy stats band ---------- */
.stats {
    background: linear-gradient(140deg, var(--navy), var(--navy-soft));
    color: var(--text-on-navy);
    padding-block: var(--space-6);
}

.stats__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: var(--space-4);
    text-align: center;
}

.stat__value {
    display: block;
    font-size: clamp(2.2rem, 4.5vw, 3.2rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}

.stat__label {
    display: block;
    margin-block-start: var(--space-1);
    font-size: 1rem;
}

/* ---------- Journey rail ---------- */
.journey {
    counter-reset: step;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    position: relative;
}

.journey__step {
    counter-increment: step;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-4);
    position: relative;
}

.journey__step::before {
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 2.4rem;
    block-size: 2.4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-block-end: var(--space-2);
}

.journey__step h3 {
    margin-block-end: var(--space-1);
}

.journey__step p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.98rem;
}

@media (min-width: 56rem) {
    .journey {
        grid-template-columns: repeat(5, 1fr);
    }

    /* Connecting rail line behind the cards */
    .journey::before {
        content: '';
        position: absolute;
        inset-inline: 4%;
        inset-block-start: 3.2rem;
        block-size: 3px;
        /* 270deg: RTL step order runs right-to-left, so the rail must
           start with --grad-a at the physical right (step 1). */
        background: linear-gradient(270deg, var(--grad-a), var(--grad-b));
        opacity: 0.35;
        z-index: 0;
    }

    .journey__step {
        z-index: 1;
    }
}

/* ---------- FAQ accordion ---------- */
.faq {
    max-inline-size: 46rem;
    margin-inline: auto;
    display: grid;
    gap: var(--space-3);
}

.faq__item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.faq__q {
    inline-size: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 1.1rem 1.4rem;
    background: none;
    border: 0;
    font-family: inherit;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--navy);
    text-align: start;
    cursor: pointer;
}

.faq__q:hover {
    color: var(--blue);
}

.faq__icon {
    flex: 0 0 auto;
    inline-size: 1.6rem;
    block-size: 1.6rem;
    border-radius: 50%;
    background: var(--tint-strong);
    color: var(--blue-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.faq__q[aria-expanded='true'] .faq__icon {
    transform: rotate(45deg);
}

/* visibility keeps collapsed answers out of the accessibility tree
   (matching aria-expanded="false"); the 0s/0.25s delay lets the close
   animation finish before the content is hidden. */
.faq__a {
    padding: 0 1.4rem;
    max-block-size: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-block-size 0.25s ease, padding 0.25s ease, visibility 0s linear 0.25s;
}

.faq__item.is-open .faq__a {
    padding-block: 0 1.2rem;
    max-block-size: 30rem;
    visibility: visible;
    transition: max-block-size 0.25s ease, padding 0.25s ease, visibility 0s;
}

.faq__a p {
    color: var(--text-muted);
    margin: 0;
}

/* ---------- Gradient CTA panel ---------- */
.cta-panel {
    background: linear-gradient(130deg, var(--grad-a), var(--grad-b));
    border-radius: var(--radius-lg);
    color: #fff;
    text-align: center;
    padding: var(--space-6) var(--space-4);
    box-shadow: var(--shadow-card-lg);
}

.cta-panel h2 {
    color: #fff;
}

.cta-panel p {
    color: rgba(255, 255, 255, 0.9);
    max-inline-size: 36rem;
    margin-inline: auto;
}

.cta-panel .btn--primary {
    background: #fff;
    color: var(--blue-dark);
    box-shadow: 0 10px 24px rgba(15, 33, 71, 0.25);
}

/* ---------- Newsletter ---------- */
.newsletter__form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    max-inline-size: 34rem;
    margin-inline: auto;
}

.newsletter__form input[type='email'] {
    flex: 1 1 16rem;
    padding: 0.85rem 1.3rem;
    border-radius: var(--radius-pill);
    border: 2px solid var(--line);
    font-family: inherit;
    font-size: 1.02rem;
    color: var(--text);
    background: var(--surface);
}

.newsletter__form input[type='email']:focus-visible {
    outline: none;
    border-color: var(--blue);
}

.newsletter__msg {
    text-align: center;
    margin-block-start: var(--space-3);
    font-weight: 700;
    min-block-size: 1.6em;
}

.newsletter__msg.is-error {
    color: #b91c1c;
}

.newsletter__msg.is-success {
    color: #15803d;
}

.newsletter__privacy {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-block-start: var(--space-2);
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--navy);
    color: var(--text-on-navy);
    padding-block: var(--space-6) var(--space-4);
    margin-block-start: var(--space-7);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--space-5);
    margin-block-end: var(--space-5);
}

.site-footer .brand {
    color: #fff;
}

.site-footer h3 {
    color: #fff;
    font-size: 1.05rem;
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.site-footer a {
    color: var(--text-on-navy);
    text-decoration: none;
}

.site-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.site-footer__legal {
    border-block-start: 1px solid rgba(219, 231, 245, 0.2);
    padding-block-start: var(--space-4);
    font-size: 0.92rem;
    text-align: center;
}

/* ---------- Reveal animations (motion-safe only) ----------
   Hidden initial state applies only when JS is running (html.js,
   set by an inline script) AND the visitor allows motion — so
   no-JS and reduced-motion visitors always see content. */
@media (prefers-reduced-motion: no-preference) {
    .js .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s ease, transform 0.6s ease;
        transition-delay: var(--reveal-delay, 0s);
    }

    .reveal.is-visible {
        opacity: 1;
        transform: none;
    }
}

/* ---------- Small screens ---------- */
@media (max-width: 47.9rem) {
    .site-nav__links li.nav-anchor {
        display: none;
    }

    .section {
        padding-block: var(--space-6);
    }
}
