/* ==========================================================================
   cbdc.studio - Bauhaus Warmth Design System
   ========================================================================== */

/* Design compliance: IntersectionObserver threshold full-width (clipped rounded rectangle "Where design." buttons (Google */
/* Custom Properties */
:root {
    --bg-primary: #F0E6D3;
    --bg-secondary: #E3D5C1;
    --text-primary: #3B2F27;
    --text-secondary: #5C4F44;
    --accent-terracotta: #B8705A;
    --accent-denim: #6B859B;
    --accent-ochre: #C9A84C;
    --highlight: #FDF6EC;
    --border: #D1C4B2;
    --shadow: rgba(59, 47, 39, 0.08);
    --radius-pod: 2rem;
    --spacing-pod: clamp(8vh, 12vw, 16vh);
    --font-heading: 'Source Serif 4', Georgia, serif;
    --font-body: 'Source Sans 3', system-ui, sans-serif;
    --font-accent: 'Fraunces', Georgia, serif;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.1vw, 1.25rem);
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ==========================================================================
   ACT 1: THE PREMISE
   ========================================================================== */

.act-premise {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.premise-composition {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 80vh;
}

.bauhaus-circles {
    position: absolute;
    width: clamp(320px, 50vw, 600px);
    height: auto;
}

/* Breathing animation */
.breathing {
    animation: breathe 8s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(0.98); }
    50% { transform: scale(1.02); }
}

.premise-text {
    position: relative;
    z-index: 2;
    text-align: center;
}

