/*
 * Nosotros redesigned (OD-115, docs/m14/ABOUT-REDESIGN.md) — the rules of templates/site/about.twig, loaded only by it after
 * base.css and site.css, in the `pages` layer. The showcase's symbols keep fixed colours (`--ab-1…6`, the same in the 3D, the
 * still drawing, the ribbon and the course: they live on night and purple bands in both themes); everything else uses the
 * design-system tokens. Complete without JavaScript, WebGL or motion (the showcase keeps its still drawing) and nothing is
 * laid over informative text (OD-103a): the stage has its own column, its own row on phones, never sticky.
 */
@layer pages {
    .p-about {
        --ab-1: #5ce1ff;
        --ab-2: #bfacdd;
        --ab-3: #effcff;
        --ab-4: #ffb547;
        --ab-5: #f2c66b;
        --ab-6: #b8f2ff;
        --ab-spectrum: linear-gradient(90deg, var(--ab-1) 0 16.66%, var(--ab-2) 0 33.33%, var(--ab-3) 0 50%, var(--ab-4) 0 66.66%, var(--ab-5) 0 83.33%, var(--ab-6) 0);
    }

    /* ---- Opening band: the name and promise beside the showcase; the ribbon at its foot (OD-72). */
    .p-about .c-about-hero {
        --band-space: var(--rhythm-m);
        background:
            radial-gradient(55% 70% at 78% 42%, rgb(0 145 179 / 0.3), rgb(0 145 179 / 0) 70%),
            radial-gradient(45% 60% at 0% 100%, rgb(140 107 194 / 0.32), rgb(140 107 194 / 0) 70%),
            var(--color-bg);
    }

    .p-about .c-about-hero::after {
        content: none;
    }

    .p-about .c-about-hero::before {
        content: "";
        position: absolute;
        inset-inline: 0;
        inset-block-end: 0;
        block-size: 0.25rem;
        background: var(--ab-spectrum);
    }

    .c-ab-hero__grid {
        display: grid;
        gap: var(--space-l) var(--grid-gap);
        align-items: center;
    }

    .c-ab-hero__inner h1 {
        font-size: clamp(2.5rem, 1.9rem + 3vw, 4.5rem);
    }

    .c-ab-hero__inner .c-page-hero__lead {
        font-family: var(--font-display);
        font-size: var(--text-xl);
        font-weight: var(--weight-semibold);
        color: var(--color-text);
    }

    .c-ab-art {
        position: relative;
        isolation: isolate;
        inline-size: 100%;
        aspect-ratio: 3 / 2;
        pointer-events: none;
    }

    /* The viewfinder's corners and the glow behind the showcase: decoration, under it. */
    .c-ab-art::before {
        content: "";
        position: absolute;
        z-index: -1;
        inset: 0;
        --corner: linear-gradient(var(--color-link), var(--color-link));
        background:
            var(--corner) left top / 1.5rem 2px no-repeat,
            var(--corner) left top / 2px 1.5rem no-repeat,
            var(--corner) right top / 1.5rem 2px no-repeat,
            var(--corner) right top / 2px 1.5rem no-repeat,
            var(--corner) left bottom / 1.5rem 2px no-repeat,
            var(--corner) left bottom / 2px 1.5rem no-repeat,
            var(--corner) right bottom / 1.5rem 2px no-repeat,
            var(--corner) right bottom / 2px 1.5rem no-repeat;
        opacity: 0.55;
    }

    .c-ab-art::after {
        content: "";
        position: absolute;
        z-index: -2;
        inset: 12% 10% 6%;
        border-radius: 50%;
        background: radial-gradient(closest-side, rgb(0 145 179 / 0.32), rgb(0 145 179 / 0));
    }

    .c-ab-still,
    .c-ab-canvas {
        position: absolute;
        inset: 0;
        inline-size: 100%;
        block-size: 100%;
    }

    .c-ab-still {
        transition: opacity var(--dur-slow) var(--ease-standard);
    }

    .c-about-hero.is-3d .c-ab-still {
        opacity: 0;
    }

    /* The caption names the claim in front (only while the 3D runs; the ribbon says every claim for everyone). */
    .c-ab-caption {
        display: none;
        align-items: baseline;
        justify-content: center;
        gap: var(--space-xs);
        min-block-size: 3em;
        margin: var(--space-xs) 0 0;
        font-family: var(--font-display);
        font-size: var(--text-m);
        font-weight: var(--weight-semibold);
        text-align: center;
        color: var(--color-text);
    }

    .c-ab-caption__number {
        color: var(--color-link);
        font-variant-numeric: tabular-nums lining-nums;
    }

    .c-about-hero.is-3d .c-ab-caption {
        display: flex;
    }

    .c-ribbon__icon {
        flex: none;
        align-self: center;
        inline-size: 1.15em;
        block-size: 1.15em;
        color: var(--turquoise-300);
    }

    @media (min-width: 64rem) {
        .c-ab-hero__grid {
            grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        }
    }

    /* ---- Who we are: the narrative beside the photograph in its viewfinder; the platform as its own card. */
    .c-ab-intro__grid {
        display: grid;
        gap: var(--space-xl) var(--grid-gap);
        align-items: center;
    }

    .c-ab-intro__lead {
        font-family: var(--font-display);
        font-size: var(--text-xl);
        font-weight: var(--weight-semibold);
        line-height: 1.35;
    }

    .c-ab-platform {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: var(--space-s);
        align-items: start;
        padding: var(--space-m);
        border: var(--border-hairline) solid var(--color-border);
        border-inline-start: 4px solid var(--color-signal);
        border-radius: var(--radius-m);
        background: var(--color-surface);
    }

    .c-ab-platform__icon {
        inline-size: 2rem;
        block-size: 2rem;
        color: var(--color-link);
    }

    .c-ab-frame {
        position: relative;
    }

    .c-ab-frame::after {
        content: "";
        position: absolute;
        inset: calc(-1 * var(--space-2xs));
        inset-block-end: auto;
        block-size: calc(100% / 1.5 + 2 * var(--space-2xs)); /* the photograph (3:2), not its caption */
        --corner: linear-gradient(var(--color-signal), var(--color-signal));
        background:
            var(--corner) left top / 2rem 3px no-repeat,
            var(--corner) left top / 3px 2rem no-repeat,
            var(--corner) right bottom / 2rem 3px no-repeat,
            var(--corner) right bottom / 3px 2rem no-repeat;
        pointer-events: none;
    }

    @media (min-width: 64rem) {
        .c-ab-intro__grid {
            grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        }
    }

    /* ---- The course: the claims that state a year, as checkpoints on one lane (2010 · 2016 · 2026), a pace light running it
       and the lane open at its end — the story goes on. Vertical below 48rem, horizontal above. */
    .c-ab-course {
        --color-bg: #0c0712;
        --color-focus-gap: #0c0712;
        --color-muted: #c9c4d3;
        --node: 3.5rem;
        background:
            radial-gradient(60% 50% at 100% 0%, rgb(0 145 179 / 0.22), rgb(0 145 179 / 0) 70%),
            radial-gradient(60% 50% at 0% 100%, rgb(45 29 71 / 0.9), rgb(45 29 71 / 0) 70%),
            #0c0712;
    }

    .c-ab-course__list {
        position: relative;
        container-type: inline-size; /* the pace light's run is the lane's length (cqi) */
        display: grid;
        gap: var(--space-xl);
        margin: 0;
        padding: 0;
        list-style: none;
    }

    /* The lane: two edges and a dashed middle line, then the pace light. */
    .c-ab-course__list::before,
    .c-ab-course__list::after {
        content: "";
        position: absolute;
        pointer-events: none;
    }

    .c-ab-course__list::before {
        inset-block: calc(var(--node) / 2) 0;
        inset-inline-start: calc(var(--node) / 2 - 0.6rem);
        inline-size: 1.2rem;
        border-inline: 2px solid rgb(92 225 255 / 0.45);
        background: linear-gradient(rgb(241 237 248 / 0.4) 50%, transparent 0) center / 2px 1.25rem repeat-y;
        mask-image: linear-gradient(#000 80%, transparent);
        transform-origin: left top;
    }

    .c-ab-course__list::after {
        display: none; /* the pace light runs the horizontal lane only */
        border-radius: 0.3rem;
        box-shadow: 0 0 1rem #5ce1ff;
        opacity: 0;
    }

    .c-ab-mile {
        position: relative;
        display: grid;
        grid-template-columns: var(--node) minmax(0, 1fr);
        grid-template-areas: "node year" "node text";
        column-gap: var(--space-m);
        align-items: start;
        align-content: start; /* the rows keep their size in the shorter checkpoints */
    }

    .c-ab-mile__node {
        grid-area: node;
        position: relative;
        z-index: 1;
        display: grid;
        place-items: center;
        inline-size: var(--node);
        aspect-ratio: 1;
        border: 2px solid var(--mile);
        border-radius: 50%;
        background: #160d24;
        box-shadow: 0 0 0 0.4rem #0c0712, 0 0 1.5rem rgb(92 225 255 / 0.35);
        color: var(--mile);
    }

    .c-ab-mile__node .c-icon {
        inline-size: 1.6rem;
        block-size: 1.6rem;
    }

    .c-ab-mile__year {
        grid-area: year;
        font-family: var(--font-display);
        font-size: clamp(2.5rem, 2rem + 2.5vw, 4.5rem);
        font-weight: var(--weight-bold);
        line-height: 1;
        letter-spacing: 0.02em;
        color: transparent;
        -webkit-text-stroke: 1.5px var(--mile);
        font-variant-numeric: tabular-nums lining-nums;
    }

    .c-ab-mile__text {
        grid-area: text;
        max-inline-size: 34rem;
        margin: var(--space-s) 0 0;
    }

    .c-ab-mile__value {
        display: block;
        font-family: var(--font-display);
        font-size: var(--text-xl);
        text-transform: uppercase;
        letter-spacing: var(--tracking-caps);
    }

    .c-ab-mile:nth-child(1) { --mile: var(--ab-1); }
    .c-ab-mile:nth-child(2) { --mile: var(--ab-5); --n: 1; }
    .c-ab-mile:nth-child(3) { --mile: var(--ab-3); --n: 2; }

    @media (min-width: 48rem) {
        .c-ab-course__list {
            grid-auto-flow: column;
            grid-auto-columns: minmax(0, 1fr);
            column-gap: var(--grid-gap);
            padding-block-start: calc(var(--node) / 2);
        }

        .c-ab-course__list::before {
            inset-block: calc(var(--node) - 0.6rem) auto;
            inset-inline: calc(var(--node) / 2) 0;
            inline-size: auto;
            block-size: 1.2rem;
            border-inline: 0;
            border-block: 2px solid rgb(92 225 255 / 0.45);
            background-image: linear-gradient(90deg, rgb(241 237 248 / 0.4) 50%, transparent 0);
            background-size: 1.25rem 2px;
            background-repeat: repeat-x;
            mask-image: linear-gradient(90deg, #000 85%, transparent);
        }

        .js-motion .c-ab-course__list.is-revealed::before {
            animation-name: c-ab-lane-across;
        }

        .c-ab-course__list::after {
            display: block;
            inset-block-start: calc(var(--node) - 0.3rem);
            inset-inline-start: calc(var(--node) / 2);
            inline-size: 4rem;
            block-size: 0.6rem;
            background: linear-gradient(90deg, rgb(92 225 255 / 0), #5ce1ff);
        }

        .c-ab-mile {
            grid-template-columns: minmax(0, 1fr);
            grid-template-areas: "node" "year" "text";
            row-gap: var(--space-s);
        }

        .c-ab-mile__text {
            margin: 0;
        }
    }

    /* ---- What the experience is measured by: one statement, centred, the claims' spectrum under the closing line. */
    .c-ab-measure__inner {
        display: grid;
        justify-items: center;
        gap: var(--space-m);
        max-inline-size: 52rem;
        text-align: center;
    }

    .c-ab-measure__kicker {
        margin: 0;
        font-size: var(--text-l);
        color: var(--color-muted);
    }

    .c-ab-measure__text {
        margin: 0;
        font-family: var(--font-display);
        font-size: var(--text-2xl);
        font-weight: var(--weight-semibold);
        line-height: 1.3;
    }

    .c-ab-measure__closing {
        position: relative;
        margin: var(--space-m) 0 0;
        padding-block-end: var(--space-s);
        font-size: var(--text-2xl);
        color: var(--color-link);
    }

    .c-ab-measure__closing::after {
        content: "";
        position: absolute;
        inset-inline: 15%;
        inset-block-end: 0;
        block-size: 0.25rem;
        background: var(--ab-spectrum);
    }

    /* ---- The testimonials: a wall of quotes in columns (each card whole, read down each column). */
    .c-ab-voices .c-testimonials--grid {
        display: block;
        columns: 20rem 3;
        column-gap: var(--space-l);
    }

    .c-ab-voices .c-testimonials__item {
        break-inside: avoid;
        margin-block-end: var(--space-l);
    }

    .c-ab-voices .c-quote {
        block-size: auto;
        box-shadow: 0 1.5rem 3rem -2.5rem rgb(12 7 18 / 0.55);
    }

    /* ---- What we do: three doors, each with its symbol; the whole card is its link (one stop, named by the link). */
    .c-ab-doors {
        --color-bg: #0c0712;
        --color-focus-gap: #0c0712;
        --color-muted: #c9c4d3;
        background:
            radial-gradient(60% 60% at 50% 0%, rgb(45 29 71 / 0.95), rgb(45 29 71 / 0) 70%),
            #0c0712;
    }

    .c-ab-doors__list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
        gap: var(--space-l);
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .c-ab-door {
        position: relative;
        display: grid;
        align-content: start;
        gap: var(--space-s);
        padding: var(--space-l);
        border: var(--border-hairline) solid rgb(191 172 221 / 0.3);
        border-block-start: 4px solid var(--door);
        border-radius: var(--radius-m);
        background: linear-gradient(160deg, rgb(45 29 71 / 0.75), rgb(22 13 36 / 0.9));
        transition: transform var(--dur-moderate) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-moderate) var(--ease-standard);
    }

    .c-ab-door:nth-child(1) { --door: var(--ab-1); }
    .c-ab-door:nth-child(2) { --door: var(--ab-2); --n: 1; }
    .c-ab-door:nth-child(3) { --door: var(--ab-4); --n: 2; }

    .c-ab-door__icon {
        display: grid;
        place-items: center;
        inline-size: 3.5rem;
        aspect-ratio: 1;
        border: 2px solid var(--door);
        border-radius: 50%;
        color: var(--door);
        background: rgb(12 7 18 / 0.6);
    }

    .c-ab-door__icon .c-icon {
        inline-size: 1.6rem;
        block-size: 1.6rem;
    }

    .c-ab-door__link {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2xs);
        font-family: var(--font-display);
        font-size: var(--text-xl);
        font-weight: var(--weight-bold);
        text-transform: uppercase;
        letter-spacing: var(--tracking-caps);
        color: var(--color-text);
        text-decoration: none;
    }

    .c-ab-door__link::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
    }

    .c-ab-door__link .c-icon--trailing {
        color: var(--door);
        transition: transform var(--dur-fast) var(--ease-standard);
    }

    .c-ab-door__text {
        margin: 0;
        color: var(--color-muted);
    }

    .c-ab-door:focus-within {
        outline: 3px solid var(--color-focus);
        outline-offset: 3px;
    }

    .c-ab-door__link:focus-visible {
        outline: none;
    }

    @media (hover: hover) {
        .c-ab-door:hover {
            border-color: var(--door);
            box-shadow: 0 1.5rem 3rem -2rem var(--door);
        }

        .c-ab-door:hover .c-icon--trailing {
            transform: translateX(0.3rem);
        }
    }

    /* ---- Track record: the history's symbol beside the words, a chequered edge (the finish) over the strip. */
    .c-ab-history__inner {
        position: relative;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: var(--space-l);
        align-items: start;
        max-inline-size: 60rem;
        padding-block-start: var(--space-l);
    }

    .c-ab-history__inner::before {
        content: "";
        position: absolute;
        inset-inline: 0;
        inset-block-start: 0;
        block-size: 0.75rem;
        background: conic-gradient(var(--color-text) 25%, transparent 0 50%, var(--color-text) 0 75%, transparent 0) 0 0 / 0.75rem 0.75rem;
        opacity: 0.18;
    }

    .c-ab-history__icon {
        display: grid;
        place-items: center;
        inline-size: 4rem;
        aspect-ratio: 1;
        border: 2px solid var(--color-signal);
        border-radius: 50%;
        color: var(--color-link);
    }

    .c-ab-history__icon .c-icon {
        inline-size: 1.9rem;
        block-size: 1.9rem;
    }

    /* ---- The call to action: the night panel, the showcase's drawing in its own column (as on the service pages). */
    .p-about .c-cta__inner {
        --color-bg: #0c0712;
        --color-text: #f1edf8;
        --color-muted: #bfacdd;
        --color-border: #4a2f74;
        --color-link: #5ce1ff;
        --color-link-hover: #b8f2ff;
        --color-focus: #5ce1ff;
        --color-focus-gap: #0c0712;
        --color-signal: #00abd1;
        --color-primary: #5ce1ff;
        --color-primary-hover: #8ae9ff;
        --color-on-primary: #0c0712;
        position: relative;
        isolation: isolate;
        grid-template-areas: "art" "text" "actions";
        overflow: hidden;
        padding: var(--space-xl) var(--space-m) var(--space-l);
        border-radius: var(--radius-m);
        background:
            radial-gradient(55% 90% at 88% 45%, rgb(0 145 179 / 0.32), rgb(0 145 179 / 0) 70%),
            radial-gradient(50% 80% at 0% 100%, rgb(140 107 194 / 0.35), rgb(140 107 194 / 0) 70%),
            var(--color-bg);
        box-shadow: 0 2.5rem 4rem -3rem rgb(12 7 18 / 0.75);
        color: var(--color-text);
        color-scheme: dark;
    }

    .p-about .c-cta__inner::before {
        content: "";
        position: absolute;
        inset-inline: 0;
        inset-block-start: 0;
        block-size: 0.25rem;
        background: var(--ab-spectrum);
    }

    .p-about .c-cta__text {
        grid-area: text;
    }

    .p-about .c-cta__title {
        font-size: var(--text-3xl);
        line-height: var(--leading-display);
    }

    .p-about .c-cta__lead {
        color: var(--color-muted);
    }

    .p-about .c-cta__actions {
        grid-area: actions;
    }

    .p-about .c-cta__secondary {
        color: var(--color-link);
    }

    .p-about .c-cta__art {
        grid-area: art;
        justify-self: center;
        inline-size: min(100%, 18rem);
    }

    .c-ab-cta__drawing {
        display: block;
        inline-size: 100%;
        block-size: auto;
    }

    @media (min-width: 64rem) {
        .p-about .c-cta__inner {
            grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
            grid-template-areas: "text art" "actions art";
            align-items: center;
            column-gap: var(--space-2xl);
            padding: var(--space-2xl);
        }

        .p-about .c-cta__actions {
            align-self: start;
        }

        .p-about .c-cta__art {
            justify-self: end;
            inline-size: min(100%, 24rem);
        }
    }

    /* ---- Motion: the opening words rise once; the checkpoints, the pace light and the doors arrive when revealed. ---- */
    @media (prefers-reduced-motion: no-preference) {
        .c-ab-hero__inner > * {
            animation: c-hero-rise var(--dur-slow) var(--ease-enter) backwards;
        }

        .c-ab-hero__inner > h1 {
            animation-delay: var(--stagger);
        }

        .c-ab-hero__inner > .c-page-hero__lead {
            animation-delay: calc(var(--stagger) * 3);
        }

        .js-motion .c-ab-course__list.is-revealed .c-ab-mile,
        .js-motion .c-ab-doors__list.is-revealed .c-ab-door {
            animation: c-hero-rise var(--dur-slow) var(--ease-enter) backwards;
            animation-delay: calc(var(--stagger) * 2 * var(--n, 0));
        }

        .js-motion .c-ab-course__list.is-revealed::before {
            animation: c-ab-lane-down calc(var(--dur-cinematic) * 1.4) var(--ease-enter) backwards;
        }

        .js-motion .c-ab-course__list.is-revealed::after {
            animation: c-ab-pace 3.6s linear calc(var(--dur-cinematic) * 1.4) infinite;
        }

        .js-motion .c-ab-measure__inner.is-revealed .c-ab-measure__closing::after {
            animation: c-ab-draw calc(var(--dur-cinematic) * 1.2) var(--ease-enter) calc(var(--stagger) * 4) backwards;
        }

        .js-motion .p-about .c-cta__art.is-revealed .c-ab-cta__drawing {
            animation: c-ab-rise calc(var(--dur-cinematic) * 1.4) var(--ease-enter) backwards;
        }

        @media (hover: hover) {
            .c-ab-door:hover {
                transform: translateY(-0.35rem);
            }
        }

        /* With motion allowed the 3D usually takes over within a second: the still drawing waits that long before it shows,
           so the symbols rising are never preceded by the finished drawing (it shows anyway if the 3D never starts). */
        .c-ab-still {
            animation: c-ab-wait var(--dur-slow) var(--ease-enter) backwards;
            animation-delay: calc(var(--dur-cinematic) * 1.5);
        }

        .c-about-hero.is-3d .c-ab-still {
            animation-name: none;
        }
    }

    @keyframes c-ab-wait {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    @keyframes c-ab-lane-down {
        from {
            transform: scaleY(0);
        }

        to {
            transform: none;
        }
    }

    @keyframes c-ab-lane-across {
        from {
            transform: scaleX(0);
        }

        to {
            transform: none;
        }
    }

    /* The pace light runs the lane, from the first checkpoint to the lane's open end (transform and opacity only). */
    @keyframes c-ab-pace {
        0% {
            opacity: 0;
            transform: translateX(0);
        }

        10%,
        75% {
            opacity: 1;
        }

        100% {
            opacity: 0;
            transform: translateX(calc(100cqi - var(--node) / 2 - 4rem));
        }
    }

    @keyframes c-ab-draw {
        from {
            transform: scaleX(0);
        }

        to {
            transform: none;
        }
    }

    @keyframes c-ab-rise {
        from {
            opacity: 0;
            transform: translate3d(0, 1rem, 0) scale(0.92);
        }

        to {
            opacity: 1;
            transform: none;
        }
    }

    @media (forced-colors: active) {
        .c-ab-art::before,
        .c-ab-art::after,
        .p-about .c-about-hero::before,
        .c-ab-frame::after,
        .c-ab-course__list::after,
        .c-ab-measure__closing::after,
        .c-ab-history__inner::before,
        .p-about .c-cta__inner::before {
            display: none;
        }

        .c-ab-mile__year {
            color: CanvasText;
            -webkit-text-stroke: 0;
        }
    }

    @media print {
        .c-ab-canvas,
        .c-ab-course__list::after {
            display: none;
        }

        .c-ab-still {
            opacity: 1;
        }
    }
}
