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

:root {
    --color-rose: #d4877f;
    --color-slate-blue: #8faabe;
    --color-deep-navy: #2a3f52;
    --color-teal: #4fd1c5;
    --color-cream: #f0ebe3;
    --color-dark-teal: #1a3a4a;
    --color-abyss: #0b1a2a;
    --color-sky-blue: #7ec8d8;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    background: var(--color-abyss);
    color: var(--color-cream);
    overflow-x: hidden;
}

.caveat {
    font-family: 'Caveat', cursive;
}

/* Layers */
.layer {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Layer 1: Sky */
#layer-sky {
    background: linear-gradient(180deg, var(--color-slate-blue) 0%, var(--color-deep-navy) 100%);
}

#condensation-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

#condensation-field .droplet {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.1) 70%, transparent 100%);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1), inset 0 -1px 1px rgba(255,255,255,0.3);
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.frost-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(255,255,255,0.05) 70%);
    backdrop-filter: blur(1px);
    pointer-events: none;
    z-index: 2;
}

.site-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.05em;
    color: var(--color-cream);
    text-shadow: 0 0 40px rgba(127, 200, 216, 0.3);
    z-index: 3;
    opacity: 0;
    animation: fadeInTitle 2s ease-out 0.5s forwards;
}

.subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--color-sky-blue);
    opacity: 0;
    z-index: 3;
    margin-top: 0.5rem;
    animation: fadeInTitle 2s ease-out 1.2s forwards;
}

@keyframes fadeInTitle {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.scroll-hint {
    position: absolute;
    bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 3;
    opacity: 0;
    animation: fadeInTitle 2s ease-out 2s forwards;
}

.scroll-hint-text {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: var(--color-slate-blue);
}

.scroll-hint-arrow {
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, var(--color-slate-blue), transparent);
    animation: pulseDown 2s ease-in-out infinite;
}

@keyframes pulseDown {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(8px); opacity: 1; }
}

/* Layer 2: Cirrus */
#layer-cirrus {
    background: linear-gradient(180deg, var(--color-deep-navy) 0%, var(--color-dark-teal) 100%);
}

.cirrus-wisps {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.cirrus-wisps::before,
.cirrus-wisps::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: wisp 12s linear infinite;
}

.cirrus-wisps::before {
    top: 30%;
    left: -50%;
    animation-duration: 15s;
}

.cirrus-wisps::after {
    top: 60%;
    left: -80%;
    animation-duration: 20s;
    height: 2px;
    opacity: 0.5;
}

@keyframes wisp {
    from { transform: translateX(-20%); }
    to { transform: translateX(20%); }
}

/* Layer 3: Stratus */
#layer-stratus {
    background: linear-gradient(180deg, var(--color-dark-teal) 0%, #15303d 100%);
}

.fog-dense {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 40% at 20% 50%, rgba(143,170,190,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 70% 40%, rgba(127,200,216,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 100% 30% at 50% 80%, rgba(212,135,127,0.06) 0%, transparent 50%);
    animation: fogPulse 8s ease-in-out infinite alternate;
}

@keyframes fogPulse {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* Layer 4: Surface */
#layer-surface {
    background: linear-gradient(180deg, #15303d 0%, var(--color-abyss) 100%);
}

.wave-field {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 40px,
            rgba(79,209,197,0.03) 40px,
            rgba(79,209,197,0.03) 41px
        );
    animation: waveShift 6s ease-in-out infinite alternate;
}

@keyframes waveShift {
    from { transform: translateX(-5px) skewY(-0.5deg); }
    to { transform: translateX(5px) skewY(0.5deg); }
}

.sea-stones {
    position: absolute;
    bottom: 10%;
    display: flex;
    gap: 2rem;
    z-index: 2;
}

.stone {
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: linear-gradient(135deg, var(--color-deep-navy), #3a5568);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.05);
}

.stone-1 { width: 60px; height: 45px; transform: rotate(-5deg); }
.stone-2 { width: 80px; height: 55px; transform: rotate(3deg); }
.stone-3 { width: 50px; height: 38px; transform: rotate(-8deg); }

/* Layer 5: Abyss */
#layer-abyss {
    background: radial-gradient(ellipse at center bottom, #0d2233 0%, var(--color-abyss) 70%);
}

.abyss-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Layer content */
.layer-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 600px;
    padding: 2rem;
}

.layer-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.layer-text {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.8;
    color: rgba(240, 235, 227, 0.75);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.layer.visible .layer-title,
.layer.visible .layer-text {
    opacity: 1;
    transform: translateY(0);
}

/* Resurface button */
.resurface-btn {
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: var(--color-cream);
    background: linear-gradient(135deg, var(--color-deep-navy), var(--color-dark-teal));
    border: 1px solid rgba(79,209,197,0.3);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}

.resurface-btn:hover {
    background: linear-gradient(135deg, var(--color-dark-teal), var(--color-deep-navy));
    border-color: var(--color-teal);
    box-shadow: 0 4px 30px rgba(79,209,197,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
    transform: translateY(-2px);
}
