* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg: #050706;
    --text: #eef4f1;
    --muted: #9da9a4;
    --line: rgba(255,255,255,.11);
}

html {
    min-height: 100%;
    background: var(--bg);
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 50% -10%, rgba(30,90,75,.14), transparent 38rem),
        linear-gradient(180deg, #080b09 0%, #030504 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .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: 46px 46px;
    mask-image: linear-gradient(to bottom, #000, transparent 85%);
}

.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 17% 54%, rgba(0,255,156,.08), transparent 25rem),
        radial-gradient(circle at 50% 54%, rgba(0,140,255,.08), transparent 25rem),
        radial-gradient(circle at 83% 54%, rgba(255,170,40,.08), transparent 25rem);
    filter: blur(20px);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,.09);
    background: linear-gradient(180deg, rgba(6,10,8,.90), rgba(4,7,5,.76));
    box-shadow: 0 10px 34px rgba(0,0,0,.24);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.topbar-inner {
    width: min(1560px, calc(100% - 40px));
    min-height: 62px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
    align-items: center;
    gap: 24px;
}

.topbar a {
    text-decoration: none;
}

.topbar-brand {
    width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #dce7e2;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .26em;
    transition: color .25s ease, text-shadow .25s ease;
}

.topbar-brand:hover,
.topbar-brand:focus-visible {
    color: #fff;
    text-shadow: 0 0 16px rgba(230,255,246,.25);
    outline: none;
}

.brand-orb {
    width: 9px;
    height: 9px;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 50%;
    background: radial-gradient(circle at 34% 28%, #fff 0 18%, #d9e2de 32%, #66716c 66%, #1d2421 100%);
    box-shadow: 0 0 12px rgba(220,240,232,.26);
}

.world-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(18px, 3vw, 40px);
}

.world-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #9eaaa5;
    font-size: .8rem;
    white-space: nowrap;
    transition: color .25s ease, transform .25s ease;
}

.world-nav a:hover,
.world-nav a:focus-visible {
    color: #f2f7f5;
    transform: translateY(-1px);
    outline: none;
}

.nav-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    transition: box-shadow .25s ease, transform .25s ease;
}

.nav-dot-apps {
    color: #20f29b;
}

.nav-dot-os {
    color: #28a8ff;
}

.nav-dot-cradles {
    color: #f1ae42;
}

.world-nav a:hover .nav-dot,
.world-nav a:focus-visible .nav-dot {
    transform: scale(1.22);
    box-shadow: 0 0 13px currentColor;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
}

.github-link {
    color: #87948e;
    font-size: .78rem;
    transition: color .25s ease;
}

.github-link:hover,
.github-link:focus-visible {
    color: #f2f7f5;
    outline: none;
}

.language-switch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 999px;
    background: rgba(255,255,255,.025);
    color: #52605a;
}

.language-button {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: #69756f;
    font: inherit;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    cursor: pointer;
    transition: color .25s ease, text-shadow .25s ease;
}

.language-button:hover,
.language-button:focus-visible {
    color: #c8d3ce;
    outline: none;
}

.language-button.is-active {
    color: #f4f7f6;
    text-shadow: 0 0 12px rgba(242,247,245,.24);
}

.hero {
    position: relative;
    z-index: 2;
    width: min(1500px, calc(100% - 48px));
    margin: 0 auto;
    padding: 46px 0 30px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 10px;
    color: #8fb8a7;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .34em;
}

.hero h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.15rem, 5vw, 5rem);
    font-weight: 400;
    letter-spacing: -.035em;
}

.lead {
    margin: 14px auto 0;
    max-width: 720px;
    color: var(--muted);
    font-size: clamp(.95rem, 1.5vw, 1.12rem);
}

