/* ============================================================
   Section 02 - Problem & Solution Toggle
   Figma frame: "without / with Skyportal" two-state section
   ============================================================ */

/* --- Visually hidden (a11y/SEO) ---
   Standard "screen-reader only" pattern. Hides content visually but
   leaves it in the accessibility tree and in flat-text scrapes, so
   AI/AEO crawlers can read state labels that the visual toggle UI
   conveys through styling alone. */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* --- Section wrapper --- */
.nl-toggle-section {
    background: #020617;
    padding: 96px 0 80px;
    position: relative;
    overflow: hidden;
}

.nl-toggle-section__inner {
    max-width: 1248px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 64px);
}

/* --- Section header (above the toggle pill) --- */
.nl-toggle-section__header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto clamp(24px, 4vw, 48px);
}

.nl-toggle-section__heading {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.nl-toggle-section__intro {
    font-size: clamp(15px, 1.6vw, 17px);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
    margin: 0;
}

/* --- Pill toggle switcher --- */
.nl-toggle-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 64px;
}

.nl-toggle-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--nl-radius-pill, 999px);
    padding: 4px;
}

.nl-toggle-pill__btn {
    font-family: var(--nl-font, 'Plus Jakarta Sans', sans-serif);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    padding: 10px 24px;
    border-radius: var(--nl-radius-pill, 999px);
    border: none;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    user-select: none;
}

.nl-toggle-pill__btn--active {
    background: #FFFFFF;
    color: #020617;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.nl-toggle-pill__btn--inactive {
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
}

.nl-toggle-pill__btn--inactive:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* --- Content area (two columns) --- */
.nl-toggle-content {
    display: grid;
    position: relative;
    isolation: isolate;
}

/* --- State containers --- */
.nl-toggle-state {
    grid-area: 1 / 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    opacity: 0;
    transform: translateY(10px) scale(0.992);
    filter: saturate(0.9);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 0.4s;
}

.nl-toggle-state--active {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: saturate(1);
    pointer-events: auto;
    visibility: visible;
    z-index: 2;
    transition-delay: 0s, 0s, 0s, 0s;
}

/* --- Left column: Text content --- */
.nl-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Kicker / eyebrow text above each panel heading.
   Small, blue, all caps — readable to humans, scannable to scrapers. */
.nl-toggle-text__kicker {
    font-family: var(--nl-font, 'Plus Jakarta Sans', sans-serif);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--nl-blue, #3B82F6);
    margin: 0 0 4px;
}

.nl-toggle-text__heading {
    font-family: var(--nl-font, 'Plus Jakarta Sans', sans-serif);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.03em;
    color: #FFFFFF;
    margin: 0;
}

.nl-toggle-text__body {
    font-family: var(--nl-font, 'Plus Jakarta Sans', sans-serif);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    color: #AFBCD5;
}

/* Quote element — now a <blockquote>, so reset its default
   browser margin/padding before applying our visual style. */
.nl-toggle-text__quote {
    font-family: var(--nl-font, 'Plus Jakarta Sans', sans-serif);
    font-size: 20px;
    font-weight: 200;
    font-style: italic;
    line-height: 1.5;
    color: var(--nl-blue, #3B82F6);
    margin: 0;
    padding: 8px 0 0;
}

/* Sample element — now a <figure>, so reset its default
   browser margin before applying our card style. */
.nl-toggle-text__sample {
    width: 100%;
    max-width: 640px;
    margin: 0;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(3px);
}

.nl-toggle-text__sample-label {
    display: inline-block;
    margin-bottom: 6px;
    font-family: var(--nl-font, 'Plus Jakarta Sans', sans-serif);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(175, 188, 213, 0.82);
}

.nl-toggle-text__sample-text {
    margin: 0;
    font-family: var(--nl-font, 'Plus Jakarta Sans', sans-serif);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    color: rgba(233, 239, 249, 0.95);
}

/* --- Right column: Visual card (now wraps a single <figure>+<img>) --- */
.nl-toggle-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    /* width: 100% is required because the <figure>'s only children are
       absolutely-positioned (img + sr-only figcaption), so its intrinsic
       content size is 0. Without an explicit width, aspect-ratio collapses
       it to 0x0 inside the grid cell. */
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 480px;
    margin: 0 auto;
    transform: translateY(0) scale(1);
    box-shadow: 0 12px 30px rgba(5, 11, 26, 0.24);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.nl-toggle-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: transparent;
    display: block;
    border-radius: inherit;
}

