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

html {
    scroll-behavior: smooth;
    background: #0D0B2E;
    color: #F5EDE0;
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    overflow-x: hidden;
}

body {
    position: relative;
    min-height: 100vh;
}

/* ===== TOP RULE ===== */
.top-rule {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(201, 168, 76, 0.3);
    background: rgba(13, 11, 46, 0.9);
    backdrop-filter: blur(10px);
}

.domain-name {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #C9A84C;
}

/* ===== AURORA BACKGROUND ===== */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.aurora-layer {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
}

.aurora-a {
    top: -10%;
    left: -5%;
    background: #00E5C7;
    opacity: 0.1;
    animation: aurora-drift-a 18s ease-in-out infinite alternate;
}

.aurora-b {
    top: 30%;
    right: -10%;
    background: #E8368F;
    opacity: 0.08;
    animation: aurora-drift-b 25s ease-in-out infinite alternate;
}

.aurora-c {
    bottom: -10%;
    left: 30%;
    background: #6B3FA0;
    opacity: 0.12;
    animation: aurora-drift-c 12s ease-in-out infinite alternate;
}

@keyframes aurora-drift-a {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 60px) scale(1.3); }
}

@keyframes aurora-drift-b {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-60px, -80px) scale(1.2); }
}

@keyframes aurora-drift-c {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, -40px) scale(1.4); }
}

