:root {
    --night-ink: #11131A;
    --vellum-cream: #F3E6C8;
    --oxide-brass: #B8893B;
    --wet-blue-black: #172A45;
    --sealing-wax: #8F1D2C;
    --lamp-green: #2F5D50;
    --blotter-lavender-gray: #A8A0B7;
    --fraunces: "Fraunces", serif;
    --cormorant: "Cormorant Garamond", serif;
    --newsreader: "Newsreader", serif;
    --mono: "IBM Plex Mono", monospace;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    color: var(--vellum-cream);
    background: var(--night-ink);
    font-family: var(--newsreader);
    overflow-x: hidden;
}

button {
    font: inherit;
}

.closing-desk {
    position: relative;
    min-height: 500vh;
    isolation: isolate;
    background:
        radial-gradient(circle at 18% 12%, rgba(47, 93, 80, 0.52), transparent 24rem),
        radial-gradient(circle at 82% 72%, rgba(143, 29, 44, 0.20), transparent 22rem),
        linear-gradient(126deg, #11131A 0%, #172A45 48%, #11131A 100%);
}

.desk-grain,
.lamp-halo {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.desk-grain {
    z-index: 0;
    opacity: 0.34;
    background-image:
        linear-gradient(90deg, rgba(243, 230, 200, 0.025) 1px, transparent 1px),
        linear-gradient(0deg, rgba(243, 230, 200, 0.018) 1px, transparent 1px),
        radial-gradient(circle, rgba(184, 137, 59, 0.18) 0 1px, transparent 1.5px);
    background-size: 83px 47px, 57px 91px, 19px 19px;
    mix-blend-mode: screen;
}

.lamp-halo {
    z-index: 1;
    background: radial-gradient(ellipse at 22% 0%, rgba(243, 230, 200, 0.16), rgba(47, 93, 80, 0.12) 28%, transparent 62%);
}

.cap-notch-nav {
    position: fixed;
    right: 2.2rem;
    top: 50%;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
    transform: translateY(-50%);
}

.notch {
    width: 3rem;
    height: 0.72rem;
    border: 1px solid rgba(184, 137, 59, 0.52);
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(184, 137, 59, 0.18), rgba(243, 230, 200, 0.04));
    color: var(--vellum-cream);
    cursor: pointer;
    transition: transform 280ms ease, background 280ms ease, box-shadow 280ms ease;
}

.notch span {
    position: absolute;
    right: 3.5rem;
    margin-top: -0.42rem;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    opacity: 0;
}

.notch.active,
.notch:hover {
    transform: translateX(-0.45rem) scaleX(1.28);
    background: var(--oxide-brass);
    box-shadow: 0 0 18px rgba(184, 137, 59, 0.46);
}

.notch.active span,
.notch:hover span {
    opacity: 1;
}

.diagonal-script {
    position: fixed;
    inset: 12vh 0 auto 0;
    z-index: 3;
    width: 100vw;
    height: 76vh;
    pointer-events: none;
    filter: drop-shadow(0 8px 18px rgba(23, 42, 69, 0.5));
}

.ink-path,
.ink-ghost {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ink-path {
    stroke: var(--wet-blue-black);
    stroke-width: 13;
    stroke-dasharray: 1800;
    stroke-dashoffset: 1800;
}

.ink-ghost {
    stroke: var(--blotter-lavender-gray);
    stroke-width: 4;
    opacity: 0.18;
    stroke-dasharray: 9 24;
}

.scene {
    position: sticky;
    top: 0;
    z-index: 5;
    min-height: 100vh;
    opacity: 0.24;
    transform: scale(0.985);
    transition: opacity 600ms ease, transform 700ms cubic-bezier(0.2, 0.7, 0.1, 1);
    overflow: hidden;
}

.scene.active {
    opacity: 1;
    transform: scale(1);
}

.paper-field,
.oblique-slip,
.blotter-note,
.sealed-oval {
    box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.34), inset 0 0 42px rgba(184, 137, 59, 0.08);
}

.paper-field::before,
.oblique-slip::before,
.blotter-note::before,
.sealed-oval::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.42;
    background-image:
        linear-gradient(112deg, rgba(17, 19, 26, 0.06), transparent 26%),
        repeating-linear-gradient(96deg, rgba(17, 19, 26, 0.045) 0 1px, transparent 1px 11px);
    pointer-events: none;
}

