/* ============================================
   okurairi.com - The Vault of Shelved Works
   ============================================ */

/* ---- CSS Custom Properties (Design Palette) ---- */
:root {
    --vault-dark: #1A1818;
    --archive-gold: #C8A040;
    --parchment-warm: #E8DCC0;
    --nature-sage: #6A8A60;
    --shelf-dust: #8A7A68;
    --drawer-wood: #5A4A38;
    --pressed-rose: #C87878;
}

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

html {
    overflow: hidden;
    height: 100%;
}

body {
    height: 100%;
    background: #1A1818;
    color: #E8DCC0;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1vw, 17px);
    line-height: 1.85;
    overflow: hidden;
}

/* ---- Progress Bar ---- */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: #C8A040;
    z-index: 1000;
    transition: width 0.1s linear;
}

/* ---- Scroll Container ---- */
#scroll-container {
    display: flex;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

#scroll-container::-webkit-scrollbar {
    display: none;
}

/* ---- Panels ---- */
.panel {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

/* ---- Panel: Vault Door ---- */
.panel-vault {
    background: #1A1818;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Corner botanicals */
.corner-botanical {
    position: absolute;
    width: 120px;
    height: 120px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.corner-botanical.visible {
    opacity: 1;
}

.corner-tl { top: 24px; left: 24px; }
.corner-tr { top: 24px; right: 24px; }
.corner-bl { bottom: 24px; left: 24px; }
.corner-br { bottom: 24px; right: 24px; }

/* Vault door wrapper */
.vault-door-wrapper {
    position: relative;
    width: min(70vw, 500px);
    height: min(70vw, 500px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vault-door {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* Vault ring draw animation */
.vault-ring {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
}

.vault-ring.animate {
    animation: drawRing 1500ms ease-out forwards;
}

.ring-outer { animation-delay: 0ms; }
.ring-mid { animation-delay: 200ms; }
.ring-inner { animation-delay: 400ms; }
.ring-innermost { animation-delay: 550ms; }

@keyframes drawRing {
    to {
        stroke-dashoffset: 0;
    }
}

/* Vault details fade in */
.vault-detail {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.vault-detail.visible {
    opacity: 1;
}

/* Vault hover rotation */
.vault-door:hover {
    transform: rotate(1deg);
    transition: transform 0.6s ease;
}

/* Vault title */
.vault-title {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.vault-title.visible {
    opacity: 1;
}

.domain-name {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 3.5vw, 52px);
    color: #E8DCC0;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.domain-japanese {
    font-family: 'Noto Serif JP', serif;
    font-weight: 500;
    font-size: clamp(18px, 2vw, 28px);
    color: #C8A040;
    margin-bottom: 16px;
}

.domain-subtitle {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-weight: 400;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8A7A68;
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 40px;
    right: 48px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.scroll-hint.visible {
    opacity: 1;
}

.scroll-hint-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8A7A68;
}

.scroll-hint-arrow {
    animation: nudgeRight 1.5s ease-in-out infinite;
}

@keyframes nudgeRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* ---- Panel: Archive Drawers ---- */
.panel-drawer {
    background: #1A1818;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #5A4A38;
    transition: border-color 0.4s ease;
}

.panel-drawer:hover {
    border-left-color: #C8A040;
}

.drawer-content {
    width: 60%;
    max-width: 800px;
    padding: 48px;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 40px;
    padding-bottom: 16px;
    border-bottom: 1px solid #5A4A38;
}

.archive-label {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-weight: 400;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8A7A68;
    transition: color 0.3s ease;
    position: relative;
}

.archive-label::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 1px;
    background: #C8A040;
    transition: width 0.3s ease;
}

.archive-label:hover::after {
    width: 100%;
}

.archive-label:hover {
    color: #C8A040;
}

.archive-date {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-weight: 400;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8A7A68;
}

.drawer-body {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.drawer-text {
    flex: 1;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.drawer-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-name {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 3.5vw, 52px);
    color: #E8DCC0;
    margin-bottom: 4px;
    line-height: 1.1;
}

.project-name-jp {
    font-family: 'Noto Serif JP', serif;
    font-weight: 500;
    font-size: clamp(16px, 1.5vw, 22px);
    color: #C8A040;
    margin-bottom: 24px;
}

.project-description {
    color: #E8DCC0;
    margin-bottom: 28px;
    max-width: 520px;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-item {
    font-size: 13px;
    color: #8A7A68;
}

.meta-label {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 11px;
    color: #5A4A38;
    margin-right: 6px;
}

/* Botanical stamps */
.drawer-botanical {
    flex: 0 0 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.botanical-stamp {
    width: 180px;
    height: 180px;
    transition: transform 0.4s ease;
}

.botanical-stamp:hover {
    transform: rotate(3deg);
}

/* Stamp ring draw animation */
.stamp-ring {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 0.8s ease-out;
}

.stamp-ring.animate {
    stroke-dashoffset: 0;
}

.stamp-ring-inner {
    stroke-dasharray: 550;
    stroke-dashoffset: 550;
    transition: stroke-dashoffset 0.8s ease-out 0.15s;
}

.stamp-ring-inner.animate {
    stroke-dashoffset: 0;
}

/* Botanical illustration draw animation */
.botanical-illustration {
    opacity: 0;
    transition: opacity 0.6s ease 0.4s;
}

.botanical-illustration.visible {
    opacity: 1;
}

/* ---- Panel: Closing ---- */
.panel-closing {
    background: #1A1818;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #5A4A38;
}

.closing-content {
    text-align: center;
    max-width: 480px;
    padding: 48px;
}

.closing-vault-mark {
    margin-bottom: 40px;
}

.closing-emblem {
    width: 80px;
    height: 80px;
    opacity: 0.6;
}

.closing-text {
    color: #8A7A68;
    font-size: clamp(15px, 1.1vw, 18px);
    line-height: 1.85;
    margin-bottom: 32px;
}

.closing-japanese {
    font-family: 'Noto Serif JP', serif;
    font-weight: 500;
    font-size: clamp(20px, 2.5vw, 36px);
    color: #C8A040;
    margin-bottom: 16px;
}

.closing-attribution {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5A4A38;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .drawer-content {
        width: 85%;
        padding: 32px 24px;
    }

    .drawer-body {
        flex-direction: column;
        gap: 32px;
        align-items: center;
    }

    .drawer-botanical {
        flex: 0 0 auto;
    }

    .botanical-stamp {
        width: 140px;
        height: 140px;
    }

    .corner-botanical {
        width: 80px;
        height: 80px;
    }

    .scroll-hint {
        right: 24px;
        bottom: 24px;
    }

    .vault-door-wrapper {
        width: min(85vw, 400px);
        height: min(85vw, 400px);
    }

    .closing-content {
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .drawer-content {
        width: 92%;
        padding: 24px 16px;
    }

    .drawer-header {
        flex-direction: column;
        gap: 4px;
    }

    .drawer-body {
        gap: 24px;
    }

    .botanical-stamp {
        width: 120px;
        height: 120px;
    }

    .corner-botanical {
        width: 60px;
        height: 60px;
    }
}
