/* ===========================================================
   lotus.dev — v2
   minimalist developer sanctuary, dark-neon, hexagonal-honeycomb
   palette: #0c0c14, #14141e, #ff6b9d, #ff8c42, #42d4b4, #e0d0e8, #6a6078
   =========================================================== */

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

:root {
    --bg:        #0c0c14;
    --surface:   #14141e;
    --pink:      #ff6b9d;
    --orange:    #ff8c42;
    --teal:      #42d4b4;
    --text:      #e0d0e8;
    --muted:     #6a6078;
    --hex-border: rgba(255, 107, 157, 0.30);
    --hex-border-hot: rgba(255, 107, 157, 0.85);
    --hex-glow:  rgba(255, 107, 157, 0.25);
    --teal-glow: rgba(66, 212, 180, 0.22);
    --orange-glow: rgba(255, 140, 66, 0.30);
    --display: 'Albert Sans', system-ui, sans-serif;
    --mono:    'Fira Code', 'SFMono-Regular', Menlo, monospace;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--display);
    font-weight: 400;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

main {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

::selection { background: var(--pink); color: var(--bg); }

/* ----------------------------------------------------------
   HERO — lotus blooming from darkness
   ---------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    background: radial-gradient(ellipse at center, #11111c 0%, #0c0c14 60%, #08080f 100%);
}

.lotus-stage {
    width: clamp(220px, 30vw, 320px);
    height: clamp(220px, 30vw, 320px);
    position: relative;
    margin-bottom: clamp(40px, 7vw, 80px);
    filter: drop-shadow(0 0 30px rgba(255, 107, 157, 0.18));
}

.lotus {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lotus-breathe 9s ease-in-out infinite;
}

.petal {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40%;
    height: 70%;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: radial-gradient(ellipse at 50% 30%, rgba(255, 107, 157, 0.55), rgba(255, 107, 157, 0.18) 60%, rgba(255, 107, 157, 0) 100%);
    transform-origin: 50% 100%;
    opacity: 0;
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.lotus.bloom .petal { opacity: 0.85; }

.petal-1 { transform: translate(-50%, -100%) rotate(0deg); }
.petal-2 { transform: translate(-50%, -100%) rotate(45deg); }
.petal-3 { transform: translate(-50%, -100%) rotate(90deg); }
.petal-4 { transform: translate(-50%, -100%) rotate(135deg); }
.petal-5 { transform: translate(-50%, -100%) rotate(180deg); }
.petal-6 { transform: translate(-50%, -100%) rotate(225deg); }
.petal-7 { transform: translate(-50%, -100%) rotate(270deg); }
.petal-8 { transform: translate(-50%, -100%) rotate(315deg); }

/* staggered bloom delays */
.lotus.bloom .petal-1 { transition-delay: 0ms;   }
.lotus.bloom .petal-5 { transition-delay: 100ms; }
.lotus.bloom .petal-2 { transition-delay: 200ms; }
.lotus.bloom .petal-6 { transition-delay: 300ms; }
.lotus.bloom .petal-3 { transition-delay: 400ms; }
.lotus.bloom .petal-7 { transition-delay: 500ms; }
.lotus.bloom .petal-4 { transition-delay: 600ms; }
.lotus.bloom .petal-8 { transition-delay: 700ms; }

.lotus-core {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--pink) 0%, rgba(255, 107, 157, 0.9) 40%, rgba(255, 107, 157, 0.2) 100%);
    box-shadow:
        0 0 18px var(--pink),
        0 0 40px rgba(255, 107, 157, 0.4),
        0 0 80px rgba(255, 107, 157, 0.15);
    opacity: 0;
    transition: opacity 1s ease-out 1.2s;
    animation: core-pulse 3s ease-in-out infinite 2.5s;
}
.lotus.bloom .lotus-core { opacity: 1; }

@keyframes lotus-breathe {
    0%, 100% { transform: scale(1)  rotate(0deg); }
    50%      { transform: scale(1.04) rotate(2deg); }
}
@keyframes core-pulse {
    0%, 100% { box-shadow: 0 0 18px var(--pink), 0 0 40px rgba(255, 107, 157, 0.4); }
    50%      { box-shadow: 0 0 28px var(--pink), 0 0 60px rgba(255, 107, 157, 0.55); }
}

.brand {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(36px, 5.5vw, 64px);
    color: var(--text);
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1s ease-out 2s, transform 1s ease-out 2s;
}
.brand.in { opacity: 1; transform: translateY(0); }

