:root {
    --neo-text: #eef7ff;
    --neo-muted: #9bb6d7;
    --neo-line: rgba(164, 192, 230, 0.3);
    --neo-line-strong: rgba(34, 211, 238, 0.56);
    --neo-cyan: #22d3ee;
    --neo-blue: #3b82f6;
    --neo-lime: #22c55e;
    --neo-amber: #f59e0b;
}

.services-section,
.use-cases-section,
.why-ai-section,
.resources-section,
.resources-hero {
    position: relative;
    isolation: isolate;
    --section-progress: 0.5;
}

.services-section::before,
.use-cases-section::before,
.why-ai-section::before,
.resources-section::before,
.resources-hero::before {
    content: "";
    position: absolute;
    inset: -100px -12% auto -12%;
    height: 340px;
    background:
        radial-gradient(42% 110% at 0% 0%, rgba(59, 130, 246, 0.25), transparent 80%),
        radial-gradient(46% 120% at 100% 0%, rgba(34, 211, 238, 0.22), transparent 84%);
    opacity: calc(0.3 + var(--section-progress) * 0.62);
    pointer-events: none;
    z-index: -2;
}

.services-section::after,
.use-cases-section::after,
.why-ai-section::after,
.resources-section::after,
.resources-hero::after {
    content: "";
    position: absolute;
    left: -10%;
    right: -10%;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0), rgba(34, 211, 238, 0.68), rgba(34, 211, 238, 0));
    transform: translateY(calc((1 - var(--section-progress)) * 68px));
    opacity: calc(0.12 + var(--section-progress) * 0.66);
    pointer-events: none;
    z-index: -1;
}

.neo-panel {
    position: relative;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--neo-text);
    overflow: visible;
}

.neo-panel::before,
.neo-panel::after {
    content: none !important;
}

.neo-head {
    display: flex;
    align-items: center;
    margin: 0;
}

.neo-icon {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid rgba(219, 242, 255, 0.36);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(155deg, rgba(59, 130, 246, 0.35), rgba(34, 211, 238, 0.26));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.neo-icon::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px solid rgba(34, 211, 238, 0.44);
    opacity: 0.22;
    animation: neo-pulse 3.1s ease-in-out infinite;
}

.neo-icon svg {
    width: 22px;
    height: 22px;
    stroke: #e8f7ff;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.neo-title {
    margin: 0;
    font-size: clamp(1.24rem, 2.2vw, 2rem);
    font-weight: 780;
    line-height: 1.16;
    letter-spacing: 0.01em;
    color: #f4faff;
}

.neo-copy {
    margin: 0;
    color: var(--neo-muted);
    font-size: 0.9rem;
    line-height: 1.62;
}

.neo-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(168, 197, 236, 0.34);
    background: rgba(9, 16, 30, 0.74);
    color: #e6f2ff;
    font-size: 0.73rem;
    font-family: var(--font-mono, monospace);
    transition: border-color 0.24s ease, color 0.24s ease, background 0.24s ease, transform 0.24s ease;
}

.neo-cta:hover,
.neo-cta:focus-visible {
    border-color: var(--neo-line-strong);
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.14), rgba(59, 130, 246, 0.1));
    color: #9bedff;
    transform: translateY(-1px);
    outline: none;
}

.neo-expand {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    min-width: 132px;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(168, 197, 236, 0.34);
    background: rgba(9, 16, 30, 0.74);
    color: #e6f2ff;
    font-size: 0.73rem;
    font-family: var(--font-mono, monospace);
    cursor: pointer;
    transition: border-color 0.24s ease, color 0.24s ease, background 0.24s ease;
}

.neo-expand::after {
    content: "+";
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
}

.neo-panel.is-open .neo-expand::after {
    content: "−";
}

.neo-expand:hover,
.neo-expand:focus-visible {
    border-color: var(--neo-line-strong);
    background: rgba(34, 211, 238, 0.14);
    color: #97ebff;
    outline: none;
}

.neo-details {
    margin-top: 10px;
    max-height: none;
    opacity: 1;
    overflow: visible;
}

