/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-y: hidden;
    overflow-x: hidden;
    height: 100vh;
    width: 100vw;
    background: #f5f0e8;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: #3d3229;
}

/* === Paper Texture Overlay === */
.paper-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* === Progress Bar === */
.progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(212, 205, 192, 0.4);
    z-index: 999;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #6b3fa0;
    transition: width 0.3s ease;
}

.progress-bead {
    position: absolute;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6b3fa0;
    left: 0%;
    transition: left 0.3s ease;
}

/* === Scroll Container === */
.scroll-container {
    display: flex;
    flex-direction: row;
    width: 500vw;
    height: 100vh;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* === Page Base === */
.page {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Neomorphic Card === */
.neo-card {
    background: #f5f0e8;
    border-radius: 24px;
    box-shadow: 8px 8px 16px #d4cdc0, -8px -8px 16px #faf7f2;
}

/* === Horizon Line Motif === */
.horizon-line {
    width: 60%;
    max-width: 400px;
    height: 1px;
    background: linear-gradient(to right, transparent, #7a7062 20%, #7a7062 80%, transparent);
    opacity: 0.3;
}

/* ================================================
   SECTION 1: THE DOCK
   ================================================ */
.page-dock {
    background: #f5f0e8;
    justify-content: flex-start;
    padding-left: 10vw;
}

.dock-card {
    max-width: 520px;
    padding: 48px;
    z-index: 2;
}

.dock-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: -0.02em;
    color: #3d3229;
    min-height: 1.2em;
}

.dock-title .cursor {
    display: inline-block;
    width: 3px;
    height: 0.9em;
    background: #6b3fa0;
    margin-left: 2px;
    vertical-align: baseline;
    animation: blink 0.53s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.dock-subtitle {
    font-family: 'Courier Prime', monospace;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.5vw, 1.125rem);
    color: #7a7062;
    margin-top: 16px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.dock-subtitle.visible {
    opacity: 1;
}

.dock-ripples {
    position: absolute;
    right: 10vw;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: 300px;
}

.ripple-svg {
    width: 100%;
    height: 100%;
}

.ripple-circle {
    fill: none;
    stroke: #1a4b8c;
    stroke-width: 1;
}

.ripple-1 { animation: ripple-expand 4s ease-out infinite; opacity: 0.2; }
.ripple-2 { animation: ripple-expand 4s ease-out infinite 1.3s; opacity: 0.15; }
.ripple-3 { animation: ripple-expand 4s ease-out infinite 2.6s; opacity: 0.1; }

@keyframes ripple-expand {
    0% { transform: scale(1); opacity: 0.2; }
    100% { transform: scale(3); opacity: 0; }
}

.dock-arrow {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
}

.arrow-chevron {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-right: 2px solid #3d3229;
    border-bottom: 2px solid #3d3229;
    transform: rotate(-45deg);
    animation: arrow-pulse 1.5s ease-in-out infinite;
}

@keyframes arrow-pulse {
    0%, 100% { transform: rotate(-45deg) translateX(0); }
    50% { transform: rotate(-45deg) translateX(8px); }
}

/* ================================================
   SECTION 2: THE CROSSING
   ================================================ */
.page-crossing {
    background: #f5f0e8;
    padding: 5vh 5vw;
}

.crossing-cards {
    display: flex;
    gap: 32px;
    width: 85vw;
    max-width: 1100px;
    height: 70vh;
    z-index: 2;
}

.crossing-left {
    flex: 0 0 55%;
    padding: 48px;
    background: #ece5d8;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.crossing-line {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 2vw, 1.25rem);
    letter-spacing: 0.01em;
    line-height: 1.8;
    color: #3d3229;
    opacity: 0;
    transform: translateY(10px);
    animation: line-fade-in 0.6s ease forwards;
}

@keyframes line-fade-in {
    to { opacity: 1; transform: translateY(0); }
}

.crossing-right {
    flex: 0 0 40%;
    position: relative;
    overflow: hidden;
    background: rgba(26, 75, 140, 0.08);
}

.water-lines {
    width: 100%;
    height: 100%;
}

.water-path {
    fill: none;
    stroke: #1a4b8c;
    stroke-width: 1.5;
    animation: water-sway 6s ease-in-out infinite alternate;
}

@keyframes water-sway {
    0% { transform: translateX(-10px); }
    100% { transform: translateX(10px); }
}

.paper-boat {
    position: absolute;
}

.boat-1 {
    top: 25%;
    left: -40px;
    animation: boat-drift 18s linear infinite;
}

.boat-2 {
    top: 50%;
    left: -40px;
    animation: boat-drift 22s linear infinite 5s;
}

.boat-3 {
    top: 72%;
    left: -40px;
    animation: boat-drift 15s linear infinite 10s;
}

@keyframes boat-drift {
    0% { transform: translateX(-40px); }
    100% { transform: translateX(calc(100% + 80px)); }
}

/* Floating wax seals */
.wax-seal {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #b8442a, #7a2a18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 12px;
    color: rgba(245, 240, 232, 0.6);
    box-shadow: inset 2px 2px 4px rgba(122, 42, 24, 0.5), inset -2px -2px 4px rgba(184, 68, 42, 0.5);
}

.seal-float-1 {
    top: 20%;
    left: 48%;
    animation: seal-drift 20s ease-in-out infinite alternate;
}

.seal-float-2 {
    top: 65%;
    left: 52%;
    animation: seal-drift 17s ease-in-out infinite alternate-reverse;
}

@keyframes seal-drift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(20px, -10px); }
    50% { transform: translate(-10px, 5px); }
    75% { transform: translate(15px, 10px); }
    100% { transform: translate(-5px, -15px); }
}

/* ================================================
   SECTION 3: THE JOURNAL
   ================================================ */
.page-journal {
    background: #f5f0e8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.journal-card {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
}

.journal-text {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #3d3229;
}

.journal-text.jp {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
}

.journal-text.kr {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 300;
}

.journal-text.en {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 2vw, 1.5rem);
}

