:root {
    --deep-border-night: #111827;
    --second-world-blue: #88BFE8;
    --moonlit-vellum: #F3F0E6;
    --treaty-violet: #5B4B8A;
    --stamp-vermilion: #D64B35;
    --oxidized-mint: #9DD7C8;
    --ink-shadow: #24203A;
    --faded-cartographic-gold: #C7A75B;
    --drift-x: 18px;
    --drift-y: -10px;
    --fold-angle: 0deg;
    --moon-phase: 0%;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    color: var(--ink-shadow);
    font-family: "Bricolage Grotesque", Inter, sans-serif;
    background: var(--deep-border-night);
    overflow-x: hidden;
}

.paper-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: .28;
    mix-blend-mode: multiply;
    background-image:
        radial-gradient(circle at 22% 17%, rgba(199, 167, 91, .16) 0 1px, transparent 1px),
        radial-gradient(circle at 71% 43%, rgba(36, 32, 58, .13) 0 1px, transparent 1px),
        linear-gradient(110deg, rgba(243, 240, 230, .05), rgba(136, 191, 232, .04), rgba(243, 240, 230, .02));
    background-size: 17px 19px, 23px 29px, 100% 100%;
}

.crossing { position: relative; }

.scene {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 7vw 8vw 6vw 12vw;
}

.scene::before {
    content: "";
    position: absolute;
    inset: -20%;
    z-index: -2;
    background:
        repeating-linear-gradient(102deg, rgba(36, 32, 58, .08) 0 1px, transparent 1px 16px),
        radial-gradient(circle at 70% 24%, rgba(136, 191, 232, .23), transparent 34%),
        radial-gradient(circle at 28% 70%, rgba(157, 215, 200, .18), transparent 40%);
    transform: rotate(var(--fold-angle));
}

.scene-border {
    color: var(--moonlit-vellum);
    background:
        linear-gradient(90deg, rgba(17, 24, 39, .98) 0 49.7%, rgba(243, 240, 230, .82) 49.8% 50.2%, rgba(36, 32, 58, .94) 50.3% 100%),
        radial-gradient(circle at 74% 42%, rgba(91, 75, 138, .58), transparent 46%);
}

.scene-sea {
    background: linear-gradient(174deg, var(--moonlit-vellum), #dbe9e7 48%, rgba(136, 191, 232, .76));
}

.scene-afterimages {
    background: linear-gradient(128deg, var(--ink-shadow), var(--deep-border-night) 42%, var(--treaty-violet));
    color: var(--moonlit-vellum);
}

.scene-weather {
    background: linear-gradient(180deg, #eef4ee, var(--moonlit-vellum) 45%, rgba(157, 215, 200, .62));
}

.scene-embassy {
    background:
        radial-gradient(circle at 50% 48%, rgba(136, 191, 232, .2), transparent 31%),
        linear-gradient(145deg, var(--deep-border-night), var(--ink-shadow) 62%, #171222);
    color: var(--moonlit-vellum);
}

.passport-strip {
    position: fixed;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding: 14px 9px;
    border-left: 1px dashed rgba(243, 240, 230, .48);
    border-right: 1px dashed rgba(214, 75, 53, .4);
    background: rgba(17, 24, 39, .36);
    backdrop-filter: blur(8px);
}

.stamp-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    color: rgba(243, 240, 230, .76);
    border: 2px solid rgba(214, 75, 53, .52);
    border-radius: 50%;
    text-decoration: none;
    font-family: "Azeret Mono", monospace;
    font-size: 12px;
    letter-spacing: .08em;
    transform: rotate(-8deg);
    transition: background .4s ease, color .4s ease, transform .4s ease, border-color .4s ease;
}

.stamp-mark::after {
    content: attr(data-scene);
    position: absolute;
    inset: 7px;
    border: 1px dotted currentColor;
    border-radius: 50%;
    opacity: .45;
}

.stamp-mark:hover, .stamp-mark.is-active {
    color: var(--moonlit-vellum);
    background: rgba(214, 75, 53, .76);
    border-color: var(--stamp-vermilion);
    transform: rotate(5deg) scale(1.06);
}

.atlas-fold.main-fold {
    position: absolute;
    top: -5vh;
    bottom: -5vh;
    left: 50%;
    width: 3.4vw;
    transform: translateX(-50%);
    background: linear-gradient(90deg, rgba(17, 24, 39, .72), var(--moonlit-vellum), rgba(136, 191, 232, .65), rgba(17, 24, 39, .62));
    box-shadow: 0 0 58px rgba(243, 240, 230, .38);
    opacity: .9;
}

.fold-shadow {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 31vw;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .24));
    transform-origin: 100% 50%;
}

