/* ============================================
   HOME STORY: static-first narrative
   - Sections flow as normal blocks (no pin, no
     sticky, no scroll-snap, no scrubbed timelines).
   - Each .story-frame's text and visual start
     visible. When JS is available AND
     prefers-reduced-motion is not set, body.js-ready
     is added: that class hides the .story-text and
     .story-visual children and an IntersectionObserver
     adds .is-visible to each frame once it enters
     the viewport, fading and lifting them in.
   - The hero frame is marked .is-visible immediately
     on load (no entrance animation).
   - With JS disabled, or with reduced motion, the
     site is fully visible and statically beautiful.
   ============================================ */

:root {
    --story-primary: #023758;
    --story-accent: #0465a5;
    --story-accent-soft: #5fa6d6;
    --story-ink: #0a1726;
    --story-mute: #5a6776;
    --story-soft: #f5f8fb;
    --story-soft-2: #eef2f7;
    --story-line: #e3e8ef;
    --story-line-soft: #edf1f6;
    --story-card: #ffffff;
    --story-elev: 0 24px 80px -32px rgba(2, 48, 77, 0.28), 0 2px 6px -2px rgba(2, 48, 77, 0.06);
    --story-elev-strong: 0 30px 90px -28px rgba(2, 48, 77, 0.34), 0 4px 10px -4px rgba(2, 48, 77, 0.08);
    --story-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --story-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

.story {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--story-ink);
    background: #ffffff;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
}

/* Hide any legacy duplicate CTA section that pages may still ship. */
.story + .cta-section { display: none; }

/* ============================================
   FRAMES
   - All frames use normal block flow.
   - No pinning, no sticky, no scroll-snap.
   - Generous vertical padding per spec
     (3-5rem desktop, 2rem min mobile).
   ============================================ */
.story-frame {
    position: relative;
    width: 100%;
    background: #ffffff;
    padding: 5rem 0;
}

@media (max-width: 767.98px) {
    .story-frame { padding: 2.5rem 0; }
}

/* Section colour rhythm: alternating white / brand-soft. */
.story-frame.frame-soft { background: var(--story-soft); }

.story-frame > .story-inner {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    gap: 3rem;
    align-items: center;
}

.story-inner-narrow {
    max-width: 820px;
    text-align: left;
}

.story-frame .story-inner.with-visual {
    grid-template-columns: 1fr;
}

@media (min-width: 992px) {
    .story-frame .story-inner.with-visual {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .story-frame .story-inner.with-visual.reverse > .story-text { order: 2; }
    .story-frame .story-inner.with-visual.reverse > .story-visual { order: 1; }
}

@media (max-width: 991.98px) {
    /* On mobile/tablet, visual stacks above the text for clarity. */
    .story-frame .story-inner.with-visual > .story-visual { order: 0; }
    .story-frame .story-inner.with-visual > .story-text   { order: 1; }
}

/* ============================================
   TYPOGRAPHY (design tokens only)
   ============================================ */
.story-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--story-accent);
    margin: 0 0 1.1rem;
    padding-left: 0.6rem;
    border-left: 3px solid var(--story-accent);
    display: inline-block;
    line-height: 1.3;
}

.story-h1 {
    font-size: clamp(2.6rem, 6vw, 4.6rem);
    line-height: 1.04;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: var(--story-primary);
    margin: 0 0 1.5rem;
}

.story-h2 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.028em;
    color: var(--story-primary);
    margin: 0 0 1.25rem;
}

.story-lead {
    font-size: clamp(1.05rem, 1.4vw, 1.22rem);
    color: var(--story-mute);
    max-width: 42em;
    margin: 0 0 1.8rem;
    line-height: 1.65;
    font-weight: 400;
}

/* ============================================
   CTA BUTTON (pill, brand bg, focus ring, touch)
   ============================================ */
.story-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--story-primary);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 0.95rem 1.85rem;
    min-height: 44px;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: -0.005em;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s var(--story-ease), background-color 0.3s var(--story-ease), box-shadow 0.3s var(--story-ease);
    box-shadow: 0 10px 28px -12px rgba(2, 48, 77, 0.55), 0 1px 2px rgba(2, 48, 77, 0.08);
}

    .story-cta::after {
        content: "\2192";
        font-weight: 400;
        transition: transform 0.3s var(--story-ease);
    }

    .story-cta:hover,
    .story-cta:focus-visible {
        background: var(--story-accent);
        color: #ffffff;
        transform: translateY(-1px);
        box-shadow: 0 18px 40px -14px rgba(4, 101, 165, 0.6), 0 2px 4px rgba(4, 101, 165, 0.12);
    }

    .story-cta:hover::after { transform: translateX(4px); }

    .story-cta:focus-visible {
        outline: 2px solid var(--story-accent-soft);
        outline-offset: 3px;
    }

/* ============================================
   FRAME 1: HERO
   - Static, no rotor, no particles, no
     scroll indicator. Visible immediately
     (entrance system marks .frame-hero
     .is-visible on load; no per-element fade).
   ============================================ */
