:root {
    --garnet: #5A1826;
    --vellum: #D7C7A0;
    --navy: #101A2F;
    --cream: #F2E6C8;
    --copper: #B87333;
    --black: #070609;
    --patina: #2E7D6B;
    --display: "Cormorant Garamond", Cormorant, serif;
    --caption: "Barlow Condensed", Inter, sans-serif;
    --body: "Manrope", Inter, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--black);
}

body {
    margin: 0;
    color: var(--cream);
    font-family: var(--body);
    background: var(--black);
    overflow-x: hidden;
}

button, a {
    font: inherit;
}

.grain,
.lacquer-reflection {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 30;
}

.grain {
    opacity: .17;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(242, 230, 200, .18) 0 1px, transparent 1.5px),
        radial-gradient(circle at 80% 10%, rgba(184, 115, 51, .18) 0 1px, transparent 1.5px),
        linear-gradient(115deg, transparent 0 48%, rgba(215, 199, 160, .08) 49%, transparent 52%);
    background-size: 41px 41px, 53px 53px, 100% 100%;
    mix-blend-mode: screen;
}

.lacquer-reflection {
    opacity: .36;
    background: linear-gradient(108deg, transparent 0 18%, rgba(242, 230, 200, .055) 23%, transparent 31% 60%, rgba(46, 125, 107, .05) 66%, transparent 76%);
    transform: translateX(var(--glint, -8%));
    transition: transform .22s ease-out;
}

.descent {
    position: relative;
    min-height: 500vh;
    background:
        linear-gradient(180deg, #070609 0%, #101A2F 27%, #5A1826 53%, #070609 78%, #101A2F 100%);
}

.chamber {
    min-height: 100vh;
    position: relative;
    display: grid;
    align-items: center;
    padding: 8vw 10vw;
    overflow: hidden;
    isolation: isolate;
}

.chamber::before {
    content: "";
    position: absolute;
    inset: 2.1rem;
    border: 1px solid rgba(184, 115, 51, .32);
    clip-path: polygon(0 0, calc(100% - 4rem) 0, 100% 4rem, 100% 100%, 4rem 100%, 0 calc(100% - 4rem));
    z-index: -1;
}

.chamber::after {
    content: attr(data-floor);
    position: absolute;
    right: 8vw;
    top: 7vh;
    font-family: var(--caption);
    font-size: clamp(6rem, 15vw, 18rem);
    line-height: .8;
    color: rgba(215, 199, 160, .055);
    letter-spacing: -.04em;
    z-index: -1;
}

.stair-rail {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 500vh;
    z-index: 10;
    pointer-events: none;
    filter: drop-shadow(0 0 16px rgba(184, 115, 51, .45));
}

#railPath {
    fill: none;
    stroke: var(--copper);
    stroke-width: .42;
    vector-effect: non-scaling-stroke;
    stroke-linecap: square;
    stroke-linejoin: miter;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

body.is-ready #railPath {
    transition: stroke-dashoffset 1.8s cubic-bezier(.7, 0, .2, 1);
    stroke-dashoffset: var(--rail-offset, .78);
}

.elevator-panel {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    display: grid;
    gap: .6rem;
    padding: .9rem .7rem;
    border: 1px solid rgba(184, 115, 51, .45);
    background: rgba(7, 6, 9, .72);
    box-shadow: inset 0 0 28px rgba(184, 115, 51, .1), 0 20px 80px rgba(0, 0, 0, .35);
}

.panel-title,
.kicker,
.vertical-label,
.lock-plaque,
.tray-cell span,
.atelier-button {
    font-family: var(--caption);
    text-transform: uppercase;
    letter-spacing: .18em;
}

.panel-title {
    writing-mode: vertical-rl;
    color: var(--vellum);
    font-size: .78rem;
    margin: auto;
}

.floor {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid rgba(215, 199, 160, .35);
    color: var(--vellum);
    background: transparent;
    cursor: pointer;
    transition: background .3s ease, border-color .3s ease, color .3s ease;
}

.floor.is-active {
    color: var(--black);
    border-color: var(--copper);
    background: var(--copper);
}

.floor span {
    font-family: var(--caption);
    font-weight: 700;
}

.scene-copy {
    max-width: 43rem;
    position: relative;
    z-index: 2;
    transform: translateY(46px);
    opacity: .18;
    transition: transform .8s cubic-bezier(.2, .8, .2, 1), opacity .8s ease;
}

.chamber.is-visible .scene-copy {
    transform: translateY(0);
    opacity: 1;
}

.align-right {
    justify-self: end;
}

