@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

@font-face {
    font-family: "night";
    src: url('fonts/tuesdaynight-regular-webfont.woff2') format('woff2'),
         url('fonts/tuesdaynight-regular-webfont.woff') format('woff');
    font-display: swap;
}

:root {
    --bg: #080b12;
    --panel: rgba(20, 24, 34, 0.78);
    --panel-strong: rgba(17, 20, 29, 0.94);
    --panel-soft: rgba(255, 255, 255, 0.055);
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.22);
    --text: #f7f8fb;
    --muted: #a7aebb;
    --blue: #6e8df6;
    --violet: #a579ff;
    --red: #d5272b;
    --copper: #d99962;
    --green: #67d5a1;
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--text);
    font-family: "Inter", sans-serif;
    background:
        linear-gradient(180deg, rgba(6, 9, 16, 0.28), rgba(6, 9, 16, 0.88)),
        url("../../assets/images/background.jpg") center top / cover fixed no-repeat,
        var(--bg);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 18%, rgba(110, 141, 246, 0.16), transparent 30rem),
        radial-gradient(circle at 80% 48%, rgba(165, 121, 255, 0.12), transparent 34rem),
        linear-gradient(180deg, rgba(4, 7, 13, 0.08), rgba(4, 7, 13, 0.72));
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.22;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

::selection {
    color: #fff;
    background: rgba(110, 141, 246, .7);
}

.site-header {
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px clamp(20px, 4vw, 64px);
    pointer-events: none;
}

.brand,
.header-actions {
    pointer-events: auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
    font-family: "Manrope", sans-serif;
    font-size: .88rem;
    font-weight: 800;
    letter-spacing: .17em;
}

.brand-mark {
    position: relative;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 50%;
    background: rgba(11, 14, 22, .55);
    backdrop-filter: blur(18px);
    box-shadow: 0 8px 30px rgba(0,0,0,.18);
}

.brand-mark::before,
.brand-mark::after {
    content: "";
    position: absolute;
    border-radius: 50%;
}

.brand-mark::before {
    width: 6px;
    height: 6px;
    background: var(--red);
    box-shadow: 0 0 14px rgba(213, 39, 43, .65);
}

.brand-mark::after {
    inset: 7px;
    border: 1px solid rgba(255,255,255,.24);
}

.brand-name {
    background: linear-gradient(90deg, #fff, #dfe5f6 58%, #ff7a7d);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-pill,
.scroll-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #ecf0f8;
    background: rgba(10, 13, 20, .48);
    backdrop-filter: blur(18px);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 14px rgba(103, 213, 161, .75);
}

.hero {
    position: relative;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 110px 20px 74px;
}

.hero-copy {
    position: absolute;
    left: clamp(20px, 5vw, 78px);
    bottom: clamp(26px, 5vw, 70px);
    z-index: 2;
    max-width: 380px;
}

.eyebrow {
    margin: 0 0 8px;
    color: rgba(255,255,255,.58);
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: .69rem;
    font-weight: 700;
}

.hero-copy h1 {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(2rem, 4vw, 4.3rem);
    line-height: .97;
    letter-spacing: -.055em;
}

.hero-copy p:last-child {
    margin: 14px 0 0;
    max-width: 31rem;
    color: var(--muted);
    line-height: 1.6;
    font-size: .92rem;
}

.chat {
    position: relative;
    width: min(880px, calc(100vw - 40px));
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background:
        linear-gradient(150deg, rgba(40, 46, 62, .82), rgba(18, 22, 31, .89));
    backdrop-filter: blur(26px) saturate(1.15);
    box-shadow: var(--shadow);
}

.chat::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(120deg, rgba(255,255,255,.10), transparent 28%),
        radial-gradient(circle at 70% 0%, rgba(110,141,246,.16), transparent 24rem);
}

.chat-topbar {
    position: relative;
    z-index: 2;
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,.09);
    background: rgba(15, 19, 28, .54);
}

.chat-avatar {
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.20);
    background: #171b24;
    box-shadow: 0 6px 22px rgba(0,0,0,.25);
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-identity {
    min-width: 0;
}

.chat-identity strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: "Manrope", sans-serif;
    font-size: .95rem;
}

.chat-presence {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    color: var(--muted);
    font-size: .75rem;
}

.chat-meta {
    margin-left: auto;
    color: rgba(255,255,255,.46);
    font-size: .72rem;
}

.chat-log {
    position: relative;
    z-index: 2;
    height: min(520px, 58svh);
    min-height: 390px;
    overflow-y: auto;
    padding: 24px 22px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}

.message-row {
    display: flex;
    gap: 12px;
    margin: 0 0 18px;
    animation: message-in .45s cubic-bezier(.2,.8,.2,1) both;
}

.message-row.user {
    justify-content: flex-end;
}

.message-mini-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,.14);
}

.message {
    max-width: min(620px, 84%);
}

.message-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 6px;
}

.message-head strong {
    font-size: .82rem;
}

.message-head time {
    color: rgba(255,255,255,.38);
    font-size: .67rem;
}

.message-bubble {
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 6px 18px 18px 18px;
    padding: 14px 16px;
    color: #edf0f7;
    background: rgba(7, 10, 16, .34);
    line-height: 1.62;
    font-size: .93rem;
}

.message-row.user .message-bubble {
    border-radius: 18px 18px 6px 18px;
    background: linear-gradient(135deg, rgba(86, 112, 220, .88), rgba(102, 73, 174, .88));
}

.message-bubble p {
    margin: 0;
}

.message-bubble p + p {
    margin-top: 10px;
}

.signature {
    display: inline-block;
    margin: 14px 0 0;
    color: #f04449;
    font-family: "night", cursive;
    font-size: 3.15rem;
    line-height: .9;
    transform: rotate(-4deg);
    filter: drop-shadow(0 6px 18px rgba(213,39,43,.18));
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.quick-action {
    appearance: none;
    border: 1px solid rgba(140, 162, 255, .30);
    border-radius: 999px;
    padding: 9px 12px;
    color: #eaf0ff;
    background: rgba(93, 120, 225, .12);
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.quick-action:hover,
.quick-action:focus-visible {
    outline: none;
    transform: translateY(-2px);
    border-color: rgba(140, 162, 255, .58);
    background: rgba(93, 120, 225, .22);
}

.typing {
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 11px 13px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 6px 16px 16px 16px;
    background: rgba(7,10,16,.30);
}

.typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9da5b3;
    animation: typing 1s infinite ease-in-out;
}

.typing span:nth-child(2) {
    animation-delay: .12s;
}

.typing span:nth-child(3) {
    animation-delay: .24s;
}

.chat-composer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(10, 13, 20, .45);
}

.composer-field {
    flex: 1;
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    color: rgba(255,255,255,.42);
    background: rgba(255,255,255,.04);
    font-size: .86rem;
}

.composer-button {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    color: #fff;
    background: rgba(255,255,255,.06);
}

.composer-button svg {
    width: 18px;
    height: 18px;
}

.social-rail {
    position: fixed;
    z-index: 40;
    left: clamp(14px, 2.2vw, 34px);
    top: 50%;
    display: grid;
    gap: 9px;
    transform: translateY(-50%);
}

.social-rail a {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 13px;
    color: rgba(255,255,255,.65);
    background: rgba(9, 12, 18, .34);
    backdrop-filter: blur(14px);
    text-decoration: none;
    font-size: .72rem;
    font-weight: 800;
    transition: .2s ease;
}

.social-rail a:hover,
.social-rail a:focus-visible {
    outline: none;
    color: #fff;
    border-color: rgba(255,255,255,.30);
    background: rgba(255,255,255,.09);
    transform: translateX(3px);
}

