/* ============================================================================
   HEALING SPACE UK — LANDING NARRATIVE LAYER
   ----------------------------------------------------------------------------
   Styles the sections introduced by the homepage rebuild: the gap, memory,
   the free-for-patients promise, the loop, the patient toolkit, why clinics
   fund it, and the radical-honesty block.

   Loaded AFTER landing-v2-modern.css and builds on its tokens (--space-*,
   --r-*, --ease-*, --glass-*). It adds no new colour system of its own.
   ============================================================================ */

/* ============================================================
   0. SHARED PRIMITIVES
   ============================================================ */

/* Numerals that need to read as instrumentation rather than prose. */
.gap-time,
.loop-num,
.hero-num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* One hairline grid used by the "engineered" sections. Sits under content,
   fades at the edges so it never reads as a hard box. */
.gap::before,
.loop::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--hairline) 1px, transparent 1px),
        linear-gradient(to bottom, var(--hairline) 1px, transparent 1px);
    background-size: 72px 72px;
    -webkit-mask-image: radial-gradient(ellipse 78% 62% at 50% 44%, #000 35%, transparent 100%);
            mask-image: radial-gradient(ellipse 78% 62% at 50% 44%, #000 35%, transparent 100%);
    opacity: 0.9;
}

.gap,
.loop,
.memory,
.promise,
.toolkit,
.why-pay,
.honesty {
    position: relative;
    isolation: isolate;
}

.gap > .section-inner,
.loop > .section-inner,
.memory > .section-inner,
.promise > .section-inner,
.toolkit > .section-inner,
.why-pay > .section-inner,
.honesty > .section-inner {
    position: relative;
    z-index: 1;
}

/* Shared glass card chrome for the new sections. */
.gap-card,
.tool-card,
.why-card,
.honesty-card,
.promise-card,
.mem-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur) var(--ease-out),
                box-shadow var(--dur) var(--ease-out),
                border-color var(--dur) var(--ease-out);
}

@media (hover: hover) {
    .gap-card:hover,
    .tool-card:hover,
    .why-card:hover,
    .honesty-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--card-hover-shadow);
        border-color: var(--border-accent);
    }
}

/* ============================================================
   1. HERO ADDITIONS
   ============================================================ */

/* The "167" carries the whole headline — give it the brand gradient and a
   soft bloom so the eye lands there first. */
.hero-num {
    background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 45%, #67e8f9 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    text-shadow: 0 0 42px rgba(139, 92, 246, 0.45);
}

.hero-subtitle-em {
    margin-top: var(--space-sm);
    font-weight: 600;
    color: #ffffff;
}

.hero-subtitle-em::before {
    content: "";
    display: block;
    width: 54px;
    height: 2px;
    margin: 0 auto var(--space-sm);
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
}

/* Four short proofs directly under the CTAs — reassurance at the exact moment
   the visitor is deciding whether to trust the page. */
.hero-microtrust {
    list-style: none;
    margin: var(--space-lg) auto 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xs) var(--space-md);
    max-width: 760px;
}

.hero-microtrust li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
}

.hero-microtrust li span {
    color: #6ee7b7;
    font-weight: 700;
}

.hero-scroll-hint {
    position: absolute;
    left: 50%;
    bottom: clamp(1.25rem, 4vh, 2.5rem);
    translate: -50% 0;
    z-index: 2;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
    animation: hs-hint-bob 2.6s var(--ease-soft) infinite;
    transition: color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out);
}

.hero-scroll-hint:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

@keyframes hs-hint-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(7px); }
}

/* ============================================================
   2. THE GAP — the emotional core
   ============================================================ */

.gap {
    background: var(--bg-surface);
}

.gap-header {
    max-width: 820px;
    margin: 0 auto var(--space-xl);
    text-align: center;
}

.gap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
    gap: var(--space-md);
}

.gap-card {
    padding: var(--space-lg) var(--space-md) var(--space-md);
    position: relative;
    overflow: hidden;
}

/* A quiet left-edge accent that intensifies on hover — the card "notices" you. */
.gap-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--brand-gradient-2);
    opacity: 0.4;
    transition: opacity var(--dur) var(--ease-out);
}

.gap-card:hover::before { opacity: 1; }

.gap-time {
    display: inline-block;
    margin-bottom: var(--space-sm);
    padding: 0.3rem 0.7rem;
    border-radius: var(--r-pill);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand-primary);
    background: color-mix(in srgb, var(--brand-primary) 11%, transparent);
    border: 1px solid var(--border-accent);
}