.fold-left { left: 17vw; transform: skewY(-9deg) rotateY(9deg); }
.fold-right { right: 11vw; transform: skewY(7deg) rotateY(-12deg); opacity: .42; }

.coordinate-field {
    position: absolute;
    display: grid;
    gap: 13px;
    font-family: "Azeret Mono", monospace;
    font-size: clamp(10px, 1vw, 13px);
    letter-spacing: .12em;
    opacity: .62;
}

.left-field { left: 8vw; top: 18vh; color: rgba(243, 240, 230, .72); }
.right-field { right: 6vw; bottom: 17vh; color: var(--second-world-blue); text-align: right; }

.moon-watermark {
    position: absolute;
    border-radius: 50%;
    background:
        radial-gradient(circle at 38% 35%, rgba(243, 240, 230, .78), rgba(243, 240, 230, .28) 42%, transparent 43%),
        radial-gradient(circle at 61% 47%, rgba(136, 191, 232, .35), transparent 52%);
    border: 1px solid rgba(243, 240, 230, .26);
    filter: blur(.2px);
}

.moon-watermark::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    background: var(--deep-border-night);
    transform: translateX(var(--moon-phase));
    opacity: .36;
}

.moon-border { width: 34vw; height: 34vw; right: 7vw; top: 7vh; opacity: .28; }
.embassy-moon { width: 48vw; height: 48vw; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: .22; }

.title-spread {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
}

h1 {
    margin: 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(72px, 15vw, 220px);
    font-weight: 500;
    line-height: .78;
    letter-spacing: -.08em;
    text-shadow: 0 20px 38px rgba(0, 0, 0, .32);
}

.title-left { display: inline-block; transform: translateX(-1.8vw) translateY(-.8vw); color: rgba(243, 240, 230, .88); }
.title-dot { color: var(--stamp-vermilion); margin: 0 .01em; }
.title-right { display: inline-block; transform: translateX(2.1vw) translateY(1vw); color: var(--second-world-blue); }

.ceremonial {
    position: absolute;
    bottom: 17vh;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    margin: 0;
    padding: 11px 27px;
    border: 1px solid rgba(214, 75, 53, .7);
    color: var(--moonlit-vellum);
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(22px, 3vw, 46px);
    background: rgba(17, 24, 39, .24);
}