.universe {
    position: relative;
    min-height: 100svh;
    padding: 120px clamp(20px, 6vw, 90px) 110px;
    background:
        linear-gradient(180deg, rgba(7,10,16,.86), rgba(7,10,16,.98)),
        radial-gradient(circle at 50% 10%, rgba(110,141,246,.12), transparent 36rem);
    border-top: 1px solid rgba(255,255,255,.08);
}

.universe-heading {
    max-width: 880px;
    margin: 0 auto 54px;
    text-align: center;
}

.section-kicker {
    margin: 0 0 12px;
    color: #9ca8c1;
    text-transform: uppercase;
    letter-spacing: .19em;
    font-size: .7rem;
    font-weight: 800;
}

.universe-heading h2 {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(2.5rem, 6vw, 6rem);
    line-height: .96;
    letter-spacing: -.06em;
}

.universe-heading p {
    max-width: 650px;
    margin: 18px auto 0;
    color: var(--muted);
    line-height: 1.7;
}

.portals {
    width: min(1280px, 100%);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 2vw, 24px);
    margin: 0 auto;
    perspective: 1200px;
}

.portal {
    --accent: 110, 141, 246;
    position: relative;
    min-height: 430px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 26px;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(var(--accent), .08), rgba(8,11,18,.96) 66%),
        rgba(12,15,23,.92);
    box-shadow: 0 20px 70px rgba(0,0,0,.23);
    text-decoration: none;
    transform-style: preserve-3d;
    isolation: isolate;
    transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .25s ease, box-shadow .35s ease;
}

.portal:nth-child(2) { --accent: 165, 121, 255; }
.portal:nth-child(3) { --accent: 217, 153, 98; }
.portal:nth-child(4) { --accent: 72, 187, 214; }
.portal:nth-child(5) { --accent: 213, 39, 43; }
.portal:nth-child(6) { --accent: 222, 181, 85; }

.portal::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: .6;
    background:
        radial-gradient(circle at var(--mx, 50%) var(--my, 20%), rgba(var(--accent), .26), transparent 40%),
        linear-gradient(135deg, rgba(255,255,255,.055), transparent 38%);
    transition: opacity .25s ease;
}

.portal::after {
    content: "";
    position: absolute;
    inset: 13px;
    z-index: -1;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.06);
    pointer-events: none;
}

.portal:hover,
.portal:focus-visible {
    outline: none;
    border-color: rgba(var(--accent), .52);
    box-shadow: 0 28px 90px rgba(0,0,0,.36), 0 0 60px rgba(var(--accent), .08);
    transform: translateY(-7px);
}

.portal-index {
    position: absolute;
    top: 20px;
    left: 22px;
    color: rgba(255,255,255,.34);
    font-family: "Manrope", sans-serif;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .16em;
}

.portal-arrow {
    position: absolute;
    top: 17px;
    right: 18px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 50%;
    color: rgba(255,255,255,.72);
    transition: transform .3s ease, background .3s ease;
}

.portal:hover .portal-arrow {
    transform: rotate(45deg);
    background: rgba(var(--accent), .16);
}

.portal-door {
    position: absolute;
    top: 74px;
    left: 50%;
    width: 54%;
    max-width: 190px;
    aspect-ratio: .62;
    transform: translateX(-50%);
    transform-style: preserve-3d;
    perspective: 850px;
}

.door-frame {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255,255,255,.18);
    border-bottom: none;
    border-radius: 110px 110px 8px 8px;
    background:
        linear-gradient(180deg, rgba(var(--accent), .16), rgba(255,255,255,.018));
    box-shadow:
        inset 0 0 55px rgba(var(--accent), .08),
        0 0 45px rgba(var(--accent), .08);
}

.door-frame::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: inherit;
}

.door-panel {
    position: absolute;
    inset: 15px 14px 0;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 92px 92px 5px 5px;
    background:
        radial-gradient(circle at 50% 22%, rgba(var(--accent), .24), transparent 45%),
        linear-gradient(180deg, rgba(29,34,47,.98), rgba(8,11,17,.98));
    box-shadow: inset 0 0 40px rgba(0,0,0,.38);
    transform-origin: left center;
    transition: transform .55s cubic-bezier(.2,.8,.2,1), filter .3s ease;
}

.portal:hover .door-panel {
    transform: rotateY(-18deg);
    filter: brightness(1.15);
}

.door-panel::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 53%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgb(var(--accent));
    box-shadow: 0 0 16px rgba(var(--accent), .8);
}

.door-glow {
    position: absolute;
    inset: 32px 31px 6px;
    z-index: -1;
    border-radius: 80px 80px 0 0;
    background: rgba(var(--accent), .16);
    filter: blur(18px);
    opacity: 0;
    transition: opacity .3s ease;
}

.portal:hover .door-glow {
    opacity: 1;
}

.portal-copy {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 25px;
}

.portal-category {
    margin: 0 0 8px;
    color: rgb(var(--accent));
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .66rem;
    font-weight: 800;
}

.portal h3 {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    letter-spacing: -.035em;
}

.portal-copy p {
    margin: 9px 0 0;
    color: #9da5b5;
    line-height: 1.5;
    font-size: .82rem;
}

.portal.is-opening {
    z-index: 5;
    transform: scale(1.03);
}

.portal.is-opening .door-panel {
    transform: rotateY(-88deg);
}

.portal.is-opening .door-glow {
    opacity: 1;
}

.transition-screen {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: grid;
    place-items: center;
    visibility: hidden;
    opacity: 0;
    background:
        radial-gradient(circle at center, rgba(var(--transition-accent, 110,141,246), .2), transparent 30rem),
        #05070c;
    transition: opacity .38s ease, visibility .38s ease;
}

.transition-screen.active {
    visibility: visible;
    opacity: 1;
}

.transition-inner {
    text-align: center;
    transform: translateY(12px);
    opacity: 0;
    transition: .35s ease .18s;
}

.transition-screen.active .transition-inner {
    transform: translateY(0);
    opacity: 1;
}

.transition-line {
    width: 74px;
    height: 1px;
    margin: 0 auto 20px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
}

.transition-screen small {
    color: #9299a8;
    text-transform: uppercase;
    letter-spacing: .18em;
    font-weight: 700;
}

.transition-screen strong {
    display: block;
    margin-top: 8px;
    font-family: "Manrope", sans-serif;
    font-size: clamp(2rem, 5vw, 4.4rem);
    letter-spacing: -.055em;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 24px clamp(20px, 6vw, 90px);
    border-top: 1px solid rgba(255,255,255,.07);
    color: #727a8a;
    background: #06090f;
    font-size: .76rem;
}

.footer a {
    color: #aab1bf;
    text-decoration: none;
}

@keyframes message-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.985);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: .35;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

