.home-page {
    background: var(--canvas-ivory);
}

.home-page .site-header {
    z-index: 30;
}

.home-shell {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 108px);
    overflow: hidden;
    isolation: isolate;
}

.analogue-field {
    position: fixed;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    opacity: 1;
    background: url("../assets/scene/home-atmosphere-v1.0.webp") center top / 100% 100% no-repeat;
}

.home-identity {
    position: relative;
    z-index: 12;
    width: 500px;
    margin: 62px auto 0;
    text-align: center;
    transform: translateY(0) scale(1);
    transform-origin: 50% 0;
    transition: opacity 520ms ease-in-out, transform 680ms cubic-bezier(.65, 0, .25, 1);
}

.home-identity h1 {
    margin: 0;
    font: 400 78px/1 var(--serif);
    letter-spacing: .11em;
}

.identity-rule {
    display: block;
    width: 29px;
    height: 2px;
    margin: 23px auto 19px;
    background: var(--oxide-orange);
}

.home-identity p {
    margin: 0;
    font: 500 15px/1.55 var(--mono);
    letter-spacing: .18em;
    text-transform: uppercase;
}

.home-scene-plane {
    position: absolute;
    z-index: 5;
    top: 0;
    left: 50%;
    width: 1672px;
    height: 833px;
    --scene-scale: 1;
    --scene-x: 0px;
    --scene-y: 0px;
    transform: translateX(calc(-50% + var(--scene-x))) translateY(var(--scene-y)) scale(var(--scene-scale));
    transform-origin: 50% 0;
    transition: transform 680ms cubic-bezier(.65, 0, .25, 1);
    pointer-events: none;
}

.home-shell[data-scene-transitioning="true"] .home-scene-plane {
    will-change: transform;
}

.home-shell[data-scene-focus="typewriter-focus"] .home-identity {
    opacity: 0;
    transform: translateY(-42px) scale(.92);
}

.home-shell:not([data-scene-focus="overview"]) .home-identity {
    pointer-events: none;
}

.home-shell[data-scene-focus="typewriter-focus"] .home-scene-plane {
    --scene-scale: 1.82;
    --scene-y: -490px;
}

.home-shell[data-scene-focus="archive-focus"] .home-identity {
    opacity: 0;
    transform: translateY(-34px) scale(.94);
}

.home-shell[data-scene-focus="archive-focus"] .home-scene-plane {
    --scene-scale: 1.72;
    --scene-x: 666px;
    --scene-y: -450px;
}

.home-shell[data-scene-focus="mailbox-focus"] .home-identity {
    opacity: 0;
    transform: translateY(-34px) scale(.94);
}

.home-shell[data-scene-focus="mailbox-focus"] .home-scene-plane {
    --scene-scale: 1.55;
    --scene-x: -500px;
    --scene-y: -255px;
}

.archive-stage,
.mailbox-stage {
    transition: opacity 460ms ease-in-out;
}

.home-shell[data-scene-focus="typewriter-focus"] .archive-stage,
.home-shell[data-scene-focus="typewriter-focus"] .mailbox-stage {
    opacity: .24;
}

.home-shell[data-scene-focus="archive-focus"] .typewriter-stage {
    opacity: .34;
}

.home-shell[data-scene-focus="archive-focus"] .mailbox-stage {
    opacity: .08;
}

.home-shell[data-scene-focus="mailbox-focus"] .archive-stage {
    opacity: .08;
}

.home-shell[data-scene-focus="mailbox-focus"] .typewriter-stage {
    opacity: .42;
}

.home-page[data-scene-focus="typewriter-focus"] .primary-nav [data-typewriter-search-trigger] {
    color: var(--oxide-orange);
}

.home-page[data-scene-focus="typewriter-focus"] .primary-nav [data-typewriter-search-trigger]::after {
    transform: scaleX(1);
}

.home-page[data-scene-focus="archive-focus"] .primary-nav [data-archive-route-trigger] {
    color: var(--oxide-orange);
}

