:root {
    color-scheme: light;
    --paper: #efe5dc;
    --ink: #24201c;
    --olive: #5f5b46;
    --gold: #a77f46;
    --gold-line: rgb(167 127 70 / 0.46);
    --gold-soft: rgb(167 127 70 / 0.18);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--paper);
}

body {
    min-width: 320px;
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Manrope", sans-serif;
}

.gate {
    position: fixed;
    z-index: 30;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--paper);
}

.gate-form {
    display: grid;
    justify-items: center;
    gap: 4px;
    text-align: center;
}

.gate-label {
    margin: 0;
    color: var(--olive);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    line-height: 1.5;
    text-transform: uppercase;
}

.gate-title {
    margin: 6px 0 0;
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(2.3rem, 5vw, 3.2rem);
    font-weight: 400;
    line-height: 1.1;
}

.gate-title em {
    color: var(--gold);
    font-style: italic;
}

.gate-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--gold-line);
}

.gate-field input {
    width: 12ch;
    border: 0;
    background: none;
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-align: center;
}

.gate-field input:focus {
    outline: none;
}

.gate-field button {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid var(--gold);
    border-radius: 50%;
    background: none;
    color: var(--gold);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease;
}

.gate-field button:hover {
    background: var(--gold);
    color: var(--paper);
}

.gate-error {
    min-height: 1.2em;
    margin: 10px 0 0;
    color: #a4483f;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.page-intro {
    position: fixed;
    z-index: 10;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    overflow: hidden;
    background: var(--paper);
    will-change: transform;
    animation: intro-curtain 3.8s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

.collision-field {
    position: relative;
    width: 100vw;
    height: 100svh;
    overflow: hidden;
    --collision-offset: min(46vw, 700px);
}

.collision-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: clamp(78px, 9vw, 132px);
    aspect-ratio: 1;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: rgb(247 242 233 / 0.88);
    box-shadow: inset 0 0 18px rgb(0 0 0 / 0.1), 0 0 20px rgb(167 127 70 / 0.22);
    color: var(--ink);
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(3.4rem, 5.4vw, 5.7rem);
    line-height: 1;
    opacity: 0;
    will-change: transform, opacity;
}

