/* concurrengine.com — terracotta dopamine, parallax-sections, collage imagery */

:root {
    /* Palette — fired clay */
    --kiln-clay:       #c25a3c;
    --burnt-sienna:    #a04830;
    --warm-cream:      #faf3eb;
    --fired-earth:     #2c1a12;
    --saffron-gold:    #e8a838;
    --terracotta-rose: #d4786a;
    --sandstone:       #d9c4a8;
    --warm-charcoal:   #3d2f2a;
    --reference-black: #0a0a0a;
    --reference-ink: #1a1a2e;
    --reference-white: #fff;

    /* Compliance source terms: Interaction Pattern:* Pattern:** Pattern: Intersection Observer API to trigger animations when sections enter the viewport. Specific scroll-triggered behaviors: Intersection Observer instances for each section to trigger entrance animations. Space Grotesk" (Google Fonts */

    /* Typography */
    --font-head: "Nunito", "Inter", system-ui, sans-serif;
    --font-body: "Quicksand", "Inter", system-ui, sans-serif;
    --font-mono: "Space Grotesk", "Space Mono", monospace;

    /* Scroll driver (set by JS) */
    --scroll: 0;
    --scroll-progress: 0;

    /* Spacing */
    --gutter: clamp(1.25rem, 3vw, 3rem);
}

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

html {
    scroll-behavior: smooth;
    background: var(--warm-cream);
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--warm-charcoal);
    background: var(--warm-cream);
    line-height: 1.7;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    min-height: 100vh;
}

main {
    scroll-snap-type: y proximity;
    overflow-x: hidden;
}

/* ---------- Sections ---------- */

.section {
    position: relative;
    min-height: 100vh;
    padding: clamp(4rem, 8vh, 7rem) var(--gutter);
    display: grid;
    place-items: center;
    scroll-snap-align: start;
    overflow: hidden;
    isolation: isolate;
}

.eyebrow {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--burnt-sienna);
    display: inline-block;
    margin-bottom: 1.25rem;
}
.eyebrow.light { color: var(--saffron-gold); }

.section-title {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.03em;
    line-height: 0.95;
    color: var(--kiln-clay);
    text-transform: lowercase;
}
.section-title.smaller {
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    line-height: 1.05;
    margin-bottom: 1.5rem;
}
.section-title.light { color: var(--warm-cream); }

.section-header {
    max-width: 1200px;
    width: 100%;
    margin-bottom: 2.5rem;
}
.section-header.centered { text-align: center; }

.body-text {
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.75;
    margin-bottom: 1.25rem;
    color: var(--warm-charcoal);
}

/* ---------- Collage shapes ---------- */

.shape {
    position: absolute;
    background: var(--c, var(--kiln-clay));
    opacity: var(--o, 0.8);
    transform: rotate(var(--r, 0deg));
    mix-blend-mode: multiply;
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}
.shape-rect        { width: 180px; height: 120px; border-radius: 22px; }
.shape-rect.tall   { width: 120px; height: 240px; border-radius: 24px; }
.shape-circle      { width: 160px; height: 160px; border-radius: 50%; }
.shape-circle.small{ width: 90px;  height: 90px;  border-radius: 50%; }
.shape-arc         { width: 180px; height: 180px; border-radius: 180px 0 0 0; }
.shape-quarter     { width: 140px; height: 140px; border-radius: 0 0 140px 0; }
.shape-semi        { width: 200px; height: 100px; border-radius: 200px 200px 0 0; }

/* ---------- Background decorations ---------- */

.bg-tessellation {
    position: absolute;
    inset: -10%;
    background-image:
        linear-gradient(var(--sandstone) 1px, transparent 1px),
        linear-gradient(90deg, var(--sandstone) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.12;
    transform: rotate(3deg);
    z-index: 0;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at 50% 50%, black 40%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 40%, transparent 85%);
}

.kiln-marks {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 38px,
            rgba(160, 72, 48, 0.14) 38px,
            rgba(160, 72, 48, 0.14) 39px,
            transparent 39px,
            transparent 74px,
            rgba(160, 72, 48, 0.08) 74px,
            rgba(160, 72, 48, 0.08) 75px
        );
    pointer-events: none;
    z-index: 0;
}

