/* ==========================================================================
   Sa 3D — site frame: container, timeline, header, menus, keyframe rail, footer, CTAs
   ========================================================================== */

.container {
    inline-size: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    inset-block-start: 12px;
    inset-inline-start: 12px;
    z-index: calc(var(--z-editor) + 1);
    padding: 0.7rem 1rem;
    border-radius: var(--radius-s);
    background: var(--lime-500);
    color: var(--ink-1000);
    font-weight: 800;
    transform: translateY(-160%);
    transition: transform var(--dur-2) var(--ease-out);
}

.skip-link:focus {
    transform: none;
}

/* ---------------------------------------------------------------- timeline
   The page is an animation: a playhead runs along the top as you read, over a strip of frame ticks. */
.timeline {
    position: fixed;
    inset-inline: 0;
    inset-block-start: 0;
    z-index: calc(var(--z-header) + 1);
    block-size: 3px;
    pointer-events: none;
    background: repeating-linear-gradient(90deg, rgb(255 255 255 / 0.07) 0 1px, transparent 1px 24px);
    opacity: var(--progress-visible, 0);
    transition: opacity var(--dur-3);
}

.timeline__bar {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--violet-700), var(--violet-500) 60%, var(--violet-300));
    transform-origin: left center;
    transform: scaleX(var(--progress, 0));
}

.timeline__bar::after {
    content: "";
    position: absolute;
    inset-block-start: -3px;
    inset-inline-end: 0;
    inline-size: 2px;
    block-size: 11px;
    background: var(--lime-500);
    box-shadow: 0 0 10px 2px var(--lime-glow);
    transform: scaleX(calc(1 / max(var(--progress, 1), 0.0001)));
    transform-origin: right center;
}

/* ---------------------------------------------------------------- header */
.site-header {
    position: fixed;
    inset-inline: 0;
    inset-block-start: 0;
    z-index: var(--z-header);
    block-size: var(--header-h);
    transition: transform var(--dur-3) var(--ease-out);
}

/* The glass lives on a pseudo-element: backdrop-filter on the header itself would make it the
   containing block of every fixed descendant and re-anchor them. */
.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgb(10 10 15 / 0.7);
    border-block-end: 1px solid var(--line);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    opacity: 0;
    transition: opacity var(--dur-3) var(--ease-out);
}

.site-header[data-scrolled="true"]::before {
    opacity: 1;
}

.site-header[data-hidden="true"] {
    transform: translateY(-110%);
}

.site-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    block-size: 100%;
}

/* ---------------------------------------------------------------- brand */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: var(--text-strong);
}

.brand__mark {
    inline-size: auto;
    block-size: 40px;
    flex: none;
    overflow: visible;
    color: var(--bone-50);
}

.brand__face {
    fill: var(--brand-violet);
    transition: fill var(--dur-3) var(--ease-out);
}

.brand__edges {
    stroke-width: 13;
}

.brand__edges polyline {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}

.brand__vertex {
    fill: var(--brand-lime);
    filter: drop-shadow(0 0 6px var(--lime-glow));
    transform-box: fill-box;
    transform-origin: center;
}

/* Hovering the logo re-models it: the edges are drawn again, the face is selected, the vertex pulses. */
.brand:hover .brand__edges polyline {
    animation: edge-draw 900ms var(--ease-out) both;
}

.brand:hover .brand__edges polyline + polyline {
    animation-delay: 180ms;
}

.brand:hover .brand__face {
    animation: face-select 900ms var(--ease-out) both;
}

.brand:hover .brand__vertex {
    animation: vertex-pulse 900ms var(--ease-spring) both;
}

