/* freedom.study -- Styles */

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

:root {
    --linen-cream: #FAF0E6;
    --sage-light: #D4DFC7;
    --cornflower-light: #C7D3DF;
    --deep-charcoal: #2B2B2B;
    --slate-gray: #5A6572;
    --burnt-sienna: #C2703E;
    --nordic-blue: #4A6FA5;
    --warm-gray: #B8B0A8;
    --birch-white: #E8DFD0;
    --aged-gold: #B8963E;
    --scale-tilt: 0deg;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.125rem);
    line-height: 1.75;
    color: var(--deep-charcoal);
    background-color: var(--linen-cream);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23FAF0E6'/%3E%3Crect x='0' y='0' width='1' height='1' fill='%23000' opacity='0.02'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23000' opacity='0.015'/%3E%3C/svg%3E");
}

/* ===================== SCALE BAR (Persistent) ===================== */

#scale-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--birch-white);
    border-bottom: 1px solid var(--warm-gray);
    padding: 10px 20px;
    transform: rotate(var(--scale-tilt));
    transition: transform 0.8s ease-out;
    transform-origin: center center;
}

.scale-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.scale-label {
    font-family: 'Overpass', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--slate-gray);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.scale-bar-icon {
    flex-shrink: 0;
}

/* ===================== VERDICT MARGIN ===================== */

#verdict-margin {
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 5;
}

.margin-icon {
    opacity: 0.3;
    transition: opacity 0.6s ease;
}

.margin-icon.active {
    opacity: 1;
}

/* ===================== MAIN CONTENT ===================== */

#main-content {
    padding-left: 80px;
}

/* ===================== THESIS ZONES ===================== */

.thesis-zone {
    max-width: 720px;
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
}

.thesis-zone h2 {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    letter-spacing: 0.01em;
    color: var(--deep-charcoal);
    margin-bottom: 1.5em;
}

.thesis-zone p {
    margin-bottom: 1.5em;
    color: var(--deep-charcoal);
}

.thesis-zone p em {
    color: var(--burnt-sienna);
    font-style: italic;
}

/* ===================== HERO SECTION ===================== */

.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 60px;
}

.hero-scale-container {
    margin-bottom: 40px;
}

.hero-scale {
    opacity: 0;
}

.hero-scale.drawn {
    opacity: 1;
}

.hero-scale .scale-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.hero-scale.drawn .scale-path {
    animation: drawPath 2s ease-out forwards;
}

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

.hero-scale.oscillating {
    animation: oscillate 6s ease-in-out infinite alternate;
}

@keyframes oscillate {
    0% { transform: rotate(-3deg); }
    100% { transform: rotate(3deg); }
}

.hero-title {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: 0.01em;
    color: var(--deep-charcoal);
    opacity: 0;
    transition: opacity 1s ease;
    margin-bottom: 16px;
}

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

.hero-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    color: var(--slate-gray);
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

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

/* ===================== DIAMOND RULE ===================== */

.diamond-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    max-width: 720px;
    margin: 0 auto;
}

.diamond-rule span {
    display: block;
    width: 100%;
    height: 1px;
    background-color: var(--warm-gray);
    position: relative;
}

.diamond-rule span::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background-color: var(--warm-gray);
    transform: translate(-50%, -50%) rotate(45deg);
}

/* ===================== MARGIN ANNOTATIONS ===================== */

.margin-annotation {
    position: absolute;
    right: -200px;
    width: 180px;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.8rem;
    color: var(--slate-gray);
    line-height: 1.5;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.margin-annotation.revealed {
    opacity: 1;
}

/* ===================== CITATIONS / BLOCKQUOTES ===================== */

.citation {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    color: var(--deep-charcoal);
    border-left: 3px solid var(--aged-gold);
    padding: 16px 24px;
    margin: 2em 0;
    background-color: rgba(232, 223, 208, 0.4);
}

.citation cite {
    display: block;
    font-size: 0.85rem;
    font-style: normal;
    color: var(--slate-gray);
    margin-top: 8px;
    font-family: 'Overpass', sans-serif;
    font-weight: 300;
}

/* ===================== COMPARISON ZONES ===================== */

.comparison-zone {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    min-height: 80vh;
}

.comparison-panel {
    padding: 60px 40px;
}

.panel-left {
    background-color: var(--sage-light);
}

.panel-right {
    background-color: var(--cornflower-light);
}

.comparison-divider {
    background-color: #8B8B8B;
}

.panel-heading {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    letter-spacing: 0.01em;
    color: var(--deep-charcoal);
    margin-bottom: 1.2em;
}

.comparison-panel p {
    margin-bottom: 1.5em;
    line-height: 1.75;
    color: var(--deep-charcoal);
}

/* ===================== VENN DIAGRAM ===================== */

.venn-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    position: relative;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.venn-container.revealed {
    opacity: 1;
}

.venn-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    opacity: 0.5;
}

.venn-left {
    background-color: var(--sage-light);
    margin-right: -50px;
    mix-blend-mode: multiply;
}

.venn-right {
    background-color: var(--cornflower-light);
    margin-left: -50px;
    mix-blend-mode: multiply;
}

.venn-label {
    position: absolute;
    font-family: 'Overpass', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--slate-gray);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ===================== BENTO BOX SECTION ===================== */

.bento-section {
    padding: 80px 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.bento-title {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    text-align: center;
    margin-bottom: 48px;
    color: var(--deep-charcoal);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.bento-card {
    aspect-ratio: 1 / 1;
    background-color: var(--birch-white);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid transparent;
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(43, 43, 43, 0.1);
}

.bento-card.border-sage {
    border-left-color: var(--sage-light);
}

.bento-card.border-cornflower {
    border-left-color: var(--cornflower-light);
}

.card-year {
    font-family: 'Overpass', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--burnt-sienna);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.bento-card h4 {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--deep-charcoal);
}

.bento-card p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--slate-gray);
}

/* ===================== ENDING SECTION ===================== */

.ending-section {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ending-scale-svg {
    opacity: 1;
}

.closing-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    color: var(--deep-charcoal);
    max-width: 500px;
    margin-top: 24px;
}

/* ===================== REVEAL ANIMATION ===================== */

.reveal-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.reveal-on-scroll.revealed {
    opacity: 1;
}

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

@media (max-width: 900px) {
    #verdict-margin {
        display: none;
    }

    #main-content {
        padding-left: 0;
    }

    .margin-annotation {
        position: relative;
        right: auto;
        width: 100%;
        margin: 8px 0 16px 0;
        padding-left: 16px;
        border-left: 2px solid var(--aged-gold);
    }

    .comparison-zone {
        grid-template-columns: 1fr;
    }

    .comparison-divider {
        height: 1px;
        width: 100%;
    }

    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bento-card {
        aspect-ratio: auto;
    }

    #scale-bar {
        transform: none;
    }
}

@media (max-width: 600px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .comparison-panel {
        padding: 40px 20px;
    }

    .thesis-zone {
        padding: 60px 20px;
    }

    .venn-circle {
        width: 120px;
        height: 120px;
    }
}
