/* okurairi.com - Victorian Conservatory Horizontal Scroll */
/* Palette */
:root {
    --fired-terracotta: #C2704E;
    --kiln-shadow: #5B2E1A;
    --bleached-linen: #F5EDDF;
    --copper-patina: #7A9E7E;
    --verdigris-wash: #4A7C6B;
    --gilded-leaf: #D4A84B;
    --ink-dark: #2B1810;
    --faded-script: #8B7363;
}

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

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

body {
    font-family: 'Source Serif 4', Georgia, serif;
    color: var(--ink-dark);
    background-color: var(--fired-terracotta);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Paper grain overlay */
.paper-grain {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

/* Horizontal scroll container */
.horizontal-scroll {
    display: flex;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

/* Room base */
.room {
    flex: 0 0 100vw;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

.room-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ========================================
   Room 1: Entry Vestibule
   ======================================== */
.room-vestibule {
    background: var(--fired-terracotta);
    background-image:
        radial-gradient(ellipse at 30% 50%, rgba(91, 46, 26, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 50%, rgba(212, 168, 75, 0.08) 0%, transparent 50%);
}

.leaf-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.border-path {
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    animation: drawBorder 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.border-top { animation-delay: 0s; }
.border-right { animation-delay: 0.3s; }
.border-bottom { animation-delay: 0.6s; }
.border-left { animation-delay: 0.9s; }

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

.corner-leaf {
    opacity: 0;
    animation: fadeLeaf 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.corner-tl { animation-delay: 1.2s; }
.corner-tr { animation-delay: 1.4s; }
.corner-bl { animation-delay: 1.6s; }
.corner-br { animation-delay: 1.8s; }

@keyframes fadeLeaf {
    to { opacity: 0.6; }
}

.vestibule-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: -0.03em;
    color: var(--bleached-linen);
    z-index: 2;
    text-align: center;
    line-height: 1;
    text-shadow: 0 4px 30px rgba(43, 24, 16, 0.3);
}

.vestibule-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.5rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gilded-leaf);
    position: absolute;
    bottom: 18vh;
    z-index: 2;
}

.room-vestibule .room-inner {
    flex-direction: column;
    gap: 1rem;
}

/* Scroll hint arrow */
.scroll-hint {
    position: absolute;
    right: 3vw;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    animation: pulseArrow 2s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes pulseArrow {
    0%, 100% { transform: translateY(-50%) translateX(0); opacity: 0.4; }
    50% { transform: translateY(-50%) translateX(6px); opacity: 0.8; }
}

/* ========================================
   Threshold Strips
   ======================================== */
.threshold {
    flex: 0 0 15vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg,
        var(--fired-terracotta) 0%,
        var(--kiln-shadow) 40%,
        var(--kiln-shadow) 60%,
        var(--fired-terracotta) 100%
    );
    position: relative;
    scroll-snap-align: none;
}

.threshold-leaf {
    width: 30px;
    height: 45px;
    animation: rotateLeaf 20s linear infinite;
    opacity: 0.4;
}

@keyframes rotateLeaf {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   Gallery Rooms
   ======================================== */
.room-gallery {
    background: var(--bleached-linen);
}

.room-gallery:nth-child(odd) {
    background: var(--fired-terracotta);
}

.room-gallery:nth-child(odd) .room-title {
    color: var(--bleached-linen);
}

.room-gallery:nth-child(odd) .room-body {
    color: var(--bleached-linen);
}

.gallery-split {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
}

.gallery-left-image {
    flex-direction: row;
}

.gallery-right-image {
    flex-direction: row-reverse;
}

.gallery-visual {
    flex: 0 0 60%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 6vh 4vw;
}

.gallery-text {
    flex: 0 0 40%;
    padding: 6vh 4vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.room-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: -0.03em;
    color: var(--kiln-shadow);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.room-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    line-height: 1.72;
    color: var(--ink-dark);
    max-width: 38ch;
}

/* Gallery image frame */
.gallery-image {
    width: 100%;
    height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
        rgba(91, 46, 26, 0.1) 0%,
        rgba(194, 112, 78, 0.15) 50%,
        rgba(139, 115, 99, 0.1) 100%
    );
    border-radius: 2px;
}

.placeholder-svg {
    width: 70%;
    height: auto;
    opacity: 0.7;
}

/* Victorian Corner Brackets */
.corner-bracket {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.6;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.gallery-visual:hover .corner-bracket {
    opacity: 1;
}

.corner-bracket::before,
.corner-bracket::after {
    content: '';
    position: absolute;
    background: var(--gilded-leaf);
}

.corner-bracket-tl {
    top: 4vh;
    left: 3vw;
}
.corner-bracket-tl::before {
    top: 0; left: 0;
    width: 30px; height: 1.5px;
}
.corner-bracket-tl::after {
    top: 0; left: 0;
    width: 1.5px; height: 30px;
}

.corner-bracket-tr {
    top: 4vh;
    right: 3vw;
}
.corner-bracket-tr::before {
    top: 0; right: 0;
    width: 30px; height: 1.5px;
}
.corner-bracket-tr::after {
    top: 0; right: 0;
    width: 1.5px; height: 30px;
}

.corner-bracket-bl {
    bottom: 4vh;
    left: 3vw;
}
.corner-bracket-bl::before {
    bottom: 0; left: 0;
    width: 30px; height: 1.5px;
}
.corner-bracket-bl::after {
    bottom: 0; left: 0;
    width: 1.5px; height: 30px;
}

.corner-bracket-br {
    bottom: 4vh;
    right: 3vw;
}
.corner-bracket-br::before {
    bottom: 0; right: 0;
    width: 30px; height: 1.5px;
}
.corner-bracket-br::after {
    bottom: 0; right: 0;
    width: 1.5px; height: 30px;
}

/* ========================================
   Room 5: Conservatory
   ======================================== */
.room-conservatory {
    background: var(--kiln-shadow);
}

.conservatory-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(122, 158, 126, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(74, 124, 107, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(194, 112, 78, 0.1) 0%, transparent 70%);
}

.frosted-strip {
    position: relative;
    z-index: 2;
    background: rgba(245, 237, 223, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 5vh 5vw;
    max-width: 65vw;
    border: 1px solid rgba(212, 168, 75, 0.15);
    border-radius: 2px;
}

.room-conservatory .room-title {
    color: var(--bleached-linen);
    font-size: clamp(2rem, 5vw, 4rem);
}

.room-conservatory .room-body {
    color: var(--bleached-linen);
    opacity: 0.85;
}

/* Cursor-follow trail leaves */
.cursor-leaves {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.trail-leaf {
    position: absolute;
    width: 20px;
    height: 30px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease;
    will-change: transform, opacity;
}

/* ========================================
   Room 6: Final Gallery
   ======================================== */
#room6 {
    background: var(--bleached-linen);
}

#room6 .room-title {
    color: var(--kiln-shadow);
}

#room6 .room-body {
    color: var(--ink-dark);
}

/* ========================================
   Entry Animations
   ======================================== */
.anim-entry {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.anim-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-image {
    transform: scale(1.03);
    transition: transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-image.visible {
    transform: scale(1);
}

/* Bracket clip-path reveal */
.corner-bracket {
    clip-path: inset(0 100% 100% 0);
    transition: clip-path 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.corner-bracket.visible {
    clip-path: inset(0 0 0 0);
}

.corner-bracket-tr {
    clip-path: inset(0 0 100% 100%);
}
.corner-bracket-tr.visible {
    clip-path: inset(0 0 0 0);
}

.corner-bracket-bl {
    clip-path: inset(100% 100% 0 0);
}
.corner-bracket-bl.visible {
    clip-path: inset(0 0 0 0);
}

.corner-bracket-br {
    clip-path: inset(100% 0 0 100%);
}
.corner-bracket-br.visible {
    clip-path: inset(0 0 0 0);
}

/* ========================================
   Progress Vine Bar
   ======================================== */
.progress-vine {
    position: fixed;
    bottom: 2vh;
    left: 10vw;
    right: 10vw;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.vine-line {
    width: 100%;
    height: 2px;
    background: rgba(212, 168, 75, 0.2);
    border-radius: 1px;
    position: relative;
    overflow: hidden;
}

.vine-fill {
    height: 100%;
    width: 0%;
    background: var(--gilded-leaf);
    border-radius: 1px;
    transition: width 0.4s ease;
}

.vine-markers {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 2%;
}

.vine-marker {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px;
}

.marker-num {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.6rem, 0.8vw, 0.75rem);
    letter-spacing: 0.15em;
    color: var(--faded-script);
    transition: color 0.3s ease;
}

.vine-marker.active .marker-num {
    color: var(--gilded-leaf);
}

.marker-leaf {
    width: 12px;
    height: 18px;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.vine-marker.active .marker-leaf path {
    opacity: 0.8;
}

.vine-marker:hover .marker-num {
    color: var(--gilded-leaf);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .gallery-split {
        flex-direction: column;
    }

    .gallery-right-image {
        flex-direction: column;
    }

    .gallery-visual {
        flex: 0 0 50%;
    }

    .gallery-text {
        flex: 0 0 50%;
        padding: 3vh 6vw;
    }

    .room-body {
        max-width: 50ch;
    }

    .threshold {
        flex: 0 0 20vw;
    }

    .vestibule-title {
        font-size: clamp(3rem, 15vw, 6rem);
    }

    .frosted-strip {
        max-width: 85vw;
        padding: 4vh 6vw;
    }

    .progress-vine {
        left: 5vw;
        right: 5vw;
        bottom: 1.5vh;
    }
}

/* ========================================
   Linen texture for light panels
   ======================================== */
.room-gallery:nth-child(even) {
    background-image:
        url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10h20M10 0v20' stroke='%238B7363' stroke-width='0.15' opacity='0.08'/%3E%3C/svg%3E"),
        linear-gradient(to bottom, var(--bleached-linen), var(--bleached-linen));
}

/* Terracotta texture for warm panels */
.room-gallery:nth-child(odd) {
    background-image:
        radial-gradient(circle at 30% 40%, rgba(91, 46, 26, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(212, 168, 75, 0.05) 0%, transparent 50%);
}