/* ===== ORGANIC BLOBS ===== */
.blob {
    position: absolute;
    background: linear-gradient(135deg, #00E5C7 0%, #6B3FA0 40%, #E8368F 100%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 1;
}

@keyframes blob-morph {
    0%, 100% { border-radius: 30% 70% 60% 40% / 50% 60% 40% 50%; }
    25% { border-radius: 50% 50% 70% 30% / 40% 60% 50% 50%; }
    50% { border-radius: 40% 60% 50% 50% / 60% 40% 70% 30%; }
    75% { border-radius: 60% 40% 40% 60% / 50% 50% 60% 40%; }
}

@keyframes blob-drift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

.blob-1 {
    width: 300px; height: 300px;
    top: 10%; left: 5%;
    opacity: 0.2;
    animation: blob-morph 18s ease-in-out infinite, blob-drift 20s ease-in-out infinite;
}

.blob-2 {
    width: 250px; height: 250px;
    top: 40%; right: 10%;
    opacity: 0.15;
    animation: blob-morph 22s ease-in-out infinite 2s, blob-drift 16s ease-in-out infinite 3s;
}

.blob-3 {
    width: 200px; height: 200px;
    top: 20%; right: 5%;
    opacity: 0.2;
    animation: blob-morph 20s ease-in-out infinite 1s, blob-drift 18s ease-in-out infinite;
}

.blob-4 {
    width: 180px; height: 180px;
    top: 10%; left: 10%;
    opacity: 0.25;
    animation: blob-morph 15s ease-in-out infinite, blob-drift 22s ease-in-out infinite 2s;
}

.blob-5 {
    width: 220px; height: 220px;
    bottom: 10%; right: 5%;
    opacity: 0.18;
    animation: blob-morph 25s ease-in-out infinite 3s, blob-drift 17s ease-in-out infinite;
}

.blob-6 {
    width: 280px; height: 280px;
    top: 5%; left: 10%;
    opacity: 0.15;
    animation: blob-morph 19s ease-in-out infinite 2s, blob-drift 21s ease-in-out infinite;
}

.blob-7 {
    width: 240px; height: 240px;
    top: 30%; left: 20%;
    opacity: 0.22;
    animation: blob-morph 17s ease-in-out infinite, blob-drift 19s ease-in-out infinite 1s;
}

.blob-8 {
    width: 200px; height: 200px;
    top: 15%; right: 8%;
    opacity: 0.18;
    animation: blob-morph 23s ease-in-out infinite 1s, blob-drift 15s ease-in-out infinite;
}

.blob-9 {
    width: 260px; height: 260px;
    top: 20%; left: 5%;
    opacity: 0.2;
    animation: blob-morph 16s ease-in-out infinite 3s, blob-drift 20s ease-in-out infinite 2s;
}

.blob-10 {
    width: 350px; height: 350px;
    top: 10%; left: 10%;
    opacity: 0.25;
    animation: blob-morph 18s ease-in-out infinite, blob-drift 22s ease-in-out infinite;
}

.blob-11 {
    width: 300px; height: 300px;
    top: 30%; right: 15%;
    opacity: 0.3;
    animation: blob-morph 20s ease-in-out infinite 2s, blob-drift 18s ease-in-out infinite 1s;
}

.blob-12 {
    width: 280px; height: 280px;
    bottom: 10%; left: 30%;
    opacity: 0.35;
    animation: blob-morph 15s ease-in-out infinite 1s, blob-drift 16s ease-in-out infinite 3s;
}

/* ===== VAULT SECTIONS ===== */
.vault-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 5vw;
    background: radial-gradient(ellipse at center, #1A1450 0%, #0D0B2E 100%);
    z-index: 2;
    overflow: hidden;
}

/* ===== HERO SECTION ===== */
.section-hero {
    flex-direction: column;
    text-align: center;
}

.hero-frame {
    position: absolute;
    width: 80%;
    max-width: 800px;
    height: auto;
    opacity: 0.6;
}

.hero-content {
    position: relative;
    z-index: 5;
}

.hero-kanji {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(5rem, 14vw, 16rem);
    letter-spacing: 0.05em;
    -webkit-text-stroke: 1px #C9A84C;
    color: transparent;
    background: linear-gradient(135deg, #C9A84C 0%, #F5EDE0 50%, #C9A84C 100%);
    -webkit-background-clip: text;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 0.2em;
}

.hero-subtitle {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: 1rem;
    color: #B8A9E8;
}

.hero-tagline {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.5rem);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    color: #F5EDE0;
    opacity: 0.85;
}

.jp-text {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-feature-settings: 'palt' 1;
}

/* ===== CORRIDOR SEPARATORS ===== */
.corridor {
    height: 20vh;
    position: relative;
    z-index: 2;
    background-color: #0D0B2E;
    background-image:
        radial-gradient(circle at 20px 20px, rgba(201, 168, 76, 0.08) 2px, transparent 2px),
        radial-gradient(circle at 40px 40px, rgba(201, 168, 76, 0.05) 1.5px, transparent 1.5px);
    background-size: 60px 60px;
}

/* ===== SECTION GRID (Z-PATTERN) ===== */
.section-grid {
    width: 100%;
    max-width: 1200px;
    display: grid;
    gap: 40px;
    position: relative;
    z-index: 5;
}

.section-left .section-grid {
    grid-template-columns: 1fr 0.6fr;
}

.section-right .section-grid {
    grid-template-columns: 0.6fr 1fr;
}

.section-content {
    position: relative;
}

.section-aside {
    position: relative;
    min-height: 200px;
}

/* ===== ORNAMENTAL FRAMES ===== */
.ornamental-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.section-frame {
    position: absolute;
    top: -20px;
    left: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
}

.frame-corner, .frame-edge {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease-in-out;
}

.vault-section.in-view .frame-corner {
    stroke-dashoffset: 0;
    transition-duration: 1.2s;
}

.vault-section.in-view .frame-edge {
    stroke-dashoffset: 0;
    transition-delay: 0.8s;
    transition-duration: 1.2s;
}

.content-inner {
    position: relative;
    z-index: 5;
    padding: 40px;
}

/* ===== TYPOGRAPHY ===== */
.section-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 5vw, 5rem);
    color: #F5EDE0;
    margin-bottom: 0.3em;
    line-height: 1.2;
}