@keyframes edge-draw {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

@keyframes face-select {
    0%, 40% { fill: transparent; }
    100% { fill: var(--brand-violet); }
}

@keyframes vertex-pulse {
    0% { transform: scale(0.2); }
    60% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

.brand__word {
    font-family: var(--font-display);
    font-size: 1.24rem;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
    white-space: nowrap;
    color: var(--text-strong);
}

.brand__word b {
    margin-inline-start: 0.28em;
    font-weight: 600;
    color: var(--lime-500);
}

.brand--lg .brand__mark {
    block-size: 54px;
}

.brand--lg .brand__word {
    font-size: 1.6rem;
}

/* ---------------------------------------------------------------- nav */
.site-nav ul {
    display: flex;
    align-items: center;
    gap: clamp(0.2rem, 1vw, 1.1rem);
    padding: 0.3rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: rgb(15 15 22 / 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.site-nav a {
    position: relative;
    display: inline-block;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: var(--step--1);
    font-weight: 600;
    color: var(--text-soft);
    text-decoration: none;
    transition: color var(--dur-2), background var(--dur-2);
}

.site-nav a:hover {
    color: var(--text-strong);
    background: rgb(255 255 255 / 0.05);
}

/* The current band is "selected": violet fill, lime vertex. */
.site-nav a[aria-current="true"] {
    color: var(--text-strong);
    background: var(--violet-glow-soft);
    box-shadow: inset 0 0 0 1px var(--line-violet);
}

.site-nav a[aria-current="true"]::before {
    content: "";
    position: absolute;
    inset-block-start: 5px;
    inset-inline-end: 7px;
    inline-size: 4px;
    block-size: 4px;
    border-radius: 1px;
    background: var(--lime-500);
    box-shadow: 0 0 6px var(--lime-glow);
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.menu-toggle {
    display: none;
    position: relative;
    inline-size: 46px;
    block-size: 46px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: rgb(255 255 255 / 0.03);
}

.menu-toggle span {
    position: absolute;
    inset-inline: 13px;
    block-size: 2px;
    border-radius: 2px;
    background: var(--text-strong);
    transition: transform var(--dur-3) var(--ease-out), inset var(--dur-3) var(--ease-out);
}

.menu-toggle span:nth-child(1) { inset-block-start: 18px; }
.menu-toggle span:nth-child(2) { inset-block-start: 26px; inset-inline-start: 20px; }

.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { inset-inline-start: 13px; transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 1060px) {
    .site-nav {
        display: none;
    }

    .menu-toggle {
        display: inline-block;
    }
}

@media (max-width: 520px) {
    /* Qualified: .button (loaded later) would otherwise win and show it again. */
    .site-header__actions .site-header__cta {
        display: none;
    }
}

/* ---------------------------------------------------------------- phone menu: the outliner */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: var(--z-menu);
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: calc(var(--header-h) + var(--space-5)) var(--gutter) calc(var(--space-6) + env(safe-area-inset-bottom));
    background:
        radial-gradient(110% 55% at 100% 0%, rgb(124 92 255 / 0.2), transparent 60%),
        radial-gradient(80% 40% at 0% 100%, rgb(200 255 77 / 0.07), transparent 60%),
        var(--ink-950);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-3) var(--ease-out), visibility 0s linear var(--dur-3);
}

.mobile-menu[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--dur-3) var(--ease-out), visibility 0s;
}

.mobile-menu__eyebrow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-block-end: var(--space-4);
    font-size: var(--step--2);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-mute);
}

.mobile-menu__eyebrow svg {
    inline-size: 16px;
    block-size: 16px;
    color: var(--violet-400);
}

.outliner {
    display: grid;
    align-content: start;
    gap: 2px;
    padding-inline-start: 10px;
    border-inline-start: 1px dashed var(--line-strong);
}

.outliner li {
    opacity: 0;
    transform: translateX(-14px);
    transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}

.mobile-menu[data-open="true"] .outliner li {
    opacity: 1;
    transform: none;
}

.mobile-menu[data-open="true"] .outliner li:nth-child(2) { transition-delay: 40ms; }
.mobile-menu[data-open="true"] .outliner li:nth-child(3) { transition-delay: 80ms; }
.mobile-menu[data-open="true"] .outliner li:nth-child(4) { transition-delay: 120ms; }
.mobile-menu[data-open="true"] .outliner li:nth-child(5) { transition-delay: 160ms; }
.mobile-menu[data-open="true"] .outliner li:nth-child(6) { transition-delay: 200ms; }

.outliner a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.62rem 0.8rem;
    border-radius: 12px;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 6.4vw, 2.1rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    color: var(--text-strong);
    text-decoration: none;
    transition: background var(--dur-2);
}

.outliner a::before {
    content: "";
    position: absolute;
    inset-inline-start: -11px;
    inset-block-start: 50%;
    inline-size: 10px;
    border-block-start: 1px dashed var(--line-strong);
}

.outliner a:active,
.outliner a:hover {
    background: var(--violet-glow-soft);
}

.outliner__icon {
    display: inline-grid;
    place-items: center;
    inline-size: 34px;
    block-size: 34px;
    flex: none;
    border-radius: 9px;
    background: rgb(255 159 67 / 0.12);
    color: #ffae5c;
}

.outliner__icon svg {
    inline-size: 18px;
    block-size: 18px;
}

.outliner__name {
    flex: 1;
}

.outliner__index {
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    color: var(--text-mute);
}

.mobile-menu__foot {
    display: grid;
    gap: var(--space-4);
}

.mobile-menu__foot .button {
    inline-size: 100%;
}

body[data-menu-open="true"] {
    overflow: hidden;
}

/* The header (and its close button) stays above the open menu. */
body[data-menu-open="true"] .site-header {
    z-index: calc(var(--z-menu) + 1);
}