.kicker {
    color: var(--copper);
    font-size: clamp(.8rem, 1.2vw, 1rem);
    margin: 0 0 1rem;
}

h1,
h2 {
    font-family: var(--display);
    font-weight: 600;
    margin: 0;
    color: var(--cream);
    text-shadow: 0 0 32px rgba(242, 230, 200, .11);
}

h1 {
    font-size: clamp(5rem, 14vw, 17rem);
    line-height: .72;
    letter-spacing: -.055em;
}

h2 {
    font-size: clamp(3.5rem, 8vw, 9.5rem);
    line-height: .82;
    letter-spacing: -.045em;
}

p {
    font-size: clamp(1rem, 1.45vw, 1.28rem);
    line-height: 1.75;
    color: rgba(242, 230, 200, .76);
}

.ceremony {
    max-width: 36rem;
    margin-top: 2rem;
    color: var(--vellum);
}

.chamber-door {
    background:
        radial-gradient(circle at 50% 45%, rgba(90, 24, 38, .52), transparent 38%),
        linear-gradient(90deg, transparent 0 47%, rgba(184, 115, 51, .18) 48% 52%, transparent 53%),
        #070609;
}

.deco-frame {
    position: absolute;
    inset: 11vh 16vw;
    border: 2px solid rgba(184, 115, 51, .5);
    box-shadow: inset 0 0 0 1.4rem rgba(16, 26, 47, .36), inset 0 0 0 1.55rem rgba(184, 115, 51, .22);
    clip-path: polygon(8% 0, 92% 0, 100% 10%, 100% 90%, 92% 100%, 8% 100%, 0 90%, 0 10%);
}

.fanlight {
    position: absolute;
    left: 50%;
    top: 8vh;
    width: 38vw;
    height: 19vw;
    transform: translateX(-50%);
    border: 1px solid rgba(215, 199, 160, .38);
    border-bottom: 0;
    border-radius: 38vw 38vw 0 0;
    background: repeating-conic-gradient(from 180deg at 50% 100%, transparent 0 10deg, rgba(184, 115, 51, .2) 10deg 11deg);
}

.door-slit {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--copper), var(--cream), var(--copper), transparent);
    box-shadow: 0 0 42px rgba(184, 115, 51, .8);
    animation: doorOpen 3.8s ease-in-out infinite alternate;
}

.lock-plaque {
    position: absolute;
    right: 12vw;
    bottom: 16vh;
    padding: .7rem 1rem;
    border: 1px solid var(--copper);
    color: var(--vellum);
    background: rgba(7, 6, 9, .76);
}

.chamber-vellum {
    background: linear-gradient(145deg, rgba(215, 199, 160, .13), transparent 45%), #101A2F;
}

.drafting-sheet {
    position: absolute;
    left: 7vw;
    top: 15vh;
    width: 48vw;
    height: 62vh;
    background: linear-gradient(135deg, rgba(242, 230, 200, .92), rgba(215, 199, 160, .72));
    color: var(--navy);
    transform: rotate(-4deg);
    box-shadow: 0 40px 90px rgba(0, 0, 0, .42);
    opacity: .82;
}

.blueprint-lines {
    position: absolute;
    inset: 1.3rem;
    background:
        linear-gradient(90deg, rgba(16, 26, 47, .18) 1px, transparent 1px),
        linear-gradient(rgba(16, 26, 47, .18) 1px, transparent 1px),
        linear-gradient(135deg, transparent 0 48%, rgba(46, 125, 107, .5) 49%, transparent 51%);
    background-size: 42px 42px, 42px 42px, 100% 100%;
}

.compass-arc {
    position: absolute;
    border: 1px solid rgba(16, 26, 47, .48);
    border-radius: 50%;
}

.arc-one {
    width: 28vw;
    height: 28vw;
    left: 20%;
    top: 12%;
}

.arc-two {
    width: 18vw;
    height: 18vw;
    right: 9%;
    bottom: 10%;
    border-color: rgba(184, 115, 51, .55);
}

.vertical-label {
    position: absolute;
    left: 9vw;
    bottom: 8vh;
    writing-mode: vertical-rl;
    color: var(--patina);
}

.chamber-tray {
    background: radial-gradient(circle at 25% 20%, rgba(184, 115, 51, .2), transparent 35%), #5A1826;
}

.parts-tray {
    position: absolute;
    right: 7vw;
    top: 16vh;
    width: min(48rem, 48vw);
    height: 68vh;
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    grid-auto-rows: 1fr;
    gap: .75rem;
    padding: .75rem;
    border: 1px solid rgba(184, 115, 51, .55);
    background: rgba(7, 6, 9, .34);
    transform: perspective(900px) rotateY(-10deg) rotateX(4deg);
}