@media (max-width: 1050px) {
    .hero {
        align-items: start;
        padding-top: 112px;
    }

    .hero-copy {
        position: static;
        width: min(880px, calc(100vw - 40px));
        margin: 24px auto 0;
    }

    .portals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    body {
        background-attachment: scroll;
    }

    .site-header {
        padding: 14px 14px;
    }

    .status-pill {
        display: none;
    }

    .scroll-link {
        min-height: 36px;
        padding: 0 11px;
    }

    .brand-name {
        font-size: .78rem;
    }

    .social-rail {
        display: none;
    }

    .hero {
        padding: 88px 12px 54px;
    }

    .chat {
        width: 100%;
        border-radius: 22px;
    }

    .chat-topbar {
        min-height: 66px;
        padding: 11px 13px;
    }

    .chat-avatar {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .chat-meta {
        display: none;
    }

    .chat-log {
        height: min(560px, 62svh);
        min-height: 430px;
        padding: 18px 13px 8px;
    }

    .message-mini-avatar {
        width: 30px;
        height: 30px;
    }

    .message {
        max-width: 88%;
    }

    .message-bubble {
        padding: 12px 13px;
        font-size: .88rem;
    }

    .signature {
        font-size: 2.55rem;
    }

    .chat-composer {
        padding: 10px;
    }

    .composer-button {
        width: 42px;
        height: 42px;
    }

    .composer-field {
        min-height: 42px;
    }

    .hero-copy {
        width: 100%;
        padding: 0 8px;
    }

    .hero-copy p:last-child {
        font-size: .86rem;
    }

    .universe {
        padding: 92px 14px 70px;
    }

    .universe-heading {
        text-align: left;
        margin-bottom: 30px;
    }

    .universe-heading p {
        margin-left: 0;
    }

    .portals {
        grid-template-columns: 1fr;
    }

    .portal {
        min-height: 390px;
    }

    .footer {
        padding: 22px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }

    .portal:hover,
    .portal:focus-visible {
        transform: none;
    }

    .portal:hover .door-panel,
    .portal.is-opening .door-panel {
        transform: none;
    }
}


.chat-avatar {
    position: relative;
    overflow: visible;
}

.chat-avatar img {
    border-radius: 50%;
    object-fit: cover;
}

.avatar-presence {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 13px;
    height: 13px;
    border: 3px solid #171b24;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px rgba(103, 213, 161, .75);
}

.chat-alias {
    display: block;
    margin-top: 1px;
    color: rgba(255,255,255,.56);
    font-size: .72rem;
}

.chat-identity .chat-presence {
    margin-top: 4px;
}

.identity-chip {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 7px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 999px;
    color: rgba(255,255,255,.56);
    background: rgba(255,255,255,.04);
    font-size: .62rem;
    font-weight: 600;
}

.message-mini-avatar {
    background: rgba(255,255,255,.04);
}

@media (max-width: 720px) {
    .chat-alias {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}


/* Interactive chat refinements */
.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;
}

.chat-composer {
    flex-wrap: wrap;
}

.chat-composer .composer-field {
    min-width: 0;
    border: 1px solid rgba(255,255,255,.10);
    outline: none;
    color: var(--text);
    caret-color: #a8b9ff;
    background: rgba(255,255,255,.04);
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.chat-composer input.composer-field::placeholder {
    color: rgba(255,255,255,.38);
}

.chat-composer input.composer-field:focus {
    border-color: rgba(126, 151, 255, .46);
    background: rgba(255,255,255,.06);
    box-shadow: 0 0 0 4px rgba(110,141,246,.08);
}

.chat-composer input.composer-field:disabled {
    opacity: .55;
}

.composer-button {
    appearance: none;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.composer-button:hover,
.composer-button:focus-visible {
    outline: none;
    transform: translateY(-1px);
    border-color: rgba(126,151,255,.42);
    background: rgba(110,141,246,.15);
}

.composer-hint {
    flex-basis: 100%;
    padding-left: 4px;
    color: rgba(255,255,255,.34);
    font-size: .66rem;
    line-height: 1.35;
}

.message-bubble a {
    color: #b8c6ff;
    text-underline-offset: 3px;
}

.dynamic-actions {
    margin-bottom: 1px;
}

.portal-highlight {
    border-color: rgba(var(--accent), .72) !important;
    box-shadow:
        0 34px 100px rgba(0,0,0,.42),
        0 0 0 1px rgba(var(--accent), .16),
        0 0 70px rgba(var(--accent), .16) !important;
}

.portal-highlight .door-panel {
    transform: rotateY(-18deg);
}

.portal-highlight .door-glow {
    opacity: 1;
}

/* Rudrix cursor — only enabled for precise pointing devices */
.rudrix-cursor {
    --cursor-accent: 110, 141, 246;
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease;
}

.rudrix-cursor.is-visible {
    opacity: 1;
}

.rudrix-cursor-ring,
.rudrix-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, width, height, opacity, background, border-color;
}

.rudrix-cursor-ring {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,.36);
    background:
        radial-gradient(circle at 35% 30%, rgba(255,255,255,.08), transparent 50%),
        rgba(8,11,18,.08);
    backdrop-filter: blur(3px);
    box-shadow:
        0 0 0 1px rgba(var(--cursor-accent), .04),
        0 0 28px rgba(var(--cursor-accent), .12);
    transition:
        width .22s cubic-bezier(.2,.8,.2,1),
        height .22s cubic-bezier(.2,.8,.2,1),
        border-color .22s ease,
        background .22s ease,
        box-shadow .22s ease;
}

.rudrix-cursor-dot {
    width: 5px;
    height: 5px;
    background: rgb(var(--cursor-accent));
    box-shadow: 0 0 12px rgba(var(--cursor-accent), .82);
    transition:
        width .18s ease,
        height .18s ease,
        background .18s ease,
        box-shadow .18s ease;
}

.rudrix-cursor-label {
    position: fixed;
    top: 0;
    left: 0;
    max-width: 180px;
    padding: 0;
    color: #fff;
    opacity: 0;
    white-space: nowrap;
    font-family: "Manrope", sans-serif;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    transform: translate(22px, 22px);
    text-shadow: 0 2px 12px rgba(0,0,0,.6);
    transition: opacity .18s ease;
}

.rudrix-cursor.is-interactive .rudrix-cursor-ring {
    width: 48px;
    height: 48px;
    border-color: rgba(var(--cursor-accent), .56);
    background: rgba(var(--cursor-accent), .055);
    box-shadow:
        0 0 0 1px rgba(var(--cursor-accent), .08),
        0 0 36px rgba(var(--cursor-accent), .18);
}

.rudrix-cursor.is-interactive .rudrix-cursor-dot {
    width: 7px;
    height: 7px;
    background: #fff;
    box-shadow:
        0 0 0 3px rgba(var(--cursor-accent), .16),
        0 0 16px rgba(var(--cursor-accent), .56);
}

.rudrix-cursor.is-portal .rudrix-cursor-ring {
    width: 62px;
    height: 62px;
    border-color: rgba(var(--cursor-accent), .72);
    background:
        radial-gradient(circle, rgba(var(--cursor-accent), .10), rgba(var(--cursor-accent), .025) 54%, transparent 72%);
    box-shadow:
        0 0 0 1px rgba(var(--cursor-accent), .08),
        0 0 48px rgba(var(--cursor-accent), .24);
}

.rudrix-cursor.is-portal .rudrix-cursor-label {
    opacity: .78;
}

.rudrix-cursor.is-down .rudrix-cursor-ring {
    width: 27px;
    height: 27px;
    background: rgba(var(--cursor-accent), .12);
}

.rudrix-cursor.is-down .rudrix-cursor-dot {
    width: 9px;
    height: 9px;
}

@media (pointer: fine) and (hover: hover) {
    .has-custom-cursor,
    .has-custom-cursor body,
    .has-custom-cursor a,
    .has-custom-cursor button,
    .has-custom-cursor input,
    .has-custom-cursor .portal {
        cursor: none !important;
    }
}

@media (max-width: 720px) {
    .composer-hint {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rudrix-cursor-ring,
    .rudrix-cursor-dot,
    .rudrix-cursor-label {
        transition: none !important;
    }
}


/* === Responsive layout pass + portal worlds === */

.chat-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    align-items: center;
    gap: 10px;
}

.chat-composer .composer-field {
    width: 100%;
    min-width: 0;
}

.chat-composer .composer-button {
    width: 46px;
    height: 46px;
    justify-self: end;
}

.chat-composer .composer-hint {
    grid-column: 1 / -1;
    padding-left: 4px;
}

/* The title now lives in its own grid column on desktop, so it can never overlap the chat. */
@media (min-width: 1101px) {
    .hero {
        grid-template-columns:
            minmax(220px, .58fr)
            minmax(660px, 880px)
            minmax(24px, .18fr);
        column-gap: clamp(18px, 2.2vw, 40px);
        align-items: center;
    }

    .chat {
        grid-column: 2;
        justify-self: center;
    }

    .hero-copy {
        position: static;
        grid-column: 1;
        grid-row: 1;
        align-self: end;
        justify-self: end;
        width: min(100%, 320px);
        margin: 0 0 clamp(30px, 6vh, 72px);
    }

    .hero-copy h1 {
        font-size: clamp(2rem, 3.15vw, 3.75rem);
        line-height: .98;
        overflow-wrap: anywhere;
    }

    .hero-copy p:last-child {
        max-width: 27rem;
        font-size: clamp(.78rem, .82vw, .92rem);
    }
}

/* Intermediate widths get an even tighter title to keep visual breathing room. */
@media (min-width: 1101px) and (max-width: 1450px) {
    .hero {
        grid-template-columns:
            minmax(190px, .46fr)
            minmax(620px, 820px)
            minmax(16px, .12fr);
    }

    .hero-copy {
        width: min(100%, 270px);
    }

    .hero-copy h1 {
        font-size: clamp(1.8rem, 2.8vw, 3rem);
    }
}

@media (max-width: 720px) {
    .chat-composer {
        grid-template-columns: minmax(0, 1fr) 42px;
        gap: 8px;
    }

    .chat-composer .composer-button {
        width: 42px;
        height: 42px;
    }

    .hero-copy h1 {
        font-size: clamp(2rem, 12vw, 3.35rem);
        line-height: .98;
    }
}

/* Content revealed behind each portal door. */
.door-scene {
    position: absolute;
    inset: 17px 16px 2px;
    overflow: hidden;
    border-radius: 88px 88px 4px 4px;
    opacity: .34;
    transform: scale(.96);
    transition:
        opacity .38s ease,
        transform .55s cubic-bezier(.2,.8,.2,1),
        filter .35s ease;
    filter: saturate(.8) brightness(.8);
    background:
        radial-gradient(circle at 50% 25%, rgba(var(--accent), .34), transparent 50%),
        linear-gradient(180deg, rgba(var(--accent), .16), rgba(7,10,16,.96));
}

.portal:hover .door-scene,
.portal:focus-visible .door-scene,
.portal-highlight .door-scene,
.portal.is-opening .door-scene {
    opacity: .95;
    transform: scale(1);
    filter: saturate(1.1) brightness(1.08);
}

.scene-label {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    color: rgba(255,255,255,.76);
    font-family: "Manrope", sans-serif;
    font-size: .48rem;
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
}

/* Portfolio: real photo appears only when the door opens. */
.scene-portfolio {
    background:
        linear-gradient(180deg, rgba(8,11,18,.12), rgba(8,11,18,.72)),
        url("../../assets/images/Cha_IMG_0838.JPG") center 25% / cover no-repeat;
}

/* Projects: modernized musical staff. */
.scene-projects {
    background:
        linear-gradient(180deg, rgba(8,11,18,.18), rgba(8,11,18,.92)),
        repeating-linear-gradient(
            to bottom,
            transparent 0 22px,
            rgba(255,255,255,.16) 22px 23px,
            transparent 23px 31px
        ),
        radial-gradient(circle at 55% 24%, rgba(var(--accent), .38), transparent 56%);
}

.scene-projects .music-note,
.scene-music .music-note {
    position: absolute;
    left: 51%;
    top: 42%;
    color: rgba(255,255,255,.88);
    font-family: Georgia, serif;
    font-size: 3.6rem;
    line-height: 1;
    transform: translate(-50%, -50%) rotate(-8deg);
    text-shadow: 0 0 24px rgba(var(--accent), .45);
}

/* Phoelynx: abstract network graph. */
.scene-phoelynx {
    background:
        linear-gradient(115deg, transparent 48%, rgba(var(--accent), .22) 49% 50%, transparent 51%),
        linear-gradient(28deg, transparent 46%, rgba(var(--accent), .16) 47% 48%, transparent 49%),
        radial-gradient(circle at 50% 30%, rgba(var(--accent), .34), transparent 58%),
        #0a0d15;
}

.network-node {
    position: absolute;
    width: 9px;
    height: 9px;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 50%;
    background: rgb(var(--accent));
    box-shadow: 0 0 18px rgba(var(--accent), .7);
}

.network-node.n1 { left: 28%; top: 34%; }
.network-node.n2 { right: 24%; top: 49%; }
.network-node.n3 { left: 48%; bottom: 27%; }

/* Robotics: two luminous "eyes" and a technical grid. */
.scene-robotics {
    background:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
        radial-gradient(circle at 50% 37%, rgba(var(--accent), .36), transparent 42%),
        #080d14;
    background-size: 18px 18px, 18px 18px, auto, auto;
}

.robot-eye {
    position: absolute;
    top: 40%;
    width: 20px;
    height: 9px;
    border-radius: 999px;
    background: rgb(var(--accent));
    box-shadow: 0 0 18px rgba(var(--accent), .9);
}

.robot-eye.e1 { left: 31%; }
.robot-eye.e2 { right: 31%; }

/* Birds: minimal audio equalizer. */
.scene-birds {
    background:
        radial-gradient(circle at 50% 25%, rgba(var(--accent), .32), transparent 52%),
        linear-gradient(180deg, #171017, #090b11);
}

.equalizer-bars {
    position: absolute;
    left: 50%;
    top: 42%;
    display: flex;
    align-items: center;
    gap: 5px;
    transform: translate(-50%, -50%);
}

.equalizer-bars i {
    display: block;
    width: 5px;
    border-radius: 999px;
    background: linear-gradient(to top, rgb(var(--accent)), #fff);
    box-shadow: 0 0 14px rgba(var(--accent), .4);
}

.equalizer-bars i:nth-child(1) { height: 24px; }
.equalizer-bars i:nth-child(2) { height: 48px; }
.equalizer-bars i:nth-child(3) { height: 35px; }
.equalizer-bars i:nth-child(4) { height: 57px; }
.equalizer-bars i:nth-child(5) { height: 29px; }

.portal:hover .equalizer-bars i:nth-child(odd),
.portal-highlight .equalizer-bars i:nth-child(odd) {
    animation: equalizer-pulse .8s ease-in-out infinite alternate;
}

.portal:hover .equalizer-bars i:nth-child(even),
.portal-highlight .equalizer-bars i:nth-child(even) {
    animation: equalizer-pulse .65s ease-in-out infinite alternate-reverse;
}

/* Music: keep the historical link to the instrument, but with a cinematic treatment. */
.scene-music {
    background:
        linear-gradient(180deg, rgba(8,11,18,.18), rgba(8,11,18,.9)),
        url("../../assets/images/music-bg.JPG") center / cover no-repeat;
}

@keyframes equalizer-pulse {
    from { transform: scaleY(.72); opacity: .68; }
    to { transform: scaleY(1.12); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .equalizer-bars i {
        animation: none !important;
    }
}


/* === Portal depth pass === */

.portal-door {
    transition:
        transform .5s cubic-bezier(.2,.8,.2,1),
        filter .35s ease;
}

.portal:hover .portal-door,
.portal:focus-visible .portal-door,
.portal-highlight .portal-door {
    transform: translateX(-50%) translateY(-5px) scale(1.02);
    filter: drop-shadow(0 20px 28px rgba(var(--accent), .08));
}

.portal.is-opening .portal-door {
    transform: translateX(-50%) translateY(-3px) scale(1.045);
}

.portal-door::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: -12px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(var(--accent), .34), transparent 68%);
    filter: blur(7px);
    opacity: .16;
    transform: perspective(90px) rotateX(68deg);
    transition: opacity .35s ease, transform .35s ease;
    pointer-events: none;
}

.portal:hover .portal-door::after,
.portal:focus-visible .portal-door::after,
.portal-highlight .portal-door::after,
.portal.is-opening .portal-door::after {
    opacity: .7;
    transform: perspective(90px) rotateX(68deg) scaleX(1.15);
}

.door-scene {
    transform:
        translate3d(var(--scene-x, 0px), var(--scene-y, 0px), 0)
        scale(.96);
}

.portal:hover .door-scene,
.portal:focus-visible .door-scene,
.portal-highlight .door-scene {
    transform:
        translate3d(var(--scene-x, 0px), var(--scene-y, 0px), 0)
        scale(1.035);
}

.portal.is-opening .door-scene {
    transform:
        translate3d(var(--scene-x, 0px), var(--scene-y, 0px), 0)
        scale(1.06);
}

.portal:hover .door-panel,
.portal:focus-visible .door-panel,
.portal-highlight .door-panel {
    transform: rotateY(-28deg) translateZ(5px);
}

.portal.is-opening .door-panel {
    transform: rotateY(-102deg) translateX(-4px);
}

.portal:hover .scene-label,
.portal:focus-visible .scene-label,
.portal-highlight .scene-label {
    color: rgba(255,255,255,.94);
    text-shadow: 0 0 18px rgba(var(--accent), .35);
}

/* Give each world a little life without turning the doors into mini-games. */
.portal:hover .scene-projects .music-note,
.portal:focus-visible .scene-projects .music-note,
.portal-highlight .scene-projects .music-note,
.portal:hover .scene-music .music-note,
.portal:focus-visible .scene-music .music-note,
.portal-highlight .scene-music .music-note {
    animation: portal-note-float 1.8s ease-in-out infinite alternate;
}

.portal:hover .network-node,
.portal:focus-visible .network-node,
.portal-highlight .network-node {
    animation: portal-node-pulse 1.15s ease-in-out infinite alternate;
}

.portal:hover .network-node.n2,
.portal:focus-visible .network-node.n2,
.portal-highlight .network-node.n2 {
    animation-delay: .18s;
}

.portal:hover .network-node.n3,
.portal:focus-visible .network-node.n3,
.portal-highlight .network-node.n3 {
    animation-delay: .34s;
}

.portal:hover .robot-eye,
.portal:focus-visible .robot-eye,
.portal-highlight .robot-eye {
    animation: portal-eye-scan 1.25s ease-in-out infinite alternate;
}

.portal:hover .robot-eye.e2,
.portal:focus-visible .robot-eye.e2,
.portal-highlight .robot-eye.e2 {
    animation-delay: .16s;
}

@keyframes portal-note-float {
    from {
        transform: translate(-50%, -50%) rotate(-8deg) translateY(2px);
        text-shadow: 0 0 18px rgba(var(--accent), .28);
    }
    to {
        transform: translate(-50%, -50%) rotate(-4deg) translateY(-7px);
        text-shadow: 0 0 32px rgba(var(--accent), .56);
    }
}

@keyframes portal-node-pulse {
    from {
        transform: scale(.82);
        opacity: .58;
    }
    to {
        transform: scale(1.18);
        opacity: 1;
    }
}

@keyframes portal-eye-scan {
    from {
        transform: translateX(-3px) scaleX(.86);
        opacity: .62;
    }
    to {
        transform: translateX(3px) scaleX(1.08);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal:hover .scene-projects .music-note,
    .portal:focus-visible .scene-projects .music-note,
    .portal-highlight .scene-projects .music-note,
    .portal:hover .scene-music .music-note,
    .portal:focus-visible .scene-music .music-note,
    .portal-highlight .scene-music .music-note,
    .portal:hover .network-node,
    .portal:focus-visible .network-node,
    .portal-highlight .network-node,
    .portal:hover .robot-eye,
    .portal:focus-visible .robot-eye,
    .portal-highlight .robot-eye {
        animation: none !important;
    }

    .door-scene {
        transform: none !important;
    }
}


/* === Cinematic portal crossing === */

body.is-transitioning {
    overflow: hidden;
}

.transition-screen {
    --transition-accent: 110, 141, 246;
    position: fixed;
    z-index: 200;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(260px, .78fr) minmax(320px, .72fr);
    align-items: center;
    justify-content: center;
    gap: clamp(30px, 6vw, 90px);
    padding: clamp(24px, 5vw, 72px);
    visibility: hidden;
    opacity: 0;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 24% 50%, rgba(var(--transition-accent), .18), transparent 26rem),
        linear-gradient(145deg, #05070c 0%, #080b12 62%, #05070a 100%);
    transition:
        opacity .35s ease,
        visibility .35s ease;
}

.transition-screen::before,
.transition-screen::after,
.transition-atmosphere {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.transition-screen::before {
    z-index: -3;
    opacity: .26;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 48px 48px;
    transform: scale(1.06);
    transition: transform 1s cubic-bezier(.2,.8,.2,1), opacity .5s ease;
}

.transition-screen::after {
    z-index: -1;
    opacity: 0;
    background:
        radial-gradient(circle at 30% 50%, rgba(var(--transition-accent), .56), transparent 18rem),
        radial-gradient(circle at 30% 50%, rgba(255,255,255,.15), transparent 7rem);
    transform: scale(.64);
    transition:
        opacity .5s ease .12s,
        transform .82s cubic-bezier(.18,.82,.24,1) .12s;
}

.transition-atmosphere {
    z-index: -2;
    background:
        radial-gradient(circle at 20% 30%, rgba(var(--transition-accent), .14), transparent 22rem),
        radial-gradient(circle at 74% 70%, rgba(255,255,255,.035), transparent 26rem);
    filter: blur(10px);
    transform: scale(1.08);
    opacity: .55;
}

.transition-screen.active {
    visibility: visible;
    opacity: 1;
}

.transition-screen.active::before {
    transform: scale(1);
    opacity: .18;
}

.transition-screen.active::after {
    opacity: 1;
    transform: scale(1);
}

.transition-gateway {
    position: relative;
    width: min(36vw, 340px);
    min-width: 245px;
    aspect-ratio: .64;
    justify-self: end;
    perspective: 1200px;
    transform: translateY(24px) scale(.88);
    opacity: 0;
    transition:
        transform .65s cubic-bezier(.2,.8,.2,1),
        opacity .4s ease;
}

.transition-screen.active .transition-gateway {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.transition-gateway-glow {
    position: absolute;
    inset: 12% 10% -8%;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(var(--transition-accent), .55), rgba(var(--transition-accent), .08) 44%, transparent 72%);
    filter: blur(24px);
    opacity: .65;
    transform: scale(.88);
    transition:
        opacity .45s ease,
        transform .8s cubic-bezier(.2,.8,.2,1);
}

.transition-gateway-world {
    position: absolute;
    inset: 22px 20px 0;
    overflow: hidden;
    border-radius: 49% 49% 3px 3px / 30% 30% 2px 2px;
    background:
        radial-gradient(circle at 50% 25%, rgba(var(--transition-accent), .46), transparent 43%),
        linear-gradient(180deg, rgba(var(--transition-accent), .16), #080b12 78%);
    box-shadow: inset 0 0 70px rgba(0,0,0,.32);
}

.transition-gateway-frame {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255,255,255,.28);
    border-bottom: none;
    border-radius: 52% 52% 5px 5px / 30% 30% 3px 3px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
    box-shadow:
        inset 0 0 0 10px rgba(255,255,255,.018),
        0 22px 70px rgba(0,0,0,.38),
        0 0 60px rgba(var(--transition-accent), .11);
}

.transition-gateway-frame::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: inherit;
}

.transition-gateway-door {
    position: absolute;
    inset: 20px 18px 0;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 49% 49% 3px 3px / 30% 30% 2px 2px;
    transform-origin: left center;
    background:
        radial-gradient(circle at 50% 24%, rgba(var(--transition-accent), .24), transparent 44%),
        linear-gradient(180deg, #1a1e2a, #090c13 74%);
    box-shadow:
        inset 0 0 60px rgba(0,0,0,.46),
        0 8px 30px rgba(0,0,0,.28);
    transition:
        transform .72s cubic-bezier(.18,.82,.24,1) .18s,
        filter .45s ease;
}

.transition-gateway-door::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 54%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgb(var(--transition-accent));
    box-shadow: 0 0 18px rgba(var(--transition-accent), .85);
}

.transition-screen.active .transition-gateway-door {
    transform: rotateY(-46deg);
}

.transition-screen.is-crossing .transition-gateway-door {
    transform: rotateY(-108deg) translateX(-6px);
    filter: brightness(1.22);
}

.transition-screen.is-crossing .transition-gateway {
    transform: scale(1.18) translateX(3vw);
}

.transition-screen.is-crossing .transition-gateway-glow {
    opacity: 1;
    transform: scale(1.35);
}

.transition-screen.is-crossing::after {
    opacity: 1;
    transform: scale(1.8);
}

.transition-inner {
    position: relative;
    z-index: 3;
    width: min(520px, 100%);
    justify-self: start;
    text-align: left;
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity .42s ease .12s,
        transform .55s cubic-bezier(.2,.8,.2,1) .12s;
}

.transition-screen.active .transition-inner {
    opacity: 1;
    transform: translateY(0);
}

.transition-screen small {
    display: block;
    margin-bottom: 14px;
    color: rgba(255,255,255,.48);
    text-transform: uppercase;
    letter-spacing: .19em;
    font-size: .68rem;
    font-weight: 800;
}

.transition-screen strong {
    display: block;
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(2.6rem, 6vw, 6.4rem);
    line-height: .92;
    letter-spacing: -.065em;
    text-wrap: balance;
}

.transition-screen p {
    max-width: 37rem;
    margin: 18px 0 0;
    color: rgba(255,255,255,.58);
    font-size: clamp(.82rem, 1.1vw, 1rem);
    line-height: 1.65;
}

.transition-progress {
    width: min(360px, 78%);
    height: 2px;
    margin-top: 26px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
}

.transition-progress span {
    display: block;
    width: 100%;
    height: 100%;
    transform: scaleX(0);
    transform-origin: left center;
    background:
        linear-gradient(90deg, rgb(var(--transition-accent)), rgba(255,255,255,.88));
    box-shadow: 0 0 18px rgba(var(--transition-accent), .42);
}

.transition-screen.active .transition-progress span {
    animation: transition-progress 1.05s cubic-bezier(.2,.8,.2,1) forwards;
}

/* Reuse each portal's visual language in the fullscreen threshold. */
.transition-screen[data-scene="portfolio"] .transition-gateway-world {
    background:
        linear-gradient(180deg, rgba(7,10,16,.12), rgba(7,10,16,.78)),
        url("../../assets/images/Cha_IMG_0838.JPG") center 25% / cover no-repeat;
}

.transition-screen[data-scene="projects"] .transition-gateway-world {
    background:
        linear-gradient(180deg, rgba(7,10,16,.12), rgba(7,10,16,.9)),
        repeating-linear-gradient(
            to bottom,
            transparent 0 28px,
            rgba(255,255,255,.18) 28px 29px,
            transparent 29px 39px
        ),
        radial-gradient(circle at 50% 28%, rgba(var(--transition-accent), .42), transparent 56%);
}

.transition-screen[data-scene="projects"] .transition-gateway-world::before,
.transition-screen[data-scene="music"] .transition-gateway-world::before {
    content: "♫";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,.72);
    font-family: Georgia, serif;
    font-size: clamp(4rem, 9vw, 7rem);
    text-shadow: 0 0 32px rgba(var(--transition-accent), .5);
}

.transition-screen[data-scene="phoelynx"] .transition-gateway-world {
    background:
        linear-gradient(118deg, transparent 48%, rgba(var(--transition-accent), .28) 49% 50%, transparent 51%),
        linear-gradient(28deg, transparent 46%, rgba(var(--transition-accent), .22) 47% 48%, transparent 49%),
        radial-gradient(circle at 45% 28%, rgba(var(--transition-accent), .45), transparent 58%),
        #0a0d15;
}

.transition-screen[data-scene="robotics"] .transition-gateway-world {
    background:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
        radial-gradient(circle at 50% 35%, rgba(var(--transition-accent), .45), transparent 48%),
        #080d14;
    background-size: 24px 24px, 24px 24px, auto, auto;
}

.transition-screen[data-scene="birds"] .transition-gateway-world {
    background:
        radial-gradient(circle at 50% 25%, rgba(var(--transition-accent), .4), transparent 52%),
        linear-gradient(180deg, #181017, #080a0f);
}

.transition-screen[data-scene="music"] .transition-gateway-world {
    background:
        linear-gradient(180deg, rgba(7,10,16,.16), rgba(7,10,16,.86)),
        url("../../assets/images/music-bg.JPG") center / cover no-repeat;
}

@keyframes transition-progress {
    0% {
        transform: scaleX(0);
    }
    72% {
        transform: scaleX(.82);
    }
    100% {
        transform: scaleX(1);
    }
}

@media (max-width: 820px) {
    .transition-screen {
        grid-template-columns: 1fr;
        align-content: center;
        gap: 28px;
        padding: 28px 22px;
    }

    .transition-gateway {
        width: min(58vw, 250px);
        min-width: 190px;
        justify-self: center;
    }

    .transition-inner {
        justify-self: center;
        text-align: center;
    }

    .transition-progress {
        margin-left: auto;
        margin-right: auto;
    }

    .transition-screen strong {
        font-size: clamp(2.4rem, 12vw, 4.5rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .transition-gateway,
    .transition-gateway-door,
    .transition-gateway-glow,
    .transition-screen::before,
    .transition-screen::after,
    .transition-inner {
        transition: none !important;
        transform: none !important;
    }

    .transition-screen.active .transition-progress span {
        animation: none !important;
        transform: scaleX(1);
    }

    .transition-screen.is-crossing .transition-gateway-door {
        transform: none !important;
    }
}


.chat-mode {
    margin-left: auto;
    margin-right: 12px;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 999px;
    color: rgba(255,255,255,.45);
    background: rgba(255,255,255,.035);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .03em;
    white-space: nowrap;
}

.chat-mode.is-ai {
    color: #cfeede;
    border-color: rgba(103,213,161,.2);
    background: rgba(103,213,161,.075);
}

.chat-mode.is-ai::before {
    content: "";
    width: 5px;
    height: 5px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 9px rgba(103,213,161,.6);
}

@media (max-width: 720px) {
    .chat-mode {
        display: none;
    }
}


html {
    background: #05070c;
}

body {
    transition: opacity .42s ease, filter .42s ease, transform .42s ease;
}

html.is-leaving-site body {
    opacity: 0;
    filter: blur(10px);
    transform: scale(.992);
}


/* === Portes 2.0 : plus profondes, plus lisibles, plus vivantes === */

.portal {
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    --portal-lift: 0px;
    transform:
        perspective(1200px)
        rotateX(var(--tilt-x))
        rotateY(var(--tilt-y))
        translateY(var(--portal-lift));
    will-change: transform;
}

.portal:hover,
.portal:focus-visible {
    --portal-lift: -8px;
    transform:
        perspective(1200px)
        rotateX(var(--tilt-x))
        rotateY(var(--tilt-y))
        translateY(var(--portal-lift));
}

.portal::after {
    background:
        linear-gradient(180deg, rgba(255,255,255,.035), transparent 40%),
        radial-gradient(circle at 50% 0%, rgba(var(--accent), .07), transparent 46%);
}

.portal-door {
    width: 58%;
    max-width: 205px;
    perspective: 1100px;
    transform-style: preserve-3d;
    will-change: transform;
}

.door-frame {
    background:
        linear-gradient(90deg, rgba(255,255,255,.025), rgba(var(--accent), .10) 48%, rgba(255,255,255,.025)),
        linear-gradient(180deg, rgba(var(--accent), .12), rgba(255,255,255,.012));
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,.025),
        inset 0 0 65px rgba(var(--accent), .10),
        0 0 50px rgba(var(--accent), .09),
        0 24px 45px rgba(0,0,0,.28);
}

.door-frame::after {
    content: "";
    position: absolute;
    left: 13%;
    right: 13%;
    bottom: -7px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(90deg, transparent, rgba(var(--accent), .34), transparent);
    filter: blur(5px);
    opacity: .45;
}

.door-panel {
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform;
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,.025),
        inset -18px 0 38px rgba(0,0,0,.34),
        inset 0 0 48px rgba(0,0,0,.38),
        7px 0 24px rgba(0,0,0,.16);
}

.door-panel::before {
    content: "";
    position: absolute;
    inset: 13% 15% 12%;
    border-radius: 76px 76px 5px 5px;
    border: 1px solid rgba(255,255,255,.045);
    background:
        linear-gradient(90deg, transparent 49.5%, rgba(255,255,255,.05) 50%, transparent 50.5%),
        linear-gradient(180deg, rgba(255,255,255,.02), transparent);
    opacity: .72;
}

.portal:hover .door-panel,
.portal:focus-visible .door-panel,
.portal-highlight .door-panel {
    transform: rotateY(-46deg);
    filter: brightness(1.09);
}

.portal.is-opening .door-panel {
    transform: rotateY(-104deg) translateZ(1px);
    filter: brightness(1.18);
}

.door-scene {
    transform:
        translate3d(var(--scene-x, 0), var(--scene-y, 0), -2px)
        scale(.965);
    will-change: transform, opacity;
}

.portal:hover .door-scene,
.portal:focus-visible .door-scene,
.portal-highlight .door-scene,
.portal.is-opening .door-scene {
    transform:
        translate3d(var(--scene-x, 0), var(--scene-y, 0), -2px)
        scale(1.025);
}

.door-scene::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255,255,255,.035), transparent 22%, transparent 78%, rgba(255,255,255,.025)),
        linear-gradient(180deg, rgba(255,255,255,.035), transparent 30%);
    mix-blend-mode: screen;
    opacity: .8;
}