.gap-title {
    font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.gap-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* The turn: the section's argument lands here. */
.gap-punch {
    margin: var(--space-xl) auto 0;
    max-width: 780px;
    text-align: center;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(1.125rem, 2.4vw, 1.5rem);
    line-height: 1.5;
    color: var(--text-secondary);
    text-wrap: balance;
}

.gap-punch strong {
    display: inline-block;
    margin-top: 0.4em;
    font-weight: 800;
    color: var(--text-primary);
    background: var(--brand-gradient-2);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================================
   3. MEMORY / CONTINUITY
   ============================================================ */

.memory-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--space-xl);
    align-items: center;
}

.memory-list {
    list-style: none;
    margin: var(--space-lg) 0 0;
    padding: 0;
    display: grid;
    gap: var(--space-sm);
}

.memory-list li {
    position: relative;
    padding-left: 1.9rem;
    font-size: 0.9688rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.memory-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--brand-gradient-2);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 14%, transparent);
}

.memory-list strong { color: var(--text-primary); font-weight: 700; }

/* The panel is deliberately literal: this is the kind of thing it holds. */
.mem-panel {
    padding: var(--space-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
            backdrop-filter: blur(16px) saturate(140%);
    box-shadow: var(--shadow-lg);
}

.mem-panel-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-sm);
    border-bottom: 1px solid var(--hairline);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mem-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    animation: hs-mem-pulse 2.4s var(--ease-soft) infinite;
}

@keyframes hs-mem-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(34, 197, 94, 0.5); }
    70%  { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0   rgba(34, 197, 94, 0); }
}

.mem-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mem-chip {
    padding: 0.45rem 0.75rem;
    border-radius: var(--r-pill);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
    border: 1px solid var(--border-accent);
}

.mem-panel-foot {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--hairline);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ============================================================
   4. THE PROMISE — free for patients
   ============================================================ */

/* The one full-bleed brand moment on the page. It earns it: this is the
   single most important thing a patient needs to believe. */
.promise {
    background: var(--brand-gradient);
    color: #ffffff;
    text-align: center;
    overflow: hidden;
}

.promise::before {
    content: "";
    position: absolute;
    inset: -30%;
    background:
        radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.22), transparent 45%),
        radial-gradient(circle at 78% 82%, rgba(103, 232, 249, 0.28), transparent 48%);
    pointer-events: none;
}

.promise .section-tag {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
}

.promise-head { max-width: 820px; margin: 0 auto var(--space-xl); }

.promise-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(2.25rem, 6.5vw, 4.25rem);
    font-weight: 900;
    line-height: 1.03;
    letter-spacing: -0.035em;
    margin-bottom: var(--space-sm);
    text-wrap: balance;
}

.promise-sub {
    font-size: clamp(1rem, 2vw, 1.1875rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: var(--space-sm);
}

.promise-lead {
    font-size: clamp(0.9688rem, 1.7vw, 1.0625rem);
    color: rgba(255, 255, 255, 0.82);
    max-width: 660px;
    margin: 0 auto;
    line-height: 1.7;
}

.promise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
    gap: var(--space-sm);
    text-align: left;
}

.promise-card {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
    box-shadow: none;
}

@media (hover: hover) {
    .promise-card:hover {
        background: rgba(255, 255, 255, 0.16);
        transform: translateY(-3px);
    }
}

.promise-no {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 800;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.34);
}

.promise-card h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    color: #ffffff;
}

.promise-card p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
}

.promise-foot {
    margin-top: var(--space-xl);
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(1.0625rem, 2.2vw, 1.375rem);
    font-weight: 700;
    color: #ffffff;
    text-wrap: balance;
}

/* ============================================================
   5. THE LOOP
   ============================================================ */

.loop-header {
    max-width: 820px;
    margin: 0 auto var(--space-xl);
    text-align: center;
}

.loop-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(244px, 1fr));
    gap: var(--space-md);
    counter-reset: loop;
}

.loop-step {
    position: relative;
    padding: var(--space-md);
    padding-top: var(--space-lg);
    border-radius: var(--r-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur) var(--ease-out),
                box-shadow var(--dur) var(--ease-out);
}

/* The connector that makes four cards read as one cycle. Drawn only where
   there is a following card, and only on multi-column layouts. */
.loop-step::after {
    content: "";
    position: absolute;
    top: calc(var(--space-lg) + 18px);
    right: calc(var(--space-md) * -1);
    width: var(--space-md);
    height: 2px;
    background: linear-gradient(90deg, var(--border-accent), transparent);
}

.loop-step:last-child::after { display: none; }

@media (hover: hover) {
    .loop-step:hover {
        transform: translateY(-4px);
        box-shadow: var(--card-hover-shadow);
    }
}

