/* ============================================
   lotus.dev - Styles
   A minimalist developer sanctuary
   ============================================ */

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

:root {
    --bg-dark: #0c0c14;
    --surface: #14141e;
    --neon-pink: #ff6b9d;
    --neon-orange: #ff8c42;
    --neon-teal: #42d4b4;
    --text-primary: #e0d0e8;
    --text-secondary: #6a6078;
    --font-display: 'Albert Sans', sans-serif;
    --font-code: 'Fira Code', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 17px);
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- Hero Section --- */
#hero {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-dark);
    position: relative;
}

/* CSS Lotus Flower */
.lotus-flower {
    position: relative;
    width: 260px;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.petal {
    position: absolute;
    width: 100px;
    height: 40px;
    background: var(--neon-pink);
    border-radius: 50%;
    opacity: 0;
    transform-origin: center center;
    transform: rotate(var(--angle)) translateX(50px);
    transition: opacity 0.2s ease;
}

/* Varying petal opacities for layered translucent effect */
.petal:nth-child(1) { opacity: 0; width: 110px; height: 44px; }
.petal:nth-child(2) { opacity: 0; width: 95px; height: 38px; }
.petal:nth-child(3) { opacity: 0; width: 105px; height: 42px; }
.petal:nth-child(4) { opacity: 0; width: 90px; height: 36px; }
.petal:nth-child(5) { opacity: 0; width: 108px; height: 43px; }
.petal:nth-child(6) { opacity: 0; width: 92px; height: 37px; }
.petal:nth-child(7) { opacity: 0; width: 100px; height: 40px; }
.petal:nth-child(8) { opacity: 0; width: 98px; height: 39px; }

.petal.visible:nth-child(1) { opacity: 0.15; }
.petal.visible:nth-child(2) { opacity: 0.25; }
.petal.visible:nth-child(3) { opacity: 0.10; }
.petal.visible:nth-child(4) { opacity: 0.20; }
.petal.visible:nth-child(5) { opacity: 0.12; }
.petal.visible:nth-child(6) { opacity: 0.28; }
.petal.visible:nth-child(7) { opacity: 0.18; }
.petal.visible:nth-child(8) { opacity: 0.22; }

.lotus-center {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--neon-pink);
    border-radius: 50%;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.lotus-center.visible {
    opacity: 0.6;
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.3);
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(32px, 5vw, 56px);
    color: var(--text-primary);
    margin-top: 60px;
    letter-spacing: 0.02em;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hero-title.visible {
    opacity: 1;
}

/* --- Modules Section (Honeycomb) --- */
#modules {
    padding: 15vh 5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(18px, 2.5vw, 28px);
    color: var(--text-primary);
    margin-bottom: 8vh;
    letter-spacing: 0.03em;
}

.honeycomb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hex-row {
    display: flex;
    gap: 10px;
}

.hex-row-offset {
    margin-left: 65px;
}

.hex-cell {
    width: 120px;
    height: 138px;
    position: relative;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.hex-empty {
    visibility: hidden;
}

.hex-filled {
    background: var(--surface);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

/* Hexagon border using pseudo-element */
.hex-filled::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--surface);
    z-index: 1;
}

.hex-filled::after {
    content: '';
    position: absolute;
    inset: -1px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(255, 107, 157, 0.3);
    z-index: 0;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.hex-filled:hover::after {
    background: rgba(255, 107, 157, 0.8);
}

.hex-filled:hover {
    filter: drop-shadow(0 0 12px rgba(255, 107, 157, 0.3));
}

.hex-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 15px 10px;
    text-align: center;
    gap: 4px;
}

.module-name {
    font-family: var(--font-code);
    font-weight: 400;
    font-size: 14px;
    color: var(--neon-pink);
    display: block;
}

.module-desc {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
    display: block;
}

.module-count {
    font-family: var(--font-code);
    font-weight: 400;
    font-size: 12px;
    color: var(--neon-teal);
    display: block;
    margin-top: 2px;
}

/* --- Ecosystem Section --- */
#ecosystem {
    padding: 15vh 5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.ecosystem-blob {
    position: relative;
    width: min(700px, 85vw);
    min-height: 350px;
    background: var(--surface);
    border-radius: 30% 70% 50% 60% / 60% 40% 70% 30%;
    border: 1px solid rgba(255, 107, 157, 0.25);
    box-shadow: 0 0 40px rgba(255, 107, 157, 0.08);
    padding: 60px 50px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blob-content {
    position: relative;
    z-index: 2;
    max-width: 480px;
    text-align: center;
}

.blob-content p {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 17px);
    color: var(--text-primary);
    line-height: 1.7;
}

/* --- CSS Koi Fish --- */
.koi {
    position: absolute;
    z-index: 1;
    display: flex;
    align-items: center;
}

.koi-body {
    width: 30px;
    height: 14px;
    background: var(--neon-orange);
    border-radius: 50%;
}

