:root {
    --bg-dark: #3b3a36;
    --bg-light: #f0ebe1;
    --text-primary: #2e2d29;
    --text-secondary: #5c5647;
    --text-tertiary: #a09882;
    --accent-warm: #c4a96a;
    --accent-cool: #6b8a5e;
    --border: #a09882;
    --shadow: #2e2d29;
    --hover: #d4c9a8;
    --text-light: #e8e0d0;
    --mid-tone: #8a7e6b;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Libre Baskerville', serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-light);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===================== */
/* SECTION 1: THE STATEMENT */
/* ===================== */

.section-hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-dark);
    overflow: hidden;
}

.noise-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    filter: url(#noise-filter);
    background: var(--bg-dark);
    pointer-events: none;
    z-index: 1;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.03em;
    line-height: 0.95;
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

/* ===================== */
/* SECTION 2: THE PROCESS */
/* ===================== */

.section-process {
    background-color: var(--bg-light);
    padding: 5rem 2rem;
    overflow-x: auto;
}

.process-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 1100px;
    margin: 0 auto;
}

.process-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.process-icon {
    width: 120px;
    height: 120px;
}

.iso-icon {
    width: 100%;
    height: 100%;
}

.process-label {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.process-line {
    width: 80px;
    height: 20px;
    flex-shrink: 0;
}

.connecting-line {
    stroke-dasharray: 6 4;
    stroke-dashoffset: 88;
    transition: stroke-dashoffset 1.5s ease-in-out;
}

.connecting-line.animated {
    stroke-dashoffset: 0;
}

/* ===================== */
/* SECTION 3: THE GRID */
/* ===================== */

.section-grid {
    position: relative;
    background-color: var(--bg-dark);
    padding: 6rem 2rem;
    overflow: hidden;
}

.blob-bg {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    border-radius: 40% 60% 55% 45% / 35% 65% 50% 50%;
    animation: morph 10s ease-in-out infinite, drift 20s ease-in-out infinite alternate;
}

.blob-bg-1 {
    width: 400px;
    height: 300px;
    background-color: var(--accent-warm);
    opacity: 0.08;
    top: 10%;
    left: -5%;
}

.blob-bg-2 {
    width: 350px;
    height: 280px;
    background-color: var(--accent-cool);
    opacity: 0.06;
    bottom: 15%;
    right: -3%;
    animation-delay: -5s;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Card subtle rotation for decomposition effect */
.card:nth-child(2) { transform: rotate(0.5deg); }
.card:nth-child(4) { transform: rotate(-1deg); }
.card:nth-child(5) { transform: rotate(1.2deg); }
.card:nth-child(7) { transform: rotate(-0.8deg); }
.card:nth-child(8) { transform: rotate(0.7deg); }
.card:nth-child(9) { transform: rotate(-1.5deg); }

.card-wide {
    grid-column: span 2;
}

.card {
    perspective: 1000px;
    position: relative;
    min-height: 280px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 280px;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 2px;
    border: 1px solid var(--border);
    box-shadow: 4px 4px 0 rgba(46, 45, 41, 0.4);
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-front {
    background-color: var(--bg-light);
}

.card-back {
    background-color: var(--hover);
    transform: rotateY(180deg);
    position: relative;
    overflow: hidden;
}

.kraft-texture {
    position: absolute;
    inset: 0;
    opacity: 0.15;
    filter: url(#kraft-noise);
    background: var(--hover);
    pointer-events: none;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 23px,
        rgba(160, 152, 130, 0.08) 23px,
        rgba(160, 152, 130, 0.08) 24px
    );
}

.card-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 16px;
}

.card-headline {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.card-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary);
}

.card-annotation {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

.card-meta {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

.tap-label {
    display: none;
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    position: absolute;
    bottom: 8px;
    right: 12px;
    z-index: 5;
}

/* Desktop hover flip */
@media (hover: hover) and (pointer: fine) {
    .card:hover .card-inner {
        transform: rotateY(180deg);
    }
    .card.flipped .card-inner {
        transform: rotateY(180deg);
    }
}

/* ===================== */
/* BLOB DIVIDER */
/* ===================== */

.blob-divider {
    height: 60px;
    background-color: var(--bg-light);
    border-radius: 40% 60% 55% 45% / 100% 100% 0% 0%;
    margin-top: -30px;
    position: relative;
    z-index: 2;
}

/* ===================== */
/* SECTION 4: THE MANIFESTO */
/* ===================== */

.section-manifesto {
    background-color: var(--bg-light);
    padding: 6rem 2rem;
}

.manifesto-content {
    max-width: 640px;
    margin: 0 auto;
}

.manifesto-opening {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.7;
    color: var(--accent-cool);
    margin-bottom: 2rem;
}

.manifesto-content p {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: 0.005em;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.manifesto-content p:nth-child(3) {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.manifesto-content p:nth-child(7) {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 18px;
    line-height: 1.7;
    color: var(--accent-cool);
}

.manifesto-content p:last-child {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-top: 2rem;
}

/* ===================== */
/* SECTION 5: THE LOOP */
/* ===================== */

.section-loop {
    background-color: var(--bg-dark);
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.loop-blob {
    width: clamp(300px, 40vw, 500px);
    height: clamp(300px, 40vw, 500px);
    background: radial-gradient(circle farthest-corner, var(--accent-warm), var(--accent-cool));
    border-radius: 40% 60% 55% 45% / 35% 65% 50% 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: morph 10s ease-in-out infinite;
}

.loop-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 6vw, 5rem);
    color: var(--bg-dark);
    letter-spacing: -0.03em;
}

/* ===================== */
/* ANIMATIONS */
/* ===================== */

@keyframes morph {
    0%   { border-radius: 40% 60% 55% 45% / 35% 65% 50% 50%; }
    25%  { border-radius: 55% 45% 40% 60% / 60% 40% 55% 45%; }
    50%  { border-radius: 45% 55% 60% 40% / 50% 50% 35% 65%; }
    75%  { border-radius: 60% 40% 45% 55% / 45% 55% 60% 40%; }
    100% { border-radius: 40% 60% 55% 45% / 35% 65% 50% 50%; }
}

@keyframes drift {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(30px, -20px); }
    100% { transform: translate(-20px, 30px); }
}

/* ===================== */
/* RESPONSIVE */
/* ===================== */

@media (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .card-wide {
        grid-column: span 2;
    }
    .process-flow {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(2.2rem, 10vw, 4rem);
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .card-wide {
        grid-column: span 1;
    }

    .card {
        min-height: 240px;
    }

    .card-inner {
        min-height: 240px;
    }

    /* Disable hover flip on mobile */
    .card:hover .card-inner {
        transform: none;
    }

    .card.flipped .card-inner {
        transform: rotateY(180deg);
    }

    .tap-label {
        display: block;
    }

    /* Cards lose rotation on mobile for readability */
    .card:nth-child(n) {
        transform: none;
    }

    .process-flow {
        flex-direction: column;
        gap: 0;
    }

    .process-line {
        width: 20px;
        height: 60px;
        transform: rotate(90deg);
    }

    .process-icon {
        width: 80px;
        height: 80px;
    }

    .loop-blob {
        width: 250px;
        height: 250px;
    }

    .blob-bg-1,
    .blob-bg-2 {
        width: 200px;
        height: 150px;
    }
}
