/* ========================================
   saram.ai — Art Deco Abyssal
   ======================================== */

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

:root {
    --hadal-midnight: #0a0e27;
    --abyssal-indigo: #131b3a;
    --pale-gold: #e8d5a3;
    --bio-teal: #4fd1c5;
    --deep-cerulean: #2b6cb0;
    --silver-mist: #c8d6e5;
    --seafoam: #81d8cf;
    --warm-anemone: #d4a96e;
    --coral-pulse: #fc8181;
    --cerulean-light: #63b3ed;
    --gold-muted: #c9a96e;
    --frosted-deep: rgba(19, 27, 58, 0.7);
    --navy-mid: #1a365d;
    --abyss-floor: #060a1e;
    --scroll: 0;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    background: var(--hadal-midnight);
    color: var(--silver-mist);
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.85;
    overflow-x: hidden;
    min-height: 700vh;
}

/* ---- Layer 0: The Abyss ---- */
#abyss {
    position: fixed;
    inset: 0;
    z-index: -100;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(79,209,197,0.15), transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(43,108,176,0.15), transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(212,169,110,0.08), transparent 60%),
        linear-gradient(180deg, #0a0e27 0%, #131b3a 40%, #1a365d 100%);
    filter: blur(80px);
    animation: abyss-drift 120s ease-in-out infinite alternate;
}

@keyframes abyss-drift {
    0% { transform: translate(0, 0) scale(1.1); }
    33% { transform: translate(-3%, 2%) scale(1.15); }
    66% { transform: translate(2%, -1%) scale(1.1); }
    100% { transform: translate(-1%, 3%) scale(1.12); }
}

/* ---- Layer 1: Bioluminescent Grid ---- */
#bio-grid {
    position: fixed;
    inset: 0;
    z-index: -50;
    pointer-events: none;
}

.grid-chevron {
    position: absolute;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(201,169,110,0.15); /* #c9a96e */
    transform: rotate(45deg);
}

.grid-chevron-1 {
    top: 10%;
    left: 15%;
    width: 200px;
    height: 200px;
}

.grid-chevron-2 {
    top: 40%;
    right: 10%;
    width: 350px;
    height: 350px;
}

.grid-chevron-3 {
    bottom: 15%;
    left: 30%;
    width: 150px;
    height: 150px;
}

/* ---- Layer 4: Surface Refraction ---- */
#surface-refraction {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(232,213,163,0.06), transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(79,209,197,0.05), transparent 50%);
    mix-blend-mode: overlay;
    animation: refraction-shift 60s ease-in-out infinite alternate;
}

@keyframes refraction-shift {
    0% { background-position: 0% 0%, 100% 100%; }
    100% { background-position: 100% 100%, 0% 0%; }
}

/* ---- Layer 3: Particles ---- */
#particles {
    position: fixed;
    inset: 0;
    z-index: 25;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    animation: rise linear infinite;
    opacity: 0;
}

@keyframes rise {
    0% { transform: translateY(100vh) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) translateX(20px); opacity: 0; }
}

/* ---- Cursor Glow ---- */
#cursor-glow {
    position: fixed;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79,209,197,0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 60;
    transform: translate(-50%, -50%);
    transition: left 0.2s ease-out, top 0.2s ease-out;
    display: none;
}

/* ---- 사람 Watermark ---- */
#saram-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 100;
    font-size: 20vw;
    color: rgba(232,213,163,0.03);
    z-index: -40;
    pointer-events: none;
    animation: watermark-drift 90s ease-in-out infinite alternate;
}

@keyframes watermark-drift {
    0% { transform: translate(-50%, -50%) translateX(0); }
    50% { transform: translate(-50%, -50%) translateX(5vw); }
    100% { transform: translate(-50%, -50%) translateX(-3vw); }
}

/* ---- Monogram ---- */
#monogram {
    position: fixed;
    top: 24px;
    left: 24px;
    font-family: 'Poiret One', cursive;
    font-size: 1.4rem;
    color: var(--pale-gold);
    letter-spacing: 0.1em;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.6s ease;
    cursor: default;
    text-shadow: 0 0 20px rgba(201,169,110,0.3);
}

#monogram.visible {
    opacity: 1;
}

/* ---- Depth Indicator ---- */
#depth-indicator {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    height: 200px;
}