.neo-dynamics .neo-expand {
    display: inline-flex;
}

.neo-dynamics [data-expandable="true"] .neo-details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.36s ease, opacity 0.32s ease;
}

.neo-dynamics [data-expandable="true"].is-open .neo-details {
    opacity: 1;
}

.neo-dynamics .reveal-item {
    opacity: 0;
    transform: translate3d(0, calc(42px + (var(--item-index, 0) * 1px)), 0);
    filter: blur(6px);
}

.neo-dynamics .reveal-item.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
    transition:
        opacity 0.88s ease var(--item-delay, 0ms),
        transform 0.98s cubic-bezier(0.2, 0.9, 0.24, 1) var(--item-delay, 0ms),
        filter 0.72s ease var(--item-delay, 0ms);
}

/* SERVICES: fullscreen reading scenes */
.neo-services {
    position: relative;
    display: flex;
    flex-direction: column;
}

.neo-services .neo-panel--service {
    position: relative;
    min-height: min(72vh, 620px);
    display: grid;
    align-content: center;
    padding: 10vh 0;
}

.neo-services .neo-panel--service .neo-head {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.neo-services .neo-panel--service .neo-title,
.neo-services .neo-panel--service .neo-copy {
    width: min(44vw, 640px);
    margin-right: auto;
    text-align: left;
    padding-right: 92px;
}

.neo-services .neo-panel--service .neo-copy {
    margin-top: 8px;
}

.neo-services .neo-panel--service::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(34, 211, 238, 0), rgba(34, 211, 238, 0.5), rgba(34, 211, 238, 0));
    transform: translateX(-50%);
    pointer-events: none;
}

.neo-services .neo-panel--service::after {
    content: "";
    position: absolute;
    top: 50%;
    left: calc(50% - 2px);
    width: min(30vw, 400px);
    border-top: 1px solid rgba(166, 194, 231, 0.36);
    transform: translateY(-50%);
}

.neo-services .neo-panel--service:nth-child(even) .neo-title,
.neo-services .neo-panel--service:nth-child(even) .neo-copy {
    margin-left: auto;
    margin-right: 0;
    text-align: right;
    padding-right: 0;
    padding-left: 92px;
}

.neo-services .neo-panel--service:nth-child(even)::after {
    left: auto;
    right: calc(50% - 2px);
}

/* CASES: stage triptych */
.neo-cases {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 20px;
    position: relative;
}

.neo-cases::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 36px;
    height: 1px;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0), rgba(245, 158, 11, 0.58), rgba(245, 158, 11, 0));
    pointer-events: none;
}

.neo-cases .neo-panel--case {
    min-height: 236px;
    padding-top: 56px;
    border-left: 1px solid rgba(245, 158, 11, 0.35);
    padding-left: 14px;
}

.neo-cases .neo-panel--case .neo-head {
    position: absolute;
    top: 0;
    left: 0;
}

.neo-cases .neo-panel--case .neo-title {
    font-size: clamp(1.08rem, 1.35vw, 1.42rem);
}

.neo-cases .neo-panel--case .neo-copy {
    margin-top: 4px;
}

.use-case-points {
    display: grid;
    gap: 9px;
    margin-top: 12px;
    border-left: 1px solid rgba(245, 158, 11, 0.42);
    padding-left: 14px;
}

.use-case-points p {
    margin: 0;
    color: #dce9fb;
    font-size: 0.79rem;
    line-height: 1.48;
}

.use-case-points p span {
    color: #ffd79a;
    font-weight: 700;
}