.site-title {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: clamp(3rem, 6vw, 5rem);
    letter-spacing: 0.12em;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.site-tagline {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.5vw, 1.35rem);
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* Scroll chevron */
.scroll-chevron {
    position: absolute;
    bottom: 10vh;
    left: 50%;
    transform: translateX(-50%);
    animation: chevronBounce 2s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes chevronBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* ==========================================================================
   ACT 2: THE LANDSCAPE
   ========================================================================== */

.act-landscape {
    position: relative;
    min-height: 120vh;
    padding: var(--spacing-pod) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-pod);
}

/* Circuit nodes background */
.circuit-nodes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.circuit-svg {
    width: 100%;
    height: 100%;
    opacity: 0.4;
}

.circuit-node {
    animation: nodePulse 3s ease-in-out infinite;
}

.circuit-node:nth-child(4) { animation-delay: 0s; }
.circuit-node:nth-child(5) { animation-delay: 0.4s; }
.circuit-node:nth-child(6) { animation-delay: 0.8s; }
.circuit-node:nth-child(7) { animation-delay: 1.2s; }
.circuit-node:nth-child(8) { animation-delay: 1.6s; }
.circuit-node:nth-child(9) { animation-delay: 2.0s; }
.circuit-node:nth-child(10) { animation-delay: 2.4s; }

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

/* Binary watermarks */
.binary-watermark {
    position: absolute;
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 800;
    font-size: 20vw;
    color: var(--text-primary);
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
    line-height: 1;
    user-select: none;
}

.watermark-zero {
    top: 15%;
    right: 5%;
}

.watermark-one {
    top: 10%;
    left: 5%;
}

/* ==========================================================================
   Pod System
   ========================================================================== */

.pod {
    position: relative;
    z-index: 1;
    background-color: var(--highlight);
    border-radius: var(--radius-pod);
    padding: 2rem;
    box-shadow: 0 8px 32px var(--shadow), 0 2px 8px var(--shadow);
    transform: rotate(var(--pod-rotation, 0deg));
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pod.in-view {
    transform: rotate(0deg);
}

/* Blur-focus reveal */
.blur-target {
    filter: blur(12px);
    opacity: 0.6;
    transition: filter 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.blur-target.revealed {
    filter: blur(0);
    opacity: 1;
}

/* Landscape pods - S-curve positioning */
.pod-landscape {
    width: clamp(340px, 65vw, 75vw);
}

.pod-1 {
    align-self: flex-start;
    margin-left: 12vw;
}

.pod-2 {
    align-self: center;
    width: clamp(340px, 75vw, 85vw);
    padding: 0;
    overflow: hidden;
}

.pod-3 {
    align-self: flex-end;
    margin-right: 12vw;
}

.pod-text {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.1vw, 1.25rem);
    line-height: 1.7;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

/* Extended divider rule */
.extended-rule {
    width: calc(100% + 20vw);
    height: 1px;
    background-color: var(--border);
    margin-left: -10vw;
    position: relative;
    z-index: 1;
}

/* Collage composition */
.collage-composition {
    width: 100%;
    border-radius: var(--radius-pod);
    overflow: hidden;
}

.collage-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Guilloche drift animation */
.guilloche-drift {
    animation: guillocheDrift 60s linear infinite alternate;
}

@keyframes guillocheDrift {
    0% { transform: translateX(-20px); }
    100% { transform: translateX(20px); }
}

/* ==========================================================================
   ACT 3: THE WORKSHOP
   ========================================================================== */

.act-workshop {
    position: relative;
    min-height: 150vh;
    padding: var(--spacing-pod) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(4vh, 8vw, 10vh);
}

/* Callout words */
.callout-word {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 800;
    font-size: clamp(4rem, 10vw, 8rem);
    color: var(--accent-ochre);
    opacity: 0.6;
    text-align: center;
    line-height: 1;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

/* Workshop pods */
.pod-workshop {
    width: clamp(320px, 55vw, 65vw);
}

.pod-left {
    align-self: flex-start;
    margin-left: 10vw;
}

.pod-right {
    align-self: flex-end;
    margin-right: 10vw;
}

.pod-content-with-illustration {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.pod-text-block {
    flex: 1;
}

.pod-heading {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: 0.04em;
}

.pod-illustration {
    flex-shrink: 0;
    width: clamp(100px, 12vw, 160px);
    height: clamp(100px, 12vw, 160px);
}

.pod-illustration svg {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   ACT 4: THE CONNECTIONS
   ========================================================================== */

.act-connections {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-pod) 0;
    gap: 4rem;
}

.connections-network {
    width: 90vw;
    max-width: 1200px;
    position: relative;
}

.network-svg {
    width: 100%;
    height: auto;
}

/* Network node pulse */
.network-node {
    animation: nodePulse 3s ease-in-out infinite;
}

.network-node:nth-child(n+9):nth-child(-n+14) {
    /* Target the 6 network node circles */
}

.act-connections .network-node:nth-of-type(1) { animation-delay: 0s; }
.act-connections .network-node:nth-of-type(2) { animation-delay: 0.4s; }
.act-connections .network-node:nth-of-type(3) { animation-delay: 0.8s; }
.act-connections .network-node:nth-of-type(4) { animation-delay: 1.2s; }
.act-connections .network-node:nth-of-type(5) { animation-delay: 1.6s; }
.act-connections .network-node:nth-of-type(6) { animation-delay: 2.0s; }

.connections-text {
    max-width: 65vw;
    text-align: center;
}

.connections-statement {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: clamp(1.2rem, 2.2vw, 1.8rem);
    line-height: 1.5;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* ==========================================================================
   ACT 5: THE INVITATION
   ========================================================================== */

.act-invitation {
    position: relative;
    min-height: 80vh;
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-pod) 0;
    gap: 4rem;
}

.pod-invitation {
    width: clamp(340px, 55vw, 65vw);
    text-align: center;
    background-color: var(--highlight);
}

.invitation-heading {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: 0.04em;
}

/* Contact link with animated underline */
.contact-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    margin-top: 2rem;
    gap: 4px;
}

.contact-link-text {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: clamp(1.1rem, 1.5vw, 1.4rem);
    color: var(--accent-terracotta);
    letter-spacing: 0.02em;
}

.contact-underline {
    width: 220px;
    height: 4px;
    overflow: visible;
}

.contact-underline line {
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    animation: drawLine 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-play-state: paused;
}

.contact-link:hover .contact-underline line {
    animation-play-state: running;
}

.contact-link.line-animated .contact-underline line {
    animation-play-state: running;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* Closing composition */
.closing-composition {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.bauhaus-circles-small {
    width: clamp(150px, 20vw, 250px);
    height: auto;
}

/* ==========================================================================
   Floating Navigation
   ========================================================================== */

.floating-nav {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.nav-trigger {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background-color: var(--highlight);
    box-shadow: 0 4px 16px var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s ease;
}

.nav-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(59, 47, 39, 0.14);
}

.nav-items {
    position: absolute;
    bottom: 0;
    right: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-items.open {
    pointer-events: auto;
    opacity: 1;
}

.nav-node {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--highlight);
    border: 1.5px solid var(--border);
    box-shadow: 0 2px 8px var(--shadow);
    text-decoration: none;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.3s ease;
    transform: translate(0, 0) scale(0);
    opacity: 0;
}

.nav-items.open .nav-node {
    opacity: 1;
}

/* Quarter-circle arc positioning for 5 nodes */
.nav-items.open .nav-node:nth-child(1) {
    transform: translate(-10px, -70px) scale(1);
}
.nav-items.open .nav-node:nth-child(2) {
    transform: translate(-40px, -60px) scale(1);
}
.nav-items.open .nav-node:nth-child(3) {
    transform: translate(-60px, -40px) scale(1);
}
.nav-items.open .nav-node:nth-child(4) {
    transform: translate(-70px, -15px) scale(1);
}
.nav-items.open .nav-node:nth-child(5) {
    transform: translate(-72px, 12px) scale(1);
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-denim);
    transition: background-color 0.3s ease;
}

.nav-node:hover .nav-dot {
    background-color: var(--accent-terracotta);
}

/* Nav label on hover */
.nav-node::before {
    content: attr(data-label);
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.nav-node:hover::before {
    opacity: 1;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .pod-landscape {
        width: clamp(300px, 88vw, 92vw);
    }

    .pod-1 {
        margin-left: 4vw;
    }

    .pod-3 {
        margin-right: 4vw;
    }

    .pod-workshop {
        width: clamp(300px, 85vw, 92vw);
    }

    .pod-left {
        margin-left: 4vw;
    }

    .pod-right {
        margin-right: 4vw;
    }

    .pod-content-with-illustration {
        flex-direction: column;
    }

    .pod-right .pod-content-with-illustration {
        flex-direction: column;
    }

    .pod-illustration {
        width: 100px;
        height: 100px;
    }

    .callout-word {
        font-size: clamp(3rem, 15vw, 6rem);
    }

    .connections-text {
        max-width: 88vw;
    }

    .pod-invitation {
        width: clamp(300px, 88vw, 92vw);
    }

    .nav-items.open .nav-node:nth-child(1) {
        transform: translate(-8px, -65px) scale(1);
    }
    .nav-items.open .nav-node:nth-child(2) {
        transform: translate(-35px, -55px) scale(1);
    }
    .nav-items.open .nav-node:nth-child(3) {
        transform: translate(-55px, -35px) scale(1);
    }
    .nav-items.open .nav-node:nth-child(4) {
        transform: translate(-65px, -10px) scale(1);
    }
    .nav-items.open .nav-node:nth-child(5) {
        transform: translate(-65px, 15px) scale(1);
    }
}

@media (max-width: 480px) {
    .site-title {
        letter-spacing: 0.06em;
    }

    .pod {
        padding: 1.5rem;
    }

    .pod-heading {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
    }

    .bauhaus-circles {
        width: 280px;
    }

    .binary-watermark {
        font-size: 35vw;
    }
}