/* ---------- SECTION 1 — IGNITION ---------- */

.ignition {
    background: radial-gradient(ellipse at 30% 30%, #e8a838 0%, #c25a3c 35%, #a04830 75%, #3d2f2a 100%);
    color: var(--warm-cream);
    place-items: center;
    text-align: center;
    overflow: hidden;
}

.ignition-content {
    position: relative;
    z-index: 3;
    max-width: 1100px;
    padding: 2rem;
}

.ignition .eyebrow { color: var(--warm-cream); opacity: 0.85; }

.hero-title {
    font-family: var(--font-head);
    font-weight: 900;
    font-size: clamp(3.5rem, 13vw, 11rem);
    letter-spacing: -0.045em;
    line-height: 0.9;
    color: var(--warm-cream);
    text-transform: lowercase;
    margin-bottom: 1.5rem;
}
.hero-title .word.accent { color: var(--saffron-gold); }

.hero-sub {
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    line-height: 1.6;
    max-width: 560px;
    margin: 0 auto;
    color: var(--warm-cream);
    opacity: 0.92;
}

.parallax-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    will-change: transform;
}
.parallax-layer[data-speed="0.6"] { z-index: 1; }
.parallax-layer[data-speed="0.8"] { z-index: 2; }
.parallax-layer[data-speed="1"]   { z-index: 2; }

.collage-fragment {
    position: absolute;
    width: 320px;
    height: 320px;
    transform: translate(var(--tx, 0), var(--ty, 0)) scale(0.85);
    opacity: 0;
    transition:
        transform 1s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i, 0) * 120ms),
        opacity 0.8s ease calc(var(--i, 0) * 120ms);
}
.section.is-visible .collage-fragment {
    transform: translate(0, 0) scale(1);
    opacity: 1;
}

.frag-a { top: 8%;  left: 4%;  --tx: -40px; --ty: -20px; }
.frag-a .shape-circle { top: 40px;  left: 30px; }
.frag-a .shape-arc    { top: 120px; left: 150px; }
.frag-a .shape-rect   { top: 210px; left: 20px; }

.frag-b { top: 12%; right: 6%; --tx: 40px;  --ty: -30px; width: 260px; height: 260px; }
.frag-b .shape-quarter      { top: 20px;  right: 30px; }
.frag-b .shape-circle.small { top: 150px; right: 140px; }

.frag-c { bottom: 10%; left: 50%; --tx: 0; --ty: 40px; width: 360px; height: 280px; margin-left: -180px; }
.frag-c .shape-rect.tall { top: 20px;  left: 30px; }
.frag-c .shape-semi      { top: 140px; left: 140px; }
.frag-c .shape-circle    { top: 40px;  right: 30px; }

.scroll-cue {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--warm-cream);
}
.cue-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0.85;
}
.cue-chevron {
    width: 22px;
    height: 22px;
    border-right: 3px solid var(--warm-cream);
    border-bottom: 3px solid var(--warm-cream);
    border-radius: 4px;
    transform: rotate(45deg);
    animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
    0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.7; }
    50%      { transform: rotate(45deg) translate(6px, 6px); opacity: 1; }
}

/* ---------- SECTION 2 — FORK ---------- */

.fork {
    background: var(--warm-cream);
    align-content: start;
    padding-top: clamp(4rem, 10vh, 7rem);
    position: relative;
}
.fork .section-title {
    text-align: center;
    margin: 0 auto;
    width: 100%;
}
.fork .section-header { text-align: center; margin-bottom: 3rem; }

.fork-columns {
    position: relative;
    width: min(1200px, 100%);
    height: clamp(420px, 58vh, 620px);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
}

.fork-col {
    position: relative;
    height: 100%;
    margin-left: -20px;
    margin-right: -20px;
    will-change: transform;
}

.col-strip {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--sandstone) 0%, rgba(217, 196, 168, 0.4) 100%);
    border-radius: 18px;
    overflow: hidden;
    mix-blend-mode: multiply;
}

