/* ============================================
   LANDING PAGE — HelloSoulmate!
   ============================================ */

.landing-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

/* ── Hero ── */
.hero {
    display: grid;
    grid-template-columns: 55fr 45fr;
    gap: 0;
    align-items: stretch;
    min-height: calc(100vh - 70px);
}

.hero-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-right: 60px;
    padding-bottom: max(0px, calc(50vh - 260px));
}

.hero-left h1 {
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 22px;
    word-break: break-word;
}

.text-gradient {
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-left p {
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 36px;
    max-width: 520px;
}

.hero-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-large {
    padding: 13px 26px;
    font-size: 0.975rem;
}

/* ── Hero right — big type ── */
.hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    overflow: hidden;
    position: relative;
    gap: 40px;
    padding-bottom: max(0px, calc(50vh - 260px));
}

.hero-bigtype {
    container-type: inline-size;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    user-select: none;
}

.hero-bigtype span {
    display: block;
    /* sized from the column width so the longest word (ЗАЦІКАВЛЕНІСТЬ) never gets clipped */
    font-size: clamp(30px, 10.4cqw, 76px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.04;
    text-transform: uppercase;
    white-space: nowrap;
    /* every standard emotion, same size, fading "into the depth" */
    --a: calc(0.26 - var(--i, 0) * 0.034);
    color: rgba(139, 92, 246, var(--a));
}

.hero-bigtype span:nth-child(even) {
    color: rgba(236, 72, 153, calc(var(--a) * 0.7));
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 20px 32px;
    align-items: flex-end;
}

.hero-stat-n {
    font-variant-numeric: tabular-nums;
    font-size: 1.9rem;
    font-weight: 800;
    color: #8b5cf6;
    line-height: 1;
}

.hero-stat-l {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.02em;
}

/* ── Features ── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin: 48px 0 48px;
}

.feature-card {
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    font-size: 1.9rem;
    color: var(--accent);
    margin-bottom: 14px;
}

.highlight-card {
    border: 1.5px solid var(--accent) !important;
    position: relative;
}

.badge-new {
    position: absolute;
    top: -11px;
    right: 18px;
    background: var(--accent);
    color: white;
    padding: 3px 11px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.bot-features-list {
    list-style: none;
    padding: 0;
    margin-top: 14px;
}

.bot-features-list li {
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.bot-features-list i {
    color: var(--success);
    margin-right: 8px;
    font-size: 0.78rem;
}

/* ── Demo section ── */
.demo-section {
    margin-bottom: 48px;
    padding: 2.5rem;
}

.demo-header {
    margin-bottom: 2rem;
}

.demo-header h2 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 800;
    margin-bottom: 6px;
    line-height: 1.2;
}

.demo-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

.demo-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

/* Sliders */
.slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.slider-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    width: 112px;
    flex-shrink: 0;
    text-align: right;
    overflow-wrap: anywhere;
    line-height: 1.2;
}

.slider-track-wrap {
    flex: 1;
}

.demo-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 4px;
    --pct: 50%;
    background: linear-gradient(90deg, var(--accent) var(--pct), rgba(255, 255, 255, 0.08) var(--pct));
    outline: none;
    cursor: pointer;
}

.demo-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #1e293b;
    cursor: grab;
    transition: transform 0.15s;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.demo-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.demo-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #1e293b;
}

.demo-range {
    touch-action: pan-y;
}

.slider-val {
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 700;
    width: 26px;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Match cards — fixed slots; a person's rank is a translateY, so reordering is a CSS transition */
.match-cards-wrap {
    --card-h: 64px;
    --card-gap: 10px;
    position: relative;
    height: calc(4 * var(--card-h) + 3 * var(--card-gap));
}

.match-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--card-h);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border-radius: 0.875rem;
    border: 1px solid var(--border);
    background: var(--bg);
    transition: transform 0.5s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.35s ease,
        border-color 0.35s ease, background 0.35s ease;
    will-change: transform, opacity;
}

/* appears "from nowhere" (chance grew) / vanishes (chance dropped) */
.match-card.is-entering {
    opacity: 0;
    scale: 0.92;
}

.match-card.is-leaving {
    opacity: 0;
    scale: 0.92;
    pointer-events: none;
}

.match-card {
    scale: 1;
    transition-property: transform, opacity, scale, border-color, background;
}

.match-card--active {
    border-color: var(--accent);
    background: rgba(139, 92, 246, 0.06);
}

.match-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.match-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.match-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-city {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.match-pct-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ring-fill {
    transition: stroke-dashoffset 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.match-pct {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    position: relative;
    z-index: 1;
    font-variant-numeric: tabular-nums;
}

.match-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 12px;
    opacity: 0.6;
    line-height: 1.5;
}

/* ── CTA bottom ── */
.cta-bottom {
    margin-bottom: 2rem;
    border-radius: 1.25rem;
    border: 1px solid var(--border);
    overflow: hidden;
}

.cta-inner {
    text-align: center;
    padding: 4rem 2rem;
    background:
        linear-gradient(135deg,
            rgba(139, 92, 246, 0.08) 0%,
            rgba(236, 72, 153, 0.06) 50%,
            rgba(139, 92, 246, 0.04) 100%);
    border-top: 1px solid rgba(139, 92, 246, 0.15);
}

.cta-inner h2 {
    font-size: clamp(1.4rem, 3.5vw, 2.1rem);
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
}

.cta-inner p {
    color: var(--text-muted);
    margin: 0 auto 2rem;
    max-width: 500px;
    font-size: 0.975rem;
    line-height: 1.65;
}

/* ── Transparent header on landing ── */
.page-landing .header {
    background: transparent;
    border-bottom-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}

.page-landing .header.header--scrolled {
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--border);
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */

/* ── Tablet: 2 columns, no bigtype, stats on right ── */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr auto;
        align-items: end;
        min-height: auto;
        padding: 48px 0;
        gap: 32px;
    }

    .hero-left {
        padding-right: 0;
        padding-bottom: 0;
        justify-content: flex-start;
    }

    .hero-btns {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-btns .btn {
        min-width: 220px;
        width: auto;
        text-align: center;
    }

    .hero-right {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: flex-end;
        padding-bottom: 0;
        gap: 0;
        overflow: visible;
        pointer-events: auto;
    }

    .hero-bigtype {
        display: none;
    }

    .hero-stats {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 20px;
    }

    .hero-stat-n {
        text-align: right;
    }
}

