/* bada.systems - Swiss-botanical hybrid design */
/* Colors: #162a3a, #0b1d2c, #f4f0e8, #2e6b7f, #5a7d8a, #d4c4a8, #c4786e, #7a9e82 */

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

:root {
    --deep-navy: #0b1d2c;
    --navy: #162a3a;
    --cream: #f4f0e8;
    --teal: #2e6b7f;
    --slate-blue: #5a7d8a;
    --sand: #d4c4a8;
    --coral: #c4786e;
    --kelp-green: #7a9e82;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-ui: 'Inter', 'Helvetica Neue', sans-serif;
}

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

body {
    background-color: var(--cream);
    color: var(--deep-navy);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
}

/* 12-column grid overlay */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0;
    padding: 0 4vw;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
}

.grid-col {
    border-left: 1px solid var(--teal);
    border-right: 1px solid var(--teal);
    height: 100%;
}

/* Spread (section) base styles */
.spread {
    position: relative;
    min-height: 100vh;
    padding: 8vh 4vw;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.spread-border {
    position: absolute;
    top: 2vh;
    left: 2vw;
    right: 2vw;
    bottom: 2vh;
    border: 1px solid transparent;
    pointer-events: none;
    z-index: 10;
}

.spread.is-visible .spread-border {
    animation: borderDraw 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes borderDraw {
    0% {
        border-color: transparent;
        clip-path: polygon(0 0, 0 0, 0 0, 0 0);
    }
    25% {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0);
    }
    75% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    100% {
        border-color: var(--sand);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

.spread-content {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2vw;
    z-index: 5;
}

.spread-index {
    position: absolute;
    bottom: 3vh;
    right: 4vw;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: var(--slate-blue);
    opacity: 0.6;
    z-index: 10;
}

/* Section titles */
.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(48px, 7vw, 96px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--deep-navy);
    margin-bottom: 2rem;
}

.section-body {
    font-family: var(--font-body);
    font-size: clamp(16px, 1.2vw, 20px);
    font-weight: 300;
    line-height: 1.75;
    color: var(--navy);
    margin-bottom: 1.5rem;
    max-width: 540px;
}

/* ==================== SPREAD 1: TITLE ==================== */
.spread-title {
    background: linear-gradient(175deg, var(--deep-navy) 0%, var(--navy) 60%, var(--teal) 100%);
    min-height: 100vh;
    align-items: center;
}

.spread-title .spread-border {
    border-color: rgba(244, 240, 232, 0.15);
}

.spread-title.is-visible .spread-border {
    border-color: rgba(244, 240, 232, 0.15);
}

.title-text {
    grid-column: 2 / 7;
    position: relative;
    z-index: 5;
}

.title-korean {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(120px, 18vw, 240px);
    font-weight: 500;
    color: rgba(244, 240, 232, 0.06);
    line-height: 0.85;
    letter-spacing: -0.03em;
    position: absolute;
    top: -0.3em;
    left: -0.2em;
    pointer-events: none;
    user-select: none;
}

.title-main {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(56px, 8vw, 112px);
    line-height: 1.0;
    letter-spacing: -0.03em;
    color: var(--cream);
    position: relative;
}

.title-dot {
    color: var(--coral);
}

.title-subtitle {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--sand);
    margin-top: 2rem;
    opacity: 0.8;
}

.title-botanical {
    grid-column: 8 / 13;
    position: relative;
    height: 60vh;
    min-height: 400px;
}

/* Kelp fronds - CSS botanical forms */
.botanical-kelp {
    position: absolute;
    width: 60px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    opacity: 0.7;
    transform-origin: bottom center;
}

.kelp-1 {
    height: 320px;
    right: 20%;
    bottom: 0;
    background: linear-gradient(180deg, rgba(122, 158, 130, 0.3) 0%, rgba(122, 158, 130, 0.8) 100%);
    animation: kelpSway 8s ease-in-out infinite;
    width: 45px;
}

.kelp-2 {
    height: 250px;
    right: 40%;
    bottom: 0;
    background: linear-gradient(180deg, rgba(122, 158, 130, 0.2) 0%, rgba(122, 158, 130, 0.6) 100%);
    animation: kelpSway 10s ease-in-out infinite 1s;
    width: 35px;
}

.kelp-3 {
    height: 380px;
    right: 10%;
    bottom: 0;
    background: linear-gradient(180deg, rgba(122, 158, 130, 0.25) 0%, rgba(122, 158, 130, 0.7) 100%);
    animation: kelpSway 9s ease-in-out infinite 0.5s;
    width: 50px;
}

@keyframes kelpSway {
    0%, 100% { transform: rotate(-3deg) skewX(1deg); }
    50% { transform: rotate(3deg) skewX(-1deg); }
}

/* Anemone forms */
.botanical-anemone {
    position: absolute;
    border-radius: 50%;
}

.anemone-1 {
    width: 140px;
    height: 140px;
    right: 30%;
    bottom: 5%;
    background: radial-gradient(circle at 40% 40%, rgba(196, 120, 110, 0.6) 0%, rgba(196, 120, 110, 0.2) 40%, transparent 70%);
    box-shadow:
        inset 0 0 30px rgba(196, 120, 110, 0.3),
        0 0 60px rgba(196, 120, 110, 0.15);
    animation: anemoneFloat 6s ease-in-out infinite;
}

@keyframes anemoneFloat {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.05) translateY(-5px); }
}

