/* ==============================================
   jungchi.boo - Mid-Century Political Salon
   ============================================== */

/* --- Paper Grain Texture Filter --- */
svg.noise-filter {
    position: absolute;
    width: 0;
    height: 0;
}

/* --- CSS Custom Properties (Design Palette) --- */
:root {
    --cream-linen: #F5EDE0;
    --warm-bisque: #EDE0CC;
    --dark-walnut: #2B2520;
    --warm-umber: #5A4E42;
    --burnished-gold: #C4A35A;
    --atomic-teal: #3A8C8C;
    --retro-coral: #D4654A;
    --espresso: #1A1512;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.85;
    color: #5A4E42;
    background-color: #F5EDE0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Paper grain texture overlay */
body::before {
    content: '';
    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='256' height='256' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Typography --- */
h1, h2 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    color: #2B2520;
    letter-spacing: 0.02em;
}

.section__heading {
    font-size: clamp(2.2rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
}

.section__heading--centered {
    text-align: center;
}

.section__body {
    max-width: 540px;
    font-weight: 300;
    color: #5A4E42;
}

/* --- Starburst Accents --- */
.starburst {
    display: inline-block;
    flex-shrink: 0;
}

.starburst--large {
    width: 64px;
    height: 64px;
}

.starburst--medium {
    width: 24px;
    height: 24px;
}

.starburst--small {
    width: 16px;
    height: 16px;
}

.starburst--pulse polygon {
    animation: starburst-pulse 4s ease-in-out infinite;
}

@keyframes starburst-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.starburst--accent {
    position: absolute;
    bottom: -12px;
    right: -12px;
}

/* --- Accent Color Classes --- */
.accent-teal {
    color: #3A8C8C;
}

.accent-coral {
    color: #D4654A;
}

/* --- Sections --- */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px;
    position: relative;
}

.section__inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Hero --- */
.section--hero {
    background-color: #1A1512;
    flex-direction: column;
    text-align: center;
    transition: background-color 800ms ease;
}

.section--hero.revealed {
    background-color: #F5EDE0;
}

.hero__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.hero__starburst {
    transform: scale(0);
    transition: transform 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section--hero.revealed .hero__starburst {
    transform: scale(1);
}

.hero__title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    text-transform: uppercase;
    letter-spacing: 0;
    opacity: 0;
    color: #2B2520;
    transition: opacity 600ms ease 200ms, letter-spacing 600ms ease 200ms;
}

.section--hero.revealed .hero__title {
    opacity: 1;
    letter-spacing: 0.02em;
}

.hero__rule {
    width: 0;
    height: 1px;
    background-color: #C4A35A;
    transition: width 600ms ease 400ms;
}

.section--hero.revealed .hero__rule {
    width: 200px;
}

.hero__subtitle {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: #5A4E42;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 500ms ease 600ms, transform 500ms ease 600ms;
}

.section--hero.revealed .hero__subtitle {
    opacity: 1;
    transform: translateY(0);
}

/* --- Split Layouts --- */
.split {
    display: flex;
    align-items: center;
    gap: 60px;
}

.split--left-heavy .split__illustration {
    flex: 0 0 60%;
    position: relative;
}

.split--left-heavy .split__text {
    flex: 0 0 calc(40% - 60px);
}

.split--right-heavy .split__illustration {
    flex: 0 0 60%;
    position: relative;
    order: 2;
}

.split--right-heavy .split__text {
    flex: 0 0 calc(40% - 60px);
    order: 1;
}

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

.split__text .starburst--small {
    margin-bottom: 1rem;
}

/* --- Concept Panel --- */
.section--concept {
    background-color: #F5EDE0;
}

/* --- Interlude --- */
.section--interlude {
    min-height: 40vh;
    background-color: #EDE0CC;
}

.interlude__quote {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 700px;
    margin: 0 auto;
}

.interlude__quote p {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: #2B2520;
    line-height: 1.5;
}

/* --- Detail Panel --- */
.section--detail {
    background-color: #EDE0CC;
}

/* --- Archive --- */
.section--archive {
    background-color: #F5EDE0;
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 100px;
}

.archive__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.archive__card {
    aspect-ratio: 3 / 2;
    perspective: 800px;
    cursor: pointer;
}

.archive__card-front,
.archive__card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: 2px solid #C4A35A;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: transform 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(43,37,32,0.08);
}

