/* ==========================================================================
   ppuzzle.dev — Political Puzzle
   Evolved-minimal aesthetic, organic-flow layout
   Colors: #7a6f63, #ebe3d7, #2c2520, #f4ede4, #4a5568, #7a8c6e, #b5654a
   Fonts: Cormorant Garamond 600, Source Serif 4 400/600, Lora 400i
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #f4ede4;
    color: #2c2520;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Grain Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ==========================================================================
   Hero — The Opening Question
   ========================================================================== */

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
}

.hero-content {
    max-width: 800px;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards;
}

.hero-question {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: #2c2520;
    margin-bottom: 2rem;
}

.hero-question em {
    font-style: italic;
    color: #b5654a;
}

.hero-subtitle {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 1.7;
    color: #4a5568;
    max-width: 600px;
    margin: 0 auto;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    color: #7a6f63;
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 2.5s forwards;
}

.scroll-indicator svg {
    animation: gentleBounce 3s ease-in-out infinite;
}

/* ==========================================================================
   Puzzle Pieces — Content Sections
   ========================================================================== */

.puzzle-piece {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 2rem;
    margin: 140px 0;
}

.piece-card {
    max-width: 620px;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.piece-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.piece-card--offset-left {
    margin-right: auto;
    margin-left: 10%;
}

.piece-card--offset-right {
    margin-left: auto;
    margin-right: 10%;
}

.piece-card--center {
    margin: 0 auto;
    text-align: center;
}

.piece-label {
    display: inline-block;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #7a8c6e;
    margin-bottom: 1.25rem;
    opacity: 0.8;
}

.piece-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: #2c2520;
    margin-bottom: 1.5rem;
}

.piece-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.7;
    color: #4a5568;
    margin-bottom: 1.25rem;
}

.piece-body em {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    color: #2c2520;
}

/* Atmospheric Fragments */
.piece-atmosphere {
    position: absolute;
    top: -20px;
    width: 280px;
    height: 360px;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.piece-atmosphere.is-visible {
    opacity: 1;
}

.piece-atmosphere--right {
    right: 8%;
}

.piece-atmosphere--left {
    left: 8%;
}

.atmos-image {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    filter: saturate(0.6) contrast(0.9);
}

/* ==========================================================================
   Interstitials — Quotes & Dividers
   ========================================================================== */

.interstitial {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    margin: 120px 0;
}

.pull-quote {
    max-width: 680px;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.4s ease, transform 1.4s ease;
}

.pull-quote.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.pull-quote p {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    line-height: 1.3;
    color: #7a6f63;
    letter-spacing: 0.01em;
    margin-bottom: 1rem;
}

.pull-quote cite {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: #7a8c6e;
    font-style: normal;
    letter-spacing: 0.05em;
}

.divider-line {
    width: 80px;
    height: 1px;
    background-color: #7a6f63;
    opacity: 0.3;
}

/* ==========================================================================
   Final Reflection
   ========================================================================== */

.reflection {
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
    margin-top: 100px;
    background-color: #ebe3d7;
    position: relative;
}

.reflection::before {
    content: '';
    position: absolute;
    top: -120px;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, #f4ede4, #ebe3d7);
    pointer-events: none;
}

.reflection-content {
    max-width: 650px;
    text-align: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

.reflection-content.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reflection-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: #2c2520;
    margin-bottom: 1.5rem;
}

.reflection-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.7;
    color: #4a5568;
    margin-bottom: 1.25rem;
}

.reflection-body em {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    color: #2c2520;
}

.reflection-coda {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(122, 111, 99, 0.2);
}

.coda-symbol {
    display: block;
    font-size: 1.25rem;
    color: #b5654a;
    margin-bottom: 0.75rem;
}

.coda-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: lowercase;
    color: #7a6f63;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .puzzle-piece {
        flex-direction: column;
        margin: 100px 0;
    }

    .piece-card--offset-left,
    .piece-card--offset-right {
        margin-left: auto;
        margin-right: auto;
    }

    .piece-atmosphere {
        display: none;
    }

    .interstitial {
        margin: 80px 0;
    }
}