/* IA: manifesto runway */
.neo-ia {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.neo-ia .neo-panel--ia {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: 106px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(154, 187, 230, 0.28);
}

.neo-ia .neo-panel--ia:first-child {
    border-top: 1px solid rgba(154, 187, 230, 0.28);
}

.neo-ia .neo-panel--ia:nth-child(2) .neo-icon {
    background: linear-gradient(160deg, rgba(59, 130, 246, 0.36), rgba(129, 140, 248, 0.24));
}

.neo-ia .neo-panel--ia:nth-child(3) .neo-icon {
    background: linear-gradient(160deg, rgba(34, 197, 94, 0.34), rgba(34, 211, 238, 0.24));
}

/* RESOURCES: poster sequence */
.neo-resources,
.resources-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.neo-panel--resource {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 140px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(154, 187, 230, 0.24);
}

.neo-panel--resource:first-child {
    border-top: 1px solid rgba(154, 187, 230, 0.24);
}

.neo-panel--resource .neo-head {
    display: none;
}

.resource-teaser-thumb,
.resource-thumb {
    width: 100%;
    height: 132px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    box-shadow: 0 10px 24px rgba(2, 8, 23, 0.46);
    padding: 6px;
    transform: perspective(600px) rotateY(-8deg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.neo-panel--resource:nth-child(even) .resource-teaser-thumb,
.neo-panel--resource:nth-child(even) .resource-thumb {
    transform: perspective(600px) rotateY(8deg);
}

.neo-panel--resource:hover .resource-teaser-thumb,
.neo-panel--resource:hover .resource-thumb {
    transform: perspective(600px) rotateY(0);
    box-shadow: 0 14px 30px rgba(2, 8, 23, 0.58);
}

.resource-teaser-body,
.resource-body {
    display: grid;
    gap: 7px;
}

.resource-meta-line {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #9fc5e8;
    font-size: 0.71rem;
    line-height: 1.2;
    font-family: var(--font-mono, monospace);
}

.resource-meta-line .lang-flag {
    width: 14px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}

.resource-teaser-desc,
.resource-desc {
    margin: 0;
}

.resource-teaser-actions,
.resource-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.resource-teaser-actions .neo-cta {
    grid-column: 1 / -1;
}

/* hard override old inline boxed rules */
.neo-resources .resource-teaser-card,
.resources-grid .resource-card,
.neo-panel--resource {
    border-radius: 0 !important;
    background: transparent !important;
    border-left: 0 !important;
    border-right: 0 !important;
    box-shadow: none !important;
}

@keyframes neo-pulse {
    0%,
    100% {
        transform: scale(0.92);
        opacity: 0.24;
    }
    50% {
        transform: scale(1.03);
        opacity: 0.66;
    }
}

@media (max-width: 1180px) {
    .neo-cases {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .neo-cases .neo-panel--case:first-child {
        grid-column: 1 / -1;
    }

    .neo-cases::before {
        display: none;
    }
}

@media (max-width: 900px) {
    .neo-services .neo-panel--service,
    .neo-services .neo-panel--service:nth-child(even) {
        min-height: 96px;
        padding: 10px 0;
    }

    .neo-services .neo-panel--service .neo-head {
        left: 0;
        top: 0;
        transform: none;
        position: relative;
        margin-bottom: 6px;
    }

    .neo-services .neo-panel--service .neo-title,
    .neo-services .neo-panel--service .neo-copy,
    .neo-services .neo-panel--service:nth-child(even) .neo-title,
    .neo-services .neo-panel--service:nth-child(even) .neo-copy {
        width: 100%;
        margin: 0;
        padding: 0;
        text-align: left;
    }

    .neo-services .neo-panel--service::before,
    .neo-services .neo-panel--service::after {
        display: none;
    }

    .neo-cases,
    .resource-actions {
        grid-template-columns: 1fr;
    }

    .neo-panel--resource {
        grid-template-columns: 98px minmax(0, 1fr);
        min-height: 120px;
        gap: 10px;
    }

    .resource-teaser-thumb,
    .resource-thumb {
        height: 108px;
        transform: none !important;
    }

    .neo-dynamics .reveal-item {
        filter: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .neo-icon::after,
    .neo-panel,
    .neo-expand,
    .neo-dynamics .reveal-item,
    .neo-dynamics .reveal-item.is-visible,
    .resource-teaser-thumb,
    .resource-thumb {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        filter: none !important;
    }

    .neo-dynamics .reveal-item {
        opacity: 1 !important;
    }
}