.portal-enter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    color: rgba(255,255,255,.72);
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .04em;
    transition: color .25s ease, transform .25s ease;
}

.portal-enter span {
    display: inline-block;
    transition: transform .25s ease;
}

.portal:hover .portal-enter,
.portal:focus-visible .portal-enter {
    color: #fff;
    transform: translateX(2px);
}

.portal:hover .portal-enter span,
.portal:focus-visible .portal-enter span {
    transform: translateX(4px);
}

.portal[data-scene="portfolio"] .scene-label::before {
    content: "IDENTITÉ · ";
    opacity: .5;
}

.portal[data-scene="projects"] .scene-label::before {
    content: "PARTITION · ";
    opacity: .5;
}

.portal[data-scene="phoelynx"] .scene-label::before {
    content: "INFRA · ";
    opacity: .5;
}

.portal[data-scene="robotics"] .scene-label::before {
    content: "ROBOTIQUE · ";
    opacity: .5;
}

.portal[data-scene="birds"] .scene-label::before {
    content: "ASSO · ";
    opacity: .5;
}

.portal[data-scene="music"] .scene-label::before {
    content: "SCÈNE · ";
    opacity: .5;
}

/* Les portes restent visibles même si JavaScript ou l'observer rencontre un souci. */
.portal {
    opacity: 1;
    translate: 0 0;
    transition:
        opacity .55s ease,
        translate .65s cubic-bezier(.2,.8,.2,1),
        border-color .25s ease,
        box-shadow .35s ease,
        transform .35s cubic-bezier(.2,.8,.2,1);
}