.border-notice, .tide-register, .customs-ribbon, .tram-ticket, .passport-number, .weather-ballot {
    font-family: "Azeret Mono", monospace;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.border-notice {
    position: absolute;
    bottom: 4vh;
    right: 5vw;
    color: rgba(243, 240, 230, .6);
    font-family: "Noto Serif KR", serif;
}

.contour-map {
    position: absolute;
    pointer-events: none;
    overflow: visible;
}

.hero-contours { width: 66vw; height: auto; left: 17vw; top: 26vh; opacity: .76; }
.sea-contours { width: 112vw; left: -5vw; top: 24vh; opacity: .88; transform: translateX(calc(var(--drift-x) * .9)); transition: transform .25s ease; }

.ghost-contour, .second-contour, .hatch {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.ghost-contour { stroke: rgba(243, 240, 230, .62); stroke-width: 4; stroke-dasharray: 9 12; }
.second-contour { stroke: var(--second-world-blue); stroke-width: 5; filter: drop-shadow(0 0 10px rgba(136, 191, 232, .38)); transform: translate(var(--drift-x), var(--drift-y)); transition: transform .38s ease; }
.hatch { stroke: rgba(199, 167, 91, .46); stroke-width: 2; stroke-dasharray: 2 9; }

.scene-label {
    position: relative;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--stamp-vermilion);
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(32px, 5vw, 76px);
    line-height: .9;
}

.scene-label span {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-family: "Azeret Mono", monospace;
    font-size: 13px;
}

.vellum-sheet {
    position: absolute;
    border: 1px solid rgba(136, 191, 232, .44);
    background: linear-gradient(120deg, rgba(243, 240, 230, .48), rgba(136, 191, 232, .35), rgba(157, 215, 200, .22));
    box-shadow: 0 28px 70px rgba(36, 32, 58, .16);
    mix-blend-mode: multiply;
}

.sheet-one { width: 56vw; height: 62vh; left: 9vw; top: 20vh; transform: rotate(-8deg); animation: tide 11s ease-in-out infinite; }
.sheet-two { width: 62vw; height: 44vh; right: -7vw; top: 31vh; transform: rotate(5deg); animation: tide 13s ease-in-out infinite reverse; }
.sheet-three { width: 32vw; height: 50vh; left: 44vw; bottom: -8vh; transform: rotate(16deg); animation: tide 15s ease-in-out infinite; }

@keyframes tide { 50% { translate: 3vw -1.4vh; } }

.tide-register { position: absolute; top: 12vh; right: 7vw; color: rgba(36, 32, 58, .66); font-size: 12px; }
.customs-ribbon { position: absolute; left: -4vw; bottom: 13vh; padding: 12px 9vw; background: var(--stamp-vermilion); color: var(--moonlit-vellum); transform: rotate(-4deg); font-size: 12px; }

.marginalia {
    position: relative;
    z-index: 3;
    max-width: 520px;
    padding: 24px 28px;
    border-left: 2px solid var(--faded-cartographic-gold);
    background: rgba(243, 240, 230, .56);
    box-shadow: 0 20px 58px rgba(36, 32, 58, .12);
}

.marginalia h2, .embassy-copy h2 {
    margin: 0 0 14px;
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(34px, 4vw, 66px);
    line-height: .92;
    font-weight: 500;
}

.marginalia p, .embassy-copy p, .cloud-column p {
    margin: 0;
    font-size: clamp(16px, 1.5vw, 21px);
    line-height: 1.48;
}

.sea-copy { margin-top: 50vh; margin-left: 45vw; transform: rotate(2deg); }

.boulevard {
    position: absolute;
    left: 4vw;
    top: 57vh;
    width: 102vw;
    height: 18vh;
    background: linear-gradient(90deg, transparent, rgba(199, 167, 91, .35), rgba(214, 75, 53, .28), transparent);
    transform: rotate(-18deg);
    border-top: 1px dashed rgba(243, 240, 230, .35);
    border-bottom: 1px dashed rgba(243, 240, 230, .25);
}

.civic-grid {
    position: absolute;
    right: 9vw;
    top: 18vh;
    display: grid;
    grid-template-columns: repeat(4, 62px);
    gap: 17px;
    transform: perspective(800px) rotateY(-17deg) rotateZ(4deg);
}

.embassy-window {
    width: 62px;
    height: 86px;
    border: 1px solid rgba(136, 191, 232, .45);
    background: rgba(17, 24, 39, .4);
    box-shadow: inset 0 0 22px rgba(36, 32, 58, .8);
}

.embassy-window.lit { background: radial-gradient(circle at 50% 35%, rgba(199, 167, 91, .8), rgba(136, 191, 232, .26) 62%, rgba(17, 24, 39, .36)); }

.street-plaque {
    position: absolute;
    left: 16vw;
    top: 36vh;
    padding: 13px 20px;
    background: var(--oxidized-mint);
    color: var(--ink-shadow);
    border: 2px solid rgba(243, 240, 230, .65);
    font-family: "Cormorant Garamond", serif;
    font-size: 30px;
    transform: rotate(-8deg);
    cursor: crosshair;
}

.street-plaque::after { content: attr(data-first); position: absolute; inset: 100% auto auto 18px; color: var(--stamp-vermilion); font-family: "Azeret Mono", monospace; font-size: 11px; letter-spacing: .1em; opacity: 0; transition: opacity .25s ease, transform .25s ease; transform: translateY(-8px); white-space: nowrap; }
.street-plaque:hover::after { opacity: 1; transform: translateY(9px); }
.plaque-two { left: 43vw; top: 66vh; background: var(--second-world-blue); transform: rotate(5deg); }

.tram-ticket { position: absolute; left: 11vw; bottom: 9vh; color: var(--faded-cartographic-gold); border: 1px dashed currentColor; padding: 13px 20px; transform: rotate(7deg); }
.stamp-cluster { position: absolute; right: 17vw; bottom: 12vh; display: flex; gap: 18px; align-items: center; }
button { font: inherit; cursor: crosshair; }
.large-stamp { width: 116px; height: 82px; border-radius: 8px; color: var(--stamp-vermilion); background: transparent; font-size: 14px; }
.round-stamp { color: var(--moonlit-vellum); background: transparent; }
.after-copy { margin-top: 45vh; max-width: 560px; background: rgba(17, 24, 39, .28); border-left-color: var(--stamp-vermilion); }

.cloud-column {
    position: absolute;
    width: 20vw;
    min-height: 62vh;
    padding: 28px 24px;
    border: 1px solid rgba(91, 75, 138, .22);
    background: linear-gradient(180deg, rgba(243, 240, 230, .72), rgba(136, 191, 232, .18), rgba(157, 215, 200, .33));
    box-shadow: 0 28px 72px rgba(36, 32, 58, .13);
    transform-origin: top center;
}

.cloud-column span { font-family: "Azeret Mono", monospace; font-size: 12px; letter-spacing: .12em; color: var(--treaty-violet); }
.cloud-column b { display: block; margin: 11vh 0 6vh; color: var(--second-world-blue); font-size: 92px; font-weight: 400; text-align: center; }
.column-one { left: 14vw; top: 24vh; transform: rotate(-4deg); }
.column-two { left: 40vw; top: 16vh; transform: rotate(2deg); }
.column-three { right: 10vw; top: 27vh; transform: rotate(5deg); }
.weather-ballot { position: absolute; padding: 12px 18px; background: rgba(243, 240, 230, .72); border: 1px solid var(--faded-cartographic-gold); color: var(--ink-shadow); font-size: 11px; }
.ballot-one { left: 19vw; bottom: 8vh; transform: rotate(-6deg); }
.ballot-two { right: 13vw; top: 12vh; transform: rotate(7deg); font-family: "Noto Serif KR", serif; }
.rain-glyphs span { position: absolute; top: -12vh; width: 1px; height: 15vh; background: linear-gradient(var(--second-world-blue), transparent); animation: rain 2.8s linear infinite; opacity: .6; }
.rain-glyphs span:nth-child(1) { left: 18%; animation-delay: -.3s; }
.rain-glyphs span:nth-child(2) { left: 32%; animation-delay: -1.1s; }
.rain-glyphs span:nth-child(3) { left: 48%; animation-delay: -.7s; }
.rain-glyphs span:nth-child(4) { left: 61%; animation-delay: -1.6s; }
.rain-glyphs span:nth-child(5) { left: 76%; animation-delay: -.2s; }
.rain-glyphs span:nth-child(6) { left: 87%; animation-delay: -2.1s; }
@keyframes rain { to { transform: translateY(120vh); } }

.folded-emblem {
    position: absolute;
    left: 11vw;
    top: 20vh;
    width: min(58vw, 620px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    background: conic-gradient(from 45deg, rgba(243, 240, 230, .12), rgba(136, 191, 232, .17), rgba(91, 75, 138, .2), rgba(243, 240, 230, .08));
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    border: 1px solid rgba(243, 240, 230, .2);
}

.folded-emblem svg { width: 70%; filter: drop-shadow(0 20px 45px rgba(0, 0, 0, .32)); }
.emblem-moon { fill: rgba(243, 240, 230, .08); stroke: var(--faded-cartographic-gold); stroke-width: 2; }
.final-seal {
    position: absolute;
    bottom: 14%;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
    padding: 15px 22px;
    border: 2px solid var(--stamp-vermilion);
    background: rgba(17, 24, 39, .42);
    color: var(--stamp-vermilion);
    font-family: "Azeret Mono", monospace;
    font-size: 12px;
    letter-spacing: .12em;
}

.embassy-copy { position: absolute; right: 8vw; bottom: 12vh; max-width: 520px; }
.passport-number { margin-top: 25px; color: var(--faded-cartographic-gold); font-size: 12px; }

.seal-layer { position: fixed; inset: 0; pointer-events: none; z-index: 80; }
.cursor-seal {
    position: absolute;
    width: 90px;
    height: 90px;
    display: grid;
    place-items: center;
    border: 3px double var(--stamp-vermilion);
    border-radius: 50%;
    color: var(--stamp-vermilion);
    font-family: "Azeret Mono", monospace;
    font-size: 11px;
    letter-spacing: .08em;
    text-align: center;
    opacity: .82;
    transform: translate(-50%, -50%) rotate(-11deg) scale(.72);
    animation: sealIn 1.9s ease forwards;
}

@keyframes sealIn { 20% { transform: translate(-50%, -50%) rotate(-6deg) scale(1.05); opacity: .95; } 100% { transform: translate(-50%, -50%) rotate(8deg) scale(1); opacity: 0; } }

@media (max-width: 820px) {
    .scene { padding: 18vw 7vw 14vw 22vw; }
    .passport-strip { left: 8px; }
    .stamp-mark { width: 42px; height: 42px; font-size: 10px; }
    h1 { font-size: 20vw; writing-mode: vertical-rl; letter-spacing: -.04em; }
    .title-left, .title-right { transform: none; }
    .hero-contours { width: 104vw; left: 0; top: 40vh; }
    .sea-copy, .after-copy { margin: 42vh 0 0; }
    .civic-grid { right: -8vw; grid-template-columns: repeat(3, 48px); gap: 11px; }
    .embassy-window { width: 48px; height: 66px; }
    .cloud-column { position: relative; left: auto; right: auto; top: auto; width: 72vw; min-height: 34vh; margin: 8vh 0; }
    .column-one, .column-two, .column-three { transform: rotate(-2deg); }
    .folded-emblem { width: 78vw; left: 15vw; top: 22vh; }
    .embassy-copy { position: relative; right: auto; bottom: auto; margin-top: 58vh; }
}
