.duna-home {
    --home-paper: #f5efe8;
    --home-serif: "DUNA Baskervville", Baskerville, Georgia, serif;
    --home-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: auto 1fr auto;
    row-gap: clamp(1.5rem, 5svh, 3.75rem);
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100svh;
    padding: clamp(1.5rem, 4.2svh, 3.5rem) clamp(1.25rem, 7.45vw, 12rem)
             clamp(1.75rem, 5.1svh, 4rem) clamp(1.25rem, 7.67vw, 12rem);
    color: var(--home-paper);
    background-color: #031925;
    font-family: var(--home-sans);
}

.duna-home__artwork, .duna-home::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.duna-home__artwork {
    --scene-width-from-viewport-height: calc(1600vh / 9);
    z-index: -2;
    overflow: hidden;
    container-type: size;
}

.duna-home__scene {
    position: absolute;
    top: 28%;
    left: 28%;
    width: max(100%, var(--scene-width-from-viewport-height));
    width: max(100%, calc(1600cqh / 9));
    aspect-ratio: 16 / 9;
    transform: translate(-28%, -28%);
}

.duna-home__earth, .duna-home__globe, .duna-home__stars {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.duna-home__globe { z-index: 1; visibility: hidden; }
.duna-home__globe.is-ready { visibility: visible; }
.duna-home__stars { z-index: -1; }
.duna-home[data-cached-sky] .duna-home__stars:not([data-frame-preview]) { visibility: hidden; }

/* Same projected limb as the globe: center (83.2% W, 128% H), radius 97% H. */
.duna-home__airglow {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    pointer-events: none;
    mix-blend-mode: screen;
    mask-image: radial-gradient(ellipse 54.5625% 97% at 83.2% 128%,
        transparent 98.25%, #0003 99.4%, #000 99.94%, #000 100.07%,
        #0009 100.49%, #0003 101.4%, transparent 103%);
}

.duna-home__airglow::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 34%;
    background: linear-gradient(90deg, transparent, #52bbff32 24%, #83dcffa8 46%,
        #c1f3ffeb 58%, #69cfff82 72%, transparent);
    animation: duna-limb-light 13s ease-in-out -4s infinite alternate;
    animation-play-state: paused;
}

.duna-home[data-sky-active] .duna-home__airglow::before { animation-play-state: running; }

@keyframes duna-limb-light {
    from { transform: translate3d(62%, 0, 0); opacity: .72; }
    to   { transform: translate3d(219%, 0, 0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .duna-home__airglow { display: none; }
    .duna-home__airglow::before { animation: none; }
}

@keyframes duna-type-arrives {
    from { opacity: 0; }
    to { opacity: 1; }
}

.duna-home__response { display: flow-root; }

@media (scripting: enabled) {
    /* Reveal the prepared sky with the globe. A slow GPU can still show the
       sky on its own while it finishes the first frame. */
    .duna-home:not([data-intro-ready]):not([data-cached-sky]) .duna-home__stars:not([data-frame-preview]) {
        animation: duna-wait-for-earth 1ms step-end 2s backwards;
    }
    @keyframes duna-wait-for-earth {
        from { visibility: hidden; }
        to { visibility: visible; }
    }
    .duna-home:not([data-earth-display]) .duna-home__scene::after,
    .duna-home:not([data-earth-display]) .duna-home__airglow,
    .duna-home[data-earth-display="selecting"] .duna-home__scene::after,
    .duna-home[data-earth-display="selecting"] .duna-home__airglow { visibility: hidden; }
    /* Allow the controls to appear even if neither page module can start. */
    .duna-home:not([data-earth-display]) :is(.duna-home__masthead, .duna-home__intro, .duna-home__footer):not(:focus-within) {
        animation: duna-type-arrives 1ms step-end 2.3s backwards;
    }
    .duna-home[data-earth-display]:not([data-intro-ready]) :is(.duna-home__masthead, .duna-home__intro, .duna-home__footer):not(:focus-within) {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .duna-home[data-intro-ready]:not([data-restart-intro]) [data-intro-item] {
        animation: duna-type-arrives .45s ease-out;
    }
    .duna-home[data-intro-ready]:not([data-restart-intro]) a[data-intro-item]:focus-visible {
        animation: none;
    }

}

.duna-home::before {
    content: "";
    z-index: -1;
    background-image:
        radial-gradient(ellipse 52% 14% at 14% 100%, rgb(3 19 30 / 72%) 30%, transparent),
        linear-gradient(90deg, rgb(5 25 34 / 24%), transparent 47%);
}

.duna-home__masthead {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    color: #fff;
}

.duna-home__brand { display: grid; justify-items: start; gap: .24rem; }
.duna-home__wordmark { font: 900 1.375rem/1.2 Orbitron, sans-serif; letter-spacing: 2px; }
.duna-home__established { font: 500 .8125rem/1.35 var(--home-sans); letter-spacing: .09em; }

.duna-home__masthead-rule {
    height: 1px;
    margin: .77rem clamp(1rem, 5.65vw, 6.5rem) 0 clamp(1rem, 2.8vw, 4rem);
    background: linear-gradient(90deg, transparent, #d5e2e7a6 22%, #d5e2e7a6 65%, transparent);
}

.duna-home__edition {
    margin: .13rem 0 0;
    font: 500 .875rem/1.5 var(--home-sans);
    letter-spacing: .17em;
    word-spacing: .62em;
    white-space: nowrap;
}

.duna-home__intro, .duna-home__values { margin-inline-start: .25rem; }
.duna-home__intro { align-self: center; min-width: 0; }

.duna-home__title {
    margin: 0;
    color: var(--home-paper);
    font: 525 clamp(4rem, min(6.25vw, 14.2svh), 8rem)/.867 var(--home-serif);
    letter-spacing: .002em;
    overflow-wrap: normal;
}

.duna-home__title span { display: block; }

.duna-home__description {
    max-width: 18.6em;
    margin: clamp(1.5rem, 4.6svh, 2.3rem) 0 0;
    font: 425 clamp(1.1875rem, min(1.5vw, 3.45svh), 1.5rem)/1.4 var(--home-serif);
    letter-spacing: -.014em;
}

.duna-home__description::before {
    content: "";
    display: block;
    width: 2rem;
    height: 1px;
    margin-bottom: clamp(1.125rem, 3.45svh, 1.65rem);
    background: #c5c4bdb8;
}

.duna-home__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem clamp(1.125rem, 1.85vw, 2rem);
    margin-top: clamp(1.375rem, 4svh, 2rem);
}

.duna-home__join, .duna-home__more {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 2.9375rem;
    max-width: 100%;
}

.duna-home__join {
    justify-content: space-between;
    gap: 1.3rem;
    min-width: min(100%, 16.375rem);
    padding: .625rem 1.56rem;
    border: 1px solid transparent;
    border-radius: .35rem;
    color: #08161c;
    background-color: var(--home-paper);
    font: 700 1rem/1.3 var(--home-sans);
    letter-spacing: -.025em;
    text-decoration: none;
}

.duna-home__arrow { position: relative; flex: 0 0 1rem; height: .75rem; }
.duna-home__arrow::before, .duna-home__arrow::after { content: ""; position: absolute; }
.duna-home__arrow::before { inset: 50% 0 auto; border-top: 1px solid currentColor; }
.duna-home__arrow::after {
    top: 50%;
    right: 0;
    width: .41rem;
    height: .41rem;
    border: solid currentColor;
    border-width: 1px 1px 0 0;
    transform: translateY(-43%) rotate(45deg);
}

.duna-home__more {
    color: #fff;
    font: 600 .9375rem/1.3 var(--home-sans);
    letter-spacing: -.025em;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .24em;
}

.duna-home__join:hover { background-color: #fff; }
.duna-home__more:hover { text-decoration-thickness: 2px; }
.duna-home a:focus-visible { outline: 2px solid #fff; outline-offset: 4px; box-shadow: 0 0 0 7px #061d29; }

.duna-home__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .4rem .75rem;
}

.duna-home__values {
    margin-block: 0;
    color: #fff;
    font: 500 .75rem/1.4 var(--home-sans);
    letter-spacing: .16em;
    word-spacing: .8em;
    text-shadow: 0 1px 3px #031823;
}

.duna-home__credits {
    position: relative;
    margin-inline-start: auto;
    padding: .08rem .28rem;
    color: #e0eaee;
    font: 500 .75rem/1.25 var(--home-sans);
    text-decoration: underline;
    text-underline-offset: .18em;
}

.duna-home__credits::after { content: ""; position: absolute; inset: -.35rem -.15rem; }
.duna-home__credits:hover { color: #fff; }

@media (max-width: 44rem), (max-width: 62rem) and (orientation: portrait) {
    .duna-home {
        row-gap: clamp(1.25rem, 3.5svh, 2rem);
        padding: clamp(1.25rem, 3.5svh, 2.5rem) clamp(1.25rem, 6.1vw, 3rem) max(1.4rem, env(safe-area-inset-bottom));
    }

    .duna-home__artwork { --scene-width-from-viewport-height: 128vh; top: auto; height: 72%; }
    .duna-home__scene { top: 100%; left: 78%; transform: translate(-78%, -100%); }
    .duna-home::before { background-image: linear-gradient(180deg, #031925 0%, #031925e8 28%, #031925a6 53%, #03192508 77%, #02121bc2 100%); }
    .duna-home__brand { gap: .08rem; }
    .duna-home__wordmark { font-size: clamp(1.05rem, 4.35vw, 1.35rem); }
    .duna-home__established { font-size: .675rem; }
    .duna-home__masthead-rule { margin: .63rem clamp(.5rem, 2.5vw, 2rem) 0; }
    .duna-home__edition { margin-top: .125rem; font-size: clamp(.6rem, 2.6vw, .8rem); letter-spacing: .14em; word-spacing: .4em; }
    .duna-home__intro, .duna-home__values { margin-inline-start: 0; }
    .duna-home__intro { align-self: start; padding-top: clamp(.75rem, 4svh, 3.5rem); }
    .duna-home__title { font-size: clamp(3rem, 15.65vw, 5.7rem); line-height: .91; }
    .duna-home__description { margin-top: 1.3rem; font-size: clamp(1.06rem, 4.65vw, 1.32rem); }
    .duna-home__description::before { margin-bottom: .95rem; }
    .duna-home__actions { gap: .25rem clamp(.8rem, 4.5vw, 1.65rem); margin-top: 1.25rem; }
    .duna-home__join { min-width: min(100%, 13.65rem); gap: .85rem; padding-inline: 1rem; font-size: .94rem; }
    .duna-home__more { font-size: .9rem; }
    .duna-home__values { font-size: clamp(.6rem, 2.45vw, .75rem); letter-spacing: .115em; word-spacing: .5em; }
    .duna-home__credits { font-size: .67rem; }
}

@media (max-width: 23rem) {
    .duna-home::before {
        background-image: linear-gradient(180deg, #031925 14%, #031925ef 36%, #031925b3 62%, #03192545 80%, #02121bce 100%);
    }
    .duna-home__join { min-width: 0; gap: .4rem; padding-inline: .6rem; font-size: .875rem; }
    .duna-home__arrow { flex-basis: .8rem; }
    .duna-home__actions { column-gap: .65rem; }
    .duna-home__more { font-size: .85rem; }
    .duna-home__values { letter-spacing: .09em; word-spacing: .32em; }
}

@media (min-width: 38rem) and (max-height: 32rem) and (orientation: landscape) {
    .duna-home { row-gap: .75rem; padding-block: 1rem; }
    .duna-home__wordmark { font-size: 1.05rem; }
    .duna-home__established, .duna-home__values { font-size: .65rem; }
    .duna-home__intro { padding-top: 0; }
    .duna-home__title { font-size: clamp(2.6rem, min(6vw, 13.2svh), 4.5rem); }
    .duna-home__description { margin-top: .85rem; font-size: 1.06rem; }
    .duna-home__description::before { margin-bottom: .7rem; }
    .duna-home__actions { margin-top: .8rem; }
}

/* The desktop sky is already dark enough for the type. A second, nearly
   identical gradient here quantizes into wide coloured stripes. */
@media (width > 44rem) and (orientation: landscape), (width > 62rem) {
    .duna-home::before { display: none; }
}

/* Dither the composited poster or WebGL sky at its displayed pixel scale.
   Keep the brightest optical rim and the city-light detail clear. */
.duna-home__scene::after, .duna-home::after {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: url("/media/sky-grain.png") repeat;
    background-image: image-set(url("/media/sky-grain.png") 1x,
        url("/media/sky-grain.png") 2x, url("/media/sky-grain.png") 3x);
    background-size: var(--sky-grain-period, auto);
    mix-blend-mode: overlay;
}

.duna-home__scene::after {
    content: "";
    z-index: 3;
    mask-image: radial-gradient(ellipse 54.5625% 97% at 83.2% 128%,
        transparent 100.5%, #000 104%);
}

@media (max-width: 44rem), (max-width: 62rem) and (orientation: portrait) {
    /* The artwork occupies the bottom 72%. Keep the scrim's gradient
       positions while avoiding same-colour alpha blending above the image. */
    .duna-home::before {
        top: 28%;
        background-size: 100% calc(100% / .72);
        background-position: bottom;
    }
    .duna-home::after {
        content: "";
        z-index: -1;
        bottom: 44%;
        mask-image: linear-gradient(#000 65%, transparent);
    }
}