/* ── Mobile: 1 column, full-width buttons, stats centered below ── */
@media (prefers-reduced-motion: reduce) {
    .match-card { transition: none; }
}

@media (max-width: 600px) {
    .hero {
        grid-template-columns: 1fr;
        align-items: start;
        padding: 36px 0 32px;
        gap: 28px;
    }

    .hero-btns {
        align-items: stretch;
    }

    .hero-btns .btn {
        width: 100%;
        min-width: unset;
    }

    .hero-right {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 0;
    }

    .hero-stats {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        flex-wrap: wrap;
        gap: 20px 28px;
    }

    .hero-stat-n {
        font-size: 1.5rem;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .landing-container {
        padding: 0 16px 32px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin: 40px 0 28px;
    }

    .demo-section {
        padding: 1.75rem;
    }

    .demo-body {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-bigtype span {
        font-size: clamp(40px, 13vw, 60px);
    }

    .demo-section {
        padding: 1.25rem;
    }

    .slider-label {
        width: 84px;
        font-size: 0.74rem;
    }

    .match-cards-wrap {
        --card-h: 60px;
    }

    .match-card {
        gap: 10px;
        padding: 0 10px;
    }

    .cta-inner {
        padding: 2.5rem 1.25rem;
    }

    .btn-large {
        padding: 12px 22px;
        font-size: 0.93rem;
    }
}

/* ============================================
   RESPONSIVE — landing.css (additions)
   ============================================ */

@media (max-width: 479px) {
    /* Hero buttons: 44px touch targets */
    .hero-btns .btn {
        min-height: 44px;
    }

    /* CTA buttons: 44px touch targets */
    .cta-inner .btn {
        min-height: 44px;
        width: 100%;
    }
}

/* Bigger drag target on touch screens */
@media (pointer: coarse) {
    .demo-range { height: 6px; }
    .demo-range::-webkit-slider-thumb { width: 24px; height: 24px; }
    .demo-range::-moz-range-thumb { width: 24px; height: 24px; }
    .slider-row { margin-bottom: 22px; }
}

/* ══════════════════════════════════════
   Emotion words = full-width BACKGROUND layer behind the hero text
   (overrides the earlier right-column version)
══════════════════════════════════════ */
.hero {
    position: relative;
    isolation: isolate;
}

.hero-right {
    position: static;
    overflow: visible;
}

.hero-bigtype {
    display: flex;
    position: absolute;
    inset: 0;
    z-index: -1;
    align-self: auto;
    justify-content: center;
    align-items: flex-end;
    container-type: inline-size;
    pointer-events: none;
    user-select: none;
}

.hero-bigtype span {
    /* biggest size at which the longest word (ЗАЦІКАВЛЕНІСТЬ) still fits the full width */
    font-size: min(10.6cqw, 17vh);
    line-height: 1;
    --a: calc(0.34 - var(--i, 0) * 0.04);
}

/* keep foreground content above the background words */
.hero-left,
.hero-stats {
    position: relative;
    z-index: 1;
}

@media (max-width: 900px) {
    .hero-bigtype {
        display: flex;       /* was hidden on tablet/phone; now a soft backdrop */
    }

    .hero-bigtype span {
        font-size: min(10.6cqw, 9vh);
        --a: calc(0.15 - var(--i, 0) * 0.018);
    }
}

/* Words live in the area ABOVE the counters; the bottom strip is reserved for the numbers */
.hero-bigtype {
    inset: 0 0 150px 0;
    justify-content: flex-start;
    padding-top: 12px;
}

.hero-bigtype span {
    font-size: min(10.6cqw, 11.5vh);
}

@media (max-width: 900px) {
    .hero-bigtype {
        inset: 0 0 190px 0;
    }

    .hero-bigtype span {
        font-size: min(10.6cqw, 7vh);
    }
}

/* Demo section: tighter top spacing (h2 had a default 25px top margin on top of the padding) */
.demo-section {
    padding-top: 1.75rem;
}

.demo-header {
    margin-bottom: 1.5rem;
}

.demo-header h2 {
    margin-top: 0;
}

.demo-body {
    align-items: start;
}

.demo-sliders .slider-row:first-child,
.match-cards-wrap {
    margin-top: 0;
}

@media (max-width: 768px) {
    .demo-section {
        padding-top: 1.25rem;
    }

    .demo-body {
        gap: 1.5rem;
    }
}

/* Demo: both columns share one height — compact people cards, sliders spread to match */
.match-cards-wrap {
    --card-h: 54px;
    --card-gap: 8px;
}

.match-card {
    gap: 10px;
}

.match-avatar {
    width: 34px;
    height: 34px;
}

.match-pct-wrap {
    width: 40px;
    height: 40px;
}

.match-hint {
    margin-top: 8px;
}

.demo-section {
    padding-bottom: 1.75rem;
}

@media (min-width: 769px) {
    .demo-sliders {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: calc(4 * 54px + 3 * 8px);   /* = height of the 4-card stack */
    }

    .demo-sliders .slider-row {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .match-cards-wrap {
        --card-h: 54px;
    }
}