.portal.is-revealed {
    opacity: 1;
    translate: 0 0;
}


.portal.is-opening {
    --portal-lift: -4px;
    transform:
        perspective(1200px)
        rotateX(0deg)
        rotateY(0deg)
        translateY(var(--portal-lift))
        scale(1.03);
    box-shadow:
        0 30px 95px rgba(0,0,0,.42),
        0 0 100px rgba(var(--accent), .16);
}

.portal.is-opening .door-scene {
    opacity: 1;
    filter: saturate(1.18) brightness(1.15);
}

.portal.is-opening .scene-label {
    opacity: 1;
}

@media (max-width: 720px) {
    .portal-door {
        width: 52%;
        max-width: 182px;
    }

    .portal-enter {
        margin-top: 12px;
    }

    .portal:hover .door-panel,
    .portal:focus-visible .door-panel {
        transform: rotateY(-30deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal {
        opacity: 1;
        translate: none;
        transform: none !important;
    }

    .portal.is-revealed {
        translate: none;
    }

    .portal:hover .door-panel,
    .portal:focus-visible .door-panel,
    .portal-highlight .door-panel,
    .portal.is-opening .door-panel {
        transform: none;
    }
}


/* Micro-animations propres à chaque univers */
.portal[data-scene="phoelynx"]:hover .network-node,
.portal[data-scene="phoelynx"]:focus-visible .network-node,
.portal[data-scene="phoelynx"].portal-highlight .network-node {
    animation: portal-node-pulse 1.25s ease-in-out infinite;
}

.portal[data-scene="phoelynx"] .network-node.n2 { animation-delay: .16s; }
.portal[data-scene="phoelynx"] .network-node.n3 { animation-delay: .32s; }

.portal[data-scene="robotics"]:hover .robot-eye,
.portal[data-scene="robotics"]:focus-visible .robot-eye,
.portal[data-scene="robotics"].portal-highlight .robot-eye {
    animation: portal-robot-scan 1.7s ease-in-out infinite alternate;
}

.portal[data-scene="robotics"] .robot-eye.e2 {
    animation-delay: .16s;
}

.portal[data-scene="projects"]:hover .music-note,
.portal[data-scene="projects"]:focus-visible .music-note,
.portal[data-scene="music"]:hover .music-note,
.portal[data-scene="music"]:focus-visible .music-note {
    animation: portal-note-float 1.8s ease-in-out infinite alternate;
}

.portal[data-scene="portfolio"]:hover .door-scene,
.portal[data-scene="portfolio"]:focus-visible .door-scene {
    background-position: center 21%;
}

.scene-projects::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 34%,
        rgba(255,255,255,.10) 48%,
        transparent 62%
    );
    transform: translateX(-130%);
    opacity: 0;
}

