/* sora.garden - Evolved Minimal Dark Gallery */

/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
    /* Palette from DESIGN.md */
    --midnight-indigo: #0a1428;
    --gallery-dark: #141e32;
    --moonlight-white: #e0e4ea;
    --shibori-blue: #3a5a8a;
    --shell-pink: #c4848a;
    --pojagi-gold: #b8a468;
    --deep-navy: #0e1830;
    --panel-border: #2a3a5a;

    /* Cursor spotlight position */
    --mouse-x: 50%;
    --mouse-y: 50%;

    /* Typography */
    --font-headline: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-cultural-kr: 'Noto Serif KR', serif;
    --font-cultural-jp: 'Noto Serif JP', serif;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--midnight-indigo);
    color: var(--moonlight-white);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
}

/* ========================================
   Cursor Spotlight Overlay
   ======================================== */
#spotlight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: radial-gradient(
        circle 200px at var(--mouse-x) var(--mouse-y),
        rgba(58, 90, 138, 0.15),
        transparent
    );
    opacity: 0;
    transition: opacity 0.8s ease;
}

#spotlight-overlay.active {
    opacity: 1;
}

/* ========================================
   Hidden Cultural Pattern Layer
   ======================================== */
#pattern-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.5s ease;
}

#pattern-layer.revealed {
    opacity: 1;
}

/* Mask the pattern layer so it's only visible near the cursor */
#pattern-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle 250px at var(--mouse-x) var(--mouse-y),
        transparent 0%,
        var(--midnight-indigo) 100%
    );
}

/* ========================================
   Full-Bleed Sections
   ======================================== */
.full-bleed {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    position: relative;
}

/* ========================================
   Hero Section
   ======================================== */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--midnight-indigo);
    position: relative;
    z-index: 10;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 11;
}

.hero-title {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(48px, 10vw, 120px);
    letter-spacing: 0.4em;
    color: var(--moonlight-white);
    opacity: 0;
    transform: translateY(10px);
}

.hero-title.visible {
    animation: heroTitleIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes heroTitleIn {
    0% {
        opacity: 0;
        letter-spacing: 0.4em;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        letter-spacing: 0.15em;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-family: var(--font-cultural-jp);
    font-weight: 400;
    font-size: clamp(14px, 2vw, 22px);
    letter-spacing: 0.3em;
    color: var(--moonlight-white);
    opacity: 0;
    margin-top: 24px;
}

.hero-subtitle.visible {
    animation: subtitleIn 1s ease forwards;
}

@keyframes subtitleIn {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 0.7;
        transform: translateY(0);
    }
}

/* ========================================
   Collage Sections
   ======================================== */
.collage-section {
    min-height: 100vh;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
}

.collage-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    min-height: 600px;
    padding: 40px;
}

/* ========================================
   Collage Fragments
   ======================================== */
.collage-fragment {
    position: absolute;
    opacity: 0;
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(30px);
}

.collage-fragment.visible {
    opacity: 1;
    transform: translateY(0);
}

.collage-fragment svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Section 1: Garden fragments */
.fragment-pojagi {
    width: clamp(120px, 20vw, 240px);
    top: 0;
    left: 5%;
    clip-path: polygon(5% 0%, 100% 3%, 97% 95%, 0% 100%);
}

.fragment-wave {
    width: clamp(180px, 30vw, 360px);
    top: 10%;
    right: 3%;
    clip-path: polygon(0% 5%, 95% 0%, 100% 92%, 3% 100%);
}

.fragment-shell {
    width: clamp(100px, 15vw, 180px);
    bottom: 5%;
    right: 15%;
    clip-path: polygon(8% 0%, 100% 5%, 95% 100%, 0% 93%);
}

/* Section 2: Sky fragments */
.fragment-shibori {
    width: clamp(150px, 22vw, 280px);
    top: 5%;
    right: 5%;
}

.fragment-textile {
    width: clamp(130px, 18vw, 220px);
    bottom: 10%;
    left: 5%;
    clip-path: polygon(3% 0%, 97% 4%, 100% 96%, 0% 100%);
}

/* Section 3: Shell fragments */
.fragment-large-shell {
    width: clamp(160px, 25vw, 320px);
    top: 0;
    left: 3%;
}

.fragment-abstract-pojagi {
    width: clamp(140px, 20vw, 260px);
    bottom: 5%;
    right: 5%;
    clip-path: polygon(6% 0%, 100% 4%, 94% 100%, 0% 96%);
}

/* Section 4: Weaving fragments */
.fragment-woven {
    width: clamp(140px, 20vw, 250px);
    top: 5%;
    left: 3%;
    clip-path: polygon(0% 3%, 96% 0%, 100% 97%, 4% 100%);
}

.fragment-cutout {
    width: clamp(120px, 17vw, 200px);
    bottom: 10%;
    right: 8%;
}

/* ========================================
   Cultural Artifact Islands
   ======================================== */
.artifact-island {
    position: relative;
    z-index: 20;
    max-width: 560px;
    margin: 0 auto;
    padding: 48px 40px;
    border: 1px solid var(--panel-border);
    background-color: rgba(20, 30, 50, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.artifact-island.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(28px, 5vw, 60px);
    letter-spacing: 0.05em;
    color: var(--moonlight-white);
    margin-bottom: 20px;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.8;
    color: var(--moonlight-white);
    opacity: 0.85;
    margin-bottom: 24px;
}

.cultural-text {
    font-size: clamp(16px, 2.5vw, 28px);
    letter-spacing: 0.1em;
    opacity: 0.6;
    margin-bottom: 16px;
}

.jp-text {
    font-family: var(--font-cultural-jp);
}

.kr-text {
    font-family: var(--font-cultural-kr);
}

/* ========================================
   Footer
   ======================================== */
#footer {
    padding: 80px 0;
    text-align: center;
    position: relative;
    z-index: 10;
    border-top: 1px solid var(--panel-border);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
}

.footer-characters {
    font-family: var(--font-cultural-jp);
    font-size: clamp(20px, 3vw, 36px);
    letter-spacing: 0.3em;
    color: var(--moonlight-white);
    opacity: 0.5;
    margin-bottom: 20px;
}

.footer-domain {
    font-family: var(--font-headline);
    font-weight: 400;
    font-size: clamp(12px, 1.2vw, 16px);
    letter-spacing: 0.2em;
    color: var(--shibori-blue);
    text-transform: lowercase;
}

/* ========================================
   Scroll-Based Reveals
   ======================================== */
.collage-section:nth-child(even) .collage-container {
    direction: rtl;
}

.collage-section:nth-child(even) .collage-container > * {
    direction: ltr;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    .collage-container {
        min-height: 500px;
        padding: 30px 20px;
    }

    .artifact-island {
        padding: 32px 24px;
        max-width: 90%;
    }

    .collage-fragment {
        display: none;
    }

    .hero-title {
        font-size: clamp(36px, 12vw, 72px);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .collage-container {
        padding: 30px;
    }
}