.frame-hero {
    background:
        radial-gradient(1100px 700px at 78% 38%, rgba(95, 166, 214, 0.18), transparent 65%),
        radial-gradient(900px 600px at 12% 88%, rgba(2, 48, 77, 0.06), transparent 70%),
        linear-gradient(180deg, #fbfcfe 0%, #eef3f8 100%);
    padding: 6.5rem 0 5rem;
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .frame-hero { padding: 4rem 0 2.5rem; }
}

.story-inner-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    justify-items: center;
    text-align: center;
}

.story-text-hero { max-width: 36em; }

/* ============================================
   STORY VISUAL CONTAINER (Connect / Trust / See / Act)
   - White card, soft elevation, generous padding,
     fills its column.
   - Subtle hover lift on pointer-capable devices.
   ============================================ */
.story-visual {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid rgba(2, 55, 88, 0.12);
    border-radius: 24px;
    padding: 16px;
    box-shadow: 0 8px 30px -12px rgba(2, 48, 77, 0.18),
                0 1px 3px rgba(2, 48, 77, 0.04);
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
                box-shadow 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.story-screenshot {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 18px;
    object-fit: cover;
}

.story-visual:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px -18px rgba(2, 55, 88, 0.28),
                0 4px 10px -4px rgba(2, 55, 88, 0.06);
}

@media (hover: none) {
    .story-visual:hover {
        transform: none;
        box-shadow: 0 8px 30px -12px rgba(2, 48, 77, 0.18),
                    0 1px 3px rgba(2, 48, 77, 0.04);
    }
}

@media (max-width: 575.98px) {
    .story-visual {
        max-width: 100%;
        border-radius: 20px;
        padding: 12px;
    }
    .story-screenshot {
        border-radius: 14px;
    }
}

/* ============================================
   MANAGED SERVICE (calm, dark)
   No wash animation; static dark gradient.
   ============================================ */