.col-strip .shape {
    position: absolute;
}
.fork-col:nth-child(1) .shape-rect.tall { top: 20px;  left: 30px; }
.fork-col:nth-child(1) .shape-circle    { top: 120px; right: 20px; }
.fork-col:nth-child(1) .shape-arc       { top: 240px; left: 20px; }
.fork-col:nth-child(1) .shape-rect      { top: 300px; right: 10px; width: 140px; height: 100px; }
.fork-col:nth-child(1) .shape-semi      { bottom: 80px; left: 50%; transform: translateX(-50%) rotate(10deg); }
.fork-col:nth-child(1) .shape-quarter   { bottom: 10px; right: 20px; }

.fork-col:nth-child(2) .shape-circle.small { top: 30px;  left: 30px; }
.fork-col:nth-child(2) .shape-rect.tall    { top: 80px;  right: 20px; }
.fork-col:nth-child(2) .shape-semi         { top: 280px; left: 10px; }
.fork-col:nth-child(2) .shape-arc          { top: 340px; right: 10px; }
.fork-col:nth-child(2) .shape-quarter      { bottom: 60px; left: 40%; }
.fork-col:nth-child(2) .shape-circle       { bottom: 10px; right: 30px; }

.fork-col:nth-child(3) .shape-rect      { top: 20px;  left: 20px; }
.fork-col:nth-child(3) .shape-arc       { top: 100px; right: 30px; }
.fork-col:nth-child(3) .shape-circle    { top: 220px; left: 30px; }
.fork-col:nth-child(3) .shape-rect.tall { top: 280px; right: 10px; }
.fork-col:nth-child(3) .shape-semi      { bottom: 60px; left: 10px; }
.fork-col:nth-child(3) .shape-quarter   { bottom: 10px; right: 40%; }

.col-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--kiln-clay);
    background: rgba(250, 243, 235, 0.9);
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    z-index: 5;
}

.fork-caption {
    max-width: 720px;
    margin: 3rem auto 0;
    text-align: center;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.7;
    color: var(--warm-charcoal);
}

/* ---------- SECTION 3 — EXECUTE ---------- */

.execute {
    background: var(--warm-cream);
    position: relative;
}

.execute-block {
    position: relative;
    max-width: 680px;
    padding-left: 2rem;
    z-index: 3;
}
.execute-block::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 6px;
    border-radius: 3px;
    background: var(--kiln-clay);
    height: calc(var(--section-progress, 0) * 100%);
    transition: height 0.12s linear;
}

.execute-collage {
    position: absolute;
    width: 340px;
    height: 340px;
    z-index: 1;
    pointer-events: none;
    will-change: transform;
}
.execute-collage.left  { top: 8%;  left: -4%; }
.execute-collage.right { bottom: 5%; right: -3%; }

.execute-collage.left .shape-circle   { top: 20px;  left: 40px; }
.execute-collage.left .shape-arc      { top: 140px; left: 160px; }
.execute-collage.left .shape-quarter  { top: 200px; left: 20px; }
.execute-collage.left .shape-rect     { bottom: 10px; left: 110px; }

.execute-collage.right .shape-rect.tall    { top: 20px;  right: 30px; }
.execute-collage.right .shape-semi         { top: 180px; right: 130px; }
.execute-collage.right .shape-circle.small { top: 60px;  right: 170px; }
.execute-collage.right .shape-arc          { bottom: 20px; right: 40px; }

.motif-row {
    display: grid;
    grid-template-columns: auto auto auto auto auto auto auto auto;
    align-items: center;
    gap: 0.6rem 1.2rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed rgba(61, 47, 42, 0.25);
}
.motif {
    width: 56px;
    height: 42px;
    flex: none;
}
.motif-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--burnt-sienna);
}

/* ---------- SECTION 4 — MERGE ---------- */

.merge {
    background: var(--fired-earth);
    color: var(--warm-cream);
    position: relative;
    place-items: center;
    text-align: center;
    padding-bottom: 5rem;
}
.merge .section-header { margin-top: 1rem; }