.hero-vellum {
    position: absolute;
    left: 7vw;
    top: 13vh;
    width: min(72vw, 980px);
    min-height: 45vh;
    padding: clamp(2rem, 5vw, 5rem);
    color: var(--night-ink);
    background: linear-gradient(135deg, var(--vellum-cream), #ead9ad);
    transform: rotate(-5deg);
    border: 1px solid rgba(184, 137, 59, 0.42);
}

.utility-label {
    position: relative;
    margin: 0 0 1rem;
    color: var(--oxide-brass);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1,
h2 {
    position: relative;
    margin: 0;
    font-family: var(--fraunces);
    font-variation-settings: "SOFT" 80, "WONK" 1;
    line-height: 0.86;
}

h1 {
    max-width: 7ch;
    color: var(--night-ink);
    font-size: clamp(4.3rem, 15vw, 13rem);
    letter-spacing: -0.085em;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.22), 0 -1px 0 rgba(17, 19, 26, 0.35);
}

h2 {
    color: inherit;
    font-size: clamp(3.2rem, 8vw, 8rem);
    letter-spacing: -0.055em;
}

p {
    position: relative;
    font-size: clamp(1.05rem, 1.8vw, 1.45rem);
    line-height: 1.45;
}

.subtitle,
.signature-note,
.marginalia {
    font-family: var(--cormorant);
    font-style: italic;
}

.subtitle {
    color: var(--lamp-green);
    font-size: clamp(1.6rem, 3vw, 3rem);
}

.wet-line {
    position: relative;
    width: min(52vw, 640px);
    height: 0.8rem;
    margin-top: 2rem;
    overflow: visible;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--wet-blue-black), #11131A 78%, rgba(23, 42, 69, 0.0));
    transform-origin: left center;
    animation: writeLine 2200ms cubic-bezier(0.4, 0, 0.1, 1) both 500ms;
}

.ink-bead {
    position: absolute;
    right: -0.35rem;
    top: 50%;
    width: 1.18rem;
    height: 1.18rem;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(243, 230, 200, 0.36), var(--wet-blue-black) 48%, #090b10 100%);
    transform: translateY(-50%);
    box-shadow: 0 0 20px rgba(23, 42, 69, 0.8);
}

@keyframes writeLine {
    from { transform: scaleX(0); opacity: 0.1; }
    to { transform: scaleX(1); opacity: 1; }
}

