/* bada.casa - Mediterranean Coastal Villa */
/* Palette: #faf8f4, #f0ebe0, #c4703f, #5e98b0, #6b7c53, #5c4033, #d4a852, #e5dac8 */

:root {
    --whitewash: #faf8f4;
    --linen: #f0ebe0;
    --terracotta: #c4703f;
    --ocean: #5e98b0;
    --olive: #6b7c53;
    --timber: #5c4033;
    --gold: #d4a852;
    --sand: #e5dac8;
    --scroll-offset: 0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--whitewash);
    color: var(--timber);
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ========================================
   LINEN TEXTURE OVERLAY
   ======================================== */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(45deg, rgba(0,0,0,0.02) 0px, transparent 1px, transparent 3px),
        repeating-linear-gradient(135deg, rgba(0,0,0,0.02) 0px, transparent 1px, transparent 3px);
    pointer-events: none;
    z-index: 9999;
}

/* ========================================
   ROOMS - Base Styles
   ======================================== */

.room {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6rem 2rem;
    gap: 3rem;
    z-index: 1;
}

/* ========================================
   THE ENTRANCE
   ======================================== */

.entrance {
    min-height: 100vh;
    justify-content: center;
    background: linear-gradient(
        180deg,
        rgba(212, 168, 82, 0.1) 0%,
        rgba(196, 112, 63, 0.04) 30%,
        var(--whitewash) 70%
    );
}

.vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse 70% 70% at center,
        transparent 40%,
        rgba(240, 235, 224, 0.7) 100%
    );
    pointer-events: none;
}

/* Archway Base */
.archway {
    border-radius: 50% 50% 0 0;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Archway */
.arch-hero {
    width: 300px;
    height: 440px;
    position: relative;
}

.arch-border-draw {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50% 50% 0 0;
    border: 1.5px solid var(--sand);
    opacity: 0;
    animation: archDraw 1.8s ease forwards 0.3s;
}

@keyframes archDraw {
    0% {
        opacity: 0;
        clip-path: inset(100% 0 0 0);
    }
    40% {
        opacity: 1;
        clip-path: inset(20% 0 0 0);
    }
    100% {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

.arch-ocean-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(
        180deg,
        rgba(94, 152, 176, 0.25) 0%,
        rgba(94, 152, 176, 0.08) 60%,
        transparent 100%
    );
    opacity: 0;
    animation: oceanReveal 2s ease forwards 1.2s;
}

@keyframes oceanReveal {
    to { opacity: 1; }
}

.arch-content {
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 2rem;
}

.brand-name {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    color: var(--timber);
    font-weight: 400;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 1s ease forwards 1.6s;
}

.brand-sub {
    font-family: 'Cormorant', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 1.15rem;
    color: var(--terracotta);
    margin-top: 0.6rem;
    letter-spacing: 0.15em;
    opacity: 0;
    animation: fadeUp 1s ease forwards 2s;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Olive Branch SVG */
.olive-branch {
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeIn 1s ease forwards 2.4s;
}

@keyframes fadeIn {
    to { opacity: 0.7; }
}

.olive-stem {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawPath 2.5s ease forwards 2.6s;
}

.olive-leaf {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
}

.leaf-1 { animation: drawPath 0.8s ease forwards 3.0s; }
.leaf-2 { animation: drawPath 0.8s ease forwards 3.2s; }
.leaf-3 { animation: drawPath 0.8s ease forwards 3.4s; }
.leaf-4 { animation: drawPath 0.8s ease forwards 3.6s; }
.leaf-5 { animation: drawPath 0.8s ease forwards 3.8s; }

.olive-fruit {
    opacity: 0;
    animation: fruitAppear 0.6s ease forwards 4.0s;
}

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

@keyframes fruitAppear {
    to { opacity: 0.35; }
}

/* Scroll Hint */
.scroll-hint {
    position: absolute;
    bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: fadeIn 1s ease forwards 4.2s;
}

.scroll-hint-line {
    display: block;
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, transparent, var(--sand));
    animation: scrollPulse 2s ease-in-out infinite 4.5s;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 0.7; transform: scaleY(1.3); }
}

/* ========================================
   THE LIVING SPACES
   ======================================== */

.living {
    background: var(--whitewash);
    padding-top: 4rem;
    padding-bottom: 4rem;
}

/* Terracotta Dividers */
.terracotta-divider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 600px;
}

.terracotta-divider-wide {
    max-width: 700px;
}

.tc-line {
    flex: 1;
    height: 1px;
    background: var(--sand);
}

.tc-line-short {
    width: 20px;
    height: 1px;
    background: var(--sand);
}

.tc-dot {
    width: 5px;
    height: 5px;
    background: var(--terracotta);
    flex-shrink: 0;
}