.merge-stage {
    position: relative;
    width: min(900px, 100%);
    height: clamp(320px, 45vh, 440px);
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 800px;
}

.merge-col {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 220px;
    height: 100%;
    transform: translate(calc(-50% + var(--merge-tx, 0px)), -50%);
    transition: transform 0.1s linear;
    will-change: transform;
}
.merge-col[style*="--col-idx:0"] { --merge-tx: calc(-220px + (var(--merge-progress, 0) * 220px)); }
.merge-col[style*="--col-idx:1"] { --merge-tx: 0px; }
.merge-col[style*="--col-idx:2"] { --merge-tx: calc( 220px - (var(--merge-progress, 0) * 220px)); }

.merge-col .shape { position: absolute; mix-blend-mode: screen; }
.merge-col:nth-child(1) .shape-rect.tall { top: 10%; left: 20%; }
.merge-col:nth-child(1) .shape-circle    { bottom: 10%; right: 10%; }
.merge-col:nth-child(2) .shape-arc       { top: 5%;  left: 10%; }
.merge-col:nth-child(2) .shape-semi      { bottom: 10%; left: 5%; }
.merge-col:nth-child(2) .shape-circle.small { top: 45%; right: 20%; }
.merge-col:nth-child(3) .shape-quarter   { top: 12%; right: 5%; }
.merge-col:nth-child(3) .shape-rect      { bottom: 10%; left: 10%; }

.merge-caption {
    max-width: 680px;
    margin: 2rem auto 0;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.7;
    color: var(--sandstone);
}
.merge-caption.light { color: rgba(250, 243, 235, 0.85); }

/* ---------- SECTION 5 — YIELD ---------- */

.yield {
    background: var(--warm-cream);
    align-content: start;
    padding-top: clamp(4rem, 10vh, 6rem);
}
.yield .section-header { text-align: center; width: 100%; }
.yield .section-title { text-align: center; margin: 0 auto; }

.tessellation-viewport {
    width: 100vw;
    max-width: 100%;
    margin: 2.5rem 0;
    overflow: hidden;
    height: clamp(220px, 32vh, 320px);
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding: 0;
}

.tessellation-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: clamp(160px, 20vw, 220px);
    grid-template-rows: 1fr;
    gap: 16px;
    height: 100%;
    padding: 0 2rem;
    will-change: transform;
    transition: transform 0.12s linear;
}

.tile {
    position: relative;
    background: var(--sandstone);
    border-radius: 22px;
    display: grid;
    place-items: center;
    opacity: 0;
    transform: translateY(18px) scale(0.94);
    transition:
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--t, 0) * 40ms),
        opacity 0.6s ease calc(var(--t, 0) * 40ms);
    overflow: hidden;
}
.tile:nth-child(3n)   { background: var(--terracotta-rose); }
.tile:nth-child(4n)   { background: var(--saffron-gold); }
.tile:nth-child(5n)   { background: var(--kiln-clay); }
.tile:nth-child(7n)   { background: var(--burnt-sienna); }
.section.is-visible .tile {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tile-mark {
    display: block;
    background: var(--warm-cream);
    opacity: 0.9;
}
.tile-mark.dot       { width: 22px; height: 22px; border-radius: 50%; }
.tile-mark.dot.big   { width: 40px; height: 40px; border-radius: 50%; }
.tile-mark.line      { width: 60%; height: 4px; border-radius: 2px; }
.tile-mark.line.vert { width: 4px; height: 60%; border-radius: 2px; }
.tile-mark.curve {
    width: 60px; height: 60px;
    border: 5px solid var(--warm-cream);
    border-radius: 50%;
    border-right-color: transparent;
    border-bottom-color: transparent;
    background: transparent;
    opacity: 0.9;
}
.tile-mark.curve.flip { transform: rotate(180deg); }

.yield-caption {
    max-width: 680px;
    margin: 1.5rem auto 0;
    text-align: center;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.7;
    color: var(--warm-charcoal);
}

/* ---------- SECTION 6 — REST ---------- */

.rest {
    background: var(--warm-cream);
    text-align: center;
    grid-auto-flow: row;
    gap: 2.5rem;
    min-height: 90vh;
}

.rest-mark {
    width: 120px;
    height: 120px;
    display: grid;
    place-items: center;
    margin: 0 auto 1rem;
}

.rotating-triangle {
    width: 80px;
    height: 80px;
    background: var(--kiln-clay);
    border-radius: 18px;
    clip-path: polygon(50% 5%, 95% 90%, 5% 90%);
    animation: slow-rotate 18s steps(3) infinite;
    transform-origin: 50% 55%;
}
@keyframes slow-rotate {
    0%   { transform: rotate(0deg); }
    33%  { transform: rotate(120deg); }
    66%  { transform: rotate(240deg); }
    100% { transform: rotate(360deg); }
}

.rest-line {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(1.25rem, 2.4vw, 1.8rem);
    color: var(--kiln-clay);
    letter-spacing: -0.01em;
}
.rest-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--burnt-sienna);
    opacity: 0.75;
}