.worlds {
    position: relative;
    z-index: 2;
    width: min(1560px, calc(100% - 40px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 18px;
}

.world {
    --accent: #fff;
    position: relative;
    isolation: isolate;
    min-height: min(79vh, 900px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    text-decoration: none;
    color: var(--text);
    background-color: #0b0e0c;
    background-position: center;
    background-size: cover;
    box-shadow: 0 30px 80px rgba(0,0,0,.38);
    transform: translateZ(0);
    transition: transform .5s cubic-bezier(.2,.8,.2,1), border-color .5s ease, box-shadow .5s ease;
}

.world::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(to top, rgba(0,0,0,.86) 0%, rgba(0,0,0,.28) 40%, rgba(0,0,0,.04) 68%, rgba(0,0,0,.23) 100%);
}

.world::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0;
    background: radial-gradient(circle at 50% 65%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 48%);
    transition: opacity .45s ease;
}

.world-apps {
    --accent: #20f29b;
    background-image:
        linear-gradient(rgba(0,18,10,.12), rgba(0,18,10,.12)),
        url("assets/portals/AyoTools.png"),
        radial-gradient(circle at 50% 40%, #0a6344, #06130e 55%, #030504);
}

.world-os {
    --accent: #28a8ff;
    min-height: min(86vh, 980px);
    background-image:
        linear-gradient(rgba(0,10,28,.12), rgba(0,10,28,.12)),
        url("assets/portals/AyoOS.png"),
        radial-gradient(circle at 50% 40%, #094c88, #07111d 55%, #030504);
}

.world-cradles {
    --accent: #f1ae42;
    background-image:
        linear-gradient(rgba(20,11,0,.08), rgba(20,11,0,.08)),
        url("assets/portals/PKolyski.png"),
        radial-gradient(circle at 50% 40%, #875520, #171008 55%, #030504);
}

.world-glow {
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -10%;
    height: 36%;
    border-radius: 50%;
    pointer-events: none;
    opacity: .15;
    background: var(--accent);
    filter: blur(70px);
    transition: opacity .45s ease, transform .45s ease;
}

.world-copy {
    position: absolute;
    inset: auto 0 0;
    display: grid;
    gap: 7px;
    padding: 44px 38px 34px;
}

.world-number {
    color: var(--accent);
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .18em;
}

.world-title-image {
    display: block;
    width: min(88%, 390px);
    height: 92px;
    margin: 0;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,.78));
}

.world-title-cradles {
    width: min(78%, 350px);
    height: 118px;
}

.world-copy small {
    color: #c0c9c5;
    font-size: .9rem;
}

.enter {
    width: max-content;
    margin-top: 12px;
    padding: 9px 0;
    color: var(--accent);
    font-size: .86rem;
    font-weight: 800;
    letter-spacing: .04em;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}

.world:hover,
.world:focus-visible {
    transform: translateY(-10px) scale(1.012);
    border-color: color-mix(in srgb, var(--accent) 65%, transparent);
    box-shadow: 0 38px 100px rgba(0,0,0,.52), 0 0 36px color-mix(in srgb, var(--accent) 12%, transparent);
    outline: none;
}

.world:hover::after,
.world:focus-visible::after {
    opacity: 1;
}

.world:hover .world-glow,
.world:focus-visible .world-glow {
    opacity: .27;
    transform: scale(1.12);
}

footer {
    position: relative;
    z-index: 2;
    width: min(1560px, calc(100% - 40px));
    margin: 0 auto;
    padding: 26px 0 32px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: #67736e;
    font-size: .72rem;
    letter-spacing: .08em;
}

@media (max-width: 980px) {
    .topbar-inner {
        grid-template-columns: 1fr auto;
        gap: 16px;
    }

    .world-nav {
        display: none;
    }

    .hero {
        padding-top: 42px;
    }

    .worlds {
        grid-template-columns: 1fr;
        max-width: 680px;
    }

    .world,
    .world-os {
        min-height: 72vh;
    }
}

@media (max-width: 560px) {
    .topbar-inner,
    .hero,
    .worlds,
    footer {
        width: min(100% - 24px, 680px);
    }

    .topbar-inner {
        min-height: 56px;
    }

    .topbar-brand {
        font-size: .65rem;
        letter-spacing: .20em;
    }

    .github-link {
        display: none;
    }

    .topbar-actions {
        gap: 10px;
    }

    .hero {
        padding: 34px 0 24px;
    }

    .world,
    .world-os {
        min-height: 68vh;
        border-radius: 22px;
    }

    .world-copy {
        padding: 34px 24px 24px;
    }

    .world-title-image {
        width: min(92%, 360px);
        height: 84px;
    }

    .world-title-cradles {
        width: min(82%, 320px);
        height: 108px;
    }

    footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

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

    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
