/* ==========================================================================
   cbdc.studio — Styles
   Flat design. Marble-classical motifs. Triadic palette.
   ========================================================================== */

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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 400;
    color: #2c2c2e;
    background: #f5f2ed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Palette Variables --- */
:root {
    --blue: #2856a6;
    --terracotta: #c4523a;
    --gold: #d4a843;
    --marble-white: #f5f2ed;
    --graphite: #2c2c2e;
    --vein-grey: #c8c2b8;
    --gutter: 24px;
    --max-width: 1440px;
    --side-margin: clamp(24px, 4vw, 64px);
}

/* --- Grid System --- */
.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 var(--gutter);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--side-margin);
    width: 100%;
}

/* --- Typography --- */
h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 1rem;
}

p {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
}

/* --- Panel Base --- */
.panel {
    position: relative;
    width: 100%;
    overflow: hidden;
    scroll-snap-align: start;
}

.panel-content {
    position: relative;
    z-index: 2;
    height: 100%;
}

.marble-vein {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ==========================================================================
   Panel 1 — The Vestibule (Hero)
   ========================================================================== */
.panel-hero {
    height: 100vh;
    background: var(--blue);
}

.panel-hero .panel-content {
    align-items: center;
}

.panel-hero .marble-vein.carrara-simple {
    opacity: 0.3;
}

/* Stroke-dasharray animation for marble veins */
.panel-hero .marble-vein.carrara-simple path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawVein 2s ease-out 0.6s forwards;
}

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

.hero-logotype {
    grid-column: 2 / 8;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(3rem, 8vw, 8rem);
    color: var(--marble-white);
    letter-spacing: -0.06em;
    line-height: 1;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateX(-100px);
    animation: bounceInX 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s forwards;
}

.logo-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--gold);
    border-radius: 50%;
    margin: 0 0.05em;
    flex-shrink: 0;
    align-self: center;
    position: relative;
    top: 0.15em;
}

.hero-rule {
    grid-column: 2 / 9;
    height: 1px;
    background: var(--vein-grey);
    position: absolute;
    top: 60%;
    left: var(--side-margin);
    width: calc((8 / 12) * (min(100vw, var(--max-width)) - 2 * var(--side-margin)));
    opacity: 0;
    animation: fadeIn 0.6s ease-out 1s forwards;
}