.tray-cell {
    position: relative;
    border: 1px solid rgba(215, 199, 160, .28);
    background: linear-gradient(145deg, rgba(16, 26, 47, .55), rgba(7, 6, 9, .5));
    box-shadow: inset 0 0 28px rgba(184, 115, 51, .08);
}

.tray-cell::after {
    content: "";
    position: absolute;
    width: .42rem;
    height: .42rem;
    right: 1rem;
    top: 1rem;
    border-radius: 50%;
    background: var(--copper);
    box-shadow: 0 0 0 .22rem rgba(184, 115, 51, .16);
}

.tray-cell span {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    color: var(--vellum);
    font-size: .88rem;
}

.tray-cell.tall {
    grid-row: span 2;
}

.tray-cell.wide {
    grid-column: span 2;
}

.chamber-mirror {
    background: radial-gradient(circle at 62% 45%, rgba(46, 125, 107, .28), transparent 34%), #070609;
}

.calibration-mirror {
    position: absolute;
    left: 8vw;
    top: 10vh;
    width: min(45rem, 48vw);
    height: 78vh;
    border: 1px solid rgba(215, 199, 160, .36);
    border-radius: 50% 50% 2rem 2rem;
    background: linear-gradient(122deg, rgba(242, 230, 200, .12), rgba(46, 125, 107, .14) 42%, rgba(90, 24, 38, .24));
    box-shadow: inset 0 0 80px rgba(242, 230, 200, .08), 0 40px 100px rgba(0, 0, 0, .5);
}

.mirror-seam {
    position: absolute;
    inset: 0 50% 0 auto;
    width: 1px;
    background: var(--copper);
    box-shadow: 0 0 28px var(--copper);
}

.mirror-orbit {
    position: absolute;
    border: 1px solid rgba(184, 115, 51, .4);
    border-radius: 50%;
    animation: orbit 14s linear infinite;
}

.orbit-a {
    width: 64%;
    height: 42%;
    left: 18%;
    top: 25%;
}

.orbit-b {
    width: 42%;
    height: 64%;
    left: 29%;
    top: 14%;
    animation-direction: reverse;
}

.indicator-stack {
    position: absolute;
    right: 14vw;
    bottom: 13vh;
    display: flex;
    gap: .65rem;
}

.indicator-stack span {
    width: .75rem;
    height: 3.4rem;
    background: linear-gradient(var(--copper), var(--patina));
    transform: skewX(-18deg);
}

.chamber-nocturne {
    background: linear-gradient(180deg, #101A2F 0%, #070609 58%, #070609 100%);
    justify-items: center;
    text-align: center;
}

.workfloor-horizon {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 24vh;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--copper), var(--cream), var(--copper), transparent);
    box-shadow: 0 0 60px rgba(184, 115, 51, .65);
}

.finished-mark {
    position: absolute;
    top: 16vh;
    width: 12rem;
    height: 12rem;
    display: grid;
    place-items: center;
    border: 1px solid rgba(184, 115, 51, .5);
    border-radius: 50%;
    color: rgba(242, 230, 200, .08);
    font-family: var(--display);
    font-size: 10rem;
}

.final-copy {
    margin-top: 14vh;
}

.atelier-button {
    display: inline-block;
    margin-top: 1.4rem;
    padding: 1rem 1.3rem;
    color: var(--black);
    text-decoration: none;
    background: var(--copper);
    border: 1px solid var(--cream);
    box-shadow: 0 18px 50px rgba(184, 115, 51, .24);
    transition: transform .3s ease, background .3s ease;
}

.atelier-button:hover {
    transform: translateY(-3px);
    background: var(--cream);
}

@keyframes doorOpen {
    from { opacity: .45; transform: scaleX(1); }
    to { opacity: 1; transform: scaleX(7); }
}

@keyframes orbit {
    to { transform: rotate(360deg); }
}

@media (max-width: 820px) {
    .elevator-panel {
        left: 50%;
        top: auto;
        bottom: 1rem;
        transform: translateX(-50%);
        grid-auto-flow: column;
    }

    .panel-title {
        writing-mode: initial;
    }

    .chamber {
        padding: 7rem 2rem;
    }

    .drafting-sheet,
    .parts-tray,
    .calibration-mirror {
        position: relative;
        width: 100%;
        height: 40vh;
        left: auto;
        right: auto;
        top: auto;
        margin-bottom: 2rem;
        transform: none;
    }

    .align-right {
        justify-self: start;
    }

    h1 {
        font-size: clamp(4.8rem, 22vw, 8rem);
    }
}
