/* ============================================================
   nanohana.moe — Coastal Dark Stylesheet
   Colors: #0a1017 (bg), #101c27 (panel), #c8d8e0 (text),
           #7a9aaa (secondary), #3ddde0 (biolum teal),
           #1a6fa8 (phosphor blue), #8c7b6a (driftwood),
           #d4923a (candle amber)
   Fonts: Space Grotesk 300/400/500/700, DM Sans 300/400,
          Azeret Mono 400
   ============================================================ */

/* --- Custom Properties --- */
:root {
    --color-bg:          #0a1017;
    --color-panel:       #101c27;
    --color-text:        #c8d8e0;
    --color-secondary:   #7a9aaa;
    --color-teal:        #3ddde0;
    --color-phosphor:    #1a6fa8;
    --color-driftwood:   #8c7b6a;
    --color-amber:       #d4923a;

    --font-display:      'Space Grotesk', sans-serif;
    --font-body:         'DM Sans', sans-serif;
    --font-mono:         'Azeret Mono', monospace;

    --spine-width:       480px;
    --spine-margin:      max(20vw, 40px);

    --ease-out-cubic:    cubic-bezier(0.33, 1, 0.68, 1);
    --ease-organic:      cubic-bezier(0.37, 0, 0.63, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Navigation --- */
.nav-trigger {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 1000;
    cursor: pointer;
}

.nav-dots {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.nav-trigger:hover .nav-dots {
    opacity: 1;
}

.nav-dot {
    display: block;
    width: 20px;
    height: 1px;
    background-color: var(--color-secondary);
    transition: background-color 0.3s ease, width 0.3s ease;
}

.nav-trigger:hover .nav-dot {
    background-color: var(--color-teal);
}

.nav-menu {
    list-style: none;
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s var(--ease-out-cubic);
}

.nav-trigger:hover .nav-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-link {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-secondary);
    text-decoration: none;
    text-align: right;
    padding: 4px 0;
    letter-spacing: 0.08em;
    transition: color 0.2s ease;
    white-space: nowrap;
}

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

/* --- Zone Shared --- */
.zone {
    width: 100%;
    position: relative;
}

/* --- Zone 1: The Shore (Hero) --- */
.zone-shore {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
}

/* Coastal Topography Background */
.topo-bg {
    position: absolute;
    inset: 0;
    opacity: 0;
    animation: topo-fade-in 1.2s ease-out 0.4s forwards;
}

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

.topo-svg {
    width: 100%;
    height: 100%;
}

.topo-line {
    fill: none;
    stroke: var(--color-phosphor);
    stroke-width: 1;
    opacity: 0.6;
}

/* Ripple rings around candle base */
.ripple-container {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -30%);
    width: 300px;
    height: 300px;
    pointer-events: none;
}

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

.ripple-ring {
    fill: none;
    stroke: var(--color-teal);
    stroke-width: 1;
    transform-origin: 150px 150px;
}

.ripple-ring-1 {
    animation: ripple-expand 8s ease-out infinite;
    animation-delay: 0s;
}
.ripple-ring-2 {
    animation: ripple-expand 8s ease-out infinite;
    animation-delay: 1.6s;
}
.ripple-ring-3 {
    animation: ripple-expand 8s ease-out infinite;
    animation-delay: 3.2s;
}
.ripple-ring-4 {
    animation: ripple-expand 8s ease-out infinite;
    animation-delay: 4.8s;
}
.ripple-ring-5 {
    animation: ripple-expand 8s ease-out infinite;
    animation-delay: 6.4s;
}

@keyframes ripple-expand {
    0%   { r: 20;  opacity: 0.40; }
    20%  { r: 45;  opacity: 0.30; }
    50%  { r: 80;  opacity: 0.18; }
    80%  { r: 110; opacity: 0.08; }
    100% { r: 130; opacity: 0; }
}

/* Candle anchor at golden ratio (38% from top) */
.candle-anchor {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: candle-appear 0.8s ease-out 0.6s forwards;
}

@keyframes candle-appear {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.candle-svg {
    width: 60px;
    height: 120px;
    overflow: visible;
}

.candle-body {
    stroke: var(--color-text);
    stroke-width: 2;
    stroke-linecap: round;
}

.candle-base {
    stroke: var(--color-secondary);
    stroke-width: 1;
    stroke-linecap: round;
}

.candle-flame {
    fill: var(--color-amber);
    stroke: none;
    transform-origin: 30px 18px;
    animation: flame-flicker 2.3s var(--ease-organic) infinite alternate;
}

@keyframes flame-flicker {
    0%   { transform: scaleY(1)    scaleX(1); }
    25%  { transform: scaleY(0.96) scaleX(1.04); }
    60%  { transform: scaleY(1.04) scaleX(0.97); }
    80%  { transform: scaleY(0.98) scaleX(1.02); }
    100% { transform: scaleY(0.96) scaleX(1.04); }
}

.glow-spoke {
    stroke: var(--color-teal);
    stroke-width: 1;
    stroke-linecap: round;
    opacity: 0.30;
}

/* Hero text block (below candle, 24px gap) */
.hero-text {
    position: absolute;
    top: calc(38% + 70px);
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0;
    animation: hero-text-appear 0.9s var(--ease-out-cubic) 1.2s forwards;
}

@keyframes hero-text-appear {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.hero-domain {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 52px;
    color: var(--color-text);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 12px;
    white-space: nowrap;
}

.hero-descriptor {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 16px;
    color: var(--color-secondary);
    letter-spacing: 0.01em;
}

/* --- Zone 2: The Current (content) --- */
.zone-current {
    padding: 120px 0 80px;
}

/* Content sections with asymmetric spine layout */
.content-section {
    position: relative;
    width: 100%;
    max-width: calc(var(--spine-width) + 160px);
    margin: 0 auto;
    padding: 0 var(--spine-margin);
    margin-bottom: 100px;
}

/* Ripple reveal animation — triggered by IntersectionObserver */
.ripple-reveal {
    animation-play-state: paused;
    clip-path: circle(48% at 50% 50%);
    animation: ripple-in 0.6s var(--ease-out-cubic) forwards;
}

.ripple-reveal.is-visible {
    animation-play-state: running;
}

@keyframes ripple-in {
    from { clip-path: circle(48% at 50% 50%); opacity: 0.6; }
    to   { clip-path: circle(100% at 50% 50%); opacity: 1; }
}

/* Section heading — offset left of spine */
.section-heading {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 32px;
    color: var(--color-text);
    letter-spacing: -0.03em;
    margin-left: -80px;
    margin-bottom: 32px;
    position: relative;
}

/* Lighthouse flash — minimal left marker */
.section-heading::before {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background-color: var(--color-secondary);
    margin-bottom: 16px;
    opacity: 0.6;
}

.section-body {
    max-width: var(--spine-width);
}

.section-body p {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 15px;
    color: var(--color-text);
    line-height: 1.75;
    margin-bottom: 20px;
}

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

/* Wave divider between sections */
.wave-divider {
    width: 100%;
    max-width: calc(var(--spine-width) + 160px);
    margin: 0 auto 100px;
    padding: 0 var(--spine-margin);
    display: flex;
    justify-content: center;
}

.wave-svg {
    width: 480px;
    height: 20px;
    max-width: 100%;
}

.wave-svg path {
    fill: none;
    stroke: var(--color-teal);
    stroke-width: 0.5;
    opacity: 0.20;
}

/* --- Zone 3: The Deep (footer) --- */
.zone-deep {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 80px 24px;
    position: relative;
}

/* Driftwood vector */
.driftwood-container {
    opacity: 0.15;
}

.driftwood-svg {
    width: 400px;
    max-width: 90vw;
    height: 60px;
}

.driftwood-body {
    fill: none;
    stroke: var(--color-secondary);
    stroke-width: 1.5;
    stroke-linecap: round;
}

.driftwood-branch {
    stroke: var(--color-secondary);
    stroke-width: 1;
    stroke-linecap: round;
}

/* Bioluminescent dots */
.bio-dots {
    display: flex;
    justify-content: center;
}

.bio-dots-svg {
    width: 48px;
    height: 12px;
}

.bio-dot {
    fill: var(--color-teal);
}

/* Footer caption */
.footer-caption {
    text-align: center;
}

.footer-mono {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--color-secondary);
    letter-spacing: 0.06em;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    :root {
        --spine-margin: max(8vw, 24px);
    }

    .hero-domain {
        font-size: 36px;
    }

    .section-heading {
        margin-left: -40px;
        font-size: 26px;
    }
}

@media (max-width: 600px) {
    :root {
        --spine-margin: 24px;
    }

    .hero-domain {
        font-size: 28px;
    }

    .section-heading {
        margin-left: 0;
        font-size: 22px;
    }

    .ripple-container {
        width: 200px;
        height: 200px;
    }

    .candle-anchor {
        top: 36%;
    }

    .hero-text {
        top: calc(36% + 60px);
    }
}