.archive__card-front {
    background-color: #F5EDE0;
    gap: 12px;
}

.archive__card-back {
    background-color: #EDE0CC;
    transform: rotateY(180deg);
}

.archive__card-back p {
    font-size: 0.85rem;
    font-weight: 300;
    text-align: center;
    color: #5A4E42;
    line-height: 1.6;
}

.archive__card:hover .archive__card-front,
.archive__card.flipped .archive__card-front {
    transform: rotateY(180deg);
}

.archive__card:hover .archive__card-back,
.archive__card.flipped .archive__card-back {
    transform: rotateY(0deg);
}

.archive__card-front,
.archive__card-back {
    position: absolute;
    inset: 0;
}

.archive__card {
    position: relative;
}

.archive__card-label {
    font-family: 'Anybody', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #C4A35A;
}

/* Card hover lift */
.archive__card:hover {
    transform: translateY(-2px);
}

.archive__card:hover .archive__card-front {
    box-shadow: 0 6px 16px rgba(43,37,32,0.12);
}

/* --- Closing --- */
.section--closing {
    background-color: #1A1512;
    text-align: center;
    flex-direction: column;
}

.section--closing .section__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.closing__heading {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.2rem);
    color: #F5EDE0;
    letter-spacing: 0.02em;
}

.closing__text {
    font-weight: 300;
    max-width: 540px;
    color: #EDE0CC;
    line-height: 1.85;
}

.closing__rule {
    width: 120px;
    height: 1px;
    background-color: #C4A35A;
    opacity: 0.6;
}

.closing__label {
    font-family: 'Anybody', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #C4A35A;
}

/* Gold accent opacity on dark backgrounds */
.section--closing .starburst--large polygon {
    opacity: 0.8;
}

/* --- Tapered Dividers --- */
.tapered-divider {
    line-height: 0;
    margin: -1px 0;
}

.tapered-divider svg {
    width: 100%;
    height: 40px;
    display: block;
}

/* --- Index Card Navigation --- */
.index-nav {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    gap: 8px;
    z-index: 1000;
    transition: transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.index-nav.visible {
    transform: translateX(-50%) translateY(0);
}

.index-nav__card {
    width: 48px;
    height: 32px;
    border: 2px solid #C4A35A;
    border-radius: 2px;
    background-color: rgba(245, 237, 224, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(4px);
}

.index-nav__card-label {
    font-family: 'Anybody', sans-serif;
    font-weight: 500;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #C4A35A;
    pointer-events: none;
}

.index-nav__card:hover {
    transform: rotate(2deg);
    box-shadow: 0 4px 12px rgba(43,37,32,0.15);
}

.index-nav__card.active {
    background-color: #C4A35A;
}

.index-nav__card.active .index-nav__card-label {
    color: #F5EDE0;
}

/* --- SVG Panel Path Drawing --- */
.svg-panel .draw-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 800ms ease;
}

.svg-panel.drawn .draw-path {
    stroke-dashoffset: 0;
}

/* --- Scroll Reveal Animations --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 500ms ease, transform 500ms ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Starburst scale-in with spring bounce */
.starburst-reveal {
    transform: scale(0);
    transition: transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.starburst-reveal.revealed {
    transform: scale(1);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .section {
        padding: 60px 32px;
    }

    .split {
        flex-direction: column;
        gap: 40px;
    }

    .split--left-heavy .split__illustration,
    .split--left-heavy .split__text,
    .split--right-heavy .split__illustration,
    .split--right-heavy .split__text {
        flex: 1 1 100%;
    }

    .split--right-heavy .split__illustration {
        order: 0;
    }

    .split--right-heavy .split__text {
        order: 0;
    }

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

    .svg-panel {
        max-width: 300px;
        height: auto;
    }
}

@media (max-width: 600px) {
    .section {
        padding: 48px 20px;
    }

    .archive__grid {
        grid-template-columns: 1fr;
    }

    .index-nav__card {
        width: 36px;
        height: 24px;
    }

    .index-nav__card-label {
        font-size: 0.5rem;
    }
}