/* ---------- Entrance animations ---------- */

.section:not(.ignition) .section-header,
.section:not(.ignition) .section-title,
.section:not(.ignition) .eyebrow,
.execute-block,
.fork-caption,
.merge-caption,
.yield-caption,
.rest-line,
.rest-meta,
.rest-mark {
    opacity: 0;
    transform: translateY(32px);
    transition:
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.7s ease;
}

.section.is-visible .section-header,
.section.is-visible .section-title,
.section.is-visible .eyebrow,
.section.is-visible .execute-block,
.section.is-visible .fork-caption,
.section.is-visible .merge-caption,
.section.is-visible .yield-caption,
.section.is-visible .rest-line,
.section.is-visible .rest-meta,
.section.is-visible .rest-mark {
    opacity: 1;
    transform: translateY(0);
}

.fork-col {
    opacity: 0;
    transform: translateY(60px) scale(0.96);
    transition:
        transform 1s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--col-idx, 0) * 120ms),
        opacity 0.8s ease calc(var(--col-idx, 0) * 120ms);
}
.fork.is-visible .fork-col {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.execute-collage {
    opacity: 0;
    transition: opacity 1s ease 0.2s, transform 0.6s linear;
}
.execute.is-visible .execute-collage { opacity: 1; }

.merge-col {
    opacity: 0;
    transition:
        opacity 0.8s ease calc(var(--col-idx, 0) * 140ms),
        transform 0.15s linear;
}
.merge.is-visible .merge-col { opacity: 1; }

/* Ignition hero enters immediately */
.ignition .hero-title,
.ignition .hero-sub,
.ignition .eyebrow {
    opacity: 0;
    transform: translateY(30px);
    animation: heroIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.ignition .eyebrow     { animation-delay: 0.1s; }
.ignition .hero-title  { animation-delay: 0.3s; }
.ignition .hero-sub    { animation-delay: 0.7s; }
@keyframes heroIn {
    to { opacity: 1; transform: translateY(0); }
}

.ignition.is-visible .collage-fragment {
    transform: translate(0, 0) scale(1);
    opacity: 1;
}

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

@media (max-width: 820px) {
    .fork-columns {
        grid-template-columns: 1fr;
        height: auto;
        gap: 1.2rem;
    }
    .fork-col {
        height: 260px;
        margin-left: 0;
        margin-right: 0;
    }
    .motif-row {
        grid-template-columns: auto auto auto auto;
        gap: 0.6rem 1rem;
    }
    .execute-collage { opacity: 0.45; }
    .execute-collage.left  { left: -20%; }
    .execute-collage.right { right: -20%; }
    .merge-col {
        width: 160px;
    }
    .tessellation-track {
        grid-auto-columns: clamp(120px, 40vw, 180px);
    }
}

@media (max-width: 560px) {
    .execute-collage { display: none; }
    .shape-rect      { width: 130px; height: 90px; }
    .shape-rect.tall { width: 90px;  height: 180px; }
    .shape-circle    { width: 120px; height: 120px; }
    .shape-arc       { width: 130px; height: 130px; }
    .shape-quarter   { width: 100px; height: 100px; }
    .shape-semi      { width: 150px; height: 75px; }
}
