/* ============================================
   diplomacy.boo - Styles
   Navy-Metallic Palette | Magazine-Spread Layout
   ============================================ */

/* CSS Custom Properties */
:root {
    --bg-primary: #0C1425;
    --bg-secondary: #152035;
    --accent-gold: #C0A46B;
    --accent-steel: #8B9DBF;
    --text-body: #B8C6D9;
    --text-marginal: #6B7D96;
    --border-indigo: #2A3B52;
    --highlight-copper: #B07D4F;
    --accent-dark: #3A4F6B;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-body);
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
}

/* ============================================
   Progress Bar
   ============================================ */

#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 0%;
    background-color: var(--accent-gold);
    z-index: 1000;
    transition: height 0.1s linear;
}

/* ============================================
   Orchid Container
   ============================================ */

#orchid-container {
    position: fixed;
    right: 38%;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 400px;
    z-index: 5;
    pointer-events: none;
    opacity: 0.6;
}

#orchid-svg {
    width: 100%;
    height: 100%;
}

.orchid-bud {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.orchid-bud.revealed {
    opacity: 1;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    color: var(--accent-gold);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.site-title {
    font-size: 72px;
}

h2 {
    font-size: 48px;
}

.body-text p {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--text-body);
    line-height: 1.65;
    max-width: 68ch;
    margin-bottom: 1.5em;
}

.body-text p:last-child {
    margin-bottom: 0;
}

.pull-quote {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 28px;
    font-style: italic;
    font-weight: 400;
    color: var(--accent-gold);
    line-height: 1.35;
    border: none;
    padding: 0;
    margin-bottom: 40px;
}

.pull-quote p {
    margin: 0;
}

.annotation {
    margin-bottom: 28px;
}

.annotation p {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-marginal);
    line-height: 1.55;
    margin-top: 6px;
}

.mono-accent {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    color: var(--accent-steel);
    border-left: 2px solid var(--border-indigo);
    padding-left: 10px;
    display: inline-block;
}

.closing-attribution {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-marginal);
    margin-top: 48px;
}

/* ============================================
   Underline Draw Animation
   ============================================ */

.underline-draw {
    background-image: linear-gradient(var(--accent-gold), var(--accent-gold));
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    transition: background-size 0.4s cubic-bezier(0.25, 0.1, 0.25, 1.0);
    padding-bottom: 2px;
}

.underline-draw.drawn {
    background-size: 100% 1px;
}

a.underline-draw:hover,
a .underline-draw:hover {
    background-size: 100% 1px;
}

/* ============================================
   Folio Layout
   ============================================ */

.folio {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

/* Opening Folio */
.folio-opening {
    justify-content: flex-start;
    padding-left: 12%;
}

.opening-content {
    max-width: 600px;
}

.opening-trace {
    width: 60vw;
    max-width: 800px;
    height: 20px;
    margin-top: 40px;
    display: block;
}

/* Editorial Folio Grid */
.folio-editorial {
    padding: 0 5%;
}

.folio-grid {
    display: grid;
    grid-template-columns: 25% 15% 60%;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
    padding: 80px 0;
}

.folio-grid-reversed {
    grid-template-columns: 60% 15% 25%;
}

.dominant-column {
    padding: 20px 0;
}

.marginal-column {
    padding: 20px 0;
}

.gutter {
    /* Pure negative space */
}

/* Title Cartouche */
.title-cartouche {
    border: 1px solid var(--accent-dark);
    padding: 48px;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.title-cartouche.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Interstitial Panels
   ============================================ */

.interstitial {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
}

.interstitial-trace {
    width: 80vw;
    max-width: 1200px;
    height: 60px;
}

/* ============================================
   Circuit Path Animation
   ============================================ */

.circuit-path {
    stroke-dasharray: 0;
    stroke-dashoffset: 0;
}

.circuit-path.animate-path {
    transition: stroke-dashoffset 1.2s ease-out;
}

/* Node Pulse Animation */
@keyframes nodePulse {
    0% {
        filter: drop-shadow(0 0 0 rgba(192, 164, 107, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(192, 164, 107, 0.6));
    }
    100% {
        filter: drop-shadow(0 0 0 rgba(192, 164, 107, 0));
    }
}

.node-pulse {
    animation: nodePulse 4s ease-in-out infinite;
}

/* Stagger node pulses */
.node-pulse:nth-child(2) {
    animation-delay: 1s;
}

.node-pulse:nth-child(3) {
    animation-delay: 2s;
}

.node-pulse:nth-child(4) {
    animation-delay: 3s;
}

/* ============================================
   Closing Folio
   ============================================ */

.folio-closing {
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.closing-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.seal-stamp {
    width: 80px;
    height: 80px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.seal-stamp svg {
    width: 100%;
    height: 100%;
    opacity: 0.15;
}

.seal-stamp.visible {
    opacity: 1;
}

.closing-trace {
    width: 400px;
    max-width: 80vw;
    height: 10px;
    margin-top: 32px;
}

/* ============================================
   Scroll Animation Classes
   ============================================ */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Responsive: Below 768px
   ============================================ */

@media (max-width: 768px) {
    .site-title {
        font-size: 42px;
    }

    h2 {
        font-size: 32px;
    }

    .folio-opening {
        padding-left: 8%;
        padding-right: 8%;
    }

    .opening-trace {
        width: 85vw;
    }

    .folio-editorial {
        padding: 0 6%;
    }

    .folio-grid,
    .folio-grid-reversed {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 40px 0;
    }

    .gutter {
        display: none;
    }

    .marginal-column {
        order: 2;
        padding-top: 32px;
        border-top: 1px solid var(--border-indigo);
        margin-top: 32px;
    }

    .dominant-column {
        order: 1;
    }

    .pull-quote {
        font-size: 22px;
    }

    .title-cartouche {
        padding: 28px;
        margin-bottom: 32px;
    }

    .body-text p {
        font-size: 16px;
    }

    #orchid-container {
        display: none;
    }

    .interstitial-trace {
        width: 90vw;
    }
}

/* ============================================
   Responsive: 769px to 1024px
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) {
    .site-title {
        font-size: 56px;
    }

    h2 {
        font-size: 40px;
    }

    .folio-grid {
        grid-template-columns: 28% 10% 62%;
    }

    .folio-grid-reversed {
        grid-template-columns: 62% 10% 28%;
    }

    #orchid-container {
        right: 34%;
        width: 50px;
    }
}