body[data-menu-open="true"] .site-header::before {
    opacity: 0;
}

/* ---------------------------------------------------------------- keyframe rail
   The dope sheet of the page on the right edge: a diamond per band, filled once you have passed it,
   lime on the current one, its name on hover. Built by header.js from the page's own bands. */
.keyframes {
    position: fixed;
    inset-inline-end: clamp(12px, 1.4vw, 24px);
    inset-block-start: 50%;
    z-index: var(--z-rail);
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-3) var(--ease-out);
}

.keyframes[data-visible="true"] {
    opacity: 1;
    pointer-events: auto;
}

.keyframes ol {
    position: relative;
    display: grid;
    gap: 16px;
    padding: 12px 0;
}

.keyframes ol::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-end: 8px;
    inline-size: 1px;
    background: linear-gradient(transparent, var(--line-strong) 10%, var(--line-strong) 90%, transparent);
}

.keyframes a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    block-size: 16px;
    text-decoration: none;
}

.keyframes__key {
    inline-size: 9px;
    block-size: 9px;
    margin-inline-end: 4px;
    border: 1.5px solid var(--text-mute);
    background: var(--ink-950);
    transform: rotate(45deg);
    transition: background var(--dur-2), border-color var(--dur-2), transform var(--dur-3) var(--ease-spring), box-shadow var(--dur-2);
}

.keyframes a[data-done="true"] .keyframes__key {
    border-color: var(--violet-400);
    background: var(--violet-500);
}

.keyframes a[aria-current="true"] .keyframes__key {
    border-color: var(--lime-500);
    background: var(--lime-500);
    transform: rotate(45deg) scale(1.35);
    box-shadow: 0 0 10px var(--lime-glow);
}

.keyframes a:hover .keyframes__key {
    transform: rotate(45deg) scale(1.3);
}

.keyframes__label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--text-strong);
    padding: 0.28rem 0.55rem;
    border-radius: 6px;
    background: rgb(10 10 15 / 0.88);
    border: 1px solid var(--line);
    opacity: 0;
    transform: translateX(6px);
    transition: opacity var(--dur-2), transform var(--dur-3) var(--ease-out);
}

.keyframes a:hover .keyframes__label,
.keyframes a:focus-visible .keyframes__label {
    opacity: 1;
    transform: none;
}

.keyframes__frame {
    position: absolute;
    inset-inline-end: 0;
    inset-block-end: calc(100% + 6px);
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    color: var(--violet-dim);
    white-space: nowrap;
}

@media (max-width: 1240px), (pointer: coarse) {
    .keyframes {
        display: none;
    }
}

/* ---------------------------------------------------------------- footer */
.site-footer {
    position: relative;
    padding-block: var(--space-9) calc(var(--space-7) + env(safe-area-inset-bottom));
    background: var(--ink-1000);
    border-block-start: 1px solid var(--line);
    overflow: hidden;
}

.site-footer::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-start: 0;
    block-size: 1px;
    background: linear-gradient(90deg, transparent, var(--violet-500), var(--lime-500), transparent);
    opacity: 0.6;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: var(--space-7);
}

.site-footer__brand p {
    margin-block-start: var(--space-4);
    max-width: 36ch;
    color: var(--text-soft);
}

.site-footer__title {
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-block-end: var(--space-4);
}

.site-footer ul {
    display: grid;
    gap: 0.55rem;
}

.site-footer a:not(.button):not(.social):not(.brand) {
    color: var(--text);
    text-decoration: none;
    transition: color var(--dur-2);
}

.site-footer a:not(.button):not(.social):not(.brand):hover {
    color: var(--violet-300);
}

.site-footer__contact {
    display: grid;
    gap: var(--space-3);
    justify-items: start;
    color: var(--text-soft);
}

.site-footer__phone {
    font-family: var(--font-mono);
    font-size: var(--step-1);
    color: var(--text-strong) !important;
    letter-spacing: 0.02em;
}

.social-row {
    display: flex;
    gap: var(--space-2);
    margin-block-start: var(--space-2);
}

.social {
    display: inline-grid;
    place-items: center;
    inline-size: 44px;
    block-size: 44px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    color: var(--text);
    transition: border-color var(--dur-2), color var(--dur-2), transform var(--dur-3) var(--ease-spring), background var(--dur-2);
}

.social svg {
    inline-size: 20px;
    block-size: 20px;
}

.social:hover {
    color: var(--text-strong);
    border-color: var(--violet-400);
    background: var(--violet-glow-soft);
    transform: translateY(-2px);
}

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-3);
    margin-block-start: var(--space-7);
    padding-block-start: var(--space-5);
    border-block-start: 1px solid var(--line);
    font-size: var(--step--1);
    color: var(--text-mute);
}