.portal[data-scene="projects"]:hover .scene-projects::after,
.portal[data-scene="projects"]:focus-visible .scene-projects::after {
    animation: portal-staff-shimmer 1.8s ease .1s both;
}

@keyframes portal-node-pulse {
    0%, 100% {
        transform: scale(.84);
        opacity: .58;
        box-shadow: 0 0 10px rgba(var(--accent), .35);
    }
    50% {
        transform: scale(1.22);
        opacity: 1;
        box-shadow: 0 0 24px rgba(var(--accent), .85);
    }
}

@keyframes portal-robot-scan {
    from {
        transform: translateX(-4px) scaleX(.82);
        filter: brightness(.8);
    }
    to {
        transform: translateX(4px) scaleX(1.08);
        filter: brightness(1.3);
    }
}

@keyframes portal-note-float {
    from {
        transform: translate(-50%, -50%) rotate(-10deg) translateY(2px);
    }
    to {
        transform: translate(-50%, -50%) rotate(-4deg) translateY(-7px);
    }
}

@keyframes portal-staff-shimmer {
    0% {
        transform: translateX(-130%);
        opacity: 0;
    }
    22% {
        opacity: .75;
    }
    100% {
        transform: translateX(130%);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal[data-scene="phoelynx"] .network-node,
    .portal[data-scene="robotics"] .robot-eye,
    .portal[data-scene="projects"] .music-note,
    .portal[data-scene="music"] .music-note,
    .scene-projects::after {
        animation: none !important;
    }
}


/* Réseaux : logos en couleur */
.social-rail .social-link {
    overflow: hidden;
}
.social-rail .social-link img {
    width: 19px;
    height: 19px;
    display: block;
    object-fit: contain;
    transition: transform .22s ease;
}
.social-rail .social-link:hover img,
.social-rail .social-link:focus-visible img {
    transform: scale(1.12);
}
.social-rail .social-discord { background: rgba(88, 101, 242, .08); }
.social-rail .social-youtube { background: rgba(255, 0, 0, .07); }
.social-rail .social-instagram { background: rgba(228, 64, 95, .08); }
.social-rail .social-linkedin { background: rgba(10, 102, 194, .09); }
.social-rail .social-mail {
    color: #ea4335;
    background: rgba(234, 67, 53, .07);
    font-size: 1.05rem;
    font-weight: 800;
}
.social-rail .social-mail:hover,
.social-rail .social-mail:focus-visible {
    color: #ff6b5f;
}


.ai-status-dot {
    transition: background .25s ease, box-shadow .25s ease, opacity .25s ease;
}
.ai-status-dot.is-online {
    background: #67d5a1;
    box-shadow: 0 0 14px rgba(103, 213, 161, .78);
}
.ai-status-dot.is-checking {
    background: #6e8df6;
    box-shadow: 0 0 14px rgba(110, 141, 246, .7);
}
.ai-status-dot.is-local {
    background: #d9a84f;
    box-shadow: 0 0 12px rgba(217, 168, 79, .62);
}
.ai-status-dot.is-error {
    background: #ef6a70;
    box-shadow: 0 0 14px rgba(239, 106, 112, .7);
}


.social-rail .social-link svg {
    width: 19px;
    height: 19px;
    display: block;
}

.social-rail .social-linkedin {
    color: #0a66c2;
}

.chat-presence {
    transition: color .25s ease;
}

.chat-presence.is-online {
    color: #67d5a1;
}

.chat-presence.is-checking {
    color: #6e8df6;
}

.chat-presence.is-local {
    color: #d9a84f;
}

.chat-presence.is-error {
    color: #ef6a70;
}


/* === Portals: real brand marks === */
.scene-logo{
    position:absolute;
    z-index:2;
    left:50%;
    top:40%;
    width:58%;
    max-height:92px;
    object-fit:contain;
    transform:translate(-50%,-50%);
    filter:drop-shadow(0 10px 24px rgba(var(--accent),.28));
    opacity:.92;
    transition:transform .35s ease, filter .35s ease, opacity .35s ease;
}
.scene-logo-birds{
    width:52%;
}
.scene-logo-phoelynx{
    width:61%;
}
.portal:hover .scene-logo,
.portal:focus-visible .scene-logo,
.portal-highlight .scene-logo,
.portal.is-opening .scene-logo{
    transform:translate(-50%,-50%) scale(1.07);
    filter:drop-shadow(0 12px 30px rgba(var(--accent),.42));
    opacity:1;
}
.scene-phoelynx .network-node,
.scene-birds .equalizer-bars{
    opacity:.34;
}
.portal:hover .scene-phoelynx .network-node,
.portal:hover .scene-birds .equalizer-bars,
.portal-highlight .scene-phoelynx .network-node,
.portal-highlight .scene-birds .equalizer-bars{
    opacity:.52;
}


/* === 2026-10 ecosystem navigation === */
.header-actions .scroll-link{
    white-space:nowrap;
}
@media (max-width: 780px){
    .site-header{
        gap:10px;
        padding-left:14px;
        padding-right:14px;
    }
    .header-actions{
        max-width:calc(100vw - 138px);
        overflow-x:auto;
        overflow-y:hidden;
        scrollbar-width:none;
        -webkit-overflow-scrolling:touch;
    }
    .header-actions::-webkit-scrollbar{display:none}
}


/* === Brand-correct portal accents === */
.portal[data-scene="phoelynx"] { --accent: 213, 39, 43; }
.portal[data-scene="birds"] { --accent: 244, 194, 13; }
.portal[data-scene="music"] { --accent: 185, 141, 244; }

/* Brand logo shown behind the door during the fullscreen transition. */
.transition-logo {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 43%;
    width: 58%;
    max-height: 120px;
    object-fit: contain;
    transform: translate(-50%, -50%) scale(.92);
    opacity: 0;
    filter: drop-shadow(0 14px 32px rgba(var(--transition-accent), .38));
    transition: opacity .3s ease .2s, transform .55s cubic-bezier(.2,.8,.2,1) .2s;
}
.transition-screen.active .transition-logo:not([hidden]) {
    opacity: .95;
    transform: translate(-50%, -50%) scale(1);
}
.transition-screen.is-crossing .transition-logo:not([hidden]) {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.14);
}
.transition-screen[data-scene="birds"] .transition-logo {
    width: 52%;
}
.transition-screen[data-scene="phoelynx"] .transition-logo {
    width: 64%;
}


/* === Birds brand badge === */
.scene-logo-birds{
    width:54%;
    aspect-ratio:1 / 1;
    max-height:none;
    object-fit:contain;
    padding:8px;
    border-radius:50%;
    background:rgba(8,11,18,.78);
    box-shadow:
        0 0 0 1px rgba(244,194,13,.26),
        0 12px 30px rgba(0,0,0,.28);
}
.transition-screen[data-scene="birds"] .transition-logo{
    width:54%;
    aspect-ratio:1 / 1;
    max-height:none;
    object-fit:contain;
    padding:10px;
    border-radius:50%;
    background:rgba(8,11,18,.8);
    box-shadow:
        0 0 0 1px rgba(244,194,13,.28),
        0 16px 40px rgba(0,0,0,.32);
}



