/* ============================================
   hanun.ai — Surrealist Zen Garden
   Midnight Blue Meditation
   ============================================ */

/* CSS Custom Properties */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111833;
    --bg-decorative: #1a2744;
    --text-headline: #c8d6e5;
    --text-body: #a0b4c8;
    --accent-warm: #c4b5a0;
    --accent-glow: #e8ddd0;
    --accent-muted: #6b7d8e;
    --interactive: #8b6e7f;

    --font-headline: 'Cormorant Garamond', 'Georgia', serif;
    --font-body: 'Crimson Pro', 'Georgia', serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    --ease-settle: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(180deg, #0a0e1a 0%, #111833 50%, #0a0e1a 100%);
    background-attachment: fixed;
    color: var(--text-body);
    font-family: var(--font-body);
    font-weight: 300;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Particle Canvas
   ============================================ */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   Navigation Circle
   ============================================ */
#nav-circle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
}

.nav-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-warm);
    cursor: pointer;
    animation: breathe 6s ease-in-out infinite;
    transition: transform 0.4s var(--ease-settle);
}

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

.nav-links {
    position: absolute;
    top: 28px;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s var(--ease-settle);
    padding-top: 0.5rem;
}

#nav-circle:hover .nav-links,
#nav-circle.active .nav-links {
    opacity: 1;
    pointer-events: all;
}

.nav-link {
    font-family: var(--font-headline);
    font-weight: 300;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--accent-warm);
    text-decoration: none;
    letter-spacing: 0.05em;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-glow);
}

/* ============================================
   Sections — General
   ============================================ */
section {
    position: relative;
    z-index: 1;
}

/* ============================================
   Section 1: The Void
   ============================================ */
.section-void {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ink-drop-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(80vw, 400px);
    height: min(80vw, 400px);
}

.ink-drop-svg {
    width: 100%;
    height: 100%;
}

/* Ink bloom animation */
.ink-bloom {
    transform-origin: center;
}

.ink-bloom-1 {
    animation: inkBloom1 8s ease-out 2s forwards;
}
.ink-bloom-2 {
    animation: inkBloom2 10s ease-out 2.5s forwards;
}
.ink-bloom-3 {
    animation: inkBloom3 12s ease-out 3s forwards;
}

@keyframes inkBloom1 {
    0% { r: 0; opacity: 0; }
    20% { opacity: 0.8; }
    100% { r: 180; opacity: 0.2; }
}

@keyframes inkBloom2 {
    0% { r: 0; opacity: 0; }
    20% { opacity: 0.6; }
    100% { r: 140; opacity: 0.15; }
}

@keyframes inkBloom3 {
    0% { r: 0; opacity: 0; }
    20% { opacity: 0.5; }
    100% { r: 100; opacity: 0.1; }
}