.loop-num {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 2.25rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: var(--space-sm);
    background: var(--brand-gradient-2);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.9;
}

.loop-title {
    font-size: 1.0625rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.loop-text {
    font-size: 0.9063rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.loop-punch {
    margin: var(--space-xl) auto 0;
    max-width: 760px;
    text-align: center;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(1.0625rem, 2.2vw, 1.375rem);
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-primary);
    text-wrap: balance;
}

/* ============================================================
   6. PATIENT TOOLKIT
   ============================================================ */

.toolkit { background: var(--bg-surface); }

.toolkit-header {
    max-width: 820px;
    margin: 0 auto var(--space-xl);
    text-align: center;
}

.toolkit-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
}

.tool-card {
    padding: var(--space-md);
    width: min(100%, 292px);
    flex: 0 1 292px;
}

.tool-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: var(--space-sm);
    border-radius: var(--r-md);
    font-size: 1.375rem;
    background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
    border: 1px solid var(--border-accent);
}

.tool-title {
    font-size: 1.0313rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 0.45rem;
    color: var(--text-primary);
}

.tool-text {
    font-size: 0.9063rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ============================================================
   7. FOR CLINICIANS — header added above the existing split
   ============================================================ */

.clin-header {
    max-width: 860px;
    margin: 0 auto var(--space-xl);
    text-align: center;
}

/* ============================================================
   8. WHY CLINICS FUND IT
   ============================================================ */

.why-pay { background: var(--bg-surface); }

.why-pay-head {
    max-width: 860px;
    margin: 0 auto var(--space-xl);
    text-align: center;
}

.why-pay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(288px, 1fr));
    gap: var(--space-md);
}

.why-card { padding: var(--space-md); }

.why-card h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.0313rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.why-card p {
    font-size: 0.9063rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ============================================================
   9. RADICAL HONESTY
   ============================================================ */

.honesty-head {
    max-width: 860px;
    margin: 0 auto var(--space-xl);
    text-align: center;
}

.honesty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(288px, 1fr));
    gap: var(--space-md);
}

.honesty-card {
    padding: var(--space-md);
    border-left: 3px solid var(--border-accent);
}

.honesty-card h3 {
    font-size: 1.0313rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.honesty-card p {
    font-size: 0.9063rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.honesty-card a {
    color: var(--brand-primary);
    font-weight: 700;
    text-underline-offset: 3px;
}

/* The crisis card is the one place on this page that should not blend in. */
.honesty-card-alert {
    border-left-color: #ef4444;
    background: color-mix(in srgb, #ef4444 6%, var(--bg-card));
}

.honesty-card-alert h3 { color: #dc2626; }
[data-theme="dark"] .honesty-card-alert h3 { color: #fca5a5; }

.honesty-card-alert a { color: #dc2626; }
[data-theme="dark"] .honesty-card-alert a { color: #fca5a5; }

.honesty-foot {
    margin: var(--space-xl) auto 0;
    max-width: 720px;
    text-align: center;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 700;
    color: var(--text-primary);
    text-wrap: balance;
}

/* ============================================================
   10. FOOTER ADDITION
   ============================================================ */

.footer-smallprint {
    margin-top: var(--space-sm);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--footer-text, rgba(255, 255, 255, 0.5));
    max-width: 46ch;
}

/* ============================================================
   11. RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
    .memory-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    /* The panel is illustrative — below the copy it explains, not beside it. */
    .memory-visual { order: 2; }
}

@media (max-width: 720px) {
    /* Single column: the horizontal connector would point into empty space. */
    .loop-step::after { display: none; }

    .hero-microtrust {
        gap: 0.5rem var(--space-sm);
        font-size: 0.8125rem;
    }
    .hero-scroll-hint { display: none; }

    .gap::before,
    .loop::before { background-size: 48px 48px; }
}

/* ============================================================
   12. REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .hero-scroll-hint,
    .mem-dot {
        animation: none;
    }
    .gap-card,
    .tool-card,
    .why-card,
    .honesty-card,
    .loop-step,
    .promise-card {
        transition: none;
    }
    .gap-card:hover,
    .tool-card:hover,
    .why-card:hover,
    .honesty-card:hover,
    .loop-step:hover,
    .promise-card:hover {
        transform: none;
    }
}

/* ============================================================
   13. PRINT — the honesty and crisis information must survive paper
   ============================================================ */

@media print {
    .hero-scroll-hint,
    .gap::before,
    .loop::before { display: none; }

    .promise {
        background: none !important;
        color: #000 !important;
    }
    .promise-title,
    .promise-sub,
    .promise-lead,
    .promise-foot,
    .promise-card h3,
    .promise-card p { color: #000 !important; }
}