.frame-managed {
    background:
        radial-gradient(900px 600px at 80% 20%, rgba(122, 185, 230, 0.22), transparent 60%),
        radial-gradient(700px 500px at 10% 90%, rgba(4, 101, 165, 0.30), transparent 65%),
        linear-gradient(160deg, #04253b 0%, #023758 60%, #011f30 100%);
    color: #f3f7fb;
}

    .frame-managed .story-eyebrow { color: #7ab9e6; border-left-color: #7ab9e6; }
    .frame-managed .story-h2      { color: #ffffff; }
    .frame-managed .story-lead    { color: #c8d6e2; max-width: 44em; }

.managed-headline {
    font-size: clamp(2.2rem, 4.4vw, 3.4rem);
    line-height: 1.12;
}

/* ---- Managed Service: expand + nav flip ---- */

/* Section needs high z-index so when its padding expands
   it visually covers the white space above/below, not
   going behind adjacent sections. */
.frame-managed,
.frame-work {
    position: relative;
    z-index: 51;
    overflow: hidden;
}

    /* Inner element animated by GSAP (scale) */
    .frame-managed .story-inner,
    .frame-work .frame-inner {
        will-change: transform;
        transform-origin: center center;
    }

/* Nav must be above the expanding section */
header nav.navbar {
    z-index: 100;
    position: relative;
}

header {
    background: transparent !important;
}

/* Nav inverted colours for when the dark section fills the screen.
   "is-dark-mode" is just our class name � nothing to do with OS dark mode. */
nav.navbar.is-dark-mode {
    background: transparent !important;
    box-shadow: none !important;
    border-bottom-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

    nav.navbar.is-dark-mode .navbar-brand,
    nav.navbar.is-dark-mode .nav-link {
        color: #f6f8fb !important;
    }

        nav.navbar.is-dark-mode .navbar-brand img,
        nav.navbar.is-dark-mode .navbar-brand svg {
            filter: brightness(0) invert(1);
        }

    nav.navbar.is-dark-mode .nav-cta {
        border-color: #f6f8fb !important;
        color: #f6f8fb !important;
        background: transparent !important;
        box-shadow: none !important;
    }

/* Smooth transitions for the colour flip */
nav.navbar .navbar-brand,
nav.navbar .nav-link,
nav.navbar .nav-cta {
    transition: color 0.4s ease, border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
}

    nav.navbar .navbar-brand img,
    nav.navbar .navbar-brand svg {
        transition: filter 0.4s ease;
    }

/* ============================================
   FRAME: USE CASES
   ============================================ */
.frame-usecases { background: #ffffff; }

.usecase-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .usecase-grid { grid-template-columns: repeat(2, 1fr); }
}

.usecase-card {
    border: 1px solid var(--story-line-soft);
    border-radius: 18px;
    padding: 1.7rem 1.8rem;
    background: var(--story-card);
    transition: transform 0.3s var(--story-ease), box-shadow 0.3s var(--story-ease), border-color 0.3s var(--story-ease);
}

    .usecase-card:hover {
        transform: translateY(-3px);
        border-color: rgba(4, 101, 165, 0.35);
        box-shadow: 0 24px 50px -28px rgba(4, 101, 165, 0.4);
    }

    .usecase-card h3 {
        font-size: 1.06rem;
        font-weight: 700;
        margin: 0 0 0.45rem;
        color: var(--story-primary);
        letter-spacing: -0.012em;
    }

    .usecase-card p {
        font-size: 0.95rem;
        color: var(--story-mute);
        margin: 0;
    }

/* ============================================
   FRAME: SECURITY pills (static)
   ============================================ */
.security-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 0.8rem;
    margin-top: 1.2rem;
}

.security-pill {
    background: #ffffff;
    border: 1px solid var(--story-line);
    border-radius: 999px;
    padding: 0.6rem 1.15rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--story-primary);
    box-shadow: 0 1px 2px rgba(2, 48, 77, 0.04);
    transition: transform 0.25s var(--story-ease), box-shadow 0.25s var(--story-ease), color 0.25s var(--story-ease), background-color 0.25s var(--story-ease), border-color 0.25s var(--story-ease);
}

    .security-pill:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 18px -10px rgba(2, 48, 77, 0.18);
        background: var(--story-accent);
        color: #ffffff;
        border-color: var(--story-accent);
    }

/* ============================================
   FRAME: CTA (gradient)
   ============================================ */
.frame-cta {
    background:
        radial-gradient(700px 400px at 20% 30%, rgba(122, 185, 230, 0.25), transparent 60%),
        radial-gradient(600px 400px at 85% 80%, rgba(4, 101, 165, 0.35), transparent 65%),
        linear-gradient(135deg, #022c47 0%, #0465a5 100%);
    color: #ffffff;
    text-align: center;
    padding: 5.5rem 0;
}

    .frame-cta .story-h2  { color: #ffffff; }
    .frame-cta .story-lead { color: #d6e3ee; max-width: 38em; margin-left: auto; margin-right: auto; }
    .frame-cta .story-inner { text-align: center; }
    .frame-cta .story-text  { margin: 0 auto; }

    .frame-cta .story-cta {
        background: #ffffff;
        color: var(--story-primary);
    }

        .frame-cta .story-cta:hover,
        .frame-cta .story-cta:focus-visible {
            background: #f3f7fb;
            color: var(--story-primary);
        }

/* ============================================
   ENTRANCE: IntersectionObserver fade + lift (single play)
   - Default (no JS): every .story-text and
     .story-visual is fully visible.
   - When JS adds body.js-ready, .story-text and
     .story-visual inside .story-frame become hidden
     and lifted by 32px. The IntersectionObserver
     adds .is-visible to each frame as it enters
     the viewport, restoring opacity:1 and translateY(0).
   - Single-play: .is-visible is never removed.
   - The hero frame (.frame-hero) is marked .is-visible
     immediately on load so it is visible without
     animation.
   - .story-visual carries an additional 120ms
     transition-delay so the visual cascades after
     its accompanying text.
   ============================================ */
.js-ready .story-frame .story-text,
.js-ready .story-frame .story-visual {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 600ms cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: opacity, transform;
}

.js-ready .story-frame.is-visible .story-text,
.js-ready .story-frame.is-visible .story-visual {
    opacity: 1;
    transform: translateY(0);
}

.js-ready .story-frame.is-visible .story-visual {
    transition-delay: 120ms;
}

/* ============================================
   Reduced motion: fully static, no animation.
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .js-ready .story-frame .story-text,
    .js-ready .story-frame .story-visual {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .story-cta,
    .usecase-card,
    .security-pill,
    .story-visual {
        animation: none !important;
        transition: none !important;
        will-change: auto !important;
    }
}

/* ============================================
   JOURNEY STRIP (sticky)
   - Wraps Connect/Trust/See/Act and sticks
     below the nav while the user reads them.
   - Inactive steps dim; active step (set by JS
     IntersectionObserver) is fully opaque.
   ============================================ */
.story-journey-wrapper {
    position: relative;
}

.journey-strip {
    position: sticky;
    top: 64px; /* below the nav height */
    z-index: 50;
    background: rgba(246, 248, 251, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e3e8ef;
    padding: 1rem 0;
}

.journey-strip-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.journey-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0 1rem;
    opacity: 0.4;
    transition: opacity 0.35s ease;
}

.journey-step.is-active {
    opacity: 1;
}

.journey-step-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(2, 55, 88, 0.08);
}

    .journey-step-icon svg {
        width: 100%;
        height: 100%;
        display: block;
    }

.journey-step-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--story-primary, #023758);
}

.journey-step-line {
    width: 32px;
    height: 2px;
    background: #e3e8ef;
    flex-shrink: 0;
    margin-bottom: 1rem; /* align with icons, not labels */
}

@media (max-width: 768px) {
    .journey-step-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .journey-step {
        padding: 0 0.5rem;
    }

    .journey-step-label {
        font-size: 0.6rem;
    }

    .journey-step-line {
        width: 20px;
    }
}