/* ============================================
   monopole.center — Generative Art Laboratory
   ============================================ */

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

:root {
    --cool-white: #E0E0F0;
    --muted-lavender: #A0A0B0;
    --neon-green: #00FF88;
    --electric-magenta: #FF0088;
    --deep-space: #0A0A14;
    --grid-line: #1A1A2A;
    --vintage-sepia: #C0B090;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-space);
    color: var(--muted-lavender);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Cursor Canvas --- */
#cursor-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* --- Botanical Overlay --- */
#botanical-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 1.5s ease;
}

#botanical-overlay.visible {
    opacity: 0.6;
}

#botanical-svg {
    width: 100%;
    height: 100%;
}

.botanical-stem .stem-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3s ease;
}

.botanical-stem.grow .stem-path {
    stroke-dashoffset: 0;
}

.botanical-stem .leaf {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.5s ease 1.5s;
}

.botanical-stem.grow .leaf {
    stroke-dashoffset: 0;
}

.botanical-stem .seed-pod {
    opacity: 0;
    transition: opacity 1s ease 2.5s;
}

.botanical-stem.grow .seed-pod {
    opacity: 1;
}

/* Staggered stem growth */
.stem-2 .stem-path { transition-delay: 0.3s; }
.stem-2 .leaf { transition-delay: 1.8s; }
.stem-2 .seed-pod { transition-delay: 2.8s; }

.stem-3 .stem-path { transition-delay: 0.6s; }
.stem-3 .leaf { transition-delay: 2.1s; }
.stem-3 .seed-pod { transition-delay: 3.1s; }

.stem-4 .stem-path { transition-delay: 0.9s; }
.stem-4 .leaf { transition-delay: 2.4s; }
.stem-4 .seed-pod { transition-delay: 3.4s; }

/* --- Typography --- */
h1, h2, h3, .section-heading {
    font-family: 'Josefin Sans', sans-serif;
    color: var(--cool-white);
    letter-spacing: 0.15em;
    font-weight: 700;
}

.code-label {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    color: var(--neon-green);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 2s ease;
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    background-size: 60px 60px;
}

#grid-lines.visible {
    opacity: 1;
}

#hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

#site-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--cool-white);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.title-text {
    display: inline;
}

.cursor-blink {
    color: var(--neon-green);
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

#site-tagline {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#site-tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Portfolio Grid --- */
#portfolio {
    position: relative;
    padding: 4rem 2rem;
    z-index: 10;
}

#portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 180px;
    gap: 3px;
    max-width: 1400px;
    margin: 0 auto;
}

.grid-item {
    position: relative;
    overflow: hidden;
    background-color: var(--grid-line);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.grid-item.span-1 {
    grid-row: span 1;
}

.grid-item.span-2 {
    grid-row: span 2;
}

.grid-item.span-3 {
    grid-row: span 3;
}

.item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.item-visual {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.item-visual canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Vintage Photo Treatment */
.vintage-photo {
    filter: grayscale(0.8) contrast(1.4);
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(192, 176, 144, 0.15), transparent);
    z-index: 2;
}

/* Item Info Overlay */
.item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(to top, rgba(10, 10, 20, 0.95) 0%, rgba(10, 10, 20, 0.6) 60%, transparent 100%);
    z-index: 5;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.grid-item:hover .item-info {
    opacity: 1;
    transform: translateY(0);
}

.item-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.7rem;
}

.item-title {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

.item-desc {
    font-size: 0.8rem;
    color: var(--muted-lavender);
    line-height: 1.5;
}

/* Grid Item Hover */
.grid-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid transparent;
    transition: border-color 0.4s ease;
    z-index: 4;
    pointer-events: none;
}

.grid-item:hover::after {
    border-color: var(--electric-magenta);
}

/* --- Parameters Section --- */
#parameters {
    position: relative;
    padding: 6rem 2rem;
    z-index: 10;
    border-top: 1px solid var(--grid-line);
}

#params-content {
    max-width: 1400px;
    margin: 0 auto;
}

.section-heading {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 300;
    margin-bottom: 3rem;
    text-transform: uppercase;
}

#params-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.param-block {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    border: 1px solid var(--grid-line);
    transition: border-color 0.4s ease, background-color 0.4s ease;
}

.param-block:hover {
    border-color: var(--neon-green);
    background-color: rgba(0, 255, 136, 0.03);
}

.param-label {
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.param-value {
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    font-weight: 700;
    color: var(--cool-white);
    letter-spacing: 0.1em;
}

/* --- Footer --- */
#site-footer {
    position: relative;
    z-index: 10;
    border-top: 1px solid var(--grid-line);
    padding: 2rem;
}

#footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.footer-divider {
    color: var(--grid-line);
    font-family: 'Fira Code', monospace;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    #portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 150px;
    }

    #params-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 140px;
    }

    #params-grid {
        grid-template-columns: 1fr;
    }

    #footer-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-divider {
        display: none;
    }
}

@media (max-width: 480px) {
    #portfolio-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 200px;
    }

    .grid-item.span-2,
    .grid-item.span-3 {
        grid-row: span 2;
    }

    #portfolio {
        padding: 2rem 1rem;
    }

    #parameters {
        padding: 3rem 1rem;
    }
}

/* --- Selection --- */
::selection {
    background: var(--electric-magenta);
    color: var(--cool-white);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--deep-space);
}

::-webkit-scrollbar-thumb {
    background: var(--grid-line);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-green);
}