.home-page[data-scene-focus="archive-focus"] .primary-nav [data-archive-route-trigger]::after {
    transform: scaleX(1);
}

.home-page[data-scene-focus="mailbox-focus"] .primary-nav [data-contact-route-trigger] {
    color: var(--oxide-orange);
}

.home-page[data-scene-focus="mailbox-focus"] .primary-nav [data-contact-route-trigger]::after {
    transform: scaleX(1);
}

.machine-stage {
    position: absolute;
    overflow: visible;
}

.registered-master {
    position: absolute;
    transform-origin: 0 0;
    filter: drop-shadow(1px 2px 1.5px rgb(41 43 43 / 10%));
}

.runtime-layer {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    pointer-events: none;
    user-select: none;
}

.ground-shadow {
    position: absolute;
    z-index: 0;
    border-radius: 0;
    opacity: .82;
    background: linear-gradient(90deg, transparent 0%, rgb(41 43 43 / 13%) 17%, rgb(41 43 43 / 19%) 50%, rgb(41 43 43 / 13%) 83%, transparent 100%);
    filter: blur(5px);
}

.archive-stage {
    top: 278px;
    left: 148px;
    width: 374.625px;
    height: 469.8px;
    pointer-events: auto;
}

.archive-home-entry {
    position: absolute;
    z-index: 8;
    inset: 0;
    border-radius: 4px;
}

.archive-home-entry:focus-visible {
    outline: 2px solid var(--oxide-orange);
    outline-offset: 7px;
}

.archive-ground {
    bottom: -6px;
    left: 24px;
    width: 326px;
    height: 17px;
}

.archive-master {
    width: 1122px;
    height: 1402px;
    transform: translate(-48.6px, -54.675px) scale(.405);
}

.archive-back {
    z-index: 1;
}

.archive-paper {
    position: absolute;
    z-index: 2;
    top: 321px;
    left: 350px;
    width: 517px;
    height: 680px;
    padding: 58px 48px 45px 45px;
    clip-path: polygon(0 0, 483px 1px, 517px 633px, 34px 680px);
    background: var(--paper-ivory);
    color: var(--soft-graphite);
    font-family: var(--mono);
}

.archive-meta {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 500;
    text-transform: uppercase;
}

.archive-paper h2 {
    margin: 52px 0 26px;
    font: 400 40px/1.12 var(--serif);
}

.archive-paper time {
    font: 500 18px/1 var(--mono);
    text-transform: uppercase;
}

.archive-paper i {
    display: block;
    width: 18px;
    height: 4px;
    margin: 18px 0 34px;
    background: var(--oxide-orange);
}

.archive-paper p {
    margin: 0;
    font: 400 15px/1.5 var(--mono);
}

.archive-open {
    position: absolute;
    right: 43px;
    bottom: 35px;
    font: 500 15px/1 var(--mono);
    text-transform: uppercase;
}

.archive-front {
    z-index: 3;
}

.archive-wheel,
.archive-slider {
    z-index: 4;
}

.typewriter-stage {
    top: 293px;
    left: 555px;
    width: 563.934px;
    height: 456.055px;
    pointer-events: auto;
}

.typewriter-ground {
    bottom: -7px;
    left: 19px;
    width: 526px;
    height: 18px;
}

.typewriter-master {
    width: 1448px;
    height: 1086px;
    transform: translate(-60.19px, -30.095px) scale(.463);
}

.typewriter-body {
    z-index: 1;
}

.typewriter-paper {
    position: absolute;
    z-index: 2;
    top: 54px;
    left: 423px;
    width: 646px;
    height: 288px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgb(80 83 82 / 8%);
}

.typewriter-sheet {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 67px 58px 38px;
    background: var(--paper-ivory);
    color: var(--charcoal);
    font-family: var(--mono);
    transition: transform 285ms cubic-bezier(.55, 0, .3, 1);
}