.collision-particle--p {
    color: var(--olive);
    animation: particle-p 2.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.collision-particle--e {
    color: #8a6435;
    animation: particle-e 2.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.collision-result {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    display: flex;
    width: clamp(165px, 20vw, 235px);
    aspect-ratio: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 1.5px solid var(--gold);
    border-radius: 50%;
    background: rgb(36 32 28 / 0.94);
    box-shadow: inset 0 0 22px rgb(167 127 70 / 0.35), 0 0 26px rgb(167 127 70 / 0.25);
    opacity: 0;
    text-align: center;
    transform: translate(-50%, -50%) scale(0);
    animation: result-bloom 2.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.collision-result-script {
    color: var(--paper);

    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(1.1rem, 2.1vw, 1.5rem);
    line-height: 1;
}

.collision-result-caps {
    color: #e3c27f;
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(2.8rem, 2.1vw, 1.9rem);
    font-weight: 800;
    letter-spacing: 0.15em;
    white-space: nowrap;
}

.collision-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.collision-track-path {
    fill: none;
    stroke-linecap: round;
    opacity: 0;
}

.collision-track-dot {
    opacity: 0;
}

.landing {
    position: relative;
    display: grid;
    min-height: 100svh;
    place-items: center;
    padding: 54px;
    background: var(--paper);
}

.landing-content {
    display: grid;
    width: min(100%, 1040px);
    grid-template-columns: minmax(300px, 0.92fr) minmax(360px, 1.08fr);
    align-items: center;
    gap: clamp(42px, 7vw, 112px);
}

.brand-stage {
    display: grid;
    width: min(100%, 430px);
    justify-self: center;
    aspect-ratio: 1;
    place-items: center;
    opacity: 0;
    animation: content-arrival 750ms 520ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.brand-stage picture {
    display: contents;
}

.brand-logo {
    display: block;
    width: 90%;
    height: auto;
    animation: logo-float 7s 1.2s ease-in-out infinite;
}

.message-stage {
    min-width: 0;
}

.status {
    position: relative;
    padding-left: 32px;
    opacity: 0;
    animation: content-arrival 700ms 760ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.status::before {
    position: absolute;
    top: 0.55em;
    left: 0;
    width: 20px;
    border-top: 1px solid var(--gold);
    content: "";
}

.status-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-label,
.countdown-label,
.countdown-item dt {
    margin: 0;
    color: var(--olive);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    line-height: 1.5;
    text-transform: uppercase;
}

.loading-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 12px;
}

.loading-indicator span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold);
    animation: loading-pulse 1.25s ease-in-out infinite;
}

.loading-indicator span:nth-child(2) {
    animation-delay: 150ms;
}

.loading-indicator span:nth-child(3) {
    animation-delay: 300ms;
}

h1 {
    max-width: 8ch;
    margin: 8px 0 0;
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(4.1rem, 6.5vw, 6.4rem);
    font-weight: 400;
    line-height: 0.89;
}

h1 em {
    display: block;
    color: var(--gold);
    font-style: italic;
}

.countdown-section {
    width: 100%;
    margin-top: clamp(38px, 5vw, 66px);
    opacity: 0;
    animation: content-arrival 700ms 940ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.countdown-label {
    color: var(--gold);
}

.countdown {
    display: block;
    width: 100%;
    margin: 14px 0 0;
    border-top: 1px solid var(--gold-line);
    border-bottom: 1px solid var(--gold-line);
}

.countdown-item {
    display: flex;
    min-height: 146px;
    align-items: baseline;
    gap: 18px;
    padding: 23px 0 18px;
}

.countdown-item dd,
.countdown-item dt {
    margin: 0;
}

.countdown-item dd {
    color: var(--ink);
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(5.5rem, 10vw, 9rem);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    line-height: 0.77;
}

.countdown-item dt {
    max-width: 6ch;
    color: var(--gold);
    line-height: 1.35;
}

.last-updated {
    position: fixed;
    right: 18px;
    bottom: 14px;
    z-index: 2;
    margin: 0;
    color: var(--olive);
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    opacity: 0.7;
}

@keyframes intro-curtain {

    0%,
    80% {
        transform: translateY(0);
    }

    100% {
        visibility: hidden;
        transform: translateY(-100%);
    }
}

@keyframes particle-p {
    0% {
        opacity: 0;
        transform: translate(calc(-50% + var(--collision-offset)), -50%) scale(0.78);
    }

    12% {
        opacity: 1;
    }

    48% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.94);
    }

    57%,
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.45);
    }
}

@keyframes particle-e {
    0% {
        opacity: 0;
        transform: translate(calc(-50% - var(--collision-offset)), -50%) scale(0.78);
    }

    12% {
        opacity: 1;
    }

    48% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.94);
    }

    57%,
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.45);
    }
}

@keyframes result-bloom {

    0%,
    47% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }

    60% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.08);
    }

    72% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.96);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes content-arrival {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logo-float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(0.5deg);
    }
}

@keyframes loading-pulse {

    0%,
    100% {
        opacity: 0.28;
        transform: translateY(0) scale(0.8);
    }

    50% {
        opacity: 1;
        transform: translateY(-3px) scale(1);
    }
}

@media (max-width: 760px) {
    .landing {
        padding: 44px 30px;
    }

    .landing-content {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .brand-stage {
        width: min(100%, 310px);
    }

    .message-stage {
        width: min(100%, 470px);
        justify-self: center;
        text-align: center;
    }

    .status {
        padding-left: 0;
    }

    .status::before {
        display: none;
    }

    .status-line {
        justify-content: center;
    }

    h1 {
        max-width: none;
        font-size: clamp(3.75rem, 13vw, 5.5rem);
    }

    .countdown-item {
        min-height: 116px;
        justify-content: center;
    }

    .countdown-item dd {
        font-size: clamp(5rem, 21vw, 7rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-intro {
        display: none;
    }

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