.jp-label {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    font-size: clamp(0.75rem, 1vw, 1rem);
    color: #B8A9E8;
    letter-spacing: 0.2em;
    margin-bottom: 1.5em;
    font-feature-settings: 'palt' 1;
}

.section-lead {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    line-height: 1.5;
    color: #F5EDE0;
    margin-bottom: 1em;
}

.section-body {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    line-height: 1.7;
    color: rgba(245, 237, 224, 0.8);
}

/* ===== TIMELINE ===== */
.timeline {
    margin-top: 1.5em;
    border-left: 2px solid rgba(201, 168, 76, 0.3);
    padding-left: 24px;
}

.timeline-entry {
    margin-bottom: 2em;
    position: relative;
}

.timeline-entry::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #C9A84C;
}

.timeline-year {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.3em;
    color: #00E5C7;
    display: block;
    margin-bottom: 0.3em;
}

.timeline-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    color: rgba(245, 237, 224, 0.8);
    line-height: 1.7;
}

/* ===== DRAWERS (Progressive Disclosure) ===== */
.drawers {
    margin-top: 1.5em;
}

.drawer {
    margin-bottom: 12px;
    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 4px;
    overflow: hidden;
}

.drawer-pull {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(90deg, #C9A84C 0%, #F5EDE0 50%, #C9A84C 100%);
    background-size: 200% 100%;
    cursor: pointer;
    min-height: 60px;
}

.drawer-label {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.05em;
    color: #0D0B2E;
}

.drawer-arrow {
    color: #0D0B2E;
    font-size: 0.8em;
    transition: transform 0.4s ease;
}

.drawer.open .drawer-arrow {
    transform: rotate(180deg);
}

.drawer-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease-out;
    padding: 0 20px;
}

.drawer.open .drawer-content {
    max-height: 300px;
    padding: 16px 20px;
}

.drawer-content p {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    line-height: 1.7;
    color: rgba(245, 237, 224, 0.85);
    opacity: 0;
    transition: opacity 0.3s ease 0.3s;
}

.drawer.open .drawer-content p {
    opacity: 1;
}

/* ===== FINALE SECTION ===== */
.section-finale {
    flex-direction: column;
    text-align: center;
    background: radial-gradient(ellipse at center, #1A1450 0%, #0D0B2E 70%);
}

.finale-content {
    position: relative;
    z-index: 5;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tondo-frame {
    width: 500px;
    max-width: 90vw;
    height: auto;
    position: relative;
}

.finale-text {
    position: relative;
    z-index: 5;
    margin-top: -80px;
    padding: 0 20px;
}

.finale-message {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.8;
    color: rgba(245, 237, 224, 0.85);
    margin-bottom: 1.5em;
}

.finale-closing {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    color: #C9A84C;
}

/* ===== HANKO SEALS ===== */
.hanko-seal circle {
    stroke: #D64045;
}

.hanko-seal text {
    fill: #D64045;
}
.hanko-seal {
    position: absolute;
    bottom: 30px;
    right: 40px;
    width: 50px;
    height: 50px;
    z-index: 10;
    transform: scale(0) rotate(-25deg);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vault-section.in-view .hanko-seal {
    transform: scale(1) rotate(-10deg);
    transition-delay: 0.8s;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .section-left .section-grid,
    .section-right .section-grid {
        grid-template-columns: 1fr;
    }

    .section-aside {
        min-height: 100px;
    }

    .content-inner {
        padding: 24px 16px;
    }

    .hero-frame {
        width: 95%;
    }

    .tondo-frame {
        width: 300px;
    }

    .finale-text {
        margin-top: -40px;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .blob, .aurora-layer {
        animation: none;
    }
    .frame-corner, .frame-edge {
        stroke-dashoffset: 0;
        transition: none;
    }
    .hanko-seal {
        transform: scale(1) rotate(-10deg);
        transition: none;
    }
    .drawer-content {
        transition: none;
    }
}