#depth-line {
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--pale-gold), var(--cerulean-light), var(--deep-cerulean));
    border-radius: 1px;
    position: relative;
    animation: depth-pulse 4s ease-in-out infinite;
}

@keyframes depth-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.depth-label {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 400;
    font-size: 0.6rem;
    color: var(--seafoam);
    opacity: 0.4;
    letter-spacing: 0.05em;
    position: absolute;
    right: 12px;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.depth-label[data-depth="0"] { top: 0; }
.depth-label[data-depth="1"] { top: 33%; }
.depth-label[data-depth="2"] { top: 66%; }
.depth-label[data-depth="3"] { bottom: 0; }

.depth-label.active {
    opacity: 1;
    color: var(--pale-gold);
}

/* ---- Acts ---- */
.act {
    position: relative;
    z-index: 1;
    scroll-snap-align: start;
}

/* ---- ACT I ---- */
#act-1 {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#title-container {
    text-align: center;
    position: relative;
}

/* Sunburst */
#sunburst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#sunburst::before,
#sunburst::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 0;
    background: rgba(232,213,163,0.4);
    transform-origin: top center;
    animation: sunburst-extend 2s ease-out 1.5s forwards;
}

#title-korean {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 100;
    font-size: 15vw;
    color: var(--pale-gold);
    opacity: 0;
    animation: fade-in 3s ease-in 1.2s forwards;
    text-shadow: 0 0 60px rgba(201,169,110,0.3);
    position: relative;
    z-index: 2;
}

#title-latin {
    font-family: 'Poiret One', cursive;
    font-size: 3vw;
    color: var(--pale-gold);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    animation: fade-in 2s ease-in 1.7s forwards;
    text-shadow: 0 0 40px rgba(201,169,110,0.3);
    position: relative;
    z-index: 2;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes sunburst-extend {
    to { height: 250px; }
}

#scroll-invite {
    position: absolute;
    bottom: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    animation: fade-in 1.5s ease-in 4s forwards;
}

.invite-text {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--seafoam);
    letter-spacing: 0.1em;
}

.scroll-chevron {
    width: 20px;
    height: 20px;
    border-right: 1.5px solid var(--pale-gold);
    border-bottom: 1.5px solid var(--pale-gold);
    transform: rotate(45deg);
    animation: chevron-pulse 2s ease-in-out infinite;
}

@keyframes chevron-pulse {
    0%, 100% { opacity: 0.4; transform: rotate(45deg) translateY(0); }
    50% { opacity: 1; transform: rotate(45deg) translateY(5px); }
}

/* ---- ACT II ---- */
#act-2 {
    min-height: 200vh;
    padding: 10vh 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 120px;
}

.content-vessel {
    max-width: 720px;
    width: 100%;
    background: var(--frosted-deep);
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    border: 1px solid rgba(201,169,110,0.15);
    padding: 60px 48px;
    position: relative;
    clip-path: polygon(50% 0%, 100% 8%, 100% 100%, 0% 100%, 0% 8%);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s ease, transform 0.8s ease, border-color 0.4s ease;
}

.content-vessel.visible {
    opacity: 1;
    transform: scale(1);
}

.content-vessel:hover {
    transform: scale(1.03);
    border-color: rgba(201,169,110,0.4);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s ease;
}

.vessel-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 180deg at 50% 50%, #e8d5a3 0deg, transparent 60deg, #4fd1c5 180deg, transparent 240deg, #e8d5a3 360deg);
    opacity: 0;
    filter: blur(60px);
    transition: opacity 0.6s ease;
    pointer-events: none;
    z-index: -1;
}

.content-vessel:hover .vessel-glow {
    opacity: 0.08;
}

.vessel-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(2.8rem, 7vw, 6rem);
    color: var(--pale-gold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 0 40px rgba(201,169,110,0.3);
    margin-bottom: 8px;
    line-height: 1.2;
}

.vessel-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: var(--seafoam);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 32px;
}

.vessel-body {
    color: var(--silver-mist);
    margin-bottom: 20px;
    font-weight: 300;
    line-height: 1.85;
}

.vessel-body:last-child {
    margin-bottom: 0;
}

/* Korean body text slightly larger */
.vessel-body:lang(ko) {
    font-size: 120%;
}