.brand-sub {
    margin-top: 18px;
    color: var(--muted);
    font-size: clamp(13px, 1.3vw, 16px);
    font-weight: 400;
    letter-spacing: 0.02em;
    text-align: center;
    max-width: 36ch;
    opacity: 0;
    transition: opacity 1s ease-out 2.6s;
}
.brand-sub.in { opacity: 1; }

.scroll-cue {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 1s ease-out 3.2s;
}
.scroll-cue.in { opacity: 1; }
.scroll-cue-line {
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, transparent, var(--pink));
    animation: cue-flow 2.2s ease-in-out infinite;
}
.scroll-cue-label {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.18em;
    text-transform: lowercase;
}
@keyframes cue-flow {
    0%   { transform: scaleY(0.2); transform-origin: top; opacity: 0.3; }
    50%  { transform: scaleY(1);   transform-origin: top; opacity: 0.9; }
    51%  { transform: scaleY(1);   transform-origin: bottom; }
    100% { transform: scaleY(0.2); transform-origin: bottom; opacity: 0.3; }
}

/* ----------------------------------------------------------
   SECTION COMMON
   ---------------------------------------------------------- */
.section-head {
    text-align: center;
    margin: 0 auto clamp(40px, 6vw, 80px);
    max-width: 600px;
    padding: 0 24px;
}
.eyebrow {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--pink);
    letter-spacing: 0.12em;
    margin-bottom: 14px;
}
.section-title {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(20px, 2.6vw, 30px);
    color: var(--text);
    letter-spacing: -0.01em;
    margin-bottom: 14px;
}
.section-lede {
    color: var(--muted);
    font-size: clamp(14px, 1.5vw, 17px);
    line-height: 1.7;
    max-width: 50ch;
    margin: 0 auto;
}

/* ----------------------------------------------------------
   MODULES — honeycomb
   ---------------------------------------------------------- */
.modules {
    padding: clamp(80px, 12vw, 160px) 24px;
    position: relative;
}

.honeycomb {
    max-width: 880px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.hex-row {
    display: flex;
    gap: 16px;
    justify-content: center;
}
.hex-row--offset {
    transform: translateX(0);
}

.hex {
    --hex-size: 150px;
    width: var(--hex-size);
    height: calc(var(--hex-size) * 1.155);
    margin: calc(var(--hex-size) * -0.144) 0;
    position: relative;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--surface);
    transition: filter 250ms ease, transform 350ms ease;
}

/* hex border via inner clip with thin gradient backdrop */
.hex::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--hex-border);
    z-index: 0;
}
.hex::after {
    content: '';
    position: absolute;
    inset: 1px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--surface);
    z-index: 1;
}

.hex--empty {
    background: transparent;
    visibility: hidden;
    pointer-events: none;
}

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

.hex-name {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--pink);
    font-weight: 500;
    letter-spacing: 0.01em;
}
.hex-desc {
    font-family: var(--display);
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
    max-width: 14ch;
}
.hex-counter {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text);
    opacity: 0.55;
    margin-top: 2px;
    letter-spacing: 0.04em;
}

.hex--center .hex-name { color: var(--teal); }
.hex--center::before { background: rgba(66, 212, 180, 0.42); }

/* hover/active glow */
.hex.hex--filled { cursor: default; }
.hex.hex--filled:hover::before {
    background: var(--hex-border-hot);
}
.hex.hex--filled:hover {
    filter: drop-shadow(0 0 14px var(--hex-glow))
            drop-shadow(0 0 36px rgba(255, 107, 157, 0.18));
    transform: translateY(-2px);
}
.hex.hex--filled.is-ripple::before {
    background: rgba(255, 107, 157, 0.55);
    transition: background 200ms ease-out;
}
.hex--center:hover { filter: drop-shadow(0 0 16px var(--teal-glow)) drop-shadow(0 0 36px rgba(66, 212, 180, 0.18)); }
.hex--center:hover::before { background: rgba(66, 212, 180, 0.85); }

/* ----------------------------------------------------------
   ECOSYSTEM — organic blob with koi
   ---------------------------------------------------------- */
.ecosystem {
    padding: clamp(80px, 12vw, 160px) 24px;
}