.journal-float-1 {
    top: 18%;
    left: 12%;
    width: 140px;
    height: 120px;
    animation: bob 3.2s ease-in-out infinite alternate;
}

.journal-float-2 {
    top: 55%;
    left: 22%;
    width: 160px;
    height: 100px;
    animation: bob 4s ease-in-out infinite alternate;
}

.journal-float-3 {
    top: 30%;
    left: 38%;
    width: 170px;
    height: 90px;
    animation: bob 3.6s ease-in-out infinite alternate;
}

.journal-float-4 {
    top: 65%;
    left: 50%;
    width: 180px;
    height: 100px;
    animation: bob 4.5s ease-in-out infinite alternate;
}

.journal-float-5 {
    top: 15%;
    left: 62%;
    width: 140px;
    height: 120px;
    animation: bob 3s ease-in-out infinite alternate;
}

.journal-float-6 {
    top: 50%;
    left: 75%;
    width: 160px;
    height: 90px;
    animation: bob 5s ease-in-out infinite alternate;
}

@keyframes bob {
    0% { transform: translateY(-3px); }
    100% { transform: translateY(3px); }
}

.seal-journal-1 {
    top: 40%;
    left: 30%;
    animation: seal-drift 22s ease-in-out infinite alternate;
}

.seal-journal-2 {
    top: 35%;
    left: 68%;
    animation: seal-drift 18s ease-in-out infinite alternate-reverse;
}

.floating-leaf {
    position: absolute;
}

.leaf-1 {
    top: 75%;
    left: 45%;
    animation: leaf-spin 40s linear infinite, seal-drift 20s ease-in-out infinite alternate;
}

@keyframes leaf-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ================================================
   SECTION 4: THE COLLECTION
   ================================================ */
.page-collection {
    background: #f5f0e8;
}

.collection-card {
    width: 80vw;
    max-width: 960px;
    padding: 48px;
    transform: rotate(1.2deg);
}

.stamp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 24px;
}

.stamp {
    width: 140px;
    height: 160px;
    border-radius: 8px;
    background: #f5f0e8;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto;
    box-shadow: inset 4px 4px 8px #d4cdc0, inset -4px -4px 8px #faf7f2;
    transition: transform 0.3s ease;
    cursor: default;
}

.stamp:hover {
    transform: translateY(-4px);
}

.stamp-amethyst {
    border: 2px solid rgba(107, 63, 160, 0.5);
}

.stamp-amethyst:hover {
    border-color: #6b3fa0;
}

.stamp-emerald {
    border: 2px solid rgba(26, 122, 79, 0.5);
}

.stamp-emerald:hover {
    border-color: #1a7a4f;
}

.stamp-sapphire {
    border: 2px solid rgba(26, 75, 140, 0.5);
}

.stamp-sapphire:hover {
    border-color: #1a4b8c;
}

.stamp-icon {
    width: 48px;
    height: 48px;
}

.postmark {
    position: absolute;
    width: 80px;
    height: 80px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(12deg);
    pointer-events: none;
}

/* ================================================
   SECTION 5: THE OTHER SHORE
   ================================================ */
.page-shore {
    background: linear-gradient(135deg, #0e2f5a, #3a1d6e);
    flex-direction: column;
    gap: 0;
}

.shore-quote {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: #f5f0e8;
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    letter-spacing: 0.08em;
}

.shore-domain {
    font-family: 'Courier Prime', monospace;
    font-weight: 400;
    color: #f5f0e8;
    font-size: clamp(0.875rem, 1.2vw, 1rem);
    margin-top: 24px;
    opacity: 0.7;
}

.page-shore .horizon-line {
    margin-top: 32px;
}

.leaf-shore {
    position: absolute;
    top: 25%;
    right: 15%;
    animation: leaf-spin 40s linear infinite;
}

.seal-shore {
    position: absolute;
    bottom: 20%;
    left: 15%;
    background: radial-gradient(circle at 40% 40%, #f5f0e8, #d4cdc0);
    color: rgba(61, 50, 41, 0.4);
    animation: seal-drift 25s ease-in-out infinite alternate;
}