.site-footer__bottom .mono {
    letter-spacing: 0.06em;
}

/* The name, huge and in wireframe on a perspective floor: outlined letters that fill in with the
   render's colours while the pointer is over them. */
.site-footer__giant {
    position: relative;
    margin-block-start: var(--space-8);
    padding-block-end: var(--space-4);
    user-select: none;
    perspective: 900px;
}

.site-footer__giant::before {
    content: "";
    position: absolute;
    inset-inline: -10%;
    inset-block: 84% -40%;
    background:
        linear-gradient(90deg, var(--grid-major) 1px, transparent 1px) 50% 0 / 60px 60px,
        linear-gradient(var(--grid-major) 1px, transparent 1px) 50% 0 / 60px 60px;
    transform: rotateX(70deg);
    transform-origin: 50% 0;
    -webkit-mask: linear-gradient(transparent, #000 30%, transparent);
    mask: linear-gradient(transparent, #000 30%, transparent);
    pointer-events: none;
}

.site-footer__giant-word {
    position: relative;
    z-index: 1;
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(4.5rem, 22vw, 20rem);
    line-height: 0.82;
    letter-spacing: -0.06em;
    text-align: center;
    white-space: nowrap;
    color: transparent;
    /* Two layers clipped to the letters: a faint violet sheet that fades into the floor, over the render
       gradient. No text-stroke: the variable font has overlapping contours and a stroke would draw them.
       On hover the sheet drains away and the render shows through. */
    background-image:
        linear-gradient(180deg, rgb(34 28 58), rgb(16 14 26) 75%, var(--ink-1000)),
        linear-gradient(100deg, var(--violet-500), #b69cff 40%, var(--lime-500) 70%, var(--violet-400));
    background-size: 100% 100%, 220% 100%;
    background-repeat: no-repeat;
    background-position: 0 0, 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background-size 900ms var(--ease-out), background-position 1.4s var(--ease-out);
}

.site-footer__giant-word b {
    margin-inline-start: 0.12em;
    font-weight: 700;
}

.site-footer__giant:hover .site-footer__giant-word {
    background-size: 100% 0%, 220% 100%;
    background-position: 0 0, 0 0;
}

@media (max-width: 860px) {
    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .site-footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .site-footer__grid {
        grid-template-columns: 1fr;
    }

    .site-footer {
        padding-block-end: calc(104px + env(safe-area-inset-bottom));
    }
}

/* ---------------------------------------------------------------- floating WhatsApp (desktop) */
.fab {
    position: fixed;
    inset-inline-end: clamp(16px, 2.4vw, 32px);
    inset-block-end: clamp(16px, 2.4vw, 32px);
    z-index: var(--z-fab);
    display: inline-flex;
    align-items: center;
    gap: 0;
    block-size: 60px;
    padding-inline: 16px;
    border-radius: var(--radius-pill);
    background: var(--wa-500);
    color: #062b14;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 14px 40px -10px rgb(37 211 102 / 0.55), 0 2px 0 rgb(255 255 255 / 0.25) inset;
    transform: translateY(140%) scale(0.9);
    opacity: 0;
    transition: transform var(--dur-3) var(--ease-spring), opacity var(--dur-2), gap var(--dur-3) var(--ease-out);
}

.fab[data-visible="true"] {
    transform: none;
    opacity: 1;
}

.fab svg {
    inline-size: 28px;
    block-size: 28px;
    flex: none;
}

.fab__label {
    max-inline-size: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-inline-size var(--dur-3) var(--ease-out);
}

.fab:hover,
.fab:focus-visible {
    gap: 10px;
}

.fab:hover .fab__label,
.fab:focus-visible .fab__label {
    max-inline-size: 16rem;
}

/* The pulse is a ring, not the button: a moving CTA is hard to press. */
.fab::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid var(--wa-500);
    animation: fab-ring 2.6s var(--ease-out) infinite;
    pointer-events: none;
}

@keyframes fab-ring {
    0% { transform: scale(1); opacity: 0.7; }
    80%, 100% { transform: scale(1.35); opacity: 0; }
}

@media (max-width: 860px) {
    .fab {
        display: none;
    }
}

/* ---------------------------------------------------------------- mobile CTA bar */
.mobile-cta {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: var(--z-fab);
    display: none;
    padding: 12px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(transparent, rgb(7 7 11 / 0.94) 40%);
    transform: translateY(110%);
    transition: transform var(--dur-3) var(--ease-out);
}

.mobile-cta[data-visible="true"] {
    transform: none;
}

.mobile-cta .button {
    inline-size: 100%;
    block-size: 56px;
}

.mobile-cta__note {
    margin-block-start: 6px;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-mute);
}

@media (max-width: 860px) {
    .mobile-cta {
        display: block;
    }
}