/* Stagger entrance for Act II vessels */
.vessel-1.visible { transition-delay: 0s; }
.vessel-2.visible { transition-delay: 0.2s; }
.vessel-3.visible { transition-delay: 0.4s; }

/* ---- ACT III ---- */
#act-3 {
    min-height: 200vh;
    padding: 10vh 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 140px;
}

.depth-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    width: 100%;
}

.depth-ring-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.depth-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow:
        0 0 0 1px rgba(232,213,163,0.3),
        0 0 0 8px rgba(232,213,163,0.15),
        0 0 0 20px rgba(232,213,163,0.08),
        0 0 0 36px rgba(232,213,163,0.04),
        0 0 0 56px rgba(232,213,163,0.02);
    animation: ring-breathe 8s ease-in-out infinite;
}

@keyframes ring-breathe {
    0%, 100% { transform: scale(0.98); }
    50% { transform: scale(1.02); }
}

.korean-callout {
    position: absolute;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 100;
    font-size: 3rem;
    color: var(--warm-anemone);
    text-shadow: 0 0 30px rgba(212,169,110,0.4);
}

.vessel-wide {
    max-width: 720px;
    clip-path: polygon(50% 0%, 98% 5%, 100% 100%, 0% 100%, 2% 5%);
}

/* ---- ACT IV ---- */
#act-4 {
    min-height: 150vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10vh 48px;
    position: relative;
}

#abyss-organism {
    position: absolute;
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background:
        radial-gradient(circle at 40% 40%, rgba(79,209,197,0.3), transparent 50%),
        radial-gradient(circle at 60% 60%, rgba(43,108,176,0.25), transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(212,169,110,0.15), transparent 40%);
    mix-blend-mode: screen;
    filter: blur(30px);
    animation: organism-pulse 10s ease-in-out infinite;
    z-index: 0;
}

@keyframes organism-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.vessel-ornate {
    max-width: 720px;
    text-align: center;
    clip-path: polygon(50% 0%, 95% 6%, 100% 15%, 100% 92%, 95% 100%, 5% 100%, 0% 92%, 0% 15%, 5% 6%);
    z-index: 1;
    padding: 80px 60px;
}

.synthesis-line {
    font-family: 'Poiret One', cursive;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    color: var(--pale-gold);
    letter-spacing: 0.06em;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    text-shadow: 0 0 30px rgba(201,169,110,0.2);
}

.synthesis-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.final-line {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 100;
    color: var(--warm-anemone);
    font-size: clamp(1.2rem, 2.5vw, 2rem);
}

/* ---- ACT V ---- */
#act-5 {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--abyss-floor) 0%, var(--abyssal-indigo) 60%, rgba(26,54,93,0.3) 100%);
}

#resurface-container {
    text-align: center;
}

#resurface-title {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 100;
    font-size: 10vw;
    color: var(--pale-gold);
    text-shadow: 0 0 60px rgba(201,169,110,0.3);
    opacity: 0;
    transition: opacity 1s ease;
}

#resurface-title.visible {
    opacity: 1;
}

#resurface-latin {
    font-family: 'Poiret One', cursive;
    font-size: 2vw;
    color: var(--pale-gold);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 40px;
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

#resurface-latin.visible {
    opacity: 1;
}

#rise-link {
    display: inline-block;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    color: var(--bio-teal);
    text-decoration: none;
    letter-spacing: 0.1em;
    padding: 12px 32px;
    border: 1px solid rgba(79,209,197,0.3);
    transition: border-color 0.3s ease, color 0.3s ease;
}

#rise-link:hover {
    border-color: var(--bio-teal);
    color: var(--pale-gold);
}

/* ---- Sunburst CSS rays ---- */
.sunburst-ray {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 0;
    background: rgba(232,213,163,0.4);
    transform-origin: top center;
}

.sunburst-ray.animate {
    animation: ray-extend 1.5s ease-out forwards;
}

@keyframes ray-extend {
    to { height: 220px; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    #act-2, #act-3 {
        padding: 10vh 24px;
    }

    .content-vessel {
        padding: 40px 28px;
        clip-path: polygon(50% 0%, 100% 5%, 100% 100%, 0% 100%, 0% 5%);
    }

    .vessel-ornate {
        padding: 50px 28px;
    }

    .vessel-title {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    #depth-indicator {
        display: none;
    }
}
