/* freedom.compare - Mid-Century Dreamy-Ethereal Broken Grid */

:root {
    --burnt-sienna: #CC5500;
    --deep-ember: #8B3A00;
    --peach-haze: #F4A460;
    --warm-cream: #FFF6EC;
    --smoked-ivory: #F0E4D4;
    --charcoal-umber: #2C2018;
    --faded-walnut: #8C6E54;
    --slate-teal: #4A6B6F;
    --ink-oxide: #1A120B;
    --collision-zone: rgba(204, 85, 0, 0.12);
    --ghost-grid: rgba(204, 85, 0, 0.06);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.25vw, 1.2rem);
    line-height: 1.75;
    color: var(--charcoal-umber);
    background: linear-gradient(180deg, var(--warm-cream) 0%, var(--smoked-ivory) 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Ghost Grid Pattern */
.ghost-grid {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(90deg, var(--ghost-grid) 0, var(--ghost-grid) 0.5px, transparent 0.5px, transparent calc(100% / 12)),
        repeating-linear-gradient(0deg, var(--ghost-grid) 0, var(--ghost-grid) 0.5px, transparent 0.5px, transparent 80px);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   TABLEAU COMMON
   ============================================ */

.tableau {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ============================================
   TABLEAU 1: THE GRID
   ============================================ */

.tableau-grid {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--warm-cream);
}

.grid-blocks {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 24px;
    padding: 60px;
    z-index: 1;
}

.grid-block {
    background: var(--smoked-ivory);
    border-radius: 4px;
    transition: transform 2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.grid-block.broken {
    opacity: 0.6;
}

.block-1.broken { transform: translate(-40px, -30px) rotate(-2deg); }
.block-2.broken { transform: translate(20px, -50px) rotate(1.5deg); }
.block-3.broken { transform: translate(-15px, 40px) rotate(-1deg); }
.block-4.broken { transform: translate(60px, -20px) rotate(3deg); }
.block-5.broken { transform: translate(-50px, 30px) rotate(-2.5deg); }
.block-6.broken { transform: translate(30px, 60px) rotate(1deg); }
.block-7.broken { transform: translate(45px, -40px) rotate(-1.5deg); }
.block-8.broken { transform: translate(-25px, -60px) rotate(2deg); }
.block-9.broken { transform: translate(55px, 25px) rotate(-3deg); }
.block-10.broken { transform: translate(-35px, 50px) rotate(1.8deg); }
.block-11.broken { transform: translate(40px, -35px) rotate(-2.2deg); }
.block-12.broken { transform: translate(-60px, 40px) rotate(2.5deg); }

.site-title {
    position: relative;
    z-index: 2;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-style: italic;
    font-size: 8vw;
    color: var(--burnt-sienna);
    transform: rotate(2deg);
    opacity: 0;
    transition: opacity 1.5s ease-out 0.8s;
    letter-spacing: -0.03em;
    text-align: center;
    pointer-events: none;
}

.site-title.visible {
    opacity: 1;
}

.tableau-1-subtitle {
    position: absolute;
    bottom: 12vh;
    left: 50%;
    transform: translateX(-50%) rotate(-0.5deg);
    z-index: 2;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-variant: small-caps;
    font-size: 0.875rem;
    color: var(--faded-walnut);
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 1.5s ease-out 1.5s;
}

.tableau-1-subtitle.visible {
    opacity: 1;
}

/* ============================================
   TABLEAU 2: COLLAGE OF MEASURES
   ============================================ */

.tableau-collage {
    min-height: 120vh;
    padding: 10vh 0;
    position: relative;
}

.collage-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100vh;
}

/* Base Layer: Geometric Shapes */
.collage-base {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.geo-shape {
    position: absolute;
}

.geo-circle-1 {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: var(--peach-haze);
    opacity: 0.35;
    top: 10%;
    left: 5%;
    transform: rotate(-1deg);
}

.geo-rect-1 {
    width: 220px;
    height: 340px;
    background: var(--smoked-ivory);
    border: 1px solid rgba(204, 85, 0, 0.15);
    top: 15%;
    right: 12%;
    transform: rotate(2.5deg);
}

.geo-boomerang-1 {
    width: 300px;
    height: 200px;
    top: 50%;
    left: 30%;
    transform: rotate(-3deg);
    opacity: 0.5;
}

.geo-kidney-1 {
    width: 250px;
    height: 180px;
    background: rgba(204, 85, 0, 0.08);
    border-radius: 50% 30% 70% 40% / 60% 40% 50% 70%;
    bottom: 15%;
    right: 20%;
    transform: rotate(1.5deg);
}

.geo-circle-2 {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(139, 58, 0, 0.1);
    bottom: 25%;
    left: 15%;
    transform: translate(10px, -20px);
}

/* Overlay Layer */
.collage-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.comparison-graph {
    position: absolute;
    width: 400px;
    height: 300px;
    top: 20%;
    left: 8%;
    transform: rotate(-1.5deg);
    opacity: 0.7;
}

.circuit-trace {
    position: absolute;
    width: 600px;
    height: 400px;
    top: 30%;
    right: 5%;
    transform: rotate(1deg);
}

/* Fragment Layer */
.collage-fragments {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.fragment {
    position: absolute;
    padding: 12px 24px;
    background: var(--warm-cream);
    box-shadow: 0 4px 20px rgba(26, 18, 11, 0.15);
    overflow: hidden;
    pointer-events: auto;
    cursor: default;
}

.fragment-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-style: italic;
    font-size: clamp(2rem, 4vw, 4rem);
    color: var(--burnt-sienna);
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.fragment-1 {
    top: 8%;
    left: 20%;
    transform: rotate(-2deg);
    clip-path: polygon(5% 0%, 100% 0%, 95% 100%, 0% 100%);
}

.fragment-2 {
    top: 35%;
    right: 8%;
    transform: rotate(1.5deg);
    clip-path: polygon(0% 0%, 92% 0%, 100% 100%, 8% 100%);
}

.fragment-3 {
    bottom: 30%;
    left: 10%;
    transform: rotate(-1deg);
    clip-path: polygon(3% 0%, 97% 0%, 100% 100%, 0% 100%);
}

.fragment-4 {
    bottom: 10%;
    right: 25%;
    transform: rotate(2.5deg);
    clip-path: polygon(0% 0%, 100% 0%, 96% 100%, 4% 100%);
}

/* Connection Lines */
.connection-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.conn-line {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 2s ease-out;
}

.conn-line.drawn {
    stroke-dashoffset: 0;
}

/* Content Text Blocks */
.collage-text-block {
    position: relative;
    z-index: 5;
    max-width: 480px;
    padding: 30px 40px;
    background: rgba(255, 246, 236, 0.92);
    backdrop-filter: blur(4px);
}

.collage-text-block p {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1rem, 1.25vw, 1.2rem);
    line-height: 1.75;
    color: var(--charcoal-umber);
}

.collage-text-block em {
    color: var(--burnt-sienna);
    font-style: italic;
}

.text-block-1 {
    margin: 0 auto 0 12%;
    transform: rotate(-0.8deg) translateY(20px);
}

.text-block-2 {
    margin: 60px 10% 0 auto;
    transform: rotate(0.5deg) translateY(20px);
}

/* Collision zones */
.collage-container::before {
    content: '';
    position: absolute;
    top: 25%;
    left: 15%;
    width: 300px;
    height: 250px;
    background: var(--collision-zone);
    border-radius: 4px;
    transform: rotate(-1deg);
    pointer-events: none;
    z-index: 0;
}

.collage-container::after {
    content: '';
    position: absolute;
    bottom: 20%;
    right: 18%;
    width: 250px;
    height: 200px;
    background: var(--collision-zone);
    border-radius: 4px;
    transform: rotate(2deg);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   TABLEAU 3: SIGNAL AND NOISE
   ============================================ */

.tableau-signal {
    min-height: 100vh;
    padding: 15vh 0;
    position: relative;
    background: var(--smoked-ivory);
}

.signal-wave {
    position: absolute;
    width: 100%;
    height: 400px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.wave-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 4s ease-out;
}

.wave-path.animated {
    stroke-dashoffset: 0;
}

.wave-path-2 {
    stroke-dasharray: 1800;
    stroke-dashoffset: 1800;
    transition: stroke-dashoffset 5s ease-out 0.5s;
}

.wave-path-2.animated {
    stroke-dashoffset: 0;
}

.signal-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 80px;
    padding: 0 10%;
}

.signal-text-block {
    max-width: 520px;
}

.signal-text-right {
    align-self: flex-end;
    transform: rotate(0.5deg);
}

.section-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-style: italic;
    font-size: clamp(2.5rem, 6vw, 6rem);
    color: var(--charcoal-umber);
    letter-spacing: -0.03em;
    margin-bottom: 30px;
    transform: rotate(-1deg);
}

.signal-text-block p {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1rem, 1.25vw, 1.2rem);
    line-height: 1.75;
    color: var(--charcoal-umber);
}

/* Node Networks */
.node-network {
    position: absolute;
    pointer-events: auto;
    cursor: default;
    z-index: 3;
}

.network-1 {
    width: 200px;
    height: 200px;
    top: 15%;
    right: 8%;
    transform: rotate(1deg);
}

.network-2 {
    width: 180px;
    height: 180px;
    bottom: 20%;
    left: 5%;
    transform: rotate(-1.5deg);
}

.node {
    animation: nodePulse 3s ease-in-out infinite;
    transform-origin: center;
}

.node:nth-child(odd) {
    animation-delay: -1.5s;
}

@keyframes nodePulse {
    0%, 100% { r: inherit; }
    50% { transform: scale(1.08); }
}

.node-network:hover .node {
    transition: opacity 300ms ease, transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.node-network:hover .node.hovered {
    transform: scale(1.15);
}

.node-network:hover .node.faded {
    opacity: 0.4;
}

/* ============================================
   TABLEAU 4: ORBITAL FREEDOM
   ============================================ */

.tableau-orbital {
    min-height: 140vh;
    padding: 10vh 0;
    position: relative;
}

.orbital-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.orbital-collage {
    position: absolute;
    z-index: 2;
    cursor: default;
}

.collage-a {
    width: 350px;
    height: 280px;
    top: 8%;
    left: 10%;
    transform: rotate(-3deg);
}

.collage-b {
    width: 300px;
    height: 320px;
    top: 25%;
    right: 8%;
    transform: rotate(4deg);
}

.collage-c {
    width: 280px;
    height: 250px;
    bottom: 25%;
    left: 25%;
    transform: rotate(-2deg);
}

.orbital-geo-1 {
    width: 100%;
    height: 100%;
    background: rgba(204, 85, 0, 0.1);
    border-radius: 50% 30% 70% 40% / 60% 40% 50% 70%;
}

.orbital-geo-2 {
    width: 100%;
    height: 100%;
    background: rgba(244, 164, 96, 0.15);
    border-radius: 30% 70% 40% 60% / 50% 30% 70% 40%;
}

.orbital-geo-3 {
    width: 100%;
    height: 100%;
    background: rgba(139, 58, 0, 0.08);
    border-radius: 60% 40% 50% 70% / 40% 60% 30% 50%;
}

.orbital-circuit,
.radar-chart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Fragmented Headline */
.fragmented-headline {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    width: 80%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    pointer-events: none;
}

.headline-fragment {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-style: italic;
    font-size: clamp(3rem, 8vw, 8rem);
    color: var(--burnt-sienna);
    letter-spacing: -0.03em;
    padding: 10px 30px;
    background: rgba(255, 246, 236, 0.85);
    box-shadow: 0 4px 20px rgba(26, 18, 11, 0.1);
}

.frag-what {
    transform: rotate(-3deg) translate(-20px, 10px);
}

.frag-cannot {
    transform: rotate(2deg) translate(15px, -20px);
}

.frag-be {
    transform: rotate(-1.5deg) translate(-30px, 5px);
}

.frag-compared {
    transform: rotate(2.5deg) translate(10px, -15px);
}

/* Starbursts */
.starburst {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.starburst-1 {
    width: 60px;
    height: 60px;
    top: 15%;
    right: 30%;
}

.starburst-2 {
    width: 40px;
    height: 40px;
    bottom: 30%;
    left: 15%;
}

/* ============================================
   TABLEAU 5: RESOLUTION
   ============================================ */

.tableau-resolution {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10vh 10%;
    position: relative;
    background: var(--warm-cream);
}

.resolution-starburst {
    width: 120px;
    height: 120px;
    margin-bottom: 60px;
    animation: starburstSpin 60s linear infinite;
}

@keyframes starburstSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.resolution-content {
    max-width: 640px;
    text-align: center;
    transform: rotate(0.5deg);
}

.resolution-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.6;
    color: var(--charcoal-umber);
    letter-spacing: -0.02em;
}

.resolution-footer {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.footer-mark {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-variant: small-caps;
    font-size: 0.8rem;
    color: var(--faded-walnut);
    letter-spacing: 0.04em;
}

/* ============================================
   SCALE-HOVER INTERACTION
   ============================================ */

.scale-hover {
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 300ms ease;
}

.scale-hover:hover {
    transform: scale(1.08);
    box-shadow: 0 0 30px rgba(204, 85, 0, 0.2);
}

.orbital-collage.scale-hover {
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 300ms ease;
}

.orbital-collage.scale-hover:hover {
    box-shadow: 0 0 40px rgba(204, 85, 0, 0.25);
}

.collage-a.scale-hover:hover {
    transform: rotate(-3deg) scale(1.08);
}

.collage-b.scale-hover:hover {
    transform: rotate(4deg) scale(1.08);
}

.collage-c.scale-hover:hover {
    transform: rotate(-2deg) scale(1.08);
}

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

.reveal-element {
    opacity: 0;
    transform: translateY(20px) rotate(-1deg);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

/* Preserve specific transforms on reveal for fragments */
.text-block-1.revealed {
    transform: rotate(-0.8deg) translateY(0);
}

.text-block-2.revealed {
    transform: rotate(0.5deg) translateY(0);
}

.frag-what.revealed {
    opacity: 1;
    transform: rotate(-3deg) translate(-20px, 10px);
}

.frag-cannot.revealed {
    opacity: 1;
    transform: rotate(2deg) translate(15px, -20px);
}

.frag-be.revealed {
    opacity: 1;
    transform: rotate(-1.5deg) translate(-30px, 5px);
}

.frag-compared.revealed {
    opacity: 1;
    transform: rotate(2.5deg) translate(10px, -15px);
}

.collage-a.revealed {
    opacity: 1;
    transform: rotate(-3deg) scale(1);
}

.collage-b.revealed {
    opacity: 1;
    transform: rotate(4deg) scale(1);
}

.collage-c.revealed {
    opacity: 1;
    transform: rotate(-2deg) scale(1);
}

/* ============================================
   PARALLAX DEPTH LAYERS
   ============================================ */

.parallax-fg {
    will-change: transform;
}

.parallax-mid {
    will-change: transform;
}

.parallax-bg {
    will-change: transform;
}

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

@media (max-width: 768px) {
    .grid-blocks {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
        padding: 30px;
    }

    .site-title {
        font-size: 12vw;
    }

    .collage-text-block {
        margin: 20px 5% !important;
        max-width: 90%;
    }

    .signal-content {
        padding: 0 5%;
    }

    .fragmented-headline {
        width: 95%;
    }

    .headline-fragment {
        font-size: clamp(2rem, 6vw, 4rem);
        padding: 8px 16px;
    }

    .comparison-graph {
        width: 250px;
        height: 200px;
    }

    .circuit-trace {
        width: 350px;
        height: 250px;
    }

    .orbital-collage {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        margin: 40px auto;
        width: 80%;
        max-width: 300px;
    }

    .fragmented-headline {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: 60px auto;
    }

    .node-network {
        display: none;
    }
}