.blob {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    background: linear-gradient(135deg, #14141e 0%, #16162a 100%);
    border: 1px solid rgba(66, 212, 180, 0.35);
    border-radius: 38% 62% 53% 47% / 58% 42% 58% 42%;
    padding: clamp(50px, 7vw, 90px) clamp(40px, 6vw, 80px);
    box-shadow:
        0 0 60px rgba(66, 212, 180, 0.10),
        inset 0 0 80px rgba(255, 107, 157, 0.05);
    overflow: hidden;
    animation: blob-morph 18s ease-in-out infinite alternate;
    cursor: pointer;
}

@keyframes blob-morph {
    0%   { border-radius: 38% 62% 53% 47% / 58% 42% 58% 42%; }
    33%  { border-radius: 52% 48% 35% 65% / 44% 60% 40% 56%; }
    66%  { border-radius: 60% 40% 60% 40% / 50% 50% 50% 50%; }
    100% { border-radius: 45% 55% 48% 52% / 55% 45% 55% 45%; }
}

.blob-content {
    position: relative;
    z-index: 3;
}

.blob-lede {
    color: var(--text);
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 56ch;
}

.blob-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px 28px;
}
.blob-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 13px;
}
.blob-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 8px var(--teal);
    flex-shrink: 0;
}
.blob-key { color: var(--pink); font-weight: 500; }
.blob-val { color: var(--muted); }

/* koi fish */
.koi-swarm {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.koi {
    position: absolute;
    width: 36px;
    height: 14px;
    opacity: 0.55;
}
.koi-body {
    position: absolute;
    inset: 0;
    border-radius: 50% 60% 60% 50% / 50%;
    background: radial-gradient(ellipse at 30% 50%, var(--orange) 0%, rgba(255, 140, 66, 0.7) 60%, rgba(255, 140, 66, 0.2) 100%);
    box-shadow: 0 0 8px rgba(255, 140, 66, 0.5);
}
.koi-fin {
    position: absolute;
    width: 8px; height: 6px;
    background: rgba(255, 140, 66, 0.6);
    border-radius: 50%;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.koi-tail {
    position: absolute;
    right: -10px;
    top: 50%;
    width: 0; height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 12px solid rgba(255, 140, 66, 0.55);
    transform-origin: left center;
    transform: translateY(-50%);
    animation: tail-wag 0.55s ease-in-out infinite alternate;
}

@keyframes tail-wag {
    0%   { transform: translateY(-50%) rotate(-18deg); }
    100% { transform: translateY(-50%) rotate(18deg); }
}

.koi-1 {
    top: 18%; left: 8%;
    animation: swim-1 13s ease-in-out infinite;
    transform: scale(1);
}
.koi-2 {
    top: 70%; left: 70%;
    animation: swim-2 11s ease-in-out infinite;
    transform: scale(0.78);
    opacity: 0.45;
}
.koi-3 {
    top: 50%; left: 30%;
    animation: swim-3 15s ease-in-out infinite;
    transform: scale(0.6);
    opacity: 0.4;
}
.koi-4 {
    top: 30%; left: 60%;
    animation: swim-4 9s ease-in-out infinite;
    transform: scale(1.1);
    opacity: 0.55;
}

@keyframes swim-1 {
    0%   { transform: translate(0, 0) rotate(8deg)   scale(1); }
    25%  { transform: translate(180px, 40px) rotate(-12deg) scale(1); }
    50%  { transform: translate(280px, 180px) rotate(28deg) scale(1); }
    75%  { transform: translate(120px, 230px) rotate(-150deg) scale(-1, 1); }
    100% { transform: translate(0, 0) rotate(8deg)   scale(1); }
}
@keyframes swim-2 {
    0%   { transform: translate(0, 0) rotate(-160deg) scale(-0.78, 0.78); }
    25%  { transform: translate(-160px, -50px) rotate(160deg) scale(-0.78, 0.78); }
    50%  { transform: translate(-260px, -180px) rotate(-30deg) scale(0.78); }
    75%  { transform: translate(-100px, -100px) rotate(20deg) scale(0.78); }
    100% { transform: translate(0, 0) rotate(-160deg) scale(-0.78, 0.78); }
}
@keyframes swim-3 {
    0%   { transform: translate(0, 0) rotate(0deg) scale(0.6); }
    33%  { transform: translate(220px, -60px) rotate(20deg) scale(0.6); }
    66%  { transform: translate(80px, 80px) rotate(-170deg) scale(-0.6, 0.6); }
    100% { transform: translate(0, 0) rotate(0deg) scale(0.6); }
}
@keyframes swim-4 {
    0%   { transform: translate(0, 0) rotate(180deg) scale(-1.1, 1.1); }
    50%  { transform: translate(-200px, 80px) rotate(20deg) scale(1.1); }
    100% { transform: translate(0, 0) rotate(180deg) scale(-1.1, 1.1); }
}

/* ripples on click */
.ripple-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
}
.ripple {
    position: absolute;
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 1px solid var(--teal);
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
    animation: ripple-out 1.4s ease-out forwards;
    pointer-events: none;
}
@keyframes ripple-out {
    0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0.85; }
    100% { transform: translate(-50%, -50%) scale(14); opacity: 0; }
}