.koi-tail {
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 10px solid var(--neon-orange);
    margin-left: -5px;
    animation: tailWag 0.5s ease-in-out infinite alternate;
}

@keyframes tailWag {
    0% { transform: rotate(-8deg); }
    100% { transform: rotate(8deg); }
}

/* Koi fish 1 */
.koi-1 {
    opacity: 0.45;
    transform: scale(0.8);
    animation: swimPath1 10s linear infinite;
}

@keyframes swimPath1 {
    0%   { top: 30%; left: 10%; transform: scale(0.8) rotate(0deg); }
    25%  { top: 50%; left: 60%; transform: scale(0.8) rotate(-15deg); }
    50%  { top: 70%; left: 80%; transform: scale(0.8) rotate(10deg); }
    75%  { top: 40%; left: 50%; transform: scale(0.8) rotate(-5deg); }
    100% { top: 30%; left: 10%; transform: scale(0.8) rotate(0deg); }
}

/* Koi fish 2 */
.koi-2 {
    opacity: 0.35;
    transform: scale(0.6);
    animation: swimPath2 13s linear infinite;
}

@keyframes swimPath2 {
    0%   { top: 60%; left: 70%; transform: scale(0.6) rotate(5deg); }
    25%  { top: 35%; left: 30%; transform: scale(0.6) rotate(-10deg); }
    50%  { top: 20%; left: 15%; transform: scale(0.6) rotate(15deg); }
    75%  { top: 55%; left: 55%; transform: scale(0.6) rotate(-8deg); }
    100% { top: 60%; left: 70%; transform: scale(0.6) rotate(5deg); }
}

/* Koi fish 3 */
.koi-3 {
    opacity: 0.5;
    transform: scale(1);
    animation: swimPath3 8s linear infinite;
}

@keyframes swimPath3 {
    0%   { top: 45%; left: 40%; transform: scale(1) rotate(-5deg); }
    25%  { top: 25%; left: 70%; transform: scale(1) rotate(12deg); }
    50%  { top: 50%; left: 85%; transform: scale(1) rotate(-8deg); }
    75%  { top: 65%; left: 45%; transform: scale(1) rotate(6deg); }
    100% { top: 45%; left: 40%; transform: scale(1) rotate(-5deg); }
}

/* Koi fish 4 */
.koi-4 {
    opacity: 0.4;
    transform: scale(0.7);
    animation: swimPath4 15s linear infinite;
}

@keyframes swimPath4 {
    0%   { top: 70%; left: 20%; transform: scale(0.7) rotate(8deg); }
    25%  { top: 30%; left: 45%; transform: scale(0.7) rotate(-12deg); }
    50%  { top: 25%; left: 75%; transform: scale(0.7) rotate(5deg); }
    75%  { top: 60%; left: 60%; transform: scale(0.7) rotate(-3deg); }
    100% { top: 70%; left: 20%; transform: scale(0.7) rotate(8deg); }
}

/* Koi fish 5 */
.koi-5 {
    opacity: 0.55;
    transform: scale(0.5);
    animation: swimPath5 11s linear infinite;
}

@keyframes swimPath5 {
    0%   { top: 40%; left: 80%; transform: scale(0.5) rotate(-10deg); }
    25%  { top: 65%; left: 40%; transform: scale(0.5) rotate(8deg); }
    50%  { top: 55%; left: 10%; transform: scale(0.5) rotate(-6deg); }
    75%  { top: 30%; left: 35%; transform: scale(0.5) rotate(14deg); }
    100% { top: 40%; left: 80%; transform: scale(0.5) rotate(-10deg); }
}

/* --- Begin Section --- */
#begin {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-dark);
    gap: 12px;
}

.begin-text {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(24px, 4vw, 40px);
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.begin-lotus-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--neon-pink);
    border-radius: 50%;
    animation: lotusIconPulse 2s ease-in-out infinite;
}

@keyframes lotusIconPulse {
    0%, 100% {
        opacity: 0.4;
        box-shadow: 0 0 6px rgba(255, 107, 157, 0.2);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 16px rgba(255, 107, 157, 0.5);
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hex-row-offset {
        margin-left: 35px;
    }

    .hex-cell {
        width: 90px;
        height: 104px;
    }

    .hex-inner {
        padding: 10px 6px;
    }

    .module-name {
        font-size: 12px;
    }

    .module-desc {
        font-size: 9px;
    }

    .module-count {
        font-size: 10px;
    }

    .ecosystem-blob {
        padding: 40px 30px;
        min-height: 280px;
    }
}

@media (max-width: 480px) {
    .hex-row-offset {
        margin-left: 20px;
    }

    .hex-cell {
        width: 70px;
        height: 81px;
    }

    .hex-row {
        gap: 6px;
    }

    .honeycomb {
        gap: 5px;
    }

    .module-desc {
        display: none;
    }

    .ecosystem-blob {
        padding: 30px 20px;
        border-radius: 40% 60% 55% 45% / 50% 50% 50% 50%;
    }
}