.nib-fragment {
    position: absolute;
    right: -8vw;
    top: -6vh;
    width: min(42vw, 520px);
    height: min(72vh, 700px);
    clip-path: polygon(50% 0, 94% 72%, 50% 100%, 6% 72%);
    background: linear-gradient(130deg, #6d5125, var(--oxide-brass) 38%, #f0cf83 50%, #4a3517 72%);
    transform: rotate(29deg);
    opacity: 0.92;
}

.nib-shoulder,
.nib-slit,
.breather-hole,
.brass-glint {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nib-shoulder {
    top: 28%;
    width: 54%;
    height: 36%;
    border: 2px solid rgba(17, 19, 26, 0.38);
    border-bottom: 0;
    border-radius: 50% 50% 0 0;
}

.nib-slit {
    top: 18%;
    width: 3px;
    height: 76%;
    background: rgba(17, 19, 26, 0.58);
}

.breather-hole {
    top: 48%;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    background: var(--night-ink);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
}

.brass-glint {
    top: 8%;
    width: 14%;
    height: 72%;
    background: linear-gradient(180deg, transparent, rgba(243, 230, 200, 0.72), transparent);
    filter: blur(10px);
    animation: glint 3.8s ease-in-out infinite;
}

@keyframes glint {
    0%, 100% { opacity: 0.15; transform: translateX(-180%) rotate(8deg); }
    48% { opacity: 0.9; transform: translateX(60%) rotate(8deg); }
}

.marginalia {
    position: absolute;
    z-index: 7;
    color: var(--blotter-lavender-gray);
    font-size: clamp(1.2rem, 2vw, 2rem);
    letter-spacing: 0.03em;
    writing-mode: vertical-rl;
}

.left-note { left: 2.4rem; top: 21vh; }
.right-note { right: 8rem; top: 18vh; }
.lower { top: 55vh; }

.proof-mark {
    position: absolute;
    left: 68vw;
    bottom: 13vh;
    color: var(--sealing-wax);
    font-family: var(--cormorant);
    font-size: 9rem;
    transform: rotate(-18deg);
}

.oblique-slip {
    position: absolute;
    z-index: 6;
    width: min(58vw, 720px);
    padding: clamp(2rem, 4vw, 4.5rem);
    border: 1px solid rgba(184, 137, 59, 0.46);
    transform: skew(-8deg) rotate(-4deg);
}

.oblique-slip > * {
    transform: skew(8deg);
}

.slip-dark {
    left: 12vw;
    top: 17vh;
    color: var(--vellum-cream);
    background: linear-gradient(135deg, rgba(23, 42, 69, 0.96), rgba(17, 19, 26, 0.95));
}

.slip-cream {
    right: 9vw;
    top: 16vh;
    color: var(--night-ink);
    background: linear-gradient(135deg, var(--vellum-cream), #d9c492);
}

.ink-pool {
    position: absolute;
    right: 11vw;
    bottom: 12vh;
    width: 24vw;
    min-width: 280px;
    aspect-ratio: 1.42;
    border-radius: 48% 52% 44% 56%;
    background: radial-gradient(circle at 30% 24%, rgba(243, 230, 200, 0.18), transparent 14%), radial-gradient(circle at 55% 55%, #172A45, #080a0f 72%);
    box-shadow: inset 0 0 40px rgba(168, 160, 183, 0.12), 0 24px 60px rgba(0, 0, 0, 0.44);
    transition: filter 300ms ease, transform 300ms ease;
}

.ink-pool.feathered {
    filter: blur(0.7px) contrast(1.2);
    transform: scale(1.04) rotate(-2deg);
}

.ink-pool span {
    position: absolute;
    border-radius: 50%;
    background: rgba(23, 42, 69, 0.72);
    filter: blur(8px);
}

.ink-pool span:nth-child(1) { left: -8%; top: 34%; width: 28%; height: 22%; }
.ink-pool span:nth-child(2) { right: -7%; top: 14%; width: 18%; height: 28%; }
.ink-pool span:nth-child(3) { right: 18%; bottom: -11%; width: 28%; height: 19%; }

.correction {
    position: absolute;
    color: var(--sealing-wax);
    font-family: var(--cormorant);
    font-style: italic;
    opacity: 0.82;
    transition: opacity 600ms ease, transform 600ms ease;
}

.scene.active .correction {
    opacity: 0.18;
    transform: translateY(-1rem) rotate(-7deg);
}

.correction-one { left: 62vw; top: 35vh; font-size: 3rem; }
.slash { left: 54vw; top: 46vh; width: 12rem; height: 0.32rem; background: var(--sealing-wax); transform: rotate(-12deg); }

.blotter-stack {
    position: absolute;
    inset: 0;
}

.blotter-note {
    position: absolute;
    color: var(--night-ink);
    background: linear-gradient(135deg, #A8A0B7, #F3E6C8 78%);
    border: 1px solid rgba(47, 93, 80, 0.35);
}

.note-one {
    left: 12vw;
    top: 16vh;
    width: min(62vw, 820px);
    padding: clamp(2rem, 4.5vw, 5rem);
    transform: rotate(3deg);
}

.note-two,
.note-three {
    display: grid;
    place-items: center;
    width: 15rem;
    height: 11rem;
    font-family: var(--mono);
    font-size: 0.88rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.note-two { right: 16vw; top: 20vh; transform: rotate(-11deg); }
.note-three { right: 28vw; bottom: 16vh; transform: rotate(8deg); color: var(--lamp-green); }

.paper-fibers {
    position: absolute;
    left: 8vw;
    bottom: 8vh;
    width: 54vw;
    height: 22vh;
    opacity: 0.5;
    background-image: repeating-linear-gradient(172deg, transparent 0 10px, rgba(243, 230, 200, 0.18) 11px 12px);
    transition: opacity 260ms ease, filter 260ms ease;
}

.paper-fibers.lit {
    opacity: 0.95;
    filter: drop-shadow(0 0 18px rgba(243, 230, 200, 0.18));
}

.wax-mark {
    display: grid;
    place-items: center;
    border-radius: 47% 53% 49% 51%;
    color: var(--vellum-cream);
    background: radial-gradient(circle at 35% 28%, #b33a48, var(--sealing-wax) 58%, #4f0d17 100%);
    box-shadow: inset -10px -14px 20px rgba(0, 0, 0, 0.24), 0 16px 32px rgba(0, 0, 0, 0.32);
    font-family: var(--cormorant);
    font-style: italic;
}

.small-wax {
    position: absolute;
    right: 13vw;
    bottom: 18vh;
    width: 6.5rem;
    height: 6rem;
    font-size: 4rem;
}

.cap-mouth {
    position: absolute;
    left: -10vw;
    top: 5vh;
    width: min(68vw, 800px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, #050609 0 27%, #172A45 28% 36%, #B8893B 37% 43%, #11131A 44% 62%, #2F5D50 63% 100%);
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.72), 0 30px 90px rgba(0, 0, 0, 0.52);
    transition: transform 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.thread-ring {
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    border: 1px dashed rgba(184, 137, 59, 0.72);
    animation: threadTurn 18s linear infinite;
}

.ring-two { inset: 18%; animation-duration: 12s; animation-direction: reverse; }
.ring-three { inset: 27%; animation-duration: 9s; }

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

.cap-shadow {
    position: absolute;
    inset: 33%;
    border-radius: 50%;
    background: radial-gradient(circle, #030407, #11131A);
}

.sealed-oval {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(76vw, 880px);
    min-height: 58vh;
    padding: clamp(2.5rem, 6vw, 6rem);
    color: var(--night-ink);
    text-align: center;
    border-radius: 50% / 38%;
    background: linear-gradient(145deg, var(--vellum-cream), #dbc28d);
    transform: translate(-50%, -50%) scale(0.92);
    transition: transform 500ms ease;
}

.scene-final-click.active .sealed-oval {
    transform: translate(-50%, -50%) scale(1);
}

.envelope-flap {
    position: absolute;
    inset: 0;
    clip-path: polygon(0 0, 50% 44%, 100% 0, 100% 21%, 50% 61%, 0 21%);
    background: rgba(184, 137, 59, 0.12);
    border-radius: inherit;
}

.final-wax {
    position: relative;
    z-index: 2;
    width: 8.5rem;
    height: 7.8rem;
    margin: 0 auto 1.8rem;
    font-size: 3.8rem;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.final-wax.impressed {
    transform: scale(0.92);
    box-shadow: inset 0 10px 22px rgba(0, 0, 0, 0.46), 0 8px 16px rgba(0, 0, 0, 0.24);
}

.click-ritual {
    position: relative;
    z-index: 3;
    margin-top: 0.7rem;
    padding: 0.8rem 1.1rem;
    border: 1px solid var(--sealing-wax);
    border-radius: 999px;
    color: var(--sealing-wax);
    background: transparent;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
}

.signature-note {
    position: absolute;
    right: 9vw;
    bottom: 5vh;
    color: var(--blotter-lavender-gray);
    font-size: clamp(1.4rem, 2vw, 2.4rem);
}

.scene-final-click.tick {
    animation: tick 220ms ease;
}

@keyframes tick {
    0%, 100% { transform: translateX(0); }
    30% { transform: translateX(-4px) rotate(-0.2deg); }
    62% { transform: translateX(5px) rotate(0.2deg); }
}

@media (max-width: 760px) {
    .cap-notch-nav { right: 1rem; }
    .hero-vellum, .oblique-slip, .note-one { left: 5vw; width: 86vw; }
    .nib-fragment { width: 62vw; opacity: 0.55; }
    .marginalia { display: none; }
    .ink-pool { right: 5vw; bottom: 8vh; }
    .cap-mouth { width: 92vw; left: -42vw; }
    .sealed-oval { width: 90vw; }
}