.nl-toggle-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 24px 46px rgba(5, 11, 26, 0.38), 0 0 52px rgba(59, 130, 246, 0.2);
}

/* --- Transition animation for state swap --- */
.nl-toggle-state .nl-toggle-text,
.nl-toggle-state .nl-toggle-card {
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.nl-toggle-state .nl-toggle-text {
    transform: translateX(-10px);
    opacity: 0;
}

.nl-toggle-state .nl-toggle-card {
    transform: translateX(10px);
    opacity: 0;
}

.nl-toggle-state--active .nl-toggle-text,
.nl-toggle-state--active .nl-toggle-card {
    transform: translateX(0);
    opacity: 1;
}

/* --- Scroll-triggered entrance --- */
.nl-toggle-section[data-visible="false"] .nl-toggle-switcher,
.nl-toggle-section[data-visible="false"] .nl-toggle-content {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(6px);
}

.nl-toggle-section[data-visible="true"] .nl-toggle-switcher {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition: opacity 0.72s cubic-bezier(0.33, 1, 0.68, 1), transform 0.72s cubic-bezier(0.34, 1.3, 0.5, 1), filter 0.72s cubic-bezier(0.33, 1, 0.68, 1);
}

.nl-toggle-section[data-visible="true"] .nl-toggle-content {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition: opacity 0.72s cubic-bezier(0.33, 1, 0.68, 1) 0.12s, transform 0.72s cubic-bezier(0.34, 1.3, 0.5, 1) 0.12s, filter 0.72s cubic-bezier(0.33, 1, 0.68, 1) 0.12s;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    /* Float the without/with toggle so you can switch while looking at the
       diagram. The two states overlap (grid 1/1), so tapping swaps the image
       in place at your current scroll position — no scrolling back up. The pill
       is frosted + slightly faded so the content behind stays visible. */
    .nl-toggle-section {
        overflow: visible; /* overflow:hidden would clip the sticky switcher */
    }

    .nl-toggle-switcher {
        position: sticky;
        top: 70px; /* floats just under the ~61px sticky site header */
        z-index: 30;
        pointer-events: none; /* transparent bar shouldn't block content... */
    }

    .nl-toggle-pill {
        pointer-events: auto; /* ...only the pill is interactive */
        background: rgba(2, 6, 23, 0.5);
        border-color: rgba(255, 255, 255, 0.12);
        -webkit-backdrop-filter: blur(16px) saturate(1.3);
        backdrop-filter: blur(16px) saturate(1.3);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }

    /* Selected tab: softened from stark white so it reads as part of the frosted
       control — but kept mostly opaque, since a clear, legible selected state is
       the right call (you shouldn't need to see through the chosen tab). */
    .nl-toggle-pill__btn--active {
        background: rgba(255, 255, 255, 0.9);
    }

    /* "Tuck" the floating toggle away once the diagram reaches it, so it stops
       right above the image instead of covering it (JS toggles .is-tucked). */
    .nl-toggle-section[data-visible] .nl-toggle-switcher.is-tucked {
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .nl-toggle-switcher.is-tucked .nl-toggle-pill {
        pointer-events: none;
    }

    .nl-toggle-state {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .nl-toggle-text__heading {
        font-size: 32px;
    }

    .nl-toggle-text__body {
        font-size: 16px;
    }

    .nl-toggle-text__quote {
        font-size: 18px;
    }

    .nl-toggle-text__sample-text {
        font-size: 15px;
    }

}

@media (max-width: 640px) {
    .nl-toggle-section {
        padding: 64px 0 56px;
    }

    .nl-toggle-switcher {
        margin-bottom: 40px;
    }

    .nl-toggle-pill__btn {
        font-size: 13px;
        padding: 8px 18px;
    }

    .nl-toggle-text__heading {
        font-size: 26px;
    }

    .nl-toggle-text__body {
        font-size: 15px;
    }

    .nl-toggle-text__quote {
        font-size: 16px;
    }

    .nl-toggle-text__sample {
        padding: 12px 14px;
        border-radius: 10px;
    }

    .nl-toggle-text__sample-label {
        font-size: 10px;
        margin-bottom: 5px;
    }

    .nl-toggle-text__sample-text {
        font-size: 14px;
    }

}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .nl-toggle-state,
    .nl-toggle-state .nl-toggle-text,
    .nl-toggle-state .nl-toggle-card {
        transition: none;
        transform: none;
        filter: none;
    }

    .nl-toggle-state:not(.nl-toggle-state--active) {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .nl-toggle-state--active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nl-toggle-card,
    .nl-toggle-card__image {
        transition: none;
        transform: none;
        animation: none;
    }

    .nl-toggle-section[data-visible] .nl-toggle-switcher,
    .nl-toggle-section[data-visible] .nl-toggle-content {
        transition: none;
        opacity: 1;
        transform: none;
        filter: none;
    }
}

/* ============================================================
   Why-Skyportal text refinements
   - Two-tone heading (without panel)
   - Warning + success capsule variants for the panel quotes
   ============================================================ */

/* Heading two-tone — primary stays white, secondary muted grey.
   AEO sees both lines as a single <h3> still. */
.nl-toggle-text__heading-primary {
    display: block;
    color: #FFFFFF;
}
.nl-toggle-text__heading-secondary {
    display: block;
    color: rgba(255, 255, 255, 0.5);
}

/* Quote — capsule variants for both panels. Pill-shaped, tinted accent,
   with an inline status icon. Warning (without): triangle-! in blue.
   Success (with): double check in green. */
.nl-toggle-text__quote--warning,
.nl-toggle-text__quote--success {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid;
    font-style: normal;
    font-weight: 500;
    /* Override the base padding-top from the with-panel quote style */
    padding-top: 10px;
}

/* Warning capsule — fragmented production signals (without panel). */
.nl-toggle-text__quote--warning {
    border-color: rgba(59, 130, 246, 0.32);
    background: rgba(59, 130, 246, 0.08);
    /* text color inherits base blue */
}

/* Success capsule — coordinated diagnosis + action (with panel). */
.nl-toggle-text__quote--success {
    border-color: rgba(34, 197, 94, 0.36);
    background: rgba(34, 197, 94, 0.10);
    color: #4ADE80; /* green text overrides the base blue */
}

/* Inline status icon — color matches its parent variant. */
.nl-toggle-text__quote-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}
.nl-toggle-text__quote--warning .nl-toggle-text__quote-icon {
    color: var(--nl-blue, #3B82F6);
}
.nl-toggle-text__quote--success .nl-toggle-text__quote-icon {
    color: #4ADE80;
}

/* --- SARA connector line (single SARA mention; bridges toggle -> regression tabs) --- */
.nl-toggle-sara {
    max-width: 760px;
    /* content-box so the horizontal padding adds OUTSIDE the 760px cap (keeps the
       desktop text width unchanged) while preventing edge-to-edge text on mobile,
       aligning it with the padded content above. */
    box-sizing: content-box;
    margin: clamp(40px, 5vw, 64px) auto 0;
    padding: 0 clamp(20px, 4vw, 64px);
    text-align: center;
    font-family: var(--nl-font, 'Plus Jakarta Sans', sans-serif);
    font-size: clamp(16px, 1.6vw, 19px);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
}

.nl-toggle-sara__label {
    color: var(--nl-blue, #3B82F6);
    font-weight: 600;
}
