/* ========================================
   okurairi.net — CSS
   McBling + Scholarly Archive
   ======================================== */

:root {
    --hot-pink: #FF69B4;
    --white: #FFFFFF;
    --vault-brown: #2C1810;
    --midnight-plum: #1A0A1E;
    --antique-gold: #E8D5B7;
    --parchment: #F5E6CC;
    --light-pink: #FFB6C1;
    --amethyst: #9B59B6;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.72;
    color: var(--vault-brown);
    background: var(--midnight-plum);
    overflow-x: hidden;
}

/* ========================================
   VAULT DOOR (Entry)
   ======================================== */

.vault-door {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--midnight-plum);
    position: relative;
}

.vault-door__inner {
    text-align: center;
    position: relative;
}

.vault-door__title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.02em;
    color: var(--parchment);
    display: inline-block;
    position: relative;
}

.vault-door__title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.vault-door__title .letter.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Rhinestone ring around title */
.rhinestone-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 280px;
    height: 280px;
    margin-left: -140px;
    margin-top: -140px;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.rhinestone-ring.visible {
    opacity: 1;
}

.rhinestone-ring .stone {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--white);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    box-shadow: 0 0 6px var(--hot-pink);
}

.vault-door__subtitle {
    font-family: 'Karla', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--antique-gold);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    margin-top: 2rem;
    letter-spacing: 0.1em;
}

.vault-door__subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.gem-scroll-prompt {
    margin-top: 3rem;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.gem-scroll-prompt.visible {
    opacity: 1;
}

.gem-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--hot-pink), var(--amethyst));
    transform: rotate(45deg);
    animation: pulse-gem 2s ease-in-out infinite;
}

@keyframes pulse-gem {
    0%, 100% { opacity: 0.5; box-shadow: 0 0 8px var(--hot-pink); }
    50% { opacity: 1; box-shadow: 0 0 20px var(--hot-pink); }
}

/* ========================================
   RHINESTONE BORDERS
   ======================================== */

