/* namu.day - Retro-Futuristic Arboreal Meditation */
/* Fonts: Roboto Slab (display), Source Sans 3 (body), Noto Sans KR (Korean) */

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

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

body {
    background: #0d2818;
    color: #a8dadc;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ==================== Section Base ==================== */
.section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ==================== The Canopy ==================== */
.canopy-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding: 0 8vw;
    background: radial-gradient(ellipse at 40% 50%, #0d2818 0%, #1a1a2e 70%, #0d1b2a 100%);
}

.canopy-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.blob {
    position: absolute;
    background: linear-gradient(135deg, rgba(42,157,143,0.35) 0%, rgba(38,70,83,0.2) 100%);
    will-change: border-radius;
}

.blob-a {
    width: 45vw;
    height: 45vw;
    max-width: 500px;
    max-height: 500px;
    top: 10%;
    left: 5%;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morphA 18s cubic-bezier(0.45,0.05,0.55,0.95) infinite alternate;
}

.blob-b {
    width: 35vw;
    height: 35vw;
    max-width: 400px;
    max-height: 400px;
    top: 25%;
    left: 30%;
    border-radius: 55% 45% 60% 40% / 40% 60% 45% 55%;
    animation: morphB 24s cubic-bezier(0.45,0.05,0.55,0.95) infinite alternate;
    background: linear-gradient(160deg, rgba(42,157,143,0.25) 0%, rgba(13,40,24,0.3) 100%);
}

.blob-c {
    width: 28vw;
    height: 28vw;
    max-width: 320px;
    max-height: 320px;
    top: 5%;
    right: 15%;
    border-radius: 40% 60% 50% 50% / 55% 35% 65% 45%;
    animation: morphC 21s cubic-bezier(0.45,0.05,0.55,0.95) infinite alternate;
    background: linear-gradient(200deg, rgba(38,70,83,0.3) 0%, rgba(42,157,143,0.15) 100%);
}

.blob-d {
    width: 20vw;
    height: 20vw;
    max-width: 250px;
    max-height: 250px;
    bottom: 15%;
    left: 20%;
    border-radius: 65% 35% 45% 55% / 50% 50% 50% 50%;
    animation: morphD 15s cubic-bezier(0.45,0.05,0.55,0.95) infinite alternate;
    background: linear-gradient(90deg, rgba(42,157,143,0.2) 0%, rgba(26,26,46,0.25) 100%);
}

.blob-e {
    width: 18vw;
    height: 18vw;
    max-width: 200px;
    max-height: 200px;
    bottom: 25%;
    right: 10%;
    border-radius: 50% 50% 35% 65% / 40% 60% 40% 60%;
    animation: morphE 20s cubic-bezier(0.45,0.05,0.55,0.95) infinite alternate;
    background: linear-gradient(250deg, rgba(42,157,143,0.18) 0%, rgba(38,70,83,0.22) 100%);
}

@keyframes morphA {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    100% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
}

@keyframes morphB {
    0% { border-radius: 55% 45% 60% 40% / 40% 60% 45% 55%; }
    100% { border-radius: 40% 60% 35% 65% / 65% 35% 60% 40%; }
}

@keyframes morphC {
    0% { border-radius: 40% 60% 50% 50% / 55% 35% 65% 45%; }
    100% { border-radius: 60% 40% 45% 55% / 35% 65% 40% 60%; }
}

@keyframes morphD {
    0% { border-radius: 65% 35% 45% 55% / 50% 50% 50% 50%; }
    100% { border-radius: 35% 65% 55% 45% / 45% 55% 55% 45%; }
}

@keyframes morphE {
    0% { border-radius: 50% 50% 35% 65% / 40% 60% 40% 60%; }
    100% { border-radius: 45% 55% 65% 35% / 60% 40% 55% 45%; }
}

.bioluminescent-dots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.bio-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2a9d8f;
    box-shadow: 0 0 12px rgba(42,157,143,0.6);
    animation: pulseDot var(--pulse-duration) ease-in-out infinite alternate;
    opacity: 0.3;
}

@keyframes pulseDot {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

.domain-title {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: clamp(72px, 10vw, 200px);
    letter-spacing: 0.06em;
    line-height: 1.1;
    color: #e9c46a;
    position: relative;
    z-index: 3;
    transform: rotate(-4deg);
    text-shadow: 0 0 40px rgba(233,196,106,0.15);
}

.canopy-subtitle {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 500;
    font-size: clamp(16px, 2.5vw, 28px);
    letter-spacing: 0.04em;
    color: #a8dadc;
    position: relative;
    z-index: 3;
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.34,1.56,0.64,1);
}