/* ==================== SPREAD 2: OBSERVATION ==================== */
.spread-observation {
    background-color: var(--cream);
}

.observation-text {
    grid-column: 2 / 7;
    padding: 4vh 0;
}

.observation-visual {
    grid-column: 8 / 12;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 300px;
}

.data-stream {
    position: relative;
    width: 100%;
    height: 200px;
}

.stream-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--teal);
    opacity: 0.4;
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.spread-observation.is-visible .stream-line {
    transform: scaleX(1);
}

.stream-line:nth-child(1) { top: 10%; transition-delay: 0.2s; }
.stream-line:nth-child(2) { top: 30%; transition-delay: 0.4s; opacity: 0.6; }
.stream-line:nth-child(3) { top: 50%; transition-delay: 0.6s; }
.stream-line:nth-child(4) { top: 70%; transition-delay: 0.8s; opacity: 0.3; }
.stream-line:nth-child(5) { top: 90%; transition-delay: 1.0s; opacity: 0.5; }

.coral-1 {
    width: 100px;
    height: 120px;
    position: absolute;
    bottom: 0;
    right: 0;
    background:
        radial-gradient(ellipse at 30% 80%, rgba(196, 120, 110, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(196, 120, 110, 0.3) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 90%, rgba(196, 120, 110, 0.4) 0%, transparent 45%);
    border-radius: 40% 60% 30% 70% / 50% 40% 60% 50%;
    opacity: 0.6;
}

/* ==================== SPREAD 3: INFRASTRUCTURE ==================== */
.spread-infrastructure {
    background: linear-gradient(180deg, var(--navy) 0%, var(--deep-navy) 100%);
}

.spread-infrastructure .section-title,
.spread-infrastructure .section-body {
    color: var(--cream);
}

.infra-visual {
    grid-column: 1 / 6;
    position: relative;
    min-height: 400px;
}

.kelp-4 {
    height: 280px;
    left: 20%;
    bottom: 10%;
    background: linear-gradient(180deg, rgba(122, 158, 130, 0.2) 0%, rgba(122, 158, 130, 0.6) 100%);
    animation: kelpSway 11s ease-in-out infinite;
    width: 40px;
}

.kelp-5 {
    height: 220px;
    left: 50%;
    bottom: 10%;
    background: linear-gradient(180deg, rgba(122, 158, 130, 0.15) 0%, rgba(122, 158, 130, 0.5) 100%);
    animation: kelpSway 9s ease-in-out infinite 2s;
    width: 30px;
}

.anemone-2 {
    width: 100px;
    height: 100px;
    left: 35%;
    bottom: 5%;
    background: radial-gradient(circle at 50% 50%, rgba(196, 120, 110, 0.4) 0%, transparent 60%);
    animation: anemoneFloat 7s ease-in-out infinite 1s;
}

.depth-markers {
    position: absolute;
    left: 5%;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2vh 0;
}

.depth-mark {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.15em;
    color: var(--slate-blue);
    opacity: 0.5;
    position: relative;
    padding-left: 20px;
}

.depth-mark::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 12px;
    height: 1px;
    background: var(--slate-blue);
    opacity: 0.4;
}

.infra-text {
    grid-column: 7 / 12;
    padding: 4vh 0;
}

.pull-quote {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(22px, 2.5vw, 32px);
    line-height: 1.4;
    color: var(--sand);
    border-left: 2px solid var(--coral);
    padding-left: 1.5rem;
    margin-top: 2rem;
    max-width: 480px;
}

.quote-mark {
    font-size: 1.5em;
    color: var(--coral);
    line-height: 0;
    vertical-align: -0.15em;
}

/* ==================== SPREAD 4: TAXONOMY ==================== */
.spread-taxonomy {
    background-color: var(--cream);
}

.taxonomy-text {
    grid-column: 2 / 6;
    padding: 4vh 0;
}

.taxonomy-specimens {
    grid-column: 7 / 12;
    display: flex;
    gap: 2vw;
    align-items: flex-end;
    padding: 4vh 0;
}

.specimen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.specimen:hover {
    transform: translateY(-10px);
}