.rhinestone-border {
    width: 100%;
    padding: 1rem 0;
    background: var(--parchment);
    position: relative;
    overflow: hidden;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rhinestone-svg {
    width: 100%;
    height: 12px;
}

.rhinestone-border .stone-dot {
    fill: var(--antique-gold);
    animation: twinkle 2s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* ========================================
   ARCHIVE SHELVES
   ======================================== */

.archive-shelves {
    min-height: 100vh;
    width: 100%;
    background: var(--parchment);
    padding: clamp(2rem, 5vw, 6rem) 0;
}

.shelf {
    display: flex;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(2rem, 4vw, 4rem) clamp(1.5rem, 3vw, 3rem);
    gap: clamp(2rem, 4vw, 4rem);
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.shelf--left {
    flex-direction: row;
    transform: translateX(-40px);
}

.shelf--right {
    flex-direction: row-reverse;
    transform: translateX(40px);
}

.shelf.revealed {
    opacity: 1;
    transform: translateX(0);
}

.shelf__illustration {
    flex: 0 0 clamp(150px, 25vw, 280px);
}

.shelf-drawing {
    width: 100%;
    height: auto;
}

.shelf-drawing .draw-line {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.2s ease-out;
}

.shelf.revealed .shelf-drawing .draw-line {
    stroke-dashoffset: 0;
}

.shelf__text {
    flex: 1;
}

.shelf__title {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    color: var(--vault-brown);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.drop-cap {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 3em;
    float: left;
    line-height: 0.8;
    margin-right: 0.08em;
    margin-top: 0.05em;
    color: var(--vault-brown);
    text-shadow: 1px 1px 0 rgba(155, 89, 182, 0.3);
}

.shelf__body {
    color: var(--vault-brown);
    margin-bottom: 1.2rem;
}

.gem-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Caveat', cursive;
    font-size: clamp(0.875rem, 1.4vw, 1.125rem);
    color: var(--amethyst);
    cursor: pointer;
    transition: color 0.3s;
}

.gem-link:hover {
    color: var(--hot-pink);
}

.gem-icon-inline {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, var(--hot-pink), var(--amethyst));
    transform: rotate(45deg);
    transition: box-shadow 0.3s;
}

.gem-link:hover .gem-icon-inline {
    box-shadow: 0 0 12px var(--hot-pink);
}

/* Rhinestone divider between shelves */
.rhinestone-divider {
    max-width: 600px;
    margin: 0 auto;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.rhinestone-divider::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background: var(--antique-gold);
    opacity: 0.4;
}

/* ========================================
   DUST JACKET
   ======================================== */

.dust-jacket {
    min-height: 100vh;
    width: 100%;
    background: var(--parchment);
    position: relative;
    padding: clamp(4rem, 8vw, 8rem) clamp(2rem, 8vw, 10rem);
    overflow: hidden;
}

/* Marginalia doodles */
.marginalia {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.4;
}

.marginalia--crown {
    top: 12%;
    left: 5%;
    transform: rotate(-8deg);
}

.marginalia--padlock {
    top: 35%;
    right: 6%;
    transform: rotate(5deg);
}

.marginalia--quill {
    bottom: 30%;
    left: 4%;
    transform: rotate(-12deg);
}

.marginalia--star {
    bottom: 15%;
    right: 8%;
    transform: rotate(10deg);
}

/* Chapter divider */
.chapter-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.divider-line {
    display: block;
    width: 80px;
    height: 1px;
    background: var(--antique-gold);
}

.divider-gem {
    display: block;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, var(--hot-pink), var(--amethyst));
    transform: rotate(45deg);
}

.dust-jacket__content {
    max-width: 700px;
    margin: 0 auto;
}

.dust-jacket__text {
    margin-bottom: 1.8rem;
    color: var(--vault-brown);
}

.dust-jacket__text.annotation {
    font-family: 'Caveat', cursive;
    font-size: clamp(0.875rem, 1.4vw, 1.125rem);
    color: var(--vault-brown);
    opacity: 0.8;
    border-left: 2px solid var(--antique-gold);
    padding-left: 1.2rem;
    margin-top: 2rem;
}

/* Page corner decorations */
.page-corner {
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
}

.page-corner--left {
    left: 0;
    border-bottom: 40px solid var(--antique-gold);
    border-right: 40px solid transparent;
    opacity: 0.3;
}

.page-corner--right {
    right: 0;
    border-bottom: 40px solid var(--antique-gold);
    border-left: 40px solid transparent;
    opacity: 0.3;
}

/* ========================================
   HIDDEN TRACK
   ======================================== */

.track-trigger {
    height: 1px;
    width: 100%;
}

.hidden-track {
    width: 100%;
    background: var(--midnight-plum);
    height: 0;
    overflow: hidden;
    transition: height 0.8s ease;
}

.hidden-track.expanded {
    height: auto;
    min-height: 60vh;
}

.hidden-track__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(4rem, 8vw, 8rem) 2rem;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.hidden-track.expanded .hidden-track__content {
    opacity: 1;
    transform: scale(1);
}

.treasure-chest {
    width: clamp(120px, 20vw, 200px);
    height: auto;
    margin-bottom: 2rem;
}

.hidden-track__text {
    font-family: 'Caveat', cursive;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--antique-gold);
    margin-bottom: 1rem;
}

.hidden-track__copyright {
    font-family: 'Karla', sans-serif;
    font-size: 0.7rem;
    color: var(--antique-gold);
    opacity: 0.5;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.gem-blink {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--hot-pink);
    border-radius: 50%;
    animation: blink-gem 3s ease-in-out infinite;
}

@keyframes blink-gem {
    0%, 80%, 100% { opacity: 0.2; }
    90% { opacity: 1; box-shadow: 0 0 10px var(--hot-pink); }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 700px) {
    .shelf--left,
    .shelf--right {
        flex-direction: column;
    }

    .shelf__illustration {
        flex: 0 0 auto;
        max-width: 200px;
    }

    .marginalia {
        display: none;
    }
}
