:root {
    --paper: #eeeae0;
    --ink: #11110f;
    --quiet: #68645b;
    --line: rgba(17, 17, 15, .25);
    --signal: #e84d2f;
    --acid: #d9f24b;
    --blue: #8cc8d9;
    --sans: "Manrope", Arial, sans-serif;
    --serif: "Newsreader", Georgia, serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; }
a { color: inherit; }

.landing-body {
    min-width: 320px;
    color: var(--ink);
    background:
        linear-gradient(rgba(17, 17, 15, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 17, 15, .035) 1px, transparent 1px),
        var(--paper);
    background-size: 24px 24px;
    font-family: var(--sans);
    text-rendering: optimizeLegibility;
}

.skip-link {
    position: fixed;
    z-index: 20;
    top: .75rem;
    left: .75rem;
    padding: .75rem 1rem;
    color: var(--paper);
    background: var(--ink);
    transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

.landing {
    position: relative;
    isolation: isolate;
    min-height: 100svh;
    padding: 1.4rem;
    overflow: hidden;
}

.landing-header {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ink);
}

.landing-wordmark,
.language-switch {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-decoration: none;
    text-transform: uppercase;
}

.language-switch {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--ink);
    place-items: center;
}

.portals { display: contents; }
.portal {
    position: absolute;
    z-index: 5;
    width: min(22vw, 19rem);
    display: grid;
    grid-template-columns: 2rem 1fr;
    gap: .25rem .7rem;
    text-decoration: none;
}
.portal::after {
    content: "\2197\FE0E";
    position: absolute;
    top: 0;
    right: 0;
    font-family: var(--mono);
    font-variant-emoji: text;
    font-size: 1rem;
    transition: transform 160ms ease;
}
.portal:hover::after,
.portal:focus-visible::after { transform: translate(.25rem, -.25rem); }
.portal:focus-visible { outline: 2px solid var(--signal); outline-offset: .5rem; }
.portal-index {
    grid-row: 1 / span 2;
    padding-top: .18rem;
    color: var(--signal);
    font-family: var(--mono);
    font-size: .64rem;
}
.portal strong {
    padding-right: 1.5rem;
    font-size: clamp(1.2rem, 1.6vw, 1.75rem);
    letter-spacing: -.04em;
    line-height: 1;
}
.portal > span:last-child {
    max-width: 17rem;
    color: var(--quiet);
    font-size: clamp(.68rem, .8vw, .78rem);
    line-height: 1.48;
}
.portal-nw { top: 7.5rem; left: 1.4rem; }
.portal-ne { top: 7.5rem; right: 1.4rem; }
.portal-sw { bottom: 1.6rem; left: 1.4rem; }
.portal-se { right: 1.4rem; bottom: 1.6rem; }

.habitat-stage {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    pointer-events: auto;
    opacity: 1;
    background: transparent;
}
.habitat-stage habitat-observatory {
    display: block;
    width: 100%;
    height: 100%;
    --habitat-background: var(--paper);
    --habitat-ink: var(--ink);
    --habitat-muted: var(--quiet);
    --habitat-line: rgba(17, 17, 15, .07);
    --habitat-accent: var(--signal);
    --habitat-blue: var(--blue);
    --habitat-mask: radial-gradient(ellipse 72% 76% at 50% 48%, #000 28%, rgba(0, 0, 0, .72) 62%, transparent 100%);
}
.habitat-stage habitat-observatory::part(frame) {
    height: 100%;
    min-height: 100%;
    aspect-ratio: auto;
    border: 0;
    background: transparent;
}
.habitat-caption {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: 1.7rem;
    width: min(28rem, calc(100% - 3rem));
    margin: 0;
    color: var(--quiet);
    font-family: var(--mono);
    font-size: .56rem;
    letter-spacing: .07em;
    line-height: 1.45;
    text-align: center;
    text-transform: uppercase;
    transform: translateX(-50%);
    pointer-events: none;
}
.habitat-feed-prompt {
    display: block;
    margin: .42rem auto 0;
    padding: .25rem .5rem;
    border: 0;
    color: var(--signal);
    background: rgba(238, 234, 224, .72);
    font: 700 .58rem/1.25 var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    pointer-events: auto;
}
.habitat-feed-prompt:hover { color: var(--ink); }
.habitat-feed-prompt:focus-visible { outline: 2px solid var(--signal); outline-offset: .2rem; }

@media (max-width: 980px) {
    .landing { min-height: 100svh; padding: 1rem; overflow: hidden; }
    .portals {
        position: relative;
        z-index: 5;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1px;
        margin-top: 1rem;
        background: var(--ink);
        border: 1px solid var(--ink);
    }
    .portal {
        position: relative;
        inset: auto;
        width: auto;
        min-height: 8.5rem;
        padding: 1rem;
        background: rgba(238, 234, 224, .72);
        -webkit-backdrop-filter: blur(1.5px);
        backdrop-filter: blur(1.5px);
    }
    .habitat-stage {
        position: absolute;
        inset: 0;
        min-height: 0;
        margin: 0;
        opacity: 1;
    }
    .habitat-stage habitat-observatory {
        --habitat-mask: radial-gradient(ellipse 88% 75% at 50% 48%, #000 20%, rgba(0, 0, 0, .6) 58%, transparent 100%);
    }
}

@media (max-width: 580px) {
    .portals { grid-template-columns: 1fr; }
    .portal { min-height: 7rem; }
    .habitat-stage {
        inset: 0;
        opacity: 1;
    }
    .habitat-stage habitat-observatory {
        --habitat-mask: radial-gradient(ellipse 96% 78% at 50% 46%, #000 32%, rgba(0, 0, 0, .78) 68%, transparent 100%);
    }
    .habitat-caption {
        bottom: .75rem;
        width: calc(100% - 2rem);
        font-size: .5rem;
    }
    .habitat-feed-prompt { font-size: .52rem; }
}

@media (max-width: 580px) and (max-height: 680px) {
    .habitat-caption {
        position: relative;
        left: auto;
        bottom: auto;
        width: 100%;
        margin: 1rem auto 0;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; }
}
