/* ============================================================
   COMFORT EXPERIENCE
   Comfort Buddy, Family Buddy and the locked Clinical Care card.

   Deliberately built from the same tokens as public.css — the same
   --blue/--orange/--line/--surface, the same rounded cards and pill buttons.
   Comfort should feel warmer than the rest of the site, not like a different
   company, so the only new idea here is a soft warm wash on the section
   backgrounds. No medical blues, no clinical iconography.
   ============================================================ */

.cf-lede {
    max-width: 760px;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.7;
    margin: 0 0 22px;
}

.cf-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 22px 0 34px;
}

/* ---------- the three service cards ---------- */
.cf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 40px;
}

.cf-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 24px 22px 22px;
    box-shadow: 0 8px 26px rgba(30, 79, 145, 0.06);
}

.cf-card h3 { font-size: 1.22rem; font-weight: 800; color: var(--ink); margin: 2px 0 0; }
.cf-card p  { font-size: 0.9rem; color: var(--muted); line-height: 1.6; margin: 0; }
.cf-card .cf-sub { font-weight: 700; color: var(--blue); font-size: 0.88rem; }
.cf-card .cf-support { font-size: 0.85rem; }
.cf-card .pg-btn { margin-top: auto; }

.cf-ico {
    width: 52px; height: 52px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: var(--blue);
    background: linear-gradient(135deg, rgba(30, 79, 145, 0.10), rgba(239, 139, 44, 0.12));
}

.cf-ico-sm {
    width: 42px; height: 42px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem; color: var(--blue); margin-bottom: 10px;
    background: linear-gradient(135deg, rgba(30, 79, 145, 0.10), rgba(239, 139, 44, 0.12));
}

/* Status is never colour alone — each pill carries its own word, so it still
   reads for anyone who cannot distinguish the two greens/ambers. */
.cf-status {
    position: absolute; top: 16px; right: 16px;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.4px;
    text-transform: uppercase; padding: 5px 11px; border-radius: 999px;
}
.cf-status-on   { background: #e5f7ec; color: #14532d; }
.cf-status-soon { background: #f1f3f7; color: #55627a; }

.cf-card-locked { background: var(--surface-soft); }
.cf-card-locked .cf-ico { filter: grayscale(0.55); opacity: 0.8; }
.cf-card-locked .pg-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.cf-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 4px 0 6px; }
.cf-tags li {
    font-size: 0.72rem; font-weight: 600; color: var(--blue);
    background: rgba(30, 79, 145, 0.07);
    border-radius: 999px; padding: 5px 10px;
}

/* ---------- companionship vs medical boundary ---------- */
.cf-boundary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    background: var(--surface-warm, #fff7ec);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 40px;
}
.cf-boundary h3 { font-size: 0.95rem; font-weight: 800; color: var(--ink); margin: 0 0 6px; }
.cf-boundary p  { font-size: 0.88rem; color: var(--muted); line-height: 1.6; margin: 0; }

/* ---------- benefits ---------- */
.cf-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}
.cf-benefits h4 { font-size: 1rem; font-weight: 800; color: var(--ink); margin: 0 0 6px; }
.cf-benefits p  { font-size: 0.87rem; color: var(--muted); line-height: 1.6; margin: 0; }

/* ---------- numbered steps ---------- */
.cf-steps { list-style: none; padding: 0; margin: 0 0 40px; display: grid; gap: 12px; }
.cf-steps li {
    display: flex; gap: 14px; align-items: flex-start;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px; padding: 14px 16px;
}
.cf-steps .cf-n {
    flex: none; font-size: 0.78rem; font-weight: 800; color: var(--orange);
    background: rgba(239, 139, 44, 0.12); border-radius: 9px; padding: 5px 9px;
}
.cf-steps strong { display: block; font-size: 0.95rem; color: var(--ink); margin-bottom: 2px; }
.cf-steps p { font-size: 0.86rem; color: var(--muted); line-height: 1.55; margin: 0; }

/* ---------- illustrative story ---------- */
.cf-story {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-left: 4px solid var(--orange);
    border-radius: 18px;
    padding: 24px 24px 22px;
    margin-bottom: 34px;
}
.cf-story h2 { font-size: clamp(1.15rem, 2.6vw, 1.5rem); font-weight: 800; color: var(--ink); margin: 0 0 6px; }
/* Labelled as an example on purpose: this is not a real customer story. */
.cf-story-tag {
    display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.4px;
    text-transform: uppercase; color: var(--muted);
    background: rgba(30, 79, 145, 0.06); border-radius: 999px; padding: 4px 10px; margin: 0 0 10px;
}
.cf-story p { font-size: 0.93rem; color: var(--muted); line-height: 1.7; margin: 0; }

/* ---------- service list used on the Comfort/Family Buddy pages ---------- */
.cf-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}
.cf-service {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 18px; padding: 20px;
}
.cf-service h3 { font-size: 1.02rem; font-weight: 800; color: var(--ink); margin: 10px 0 6px; }
.cf-service p  { font-size: 0.87rem; color: var(--muted); line-height: 1.6; margin: 0 0 10px; }
.cf-service .cf-dur {
    display: inline-block; font-size: 0.74rem; font-weight: 700; color: var(--blue);
    background: rgba(30, 79, 145, 0.07); border-radius: 999px; padding: 4px 10px;
}
.cf-service ul { margin: 0 0 10px; padding-left: 18px; }
.cf-service li { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }

/* A plain, high-contrast note for the limits of a non-medical service. */
.cf-limit {
    background: var(--surface-warm, #fff7ec);
    border: 1px solid var(--line);
    border-left: 4px solid var(--orange);
    border-radius: 14px; padding: 14px 16px; margin: 0 0 22px;
}
.cf-limit strong { display: block; color: var(--ink); font-size: 0.92rem; margin-bottom: 4px; }
.cf-limit p, .cf-limit li { font-size: 0.86rem; color: var(--muted); line-height: 1.6; margin: 0; }
.cf-limit ul { margin: 6px 0 0; padding-left: 18px; }

@media (max-width: 640px) {
    .cf-hero-actions .pg-btn { width: 100%; }
    .cf-card { padding: 20px 18px 18px; }
    .cf-status { position: static; align-self: flex-start; margin-bottom: 4px; }
}

/* ============================================================
   HOME PAGE — COMFORT EXPERIENCE STORY

   Reads as a continuation of the hero rather than a separate card: same dark
   ground, same Manrope display face, same gradient accents. Replaced the old
   .worlds choice cards and the small beige .comfort-intro panel.

   Motion contract: everything here is VISIBLE BY DEFAULT. The hidden start
   state lives behind .cx-anim, which JavaScript adds only when motion is
   allowed. So no-JS, an old browser and prefers-reduced-motion all get the
   finished picture instead of an empty section.
   ============================================================ */

.cx {
    position: relative;
    overflow: hidden;
    background: #0a0a1a;
    padding: clamp(64px, 8vw, 118px) 20px clamp(56px, 7vw, 104px);
    isolation: isolate;
}

/* Soft brand glow, the same warm-to-cool pairing the hero uses. */
.cx-glow {
    position: absolute;
    inset: -20% -10% auto;
    height: 70%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60% 60% at 22% 18%, rgba(30, 79, 145, 0.42), transparent 70%),
        radial-gradient(52% 55% at 82% 12%, rgba(239, 139, 44, 0.26), transparent 72%),
        radial-gradient(40% 45% at 50% 60%, rgba(200, 154, 50, 0.12), transparent 75%);
}

.cx-inner { max-width: 1120px; margin: 0 auto; text-align: center; }