/* ----------------------------------------------------------
   PHILOSOPHY — extreme negative space
   ---------------------------------------------------------- */
.philosophy {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(80px, 12vw, 160px) 24px;
    text-align: center;
    gap: 30px;
}
.philosophy-line {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(22px, 3vw, 36px);
    color: var(--text);
    letter-spacing: 0.02em;
}
.phil-word { color: var(--text); }
.phil-sep  {
    color: var(--pink);
    margin: 0 18px;
    opacity: 0.7;
}
.philosophy-text {
    color: var(--muted);
    font-size: clamp(14px, 1.4vw, 16px);
    max-width: 50ch;
    line-height: 1.8;
}

/* ----------------------------------------------------------
   BEGIN — closing
   ---------------------------------------------------------- */
.begin {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(80px, 12vw, 160px) 24px;
    gap: 28px;
}

.begin-line {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(40px, 7vw, 80px);
    color: var(--text);
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}
.begin-word { }
.begin-period { color: var(--pink); }
.begin-lotus {
    display: inline-block;
    width: 14px; height: 14px;
    position: relative;
    margin-left: 6px;
    transform: translateY(-4px);
    animation: mini-pulse 2.4s ease-in-out infinite;
}
.begin-lotus .mini-petal {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 4px; height: 12px;
    background: var(--pink);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--pink);
    transform-origin: 50% 50%;
    opacity: 0.8;
}
.begin-lotus .mini-petal:nth-child(1) { transform: rotate(0deg); }
.begin-lotus .mini-petal:nth-child(2) { transform: rotate(45deg); }
.begin-lotus .mini-petal:nth-child(3) { transform: rotate(90deg); }
.begin-lotus .mini-petal:nth-child(4) { transform: rotate(135deg); }

@keyframes mini-pulse {
    0%, 100% { transform: translateY(-4px) scale(1);   opacity: 1; }
    50%      { transform: translateY(-4px) scale(1.18); opacity: 0.85; }
}

.begin-cmd {
    font-family: var(--mono);
    font-size: clamp(13px, 1.3vw, 15px);
    color: var(--muted);
    background: var(--surface);
    border: 1px solid rgba(255, 107, 157, 0.18);
    padding: 14px 22px;
    border-radius: 6px;
    box-shadow: 0 0 24px rgba(255, 107, 157, 0.06);
}
.begin-prompt {
    color: var(--pink);
    margin-right: 10px;
}

/* ----------------------------------------------------------
   FOOTER
   ---------------------------------------------------------- */
.page-foot {
    border-top: 1px solid rgba(106, 96, 120, 0.15);
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.06em;
    flex-wrap: wrap;
    gap: 12px;
}
.foot-mid { opacity: 0.7; }

/* ----------------------------------------------------------
   reveal animations on scroll
   ---------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}
.reveal.in {
    opacity: 1;
    transform: translateY(0);
}

/* ----------------------------------------------------------
   responsive
   ---------------------------------------------------------- */
@media (max-width: 640px) {
    .hex { --hex-size: 110px; }
    .hex-name { font-size: 11px; }
    .hex-desc { font-size: 10px; }
    .hex-counter { font-size: 9px; }
    .hex-row { gap: 8px; }
    .blob { padding: 50px 28px; }
    .blob-list { grid-template-columns: 1fr 1fr; gap: 10px 14px; }
    .phil-sep { margin: 0 10px; }
    .page-foot { font-size: 10px; padding: 22px 18px; }
}

@media (max-width: 420px) {
    .hex { --hex-size: 92px; }
    .hex-row { gap: 6px; }
    .hex-desc { display: none; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.2s !important;
    }
}