@keyframes bounceInX {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    60% {
        transform: translateX(12px);
        opacity: 1;
    }
    80% {
        transform: translateX(-4px);
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================================================
   Panel 2 — The Statement
   ========================================================================== */
.panel-statement {
    min-height: 80vh;
    background: var(--marble-white);
    display: flex;
    align-items: center;
}

.panel-statement .panel-content {
    position: relative;
    width: 100%;
}

.currency-watermark {
    grid-column: 1 / 4;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(6rem, 12vw, 14rem);
    color: var(--graphite);
    opacity: 0.05;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    pointer-events: none;
}

.statement-text {
    grid-column: 5 / 12;
    display: flex;
    align-items: center;
    padding: clamp(3rem, 6vw, 6rem) 0;
}

.statement-text p {
    color: var(--graphite);
    text-align: right;
}

/* ==========================================================================
   Panel 3 — The Capabilities
   ========================================================================== */
.panel-capabilities {
    background: var(--marble-white);
}

.panel-capabilities .panel-content {
    padding-top: 0;
    padding-bottom: 0;
}

.capabilities-left {
    grid-column: 1 / 6;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.capabilities-right {
    grid-column: 7 / 13;
    display: flex;
}

.capability-block {
    padding: clamp(2rem, 4vw, 3.5rem);
}

.capability-block h3 {
    color: var(--marble-white);
}

.capability-block p {
    color: var(--marble-white);
}

.block-research {
    background: var(--terracotta);
}

.block-prototyping {
    background: var(--blue);
}

.block-design-systems {
    background: var(--gold);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Bounce-enter animation for capability blocks */
.capability-block {
    opacity: 0;
    transform: translateY(40px);
}

.capability-block.is-visible {
    animation: bounceInY 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes bounceInY {
    0% {
        transform: translateY(40px);
        opacity: 0;
    }
    60% {
        transform: translateY(-8px);
        opacity: 1;
    }
    80% {
        transform: translateY(3px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   Panel 4 — The Process
   ========================================================================== */
.panel-process {
    height: 100vh;
    background: var(--graphite);
    display: flex;
    align-items: center;
}

.panel-process .marble-vein.breccia-fragment {
    opacity: 0.15;
}

.panel-process .panel-content {
    width: 100%;
}

.timeline {
    grid-column: 2 / 12;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 120px;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--vein-grey);
    transform: translateY(-50%);
}

.timeline-phase {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.phase-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.circle-blue {
    background: var(--blue);
}

.circle-terracotta {
    background: var(--terracotta);
}

.circle-gold {
    background: var(--gold);
}

.phase-label {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--marble-white);
    white-space: nowrap;
}

.phase-label-above {
    margin-bottom: 16px;
}

.phase-label-below {
    margin-top: 16px;
}

/* Bounce animation for timeline circles */
.timeline-phase .phase-circle {
    transform: scale(0);
}

.timeline-phase.is-visible .phase-circle {
    animation: bounceScale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.timeline-phase .phase-label {
    opacity: 0;
}

.timeline-phase.is-visible .phase-label {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes bounceScale {
    0% {
        transform: scale(0);
    }
    60% {
        transform: scale(1.3);
    }
    80% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* ==========================================================================
   Panel 5 — The Closing
   ========================================================================== */
.panel-closing {
    height: 60vh;
    background: var(--marble-white);
    overflow: hidden;
}

.panel-closing .marble-vein.calacatta-bold {
    opacity: 0.12;
}

.panel-closing .panel-content {
    position: relative;
    height: 100%;
}

.closing-contact {
    grid-column: 2 / 5;
    padding-top: clamp(2rem, 4vw, 4rem);
}

.contact-email {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--graphite);
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.contact-location {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--vein-grey);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.closing-studio {
    grid-column: 6 / 13;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 20vw;
    color: var(--blue);
    letter-spacing: -0.06em;
    line-height: 0.85;
    align-self: end;
    position: relative;
    bottom: -0.15em;
    white-space: nowrap;
    user-select: none;
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .hero-logotype {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .hero-rule {
        opacity: 1;
        animation: none;
    }

    .panel-hero .marble-vein.carrara-simple path {
        stroke-dashoffset: 0;
        animation: none;
    }

    .capability-block {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .capability-block.is-visible {
        animation: none;
    }

    .timeline-phase .phase-circle {
        transform: scale(1);
    }

    .timeline-phase.is-visible .phase-circle {
        animation: none;
    }

    .timeline-phase .phase-label {
        opacity: 1;
    }

    .timeline-phase.is-visible .phase-label {
        animation: none;
    }
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
    .hero-logotype {
        grid-column: 1 / -1;
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .hero-rule {
        width: 70%;
    }

    .currency-watermark {
        position: absolute;
        left: var(--side-margin);
        top: 50%;
        transform: translateY(-50%);
        font-size: 20vw;
    }

    .statement-text {
        grid-column: 2 / 12;
    }

    .statement-text p {
        text-align: left;
    }

    .capabilities-left {
        grid-column: 1 / -1;
    }

    .capabilities-right {
        grid-column: 1 / -1;
    }

    .block-design-systems {
        min-height: auto;
    }

    .timeline {
        grid-column: 1 / -1;
        flex-direction: column;
        height: auto;
        gap: 3rem;
        padding: clamp(3rem, 6vw, 5rem) 0;
    }

    .timeline-line {
        top: 0;
        bottom: 0;
        left: 50%;
        right: auto;
        width: 1px;
        height: 100%;
        transform: translateX(-50%);
    }

    .timeline-phase {
        flex-direction: row;
        gap: 1rem;
    }

    .phase-label-above {
        margin-bottom: 0;
    }

    .phase-label-below {
        margin-top: 0;
    }

    .closing-contact {
        grid-column: 1 / -1;
    }

    .closing-studio {
        grid-column: 1 / -1;
        font-size: 25vw;
    }
}