.cx-eyebrow {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    margin: 0 0 14px;
    background: linear-gradient(135deg, #f9a8d4, #d8b4fe, #fdba74);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #fdba74;                 /* fallback where background-clip is unsupported */
}

/* Same weight, tracking and leading as the hero h1, sized with clamp so it
   reaches the hero 72px on desktop without being hard-coded per breakpoint. */
.cx-title {
    font-family: var(--font-display, 'Manrope', sans-serif);
    font-size: clamp(2.1rem, 5.6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: #fff;
    margin: 0 auto clamp(38px, 5vw, 62px);
    max-width: 15ch;
}

/* ---------- the three scenes ---------- */
.cx-story { position: relative; }

.cx-scenes {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(20px, 3vw, 42px);
    align-items: start;
}

.cx-scene {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Fixed aspect box: reserves the space before the SVG paints, so nothing
   shifts as the section scrolls into view. */
.cx-art {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 200 / 140;
    margin: 0 auto 20px;
}
.cx-art svg { width: 100%; height: 100%; display: block; overflow: visible; }

.cx-art [data-draw] {
    fill: none;
    stroke: rgba(255, 255, 255, 0.86);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.cx-art .cx-accent   { stroke: #f0a63c; }
.cx-art .cx-accent-2 { stroke: #7fb3f0; }
/* Background props (furniture, trees, the clock) sit back on thinner, dimmer
   strokes so the people and the accents carry the scene. */
.cx-art .cx-fine     { stroke-width: 1.6; }
.cx-art .cx-soft     { stroke: rgba(255, 255, 255, 0.5); }
/* pathLength="1" normalises dash units along with everything else, so
   decorative dashes are fractions of the whole path, not user units. */
.cx-art .cx-dash     { stroke-dasharray: .08 .1; }

.cx-text {
    color: rgba(255, 255, 255, 0.78);
    font-size: clamp(0.92rem, 1.1vw, 1rem);
    line-height: 1.72;
    margin: 0;
    max-width: 34ch;
}

/* Desktop connector, laid over the illustration row. */
.cx-connector {
    position: absolute;
    top: clamp(28px, 4.5vw, 62px);
    left: 8%;
    width: 84%;
    height: 60px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}
.cx-connector .cx-link {
    fill: none;
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: .017 .021;
}

/* ---------- closing line + calls to action ---------- */
.cx-line {
    font-family: var(--font-display, 'Manrope', sans-serif);
    font-size: clamp(1.3rem, 2.6vw, 2rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: #fff;
    margin: clamp(44px, 5.5vw, 70px) auto clamp(26px, 3vw, 34px);
    max-width: 20ch;
}

/* One row wherever it genuinely fits. The wrap only engages when a single
   row would overflow, which on these two labels is around 430px. */
.cx-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    align-items: stretch;
}
.cx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 0 1 auto;
    min-width: 230px;
    padding: 15px 26px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none;
    border: 2px solid transparent;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.cx-btn-primary {
    color: #fff;
    background: var(--gradient-brand, linear-gradient(135deg, #1e4f91, #ef8b2c));
    box-shadow: 0 12px 30px rgba(239, 139, 44, 0.24);
}
.cx-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(239, 139, 44, 0.34); }
.cx-btn-ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.06);
}
.cx-btn-ghost:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-2px); }
.cx-btn:focus-visible { outline: 3px solid #fdba74; outline-offset: 3px; }

/* ---------- entrance animation ---------- */
/* Applied only once .cx-anim is present, i.e. only when motion is allowed. */
.cx-anim .cx-scene { opacity: 0; transform: translateY(20px); }
.cx-anim .cx-art [data-draw] { stroke-dasharray: 1; stroke-dashoffset: 1; }
.cx-anim .cx-connector .cx-link { stroke-dasharray: 1; stroke-dashoffset: 1; }
.cx-anim .cx-line,
.cx-anim .cx-ctas { opacity: 0; transform: translateY(14px); }

.cx-anim.cx-in .cx-scene {
    opacity: 1;
    transform: none;
    transition: opacity .65s ease, transform .65s ease;
}
.cx-anim.cx-in .cx-scene:nth-child(2) { transition-delay: .5s; }
.cx-anim.cx-in .cx-scene:nth-child(3) { transition-delay: 1s; }

/* pathLength="1" on every path means one duration draws every stroke evenly,
   whatever its real length. --d is the scene's start, --i the stroke's index
   (set by the same script that adds .cx-anim), so each scene sketches itself
   in stroke by stroke instead of appearing all at once. */
.cx-anim.cx-in .cx-art [data-draw] {
    animation: cx-draw .9s ease forwards;
    animation-delay: calc(var(--d, 0s) + var(--i, 0) * .05s);
}
.cx-anim.cx-in .cx-scene:nth-child(2) { --d: .5s; }
.cx-anim.cx-in .cx-scene:nth-child(3) { --d: 1s; }

.cx-anim.cx-in .cx-connector .cx-link { animation: cx-draw .55s ease forwards; }
.cx-anim.cx-in .cx-connector .cx-link:nth-of-type(1) { animation-delay: .42s; }
.cx-anim.cx-in .cx-connector .cx-link:nth-of-type(2) { animation-delay: .92s; }

.cx-anim.cx-in .cx-line,
.cx-anim.cx-in .cx-ctas {
    opacity: 1;
    transform: none;
    transition: opacity .6s ease 1.35s, transform .6s ease 1.35s;
}

@keyframes cx-draw { to { stroke-dashoffset: 0; } }

/* Added by script when the last stroke finishes. The drawing dash has done its
   job by then, and keeping it would leave closed shapes looking broken. */
.cx-drawn .cx-art [data-draw],
.cx-drawn .cx-connector .cx-link { stroke-dasharray: none; stroke-dashoffset: 0; }
.cx-drawn .cx-art .cx-dash { stroke-dasharray: .08 .1; }
.cx-drawn .cx-connector .cx-link { stroke-dasharray: .017 .021; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .cx-scenes { grid-template-columns: 1fr; gap: 8px; justify-items: center; }
    .cx-scene { max-width: 460px; }
    /* Vertical rhythm between stacked scenes, with a downward arrow so the
       story still reads in order. The horizontal overlay would be meaningless
       once the columns collapse. */
    .cx-scene + .cx-scene::before {
        content: '';
        display: block;
        width: 2px;
        height: 44px;
        margin: 6px auto 18px;
        background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .45));
    }
    .cx-scene + .cx-scene::after {
        content: '';
        position: absolute;
        top: 44px;
        left: 50%;
        margin-left: -5px;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 8px solid rgba(255, 255, 255, 0.45);
    }
    .cx-connector { display: none; }
    .cx-title { max-width: 18ch; }
}

@media (max-width: 430px) {
    .cx-btn { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    /* Belt and braces: even if .cx-anim were somehow applied, nothing moves
       and the full illustration is shown. */
    .cx-anim .cx-scene,
    .cx-anim .cx-line,
    .cx-anim .cx-ctas { opacity: 1; transform: none; transition: none; }
    .cx-anim .cx-art [data-draw],
    .cx-anim .cx-connector .cx-link { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
    .cx-art .cx-dash { stroke-dasharray: .08 .1; }
    .cx-connector .cx-link { stroke-dasharray: .017 .021; }
    .cx-btn { transition: none; }
}

/* A balanced pair rather than a three-up grid: Activity Experience is Sports
   Buddy and Study Buddy only. Collapses to one column on mobile via the same
   auto-fit rule .cf-grid already uses. */
@media (min-width: 720px) {
    .cf-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; margin-inline: auto; }
}