.typewriter-neutral {
    transition: opacity 120ms ease-out;
}

.typewriter-home-paper h2 {
    margin: 0 0 24px;
    font: 500 43px/1.05 var(--mono);
    letter-spacing: -.015em;
    white-space: nowrap;
}

.typewriter-home-paper h2 em {
    color: var(--oxide-orange);
    font-style: normal;
}

.typewriter-identity-visible {
    display: inline-flex;
    align-items: baseline;
}

.typewriter-identity-rewrite {
    display: inline-flex;
    transform: scaleX(1);
    transform-origin: 0 50%;
}

.typewriter-neutral[data-identity-fit="compact"] .typewriter-identity-rewrite {
    transform: scaleX(.78);
}

.typewriter-identity-caret {
    display: inline-block;
    color: var(--charcoal);
    opacity: 1;
}

.typewriter-neutral[data-identity-state="identity-idle"] .typewriter-identity-caret,
.typewriter-neutral[data-identity-state="identity-hold"] .typewriter-identity-caret {
    animation: typewriter-identity-caret 1.4s steps(1, end) infinite;
}

@keyframes typewriter-identity-caret {
    0%,
    49% {
        opacity: 1;
    }

    50%,
    99% {
        opacity: .28;
    }
}

.typewriter-home-paper p {
    margin: 0;
    font: 400 27px/1.45 var(--mono);
}

.typewriter-home-paper {
    transform: translateY(0);
}

.typewriter-search-paper {
    transform: translateY(106%);
}

.typewriter-paper[data-paper-state="search-feed-out"] .typewriter-home-paper,
.typewriter-paper[data-paper-state="search-feed-in"] .typewriter-home-paper,
.typewriter-paper[data-paper-state="search-input"] .typewriter-home-paper,
.typewriter-paper[data-paper-state="search-submitting"] .typewriter-home-paper,
.typewriter-paper[data-paper-state="search-results"] .typewriter-home-paper,
.typewriter-paper[data-paper-state="search-empty"] .typewriter-home-paper,
.typewriter-paper[data-paper-state="search-error"] .typewriter-home-paper,
.typewriter-paper[data-paper-state="record-selected"] .typewriter-home-paper,
.typewriter-paper[data-paper-state="article-transition"] .typewriter-home-paper {
    transform: translateY(-106%);
}

.typewriter-paper[data-paper-state="search-feed-in"] .typewriter-search-paper,
.typewriter-paper[data-paper-state="search-input"] .typewriter-search-paper,
.typewriter-paper[data-paper-state="search-submitting"] .typewriter-search-paper,
.typewriter-paper[data-paper-state="search-results"] .typewriter-search-paper,
.typewriter-paper[data-paper-state="search-empty"] .typewriter-search-paper,
.typewriter-paper[data-paper-state="search-error"] .typewriter-search-paper,
.typewriter-paper[data-paper-state="record-selected"] .typewriter-search-paper,
.typewriter-paper[data-paper-state="article-transition"] .typewriter-search-paper {
    transform: translateY(0);
}

.typewriter-paper[data-paper-state="home-feed-in"] .typewriter-home-paper {
    transform: translateY(0);
}

.typewriter-paper[data-paper-state="home-feed-in"] .typewriter-search-paper {
    transform: translateY(-106%);
}

.typewriter-paper .typewriter-search-paper.is-advancing {
    transform: translateY(-7px);
}

.typewriter-search-interface {
    position: absolute;
    inset: 0;
    padding: 27px 34px 24px;
    overflow: hidden;
    color: var(--charcoal);
    opacity: 0;
    pointer-events: none;
    transition: opacity 110ms ease-out;
}