.tc-diamond {
    width: 6px;
    height: 6px;
    background: var(--terracotta);
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* Room Pairs */
.room-pair {
    display: flex;
    gap: 2.5rem;
    max-width: 850px;
    width: 100%;
    align-items: flex-start;
}

.room-pair-reverse {
    flex-direction: row-reverse;
}

/* Stagger Animation */
.stagger-pair {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.stagger-pair.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-pair .panel-small {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.stagger-pair.visible .panel-small {
    opacity: 1;
    transform: translateY(0);
}

/* Panels */
.panel {
    position: relative;
}

.panel-large {
    flex: 3;
    padding: 2.5rem;
    background: var(--whitewash);
}

.shadow-panel {
    box-shadow:
        calc(var(--scroll-offset, 0) * 10px + 8px)
        calc(var(--scroll-offset, 0) * 5px + 15px)
        45px
        rgba(229, 218, 200, 0.5);
    transition: box-shadow 0.3s ease;
}

.panel-small {
    flex: 2;
    padding: 1.5rem;
    margin-top: 3.5rem;
}

.room-title {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 400;
    color: var(--timber);
    margin-bottom: 0.8rem;
}

.room-body {
    font-family: 'Jost', sans-serif;
    font-size: 0.92rem;
    line-height: 1.8;
    color: rgba(92, 64, 51, 0.72);
}

/* Small Archway */
.arch-small {
    width: 170px;
    height: 240px;
    border: 1px solid var(--sand);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
}

.arch-small-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(94, 152, 176, 0.08) 0%,
        transparent 50%
    );
    border-radius: 50% 50% 0 0;
}

.arch-small-warm {
    background: linear-gradient(
        180deg,
        rgba(212, 168, 82, 0.1) 0%,
        transparent 50%
    );
}

.arch-quote {
    font-family: 'Cormorant', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 1.05rem;
    color: var(--terracotta);
    text-align: center;
    padding: 1.2rem;
    line-height: 1.5;
    position: relative;
    z-index: 2;
}

/* Tile Pattern */
.tile-pattern-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 180px;
}

.tile-pattern {
    width: 140px;
    height: 140px;
    background:
        repeating-conic-gradient(
            var(--terracotta) 0% 25%,
            var(--linen) 0% 50%
        ) 50% / 18px 18px;
    opacity: 0.18;
    border-radius: 2px;
}

/* ========================================
   THE TERRACE
   ======================================== */

.terrace {
    background: linear-gradient(
        180deg,
        var(--whitewash) 0%,
        var(--linen) 15%,
        var(--linen) 85%,
        var(--whitewash) 100%
    );
    min-height: 80vh;
    padding: 8rem 2rem;
}

.olive-band {
    width: 100%;
    max-width: 700px;
    opacity: 0.6;
}

.olive-band-stem {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 2s ease;
}

.olive-band-stem.drawn {
    stroke-dashoffset: 0;
}

.olive-band-stem-2 {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 2.5s ease 0.3s;
}

.olive-band-stem-2.drawn {
    stroke-dashoffset: 0;
}

.terrace-content {
    max-width: 580px;
    text-align: center;
}

.terrace-title {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 400;
    color: var(--timber);
    margin-bottom: 1.2rem;
}

.terrace-body {
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    line-height: 1.9;
    color: rgba(92, 64, 51, 0.65);
}

.terrace-accent {
    margin-top: 2rem;
    opacity: 0.5;
}

/* Ocean Hint */
.terrace-ocean-hint {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 500px;
    margin-top: 1rem;
}

.ocean-line {
    height: 1px;
    border-radius: 1px;
}

.ocean-line-1 {
    background: linear-gradient(90deg, transparent 10%, var(--ocean) 50%, transparent 90%);
    opacity: 0.2;
    width: 80%;
    margin: 0 auto;
}

.ocean-line-2 {
    background: linear-gradient(90deg, transparent 15%, var(--ocean) 50%, transparent 85%);
    opacity: 0.15;
    width: 60%;
    margin: 0 auto;
}

.ocean-line-3 {
    background: linear-gradient(90deg, transparent 20%, var(--ocean) 50%, transparent 80%);
    opacity: 0.1;
    width: 40%;
    margin: 0 auto;
}

/* ========================================
   THE VIEW
   ======================================== */

.view {
    background: var(--whitewash);
    min-height: 90vh;
    justify-content: center;
    padding: 8rem 2rem;
}

.arch-final {
    width: 340px;
    height: 480px;
    border: 1.5px solid var(--sand);
    flex-direction: column;
}

.arch-sea {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        var(--whitewash) 10%,
        rgba(94, 152, 176, 0.08) 35%,
        rgba(94, 152, 176, 0.18) 60%,
        rgba(94, 152, 176, 0.3) 85%,
        rgba(94, 152, 176, 0.4) 100%
    );
}

.view-statement {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--timber);
    text-align: center;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

.tc-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2rem;
    position: relative;
    z-index: 2;
}

.view-closing {
    font-family: 'Cormorant', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 1rem;
    color: var(--terracotta);
    margin-top: 3rem;
    opacity: 0;
    transition: opacity 1s ease;
    letter-spacing: 0.1em;
}

.view-closing.visible {
    opacity: 0.6;
}

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

@media (max-width: 768px) {
    .room {
        padding: 4rem 1.5rem;
        gap: 2rem;
    }

    .room-pair,
    .room-pair-reverse {
        flex-direction: column;
        gap: 1.5rem;
    }

    .panel-small {
        margin-top: 0;
    }

    .panel-large {
        padding: 1.8rem;
    }

    .arch-hero {
        width: 230px;
        height: 340px;
    }

    .arch-final {
        width: 270px;
        height: 390px;
    }

    .arch-small {
        width: 140px;
        height: 200px;
    }

    .terrace {
        padding: 5rem 1.5rem;
    }

    .view {
        padding: 5rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .arch-hero {
        width: 200px;
        height: 300px;
    }

    .arch-final {
        width: 240px;
        height: 350px;
    }

    .brand-name {
        font-size: 1.8rem;
    }

    .terrace-title {
        font-size: 1.8rem;
    }

    .view-statement {
        font-size: 1rem;
    }

    .olive-branch svg {
        width: 160px;
        height: 40px;
    }
}
