/* ============================================
   chloengine.com - Bauhaus Constructivism
   Muted Vintage Palette | Ma-Negative-Space
   ============================================ */

:root {
    --bg-primary: #F5F0E6;
    --bg-secondary: #EDE6D6;
    --text-primary: #3D3228;
    --text-secondary: #8B7E6A;
    --accent-warm: #C4A870;
    --accent-cool: #7A8B7A;
    --stroke: #A6956D;
    --glass-base: #F0EBE0;
    --glass-tint: rgba(240, 235, 224, 0.55);
    --glass-border: rgba(164, 149, 109, 0.3);
}

/* ---- Reset & Base ---- */

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

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

body {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--text-primary);
    background: radial-gradient(ellipse at 50% 30%, #F5F0E6 0%, #EDE6D6 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Paper grain overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* SVG filters hidden */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ---- Typography ---- */

h1, h2, h3 {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2rem, 5vw, 4.5rem);
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
}

h3 {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
}

p {
    max-width: 38ch;
    color: var(--text-secondary);
}

/* Caption style */
.caption {
    font-weight: 200;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

/* ---- Blur-Focus Transition System ---- */

.station-element {
    filter: blur(8px);
    opacity: 0.4;
    transition: filter 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.station-element.in-view {
    filter: blur(0px);
    opacity: 1;
}

/* Character animation spans */
.char-span {
    display: inline-block;
    opacity: 0;
    filter: blur(4px);
    transform: translateY(8px);
    transition: opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease;
}

.char-span.revealed {
    opacity: 1;
    filter: blur(0px);
    transform: translateY(0);
}

/* ---- Navigation ---- */

.nav-shapes {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-shape {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--stroke);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-shape svg {
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    flex-shrink: 0;
}

.nav-shape:hover svg {
    transform: scale(1.3);
}

.nav-label {
    font-family: 'Commissioner', sans-serif;
    font-weight: 200;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    filter: blur(4px);
    transition: opacity 0.4s ease, filter 0.4s ease;
    white-space: nowrap;
}

.nav-shape:hover .nav-label {
    opacity: 1;
    filter: blur(0px);
}

/* ---- Stations (General) ---- */

.station {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 2rem;
    position: relative;
}

/* ---- Station 1: Circle (Hero) ---- */

.station-circle {
    background: transparent;
}

.circle-container {
    position: relative;
    width: min(60vw, 60vh);
    height: min(60vw, 60vh);
    display: flex;
    align-items: center;
    justify-content: center;
}

.enso-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Enso breathing rotation */
@keyframes enso-breathe {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.enso-circle {
    animation: enso-breathe 60s linear infinite;
}

.circle-content {
    text-align: center;
    z-index: 1;
    padding: 2rem;
}

.circle-content h1 {
    margin-bottom: 1.5rem;
}

.circle-tagline {
    font-weight: 200;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    max-width: 32ch;
    margin: 0 auto;
}

/* ---- Station 2: Triangle (Philosophy) ---- */

.station-triangle {
    background: var(--bg-secondary);
}

.triangle-composition {
    position: relative;
    width: min(80vw, 900px);
    height: min(80vw, 780px);
}

.triangle-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
}

/* Triangle side draw animation */
.triangle-side {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.triangle-side.drawn {
    stroke-dashoffset: 0;
}

.triangle-vertex {
    position: absolute;
    max-width: 280px;
}

.triangle-vertex h2 {
    margin-bottom: 0.75rem;
}

.triangle-vertex p {
    font-size: clamp(0.85rem, 1vw, 1rem);
    line-height: 1.65;
}

.vertex-top {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.vertex-right {
    bottom: 5%;
    right: 0;
    text-align: right;
}

.vertex-left {
    bottom: 5%;
    left: 0;
    text-align: left;
}

/* ---- Section Divider ---- */

.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 4vh 0;
}

/* ---- Station 3: Square (Capabilities) ---- */

.station-square {
    background: transparent;
    padding: 15vh 2rem;
}

.square-grid {
    display: grid;
    grid-template-columns: repeat(2, min(20vw, 280px));
    gap: clamp(1rem, 2vw, 2rem);
    justify-content: center;
}

.glass-card {
    width: min(20vw, 280px);
    height: min(20vw, 280px);
    background: var(--glass-tint);
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
    border: 1px solid var(--glass-border);
    border-radius: 2px;
    box-shadow: 0 8px 32px rgba(61, 50, 40, 0.06);
    padding: clamp(1.5rem, 2vw, 2.5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transform: translateZ(0);
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                backdrop-filter 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.glass-card:hover {
    transform: translateZ(8px) scale(1.01);
    box-shadow: 0 16px 48px rgba(61, 50, 40, 0.10);
    backdrop-filter: blur(16px) saturate(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
}

.glass-card h3 {
    margin-bottom: 0.75rem;
}

.glass-card p {
    font-size: clamp(0.8rem, 0.9vw, 0.95rem);
    line-height: 1.65;
}

/* ---- Station 4: Composition (Integration) ---- */

.station-composition {
    background: var(--bg-secondary);
    flex-direction: column;
    gap: 4rem;
}

.composition-container {
    position: relative;
    width: min(70vw, 700px);
    height: min(50vw, 500px);
}

.comp-shape {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.comp-shape svg {
    width: 100%;
    height: 100%;
}

.comp-text {
    position: absolute;
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    letter-spacing: 0.06em;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
}

.comp-circle {
    width: min(28vw, 280px);
    height: min(28vw, 280px);
    left: 5%;
    top: 10%;
}

.comp-triangle {
    width: min(24vw, 240px);
    height: min(22vw, 220px);
    right: 10%;
    top: 5%;
}

.comp-square {
    width: min(22vw, 220px);
    height: min(22vw, 220px);
    left: 35%;
    bottom: 5%;
}

/* Merged state for scroll-linked animation */
.comp-shape.merged {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.composition-summary {
    text-align: center;
    font-weight: 200;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    letter-spacing: 0.04em;
    max-width: 50ch;
}

/* ---- Station 5: Line (Contact) ---- */

.station-line {
    background: transparent;
    flex-direction: column;
    gap: 3rem;
}

.line-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.line-word {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-primary);
    max-width: none;
}

.horizontal-line {
    width: 60%;
    height: 1px;
    background-color: var(--text-secondary);
}

.line-contact {
    font-weight: 200;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    text-align: center;
}

/* ---- 12-Column Grid System ---- */

@media (min-width: 1024px) {
    .station {
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        column-gap: clamp(1rem, 2vw, 2rem);
        align-content: center;
        justify-items: center;
    }

    .circle-container,
    .triangle-composition,
    .square-grid,
    .composition-container,
    .composition-summary,
    .line-content {
        grid-column: 3 / 11;
    }

    .station-composition {
        grid-template-rows: auto auto;
    }

    .composition-summary {
        grid-column: 3 / 11;
    }
}

@media (min-width: 1440px) {
    .circle-container,
    .triangle-composition,
    .square-grid,
    .composition-container,
    .composition-summary,
    .line-content {
        grid-column: 4 / 10;
    }
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .nav-shapes {
        top: 1rem;
        left: 1rem;
    }

    .square-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .glass-card {
        width: min(70vw, 280px);
        height: min(70vw, 280px);
    }

    .triangle-composition {
        width: 90vw;
        height: auto;
        min-height: 90vh;
    }

    .vertex-top {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin-bottom: 3rem;
    }

    .vertex-right {
        position: relative;
        bottom: auto;
        right: auto;
        text-align: left;
        margin-bottom: 3rem;
    }

    .vertex-left {
        position: relative;
        bottom: auto;
        left: auto;
    }

    .triangle-lines {
        display: none;
    }

    .triangle-composition {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        padding: 2rem 0;
    }

    .composition-container {
        width: 90vw;
        height: 60vh;
    }

    .comp-circle {
        width: 45vw;
        height: 45vw;
    }

    .comp-triangle {
        width: 40vw;
        height: 35vw;
    }

    .comp-square {
        width: 38vw;
        height: 38vw;
    }

    .horizontal-line {
        width: 80%;
    }
}