.typewriter-paper[data-paper-state="search-input"] .typewriter-search-interface,
.typewriter-paper[data-paper-state="search-submitting"] .typewriter-search-interface,
.typewriter-paper[data-paper-state="search-results"] .typewriter-search-interface,
.typewriter-paper[data-paper-state="search-empty"] .typewriter-search-interface,
.typewriter-paper[data-paper-state="search-error"] .typewriter-search-interface,
.typewriter-paper[data-paper-state="record-selected"] .typewriter-search-interface,
.typewriter-paper[data-paper-state="article-transition"] .typewriter-search-interface {
    opacity: 1;
    pointer-events: auto;
}

.typewriter-search-form {
    margin: 0;
}

.typewriter-search-form > label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.typewriter-query-line {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border-bottom: 2px solid rgb(199 104 50 / 72%);
    padding-bottom: 9px;
}

.typewriter-query-line > span,
.typewriter-query-line button {
    font: 500 14px/1 var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.typewriter-query-line input {
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0;
    background: transparent;
    color: var(--charcoal);
    font: 500 25px/1.15 var(--mono);
    caret-color: var(--oxide-orange);
}

.typewriter-query-line input::-webkit-search-cancel-button {
    display: none;
}

.typewriter-query-line input:focus-visible {
    border-radius: 2px;
    box-shadow: 0 0 0 3px rgb(199 104 50 / 32%);
}

.typewriter-query-line button {
    border: 0;
    border-bottom: 1px solid rgb(80 83 82 / 38%);
    padding: 4px 0 3px;
    background: transparent;
    color: var(--soft-graphite);
    cursor: pointer;
}

.typewriter-query-line button:hover,
.typewriter-query-line button:focus-visible {
    color: var(--oxide-orange);
}

.typewriter-search-status {
    min-height: 18px;
    margin: 12px 0 8px;
    color: var(--soft-graphite);
    font: 400 14px/1.25 var(--mono);
}

.typewriter-search-results {
    min-height: 136px;
}

.typewriter-search-results ol {
    display: grid;
    gap: 3px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.typewriter-search-results li {
    min-width: 0;
}

.typewriter-search-results a {
    display: grid;
    min-width: 0;
    grid-template-columns: 17px 32px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 7px;
    padding: 5px 3px;
    color: var(--charcoal);
    font: 400 16px/1.15 var(--mono);
    text-decoration: none;
}

.typewriter-search-results a:focus-visible {
    outline: 2px solid var(--oxide-orange);
    outline-offset: 1px;
}

.typewriter-index-pointer {
    width: 8px;
    height: 8px;
    transform: rotate(45deg) scale(.6);
    background: transparent;
    transition: transform 100ms ease-out, background-color 100ms ease-out;
}

.typewriter-result-number,
.typewriter-result-date {
    color: var(--soft-graphite);
    font-size: 13px;
}

.typewriter-result-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.typewriter-search-results a[data-selected="true"] .typewriter-index-pointer,
.typewriter-search-results a:hover .typewriter-index-pointer,
.typewriter-search-results a:focus-visible .typewriter-index-pointer {
    transform: rotate(45deg) scale(1);
    background: var(--oxide-orange);
}

.typewriter-search-results a[data-selected="true"] .typewriter-result-title {
    color: #a9471b;
}

.typewriter-search-more {
    position: absolute;
    right: 35px;
    bottom: 18px;
    color: var(--soft-graphite);
    font: 500 13px/1 var(--mono);
    text-decoration: none;
    text-transform: uppercase;
}

.typewriter-search-more:hover,
.typewriter-search-more:focus-visible {
    color: var(--oxide-orange);
}

.typewriter-search-interface[data-paper-state="loading"] .typewriter-search-status::after {
    display: inline-block;
    width: 1.5em;
    content: "...";
    overflow: hidden;
    vertical-align: bottom;
}

.typewriter-paper[data-search-state="empty"] .typewriter-search-results,
.typewriter-paper[data-search-state="error"] .typewriter-search-results {
    display: flex;
    align-items: center;
    color: var(--soft-graphite);
    font: 400 16px/1.35 var(--mono);
}

.typewriter-carriage {
    z-index: 3;
    transform: translateX(var(--typewriter-carriage-x, 0));
    transition: transform 90ms cubic-bezier(.2, .7, .2, 1);
}

.typewriter-keyboard {
    z-index: 4;
    transform: none;
    transition: none;
}

.typewriter-key-feedback {
    position: absolute;
    z-index: 5;
    inset: 0;
    pointer-events: none;
}

.typewriter-key-feedback span {
    position: absolute;
    border: 0;
    border-radius: 6px 6px 5px 5px;
    opacity: 0;
    background: transparent;
    box-shadow: none;
    filter: brightness(1);
    transform: translateY(0);
    transform-origin: 50% 70%;
    transition: opacity 12ms linear, transform 28ms cubic-bezier(.23, 1, .32, 1), filter 20ms linear, box-shadow 20ms linear;
}

.typewriter-key-feedback span::before,
.typewriter-key-feedback span::after {
    position: absolute;
    inset: 0;
    clip-path: polygon(5% 2%, 95% 2%, 100% 88%, 94% 100%, 6% 100%, 0 88%);
    content: "";
}

.typewriter-key-feedback span::before {
    background: url("../assets/machines/typewriter/typewriter-keyboard.webp") var(--key-background-position) / 1448px 1086px no-repeat;
}

.typewriter-key-feedback span::after {
    background: linear-gradient(
        180deg,
        rgb(5 7 7 / 7%) 0,
        rgb(12 14 14 / 4%) 46%,
        rgb(4 6 6 / 9%) 100%
    );
    box-shadow:
        inset 0 2px 2px rgb(0 0 0 / 11%),
        inset 0 -2px 1px rgb(0 0 0 / 18%);
}

.typewriter-key-feedback span.is-pressed {
    opacity: 1;
    filter: brightness(.93);
    box-shadow: 0 1px 1px rgb(0 0 0 / 25%);
    transform: translateY(3px);
}

.typewriter-lever {
    z-index: 6;
    transform-origin: 302px 105px;
    transition: transform 130ms cubic-bezier(.2, .7, .2, 1);
}

.typewriter-lever.is-returning {
    transform: rotate(-5deg);
}

.mailbox-stage {
    top: 263px;
    left: 1150px;
    width: 287.028px;
    height: 486.42px;
    pointer-events: auto;
}

.mailbox-route-entry {
    position: absolute;
    z-index: 8;
    inset: 0;
    border-radius: 4px;
}

.mailbox-route-entry:focus-visible {
    outline: 2px solid var(--oxide-orange);
    outline-offset: 7px;
}

.mailbox-ground {
    bottom: -6px;
    left: 26px;
    width: 235px;
    height: 17px;
}

.mailbox-master {
    width: 1122px;
    height: 1402px;
    transform: translate(-84.42px, -35.376px) scale(.402);
}

.mailbox-body {
    z-index: 1;
}

.mailbox-door {
    z-index: 2;
}

.mailbox-lever {
    z-index: 3;
}

@media (min-width: 1800px) and (min-height: 980px) {
    .home-scene-plane {
        --scene-scale: 1.1477;
    }

    .home-shell[data-scene-focus="typewriter-focus"] .home-scene-plane {
        --scene-scale: 2.05;
        --scene-y: -550px;
    }

    .home-shell[data-scene-focus="archive-focus"] .home-scene-plane {
        --scene-scale: 1.9;
        --scene-x: 740px;
        --scene-y: -500px;
    }

    .home-shell[data-scene-focus="mailbox-focus"] .home-scene-plane {
        --scene-scale: 1.72;
        --scene-x: -570px;
        --scene-y: -290px;
    }

    .home-identity h1 {
        font-size: 84px;
    }
}

@media (max-width: 1500px) and (min-width: 768px) {
    .home-scene-plane {
        --scene-scale: .8612;
    }

    .home-shell[data-scene-focus="typewriter-focus"] .home-scene-plane {
        --scene-scale: 1.58;
        --scene-y: -420px;
    }

    .home-shell[data-scene-focus="archive-focus"] .home-scene-plane {
        --scene-scale: 1.5;
        --scene-x: 570px;
        --scene-y: -390px;
    }

    .home-shell[data-scene-focus="mailbox-focus"] .home-scene-plane {
        --scene-scale: 1.4;
        --scene-x: -425px;
        --scene-y: -225px;
    }

    .home-shell {
        min-height: 792px;
    }
}

@media (max-width: 1340px) and (min-width: 768px) {
    .home-scene-plane {
        --scene-scale: .766;
    }

    .home-shell[data-scene-focus="typewriter-focus"] .home-scene-plane {
        --scene-scale: 1.42;
        --scene-y: -370px;
    }

    .home-shell[data-scene-focus="archive-focus"] .home-scene-plane {
        --scene-scale: 1.38;
        --scene-x: 510px;
        --scene-y: -355px;
    }

    .home-shell[data-scene-focus="mailbox-focus"] .home-scene-plane {
        --scene-scale: 1.28;
        --scene-x: -375px;
        --scene-y: -200px;
    }
}

@media (max-width: 767px) {
    .home-shell {
        min-height: 0;
        padding: 40px 20px 64px;
        overflow: hidden visible;
    }

    .analogue-field {
        opacity: .52;
        background-size: auto 100%;
    }

    .home-identity {
        width: 100%;
        margin: 0 auto 46px;
    }

    .home-identity h1 {
        font-size: clamp(52px, 16vw, 68px);
    }

    .home-identity p {
        font-size: 11px;
        letter-spacing: .12em;
    }

    .home-scene-plane {
        position: relative;
        top: auto;
        left: auto;
        display: flex;
        width: 100%;
        height: auto;
        flex-direction: column;
        align-items: center;
        gap: 32px;
        transform: none;
        transition-duration: 220ms;
    }

    .home-shell[data-scene-focus="typewriter-focus"] .home-scene-plane {
        transform: none;
    }

    .home-shell[data-scene-focus="archive-focus"] .home-scene-plane {
        transform: none;
    }

    .home-shell[data-scene-focus="mailbox-focus"] .home-scene-plane {
        transform: none;
    }

    .home-shell[data-scene-focus="typewriter-focus"] .home-identity {
        opacity: .12;
        transform: translateY(-12px) scale(.96);
    }

    .home-shell[data-scene-focus="typewriter-focus"] .archive-stage,
    .home-shell[data-scene-focus="typewriter-focus"] .mailbox-stage {
        opacity: .12;
    }

    .home-shell[data-scene-focus="archive-focus"] .typewriter-stage,
    .home-shell[data-scene-focus="archive-focus"] .mailbox-stage {
        opacity: .12;
    }

    .home-shell[data-scene-focus="mailbox-focus"] .archive-stage,
    .home-shell[data-scene-focus="mailbox-focus"] .typewriter-stage {
        opacity: .12;
    }

    .machine-stage {
        position: relative;
        top: auto;
        left: auto;
        flex: none;
        transform-origin: top center;
        zoom: .58;
    }

    .typewriter-stage {
        order: 1;
    }

    .archive-stage {
        order: 2;
    }

    .mailbox-stage {
        order: 3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-identity,
    .home-scene-plane,
    .archive-stage,
    .mailbox-stage,
    .typewriter-sheet,
    .typewriter-search-interface,
    .typewriter-neutral,
    .typewriter-carriage,
    .typewriter-lever,
    .typewriter-key-feedback span,
    .typewriter-index-pointer {
        transition: none !important;
    }

    .typewriter-identity-caret {
        animation: none !important;
    }

    .typewriter-key-feedback span.is-pressed {
        transform: translateY(3px);
    }

    .typewriter-lever.is-returning {
        transform: none;
    }
}