.specimen-form {
    width: 100%;
    aspect-ratio: 3 / 4;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.botanical-specimen-1 {
    background:
        radial-gradient(ellipse at 50% 100%, rgba(122, 158, 130, 0.7) 0%, transparent 60%),
        linear-gradient(0deg, rgba(122, 158, 130, 0.4) 0%, transparent 80%);
    border-radius: 20% 20% 50% 50% / 10% 10% 40% 40%;
    clip-path: polygon(40% 0%, 60% 0%, 70% 20%, 65% 50%, 75% 80%, 60% 100%, 40% 100%, 25% 80%, 35% 50%, 30% 20%);
}

.botanical-specimen-2 {
    background:
        radial-gradient(circle at 40% 50%, rgba(196, 120, 110, 0.6) 0%, transparent 50%),
        radial-gradient(circle at 60% 30%, rgba(196, 120, 110, 0.4) 0%, transparent 40%),
        radial-gradient(circle at 50% 70%, rgba(196, 120, 110, 0.5) 0%, transparent 45%);
    border-radius: 40% 60% 50% 50% / 50% 40% 60% 50%;
}

.botanical-specimen-3 {
    background:
        radial-gradient(ellipse at 50% 40%, rgba(212, 196, 168, 0.8) 0%, transparent 50%),
        conic-gradient(from 0deg at 50% 60%, rgba(244, 240, 232, 0.5) 0deg, transparent 30deg, rgba(244, 240, 232, 0.3) 60deg, transparent 90deg, rgba(244, 240, 232, 0.5) 120deg, transparent 150deg, rgba(244, 240, 232, 0.3) 180deg, transparent 210deg, rgba(244, 240, 232, 0.5) 240deg, transparent 270deg, rgba(244, 240, 232, 0.3) 300deg, transparent 330deg, rgba(244, 240, 232, 0.5) 360deg);
    border-radius: 50% 50% 45% 55% / 60% 55% 45% 40%;
}

.specimen-label {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 14px;
    color: var(--navy);
    display: block;
    margin-bottom: 0.25rem;
}

.specimen-common {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--slate-blue);
}

/* ==================== SPREAD 5: SIGNAL ==================== */
.spread-signal {
    background: var(--deep-navy);
}

.spread-signal .section-title,
.spread-signal .section-body {
    color: var(--cream);
}

.signal-visual {
    grid-column: 1 / 13;
    height: 200px;
    margin-bottom: 4vh;
}

.wave-form {
    width: 100%;
    height: 100%;
}

.wave-form svg {
    width: 100%;
    height: 100%;
}

.wave-path {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    opacity: 0.7;
}

.wave-1 { stroke: var(--teal); }
.wave-2 { stroke: var(--coral); opacity: 0.5; }
.wave-3 { stroke: var(--kelp-green); opacity: 0.4; }

.signal-text {
    grid-column: 2 / 7;
}

/* ==================== SPREAD 6: COLOPHON ==================== */
.spread-colophon {
    background-color: var(--cream);
    min-height: 60vh;
}

.colophon-text {
    grid-column: 2 / 11;
}

.colophon-title {
    font-size: clamp(36px, 5vw, 64px);
    margin-bottom: 3rem;
}

.colophon-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.colophon-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.colophon-label {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--slate-blue);
}

.colophon-value {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 300;
    color: var(--navy);
    line-height: 1.5;
}

.colophon-botanical {
    position: relative;
    height: 150px;
    margin-top: 2rem;
}

.kelp-6 {
    height: 140px;
    left: 60%;
    bottom: 0;
    background: linear-gradient(180deg, rgba(122, 158, 130, 0.15) 0%, rgba(122, 158, 130, 0.5) 100%);
    animation: kelpSway 10s ease-in-out infinite;
    width: 30px;
}

.coral-2 {
    width: 80px;
    height: 90px;
    position: absolute;
    bottom: 0;
    left: 70%;
    background:
        radial-gradient(ellipse at 40% 70%, rgba(196, 120, 110, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 65% 50%, rgba(196, 120, 110, 0.3) 0%, transparent 40%);
    border-radius: 45% 55% 40% 60% / 50% 45% 55% 50%;
    opacity: 0.5;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .spread-content {
        grid-template-columns: 1fr;
        gap: 3vh;
    }

    .title-text,
    .observation-text,
    .observation-visual,
    .infra-visual,
    .infra-text,
    .taxonomy-text,
    .taxonomy-specimens,
    .signal-visual,
    .signal-text,
    .colophon-text {
        grid-column: 1 / -1;
        padding: 2vh 2vw;
    }

    .title-botanical {
        grid-column: 1 / -1;
        height: 30vh;
        min-height: 200px;
    }

    .taxonomy-specimens {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .colophon-details {
        grid-template-columns: 1fr;
    }

    .grid-overlay {
        display: none;
    }
}

/* ==================== INITIAL STATES FOR ANIMATION ==================== */
.spread .section-title {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.spread .section-body {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

.spread .pull-quote {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.4s, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.4s;
}

.spread.is-visible .section-title,
.spread.is-visible .section-body,
.spread.is-visible .pull-quote {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

/* Title spread special animations */
.spread-title .title-main {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.3s, transform 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}

.spread-title .title-subtitle {
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1) 0.8s;
}

.spread-title.is-visible .title-main {
    opacity: 1;
    transform: translateY(0);
}

.spread-title.is-visible .title-subtitle {
    opacity: 0.8;
}

/* Specimens animation */
.specimen {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.spread-taxonomy.is-visible .specimen:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.3s; }
.spread-taxonomy.is-visible .specimen:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.5s; }
.spread-taxonomy.is-visible .specimen:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.7s; }
