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

:root {
    --parchment: #f4ebe0;
    --ink: #2b1d14;
    --terracotta: #a8522e;
    --sage: #8a9a6e;
    --warm-gray: #c8b9a8;
    --deep-brown: #1f1410;
    --ochre: #d4a34c;
    --muted-brown: #7a6555;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    background-color: var(--parchment);
    color: var(--ink);
    overflow-x: hidden;
    position: relative;
}

/* === Terrazzo Speckle Overlay === */
.terrazzo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(circle 2px at 15% 25%, var(--terracotta) 1px, transparent 1px),
        radial-gradient(circle 1.5px at 45% 12%, var(--ochre) 1px, transparent 1px),
        radial-gradient(circle 2px at 72% 35%, var(--sage) 1px, transparent 1px),
        radial-gradient(circle 1px at 88% 68%, var(--terracotta) 0.5px, transparent 0.5px),
        radial-gradient(circle 1.5px at 25% 78%, var(--ochre) 1px, transparent 1px),
        radial-gradient(circle 2px at 55% 55%, var(--sage) 1px, transparent 1px),
        radial-gradient(circle 1px at 35% 92%, var(--terracotta) 0.5px, transparent 0.5px),
        radial-gradient(circle 1.5px at 82% 15%, var(--ochre) 1px, transparent 1px),
        radial-gradient(circle 1px at 8% 50%, var(--sage) 0.5px, transparent 0.5px),
        radial-gradient(circle 2px at 65% 85%, var(--terracotta) 1px, transparent 1px);
    background-size: 200px 200px;
    opacity: 0.4;
}

/* === Hero Section === */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 60%, rgba(212, 163, 76, 0.15) 0%, transparent 60%),
                var(--parchment);
    z-index: 1;
    overflow: hidden;
}

.hero-memphis-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.memphis-shape {
    position: absolute;
    opacity: 0.6;
    animation: float 8s ease-in-out infinite;
}

.shape-circle {
    top: 12%;
    left: 8%;
    animation-delay: 0s;
}

.shape-triangle {
    top: 20%;
    right: 12%;
    animation-delay: -2s;
}

.shape-zigzag {
    bottom: 25%;
    left: 5%;
    animation-delay: -4s;
}

.shape-squiggle {
    top: 15%;
    right: 5%;
    animation-delay: -1s;
}

.shape-dot-grid {
    bottom: 15%;
    right: 10%;
    animation-delay: -3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(3deg); }
}

/* === Candle === */
.hero-candle {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
}

.candle-body {
    width: 24px;
    height: 80px;
    background: linear-gradient(to right, #e8d5b7, #f5e6d0, #e8d5b7);
    border-radius: 2px 2px 4px 4px;
    margin: 0 auto;
    position: relative;
}

.candle-body::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 12px;
    background: #2b1d14;
}

.candle-flame {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 30px;
    animation: flicker 2s ease-in-out infinite alternate;
}

.flame-inner {
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 80%, #fff8e0 0%, #d4a34c 40%, #a8522e 70%, transparent 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

@keyframes flicker {
    0% { transform: translateX(-50%) scale(1) rotate(-1deg); }
    25% { transform: translateX(-50%) scale(1.05) rotate(1deg); }
    50% { transform: translateX(-50%) scale(0.95) rotate(-0.5deg); }
    75% { transform: translateX(-50%) scale(1.02) rotate(0.5deg); }
    100% { transform: translateX(-50%) scale(1) rotate(-1deg); }
}

.candle-glow {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212, 163, 76, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: glow-pulse 3s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
    0% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    100% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

/* === Hero Content === */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 120px;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2.4rem, 6vw, 5.5rem);
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 20px rgba(212, 163, 76, 0.2);
}

.hero-subtitle {
    font-family: 'Source Serif 4', serif;
    font-size: clamp(1rem, 2vw, 1.4rem);
    font-weight: 400;
    color: var(--muted-brown);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.meta-tag {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--muted-brown);
}

.meta-divider {
    color: var(--ochre);
    font-size: 0.6rem;
}

/* === Scroll Indicator === */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.scroll-text {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--muted-brown);
}

.scroll-arrow {
    width: 1px;
    height: 30px;
    background: var(--muted-brown);
    position: relative;
    animation: scroll-bounce 2s ease-in-out infinite;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -4px;
    width: 9px;
    height: 9px;
    border-right: 1px solid var(--muted-brown);
    border-bottom: 1px solid var(--muted-brown);
    transform: rotate(45deg);
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(8px); opacity: 0.5; }
}

/* === Memphis Divider === */
.memphis-divider {
    width: 100%;
    padding: 1rem 0;
    position: relative;
    z-index: 1;
}

.memphis-divider svg {
    width: 100%;
    height: 40px;
}

/* === Matches Section === */
.matches {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* === Match Card === */
.match-card {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 0;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--warm-gray);
}

.match-number {
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--terracotta);
    font-weight: 500;
}

.match-date {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted-brown);
    letter-spacing: 0.1em;
}

/* === Match Pair === */
.match-pair {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2.5rem;
}

.match-connector {
    display: flex;
    align-items: center;
    justify-content: center;
}

.story {
    padding: 2rem;
    background: rgba(244, 235, 224, 0.7);
    border: 1px solid var(--warm-gray);
    border-radius: 2px;
    transition: box-shadow 0.4s ease, transform 0.3s ease;
}

.story:hover {
    box-shadow: 0 8px 30px rgba(31, 20, 16, 0.1);
    transform: translateY(-2px);
}

.story-category {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--sage);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.story-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.story-excerpt {
    font-family: 'Source Serif 4', serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--muted-brown);
    margin-bottom: 1.2rem;
}

.story-source {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--terracotta);
    opacity: 0.8;
}

/* === Match Insight === */
.match-insight {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(168, 82, 46, 0.05) 0%, rgba(212, 163, 76, 0.08) 100%);
    border-left: 3px solid var(--ochre);
    border-radius: 0 2px 2px 0;
}

.insight-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ochre);
    display: block;
    margin-bottom: 0.5rem;
}

.insight-text {
    font-family: 'Source Serif 4', serif;
    font-size: 1rem;
    font-style: italic;
    color: var(--ink);
    line-height: 1.6;
}

/* === Footer === */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 4rem 2rem;
    border-top: 1px solid var(--warm-gray);
    margin-top: 4rem;
}

.footer-memphis {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    opacity: 0.5;
}

.footer-text {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.footer-mono {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted-brown);
    letter-spacing: 0.1em;
}

/* === Responsive === */
@media (max-width: 768px) {
    .match-pair {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .match-connector {
        transform: rotate(90deg);
    }

    .story {
        padding: 1.5rem;
    }

    .matches {
        padding: 2rem 1rem;
    }

    .hero-memphis-shapes .memphis-shape {
        opacity: 0.3;
    }
}