.canopy-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== The Ring Record ==================== */
.ring-record-section {
    min-height: 120vh;
    padding: 15vh 0;
    background: linear-gradient(102deg, #0d2818 0%, #1a1a2e 40%, #264653 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4vh;
}

.diagonal-panel {
    position: relative;
    width: 110vw;
    margin-left: -5vw;
    padding: 8vh 12vw;
    will-change: transform, opacity;
    transition: transform 0.9s cubic-bezier(0.34,1.56,0.64,1), opacity 0.9s ease;
    background-image: repeating-linear-gradient(
        12deg,
        rgba(13,27,26,0.08) 0px,
        rgba(13,27,26,0.08) 1px,
        transparent 1px,
        transparent 4px
    );
}

.panel-1 {
    clip-path: polygon(0 8%, 100% 0, 100% 92%, 0 100%);
    background-color: #16213e;
    background-image:
        repeating-linear-gradient(12deg, rgba(13,27,26,0.08) 0px, rgba(13,27,26,0.08) 1px, transparent 1px, transparent 4px),
        linear-gradient(102deg, #16213e 0%, #0f3460 100%);
}

.panel-2 {
    clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 92%);
    background-color: #1a472a;
    background-image:
        repeating-linear-gradient(-12deg, rgba(13,27,26,0.08) 0px, rgba(13,27,26,0.08) 1px, transparent 1px, transparent 4px),
        linear-gradient(102deg, #1a472a 0%, #2d6a4f 100%);
}

.panel-3 {
    clip-path: polygon(0 8%, 100% 0, 100% 92%, 0 100%);
    background-color: #533483;
    background-image:
        repeating-linear-gradient(12deg, rgba(13,27,26,0.08) 0px, rgba(13,27,26,0.08) 1px, transparent 1px, transparent 4px),
        linear-gradient(102deg, #533483 0%, #2b2d42 100%);
}

.panel-left {
    transform: translateX(-120px) rotate(2deg);
    opacity: 0;
}

.panel-left.visible {
    transform: translateX(0) rotate(2deg);
    opacity: 1;
}

.panel-right {
    transform: translateX(120px) rotate(-2deg);
    opacity: 0;
}

.panel-right.visible {
    transform: translateX(0) rotate(-2deg);
    opacity: 1;
}

.panel-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(18px, 2.5vw, 28px);
    line-height: 1.7;
    color: #a8dadc;
    font-style: italic;
    max-width: 700px;
}

.panel-label {
    display: block;
    margin-top: 1.5rem;
}

.korean-label {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: clamp(24px, 3vw, 40px);
    letter-spacing: 0.04em;
    color: #f4a261;
}

/* ==================== The Root Network ==================== */
.root-network-section {
    min-height: 100vh;
    padding: 10vh 5vw;
    background: #0d1b2a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.section-header {
    font-family: 'Roboto Slab', serif;
    font-weight: 400;
    font-size: clamp(28px, 4vw, 56px);
    letter-spacing: 0.06em;
    line-height: 1.1;
    color: #e9c46a;
    text-align: center;
    margin-bottom: 4vh;
}

.root-svg {
    width: 90vw;
    max-width: 1200px;
    height: auto;
}

.root-path {
    will-change: stroke-dashoffset;
}

.root-node-text {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
}

/* ==================== The Aquarium Layer ==================== */
.aquarium-section {
    min-height: 100vh;
    padding: 10vh 5vw;
    background: linear-gradient(180deg, #0d1b2a 0%, #16213e 30%, #0f3460 70%, #0d1b2a 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.aquarium-diagonal-reveal {
    position: absolute;
    top: -5vh;
    left: -5vw;
    width: 115vw;
    height: 15vh;
    background: #0d1b2a;
    clip-path: polygon(0 0, 100% 0, 100% 60%, 0 100%);
    z-index: 2;
}

.aquarium-header {
    position: relative;
    z-index: 3;
    margin-bottom: 2vh;
}

.fish-container {
    position: relative;
    width: 100%;
    height: 60vh;
    overflow: hidden;
}

.fish {
    position: absolute;
    will-change: transform;
}

.fish-1 {
    width: 100px;
    height: auto;
    top: 15%;
    animation: fishDrift1 45s linear infinite, fishBob 4s ease-in-out infinite alternate;
}

.fish-2 {
    width: 80px;
    height: auto;
    top: 55%;
    animation: fishDrift2 50s linear infinite, fishBob2 5s ease-in-out infinite alternate;
    animation-delay: -15s, 0s;
}

.fish-3 {
    width: 75px;
    height: auto;
    top: 35%;
    animation: fishDrift3 60s linear infinite, fishBob 6s ease-in-out infinite alternate;
    animation-delay: -8s, -2s;
}

.fish-4 {
    width: 60px;
    height: auto;
    top: 70%;
    animation: fishDrift4 55s linear infinite, fishBob2 4.5s ease-in-out infinite alternate;
    animation-delay: -25s, -1s;
}

.fish-5 {
    width: 140px;
    height: auto;
    top: 10%;
    animation: fishDrift5 35s linear infinite, fishBob 5s ease-in-out infinite alternate;
    animation-delay: -5s, -3s;
}

.fish-6 {
    width: 110px;
    height: auto;
    top: 50%;
    animation: fishDrift6 40s linear infinite, fishBob2 5.5s ease-in-out infinite alternate;
    animation-delay: -20s, -1.5s;
}

@keyframes fishDrift1 {
    0% { transform: translateX(-150px); }
    100% { transform: translateX(calc(100vw + 150px)); }
}

@keyframes fishDrift2 {
    0% { transform: translateX(-130px); }
    100% { transform: translateX(calc(100vw + 130px)); }
}

@keyframes fishDrift3 {
    0% { transform: translateX(-120px); }
    100% { transform: translateX(calc(100vw + 120px)); }
}

@keyframes fishDrift4 {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(calc(100vw + 100px)); }
}

@keyframes fishDrift5 {
    0% { transform: translateX(-180px); }
    100% { transform: translateX(calc(100vw + 180px)); }
}

@keyframes fishDrift6 {
    0% { transform: translateX(-160px); }
    100% { transform: translateX(calc(100vw + 160px)); }
}

@keyframes fishBob {
    0% { margin-top: 0; }
    100% { margin-top: 15px; }
}

@keyframes fishBob2 {
    0% { margin-top: 0; }
    100% { margin-top: -15px; }
}

.fish-container.paused .fish {
    animation-play-state: paused;
}

/* ==================== The Annual Ring ==================== */
.annual-ring-section {
    min-height: 100vh;
    padding: 10vh 5vw;
    background: radial-gradient(ellipse at 50% 50%, #1a1a2e 0%, #0d2818 50%, #0d1b2a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ring-header {
    margin-bottom: 2vh;
}

.ring-container {
    position: relative;
    width: 80vmin;
    height: 80vmin;
    max-width: 700px;
    max-height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ring-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.ring-year {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: clamp(36px, 6vw, 72px);
    color: #f4a261;
    position: relative;
    z-index: 2;
    letter-spacing: 0.06em;
}

.ring-closing-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(16px, 2vw, 24px);
    color: #a8dadc;
    text-align: center;
    margin-top: 4vh;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s ease, transform 1.5s cubic-bezier(0.34,1.56,0.64,1);
}

.ring-closing-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Ring pulse animation */
.ring-svg circle {
    transition: transform 0.6s cubic-bezier(0.22,1.0,0.36,1.0);
    transform-origin: center;
}

.ring-svg.pulse circle {
    animation: ringPulse 1.5s cubic-bezier(0.22,1.0,0.36,1.0) forwards;
}

@keyframes ringPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ==================== Wood grain overlay ==================== */
.ring-record-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        12deg,
        rgba(13,27,24,0.06) 0px,
        rgba(13,27,24,0.06) 1px,
        transparent 1px,
        transparent 5px
    );
    pointer-events: none;
    opacity: 0.15;
    z-index: 0;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .canopy-section {
        align-items: center;
        padding: 0 5vw;
    }

    .domain-title {
        text-align: center;
    }

    .diagonal-panel {
        padding: 6vh 8vw;
    }

    .panel-text {
        font-size: clamp(16px, 4vw, 22px);
    }

    .fish-container {
        height: 50vh;
    }

    .ring-container {
        width: 90vmin;
        height: 90vmin;
    }
}


/* Accent color highlights using full palette */
.korean-label:hover {
    color: #e76f51;
    transition: color 0.4s ease;
}

.panel-2 .panel-text {
    color: #1d3557;
}

.section-header::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: linear-gradient(102deg, #e9c46a 0%, #f4a261 50%, #e76f51 100%);
    margin: 1.5rem auto 0;
}