/* Ink tendrils */
.ink-tendril {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

.ink-tendril-1 { animation: tendrilDraw 6s ease-out 2.5s forwards; }
.ink-tendril-2 { animation: tendrilDraw 7s ease-out 3s forwards; }
.ink-tendril-3 { animation: tendrilDraw 8s ease-out 3.5s forwards; }
.ink-tendril-4 { animation: tendrilDraw 7s ease-out 3.2s forwards; }
.ink-tendril-5 { animation: tendrilDraw 8s ease-out 3.8s forwards; }

@keyframes tendrilDraw {
    0% { stroke-dashoffset: 200; opacity: 0; }
    10% { opacity: 0.4; }
    100% { stroke-dashoffset: 0; opacity: 0.2; }
}

.void-text {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-top: 2rem;
}

.domain-title {
    font-family: var(--font-headline);
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.12em;
    text-transform: lowercase;
    color: var(--bg-primary);
    line-height: 1.2;
    animation: titleReveal 3s ease-out 2s forwards;
}

@keyframes titleReveal {
    0% { color: #0a0e1a; }
    100% { color: #c8d6e5; }
}

.domain-subtitle {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--bg-primary);
    margin-top: 1.5rem;
    animation: subtitleReveal 2s ease-out 4s forwards;
}

@keyframes subtitleReveal {
    0% { color: #0a0e1a; }
    100% { color: #6b7d8e; }
}

/* ============================================
   Section 2: The Garden
   ============================================ */
.section-garden {
    padding-top: 20vh;
    padding-bottom: 20vh;
    min-height: 100vh;
}

/* Content Islands — Organic S-curve */
.island {
    position: relative;
    max-width: 500px;
    box-shadow: 0 0 120px 60px rgba(26, 39, 68, 0.4);
    padding: 2rem;
}

.island-left {
    margin-left: clamp(8vw, 15vw, 22vw);
    margin-right: auto;
}

.island-right {
    margin-left: clamp(30vw, 40vw, 50vw);
    margin-right: auto;
}

.island-left-lower {
    margin-left: clamp(10vw, 18vw, 25vw);
    margin-right: auto;
}

.island-right-wide {
    margin-left: clamp(25vw, 35vw, 45vw);
    margin-right: clamp(5vw, 8vw, 12vw);
    max-width: 600px;
}

/* Garden items */
.garden-item {
    margin-bottom: 60vh;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s var(--ease-settle), transform 1.2s var(--ease-settle);
}

.garden-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.garden-item:nth-child(2) {
    transition-delay: 200ms;
}

.garden-item:nth-child(3) {
    transition-delay: 400ms;
}

.garden-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
}

.garden-icon svg {
    width: 100%;
    height: 100%;
}

.garden-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 2.0;
    color: var(--text-body);
    max-width: 60ch;
}

/* ============================================
   Section 3: The Reflection
   ============================================ */
.section-reflection {
    padding-top: 40vh;
    padding-bottom: 20vh;
    min-height: 80vh;
}

.reflection-content {
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s var(--ease-settle), transform 1.2s var(--ease-settle);
}

.reflection-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.enso-container {
    width: 200px;
    height: 200px;
    margin-bottom: 2rem;
}

.enso-large {
    width: 100%;
    height: 100%;
    animation: ensoRotate 360s linear infinite;
}

@keyframes ensoRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Seigaiha pattern */
.seigaiha-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.04;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40'%3E%3Cpath d='M0 40 A40 40 0 0 1 40 0 A40 40 0 0 1 80 40' fill='none' stroke='%231a2744' stroke-width='1'/%3E%3Cpath d='M0 40 A30 30 0 0 1 30 10 ' fill='none' stroke='%231a2744' stroke-width='0.5'/%3E%3Cpath d='M50 10 A30 30 0 0 1 80 40' fill='none' stroke='%231a2744' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 80px 40px;
}

.reflection-text {
    position: relative;
    z-index: 1;
}

.reflection-text p {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 2.0;
    color: var(--text-body);
    margin-bottom: 2rem;
    max-width: 60ch;
}

.reflection-text p:last-child {
    margin-bottom: 0;
}

/* ============================================
   Section 4: The Ripple
   ============================================ */
.section-ripple {
    padding-top: 40vh;
    padding-bottom: 20vh;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ripple-animation-container {
    width: min(80vw, 600px);
    margin: 0 auto;
    opacity: 0;
    transition: opacity 1.2s var(--ease-settle);
}

.ripple-animation-container.visible {
    opacity: 1;
}

.ripple-svg {
    width: 100%;
    height: auto;
}

/* Ripple ring animations — triggered by JS class */
.ripple-animation-container.animating .ripple-ring-1 {
    animation: rippleExpand 4s ease-out 0s forwards;
}
.ripple-animation-container.animating .ripple-ring-2 {
    animation: rippleExpand 4s ease-out 0.5s forwards;
}
.ripple-animation-container.animating .ripple-ring-3 {
    animation: rippleExpand 4s ease-out 1s forwards;
}
.ripple-animation-container.animating .ripple-ring-4 {
    animation: rippleExpand 4s ease-out 1.5s forwards;
}
.ripple-animation-container.animating .ripple-ring-5 {
    animation: rippleExpand 4s ease-out 2s forwards;
}

.ripple-animation-container.animating .stone-dot {
    animation: stoneDrop 0.5s ease-out forwards;
}

@keyframes rippleExpand {
    0% { r: 5; opacity: 0.6; }
    100% { r: 180; opacity: 0; }
}

@keyframes stoneDrop {
    0% { opacity: 0; r: 0; }
    30% { opacity: 0.8; r: 4; }
    100% { opacity: 0.3; r: 2; }
}

.ripple-text {
    font-family: var(--font-headline);
    font-weight: 300;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.2em;
    text-transform: lowercase;
    color: var(--interactive);
    text-align: center;
    margin-top: 4rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s var(--ease-settle), transform 1.2s var(--ease-settle);
}

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

/* ============================================
   Section 5: The Return
   ============================================ */
.section-return {
    padding-top: 40vh;
    padding-bottom: 20vh;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Enso drawing animation */
.enso-draw-container {
    width: min(60vw, 300px);
    height: min(60vw, 300px);
    margin: 0 auto 6rem;
    opacity: 0;
    transition: opacity 0.6s var(--ease-settle);
}

.enso-draw-container.visible {
    opacity: 1;
}

.enso-draw {
    width: 100%;
    height: 100%;
}

.enso-draw-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: none;
}

.enso-draw-container.drawing .enso-draw-path {
    animation: drawEnso 4s ease-in-out forwards;
}

@keyframes drawEnso {
    0% { stroke-dashoffset: 800; }
    100% { stroke-dashoffset: 0; }
}

/* Icon Constellation */
.icon-constellation {
    position: relative;
    width: min(80vw, 600px);
    height: 300px;
    margin: 0 auto 6rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s var(--ease-settle), transform 1.2s var(--ease-settle);
}

.icon-constellation.visible {
    opacity: 1;
    transform: translateY(0);
}

.constellation-icon {
    position: absolute;
    transition: filter 0.6s ease;
}

.constellation-icon:hover {
    filter: drop-shadow(0 0 20px rgba(196, 181, 160, 0.1));
}

.constellation-icon svg {
    width: 100%;
    height: 100%;
}

/* Zen garden placement — asymmetric, different scales */
.icon-pos-1 {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 5%;
    transform: rotate(-8deg);
}

.icon-pos-2 {
    width: 60px;
    height: 60px;
    top: 40%;
    left: 25%;
    transform: rotate(5deg);
}

.icon-pos-3 {
    width: 120px;
    height: 120px;
    top: 5%;
    left: 45%;
    transform: rotate(-3deg);
}

.icon-pos-4 {
    width: 50px;
    height: 50px;
    top: 55%;
    left: 55%;
    transform: rotate(12deg);
}

.icon-pos-5 {
    width: 80px;
    height: 80px;
    top: 15%;
    left: 75%;
    transform: rotate(-15deg);
}

.icon-pos-6 {
    width: 70px;
    height: 70px;
    top: 60%;
    left: 80%;
    transform: rotate(7deg);
}

/* Return title */
.return-title {
    font-family: var(--font-headline);
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.12em;
    text-transform: lowercase;
    color: var(--text-headline);
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s var(--ease-settle), transform 1.2s var(--ease-settle);
}

.return-title.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .island-left,
    .island-right,
    .island-left-lower,
    .island-right-wide {
        margin-left: 8vw;
        margin-right: 8vw;
        max-width: calc(100% - 16vw);
    }

    .garden-item {
        margin-bottom: 40vh;
    }

    .icon-constellation {
        height: 200px;
    }

    .icon-pos-1 { width: 70px; height: 70px; }
    .icon-pos-2 { width: 45px; height: 45px; }
    .icon-pos-3 { width: 80px; height: 80px; }
    .icon-pos-4 { width: 40px; height: 40px; }
    .icon-pos-5 { width: 55px; height: 55px; }
    .icon-pos-6 { width: 50px; height: 50px; }

    #nav-circle {
        top: 1rem;
        right: 1rem;
    }
}
