/* ==========================================================================
   lunar.quest — Styles
   McBling-Editorial Fusion / Lunar Cartography Journal
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #0B1628;
    color: #D4DCE6;
    font-family: 'Nunito', sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.75;
    overflow-x: hidden;
    cursor: default;
}

::selection {
    background: rgba(232, 197, 71, 0.3);
    color: #EEF2F7;
}

/* --- Navigation: Diamond Glyphs --- */
#folio-nav {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    gap: 20px;
    align-items: center;
}

.diamond-nav {
    display: block;
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
    background: linear-gradient(135deg, #7B8FA3, #C8D6E5, #EEF2F7, #C8D6E5, #7B8FA3);
    border: none;
    cursor: pointer;
    transition: transform 0.6s ease, box-shadow 0.6s ease;
    text-decoration: none;
}

.diamond-nav.active {
    animation: diamond-pulse 2s ease-in-out infinite;
}

.diamond-nav:hover {
    transform: rotate(45deg) scale(1.6);
    box-shadow: 0 0 8px #E8C547;
}

@keyframes diamond-pulse {
    0%, 100% { opacity: 1; transform: rotate(45deg) scale(1); box-shadow: none; }
    50% { opacity: 0.7; transform: rotate(45deg) scale(1.15); box-shadow: 0 0 6px rgba(232, 197, 71, 0.4); }
}

/* --- HUD Overlay --- */
#hud-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#hud-lunar-phase {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #7B8FA3;
    background: conic-gradient(
        #C8D6E5 0deg,
        #C8D6E5 180deg,
        #0B1628 180deg,
        #0B1628 360deg
    );
    opacity: 0.6;
    transition: transform 0.1s linear;
}

#hud-folio-label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #7B8FA3;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.crosshair {
    position: absolute;
    background: #7B8FA3;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#hud-crosshair-h {
    width: 100%;
    height: 1px;
    left: 0;
    top: 50%;
}

#hud-crosshair-v {
    width: 1px;
    height: 100%;
    top: 0;
    left: 50%;
}

.crosshair.visible {
    opacity: 0.15;
}

/* --- Star Field --- */
#star-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Folio Sections --- */
.folio {
    position: relative;
    min-height: 100vh;
    z-index: 1;
    padding: 120px 80px 80px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.folio-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(#0F1D33 1px, transparent 1px),
        linear-gradient(90deg, #0F1D33 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

/* Shift grid per folio */
#folio-1 .folio-bg-grid { background-position: 0px 0px; }
#folio-2 .folio-bg-grid { background-position: 1px 1px; }
#folio-3 .folio-bg-grid { background-position: 2px 2px; }
#folio-4 .folio-bg-grid { background-position: 3px 3px; }
#folio-5 .folio-bg-grid { background-position: 4px 4px; }

.folio-content {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 65% 35%;
    gap: 40px;
    position: relative;
}

/* --- Main Column --- */
.col-main {
    padding-right: 30px;
}

.col-margin {
    padding-left: 20px;
    padding-top: 100px;
    border-left: 1px solid rgba(127, 163, 191, 0.15);
}

/* --- Typography --- */
.folio-title {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 68px;
    font-weight: 600;
    color: #C8D6E5;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    line-height: 1.1;
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(200, 214, 229, 0.3);
}

.folio-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 30px;
    font-weight: 300;
    font-style: italic;
    color: #8FA3BF;
    margin-bottom: 40px;
    line-height: 1.3;
}

.body-text {
    font-family: 'Nunito', sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.75;
    color: #D4DCE6;
    max-width: 38em;
    margin-bottom: 24px;
}

.closing-text {
    margin-top: 40px;
    font-style: italic;
    color: #C8D6E5;
}

.marginalia {
    font-family: 'Caveat', cursive;
    font-size: 16px;
    font-weight: 400;
    color: #E8C547;
    line-height: 1.5;
    padding: 10px 0;
}

/* --- Tooltip Triggers --- */
.tooltip-trigger {
    text-decoration: underline;
    text-decoration-color: rgba(232, 197, 71, 0.4);
    text-underline-offset: 3px;
    cursor: help;
    position: relative;
}

.tooltip-trigger:hover {
    text-decoration-color: #E8C547;
    color: #EEF2F7;
}

/* --- Tooltip Box --- */
.tooltip-box {
    position: fixed;
    z-index: 300;
    font-family: 'Caveat', cursive;
    font-size: 15px;
    color: #E8C547;
    background: #0B1628;
    border: 1px solid #E8C547;
    padding: 10px 14px;
    max-width: 280px;
    border-radius: 3px;
    pointer-events: none;
    opacity: 0;
    transform: rotate(-3deg);
    transition: opacity 0.2s ease, transform 0.2s ease;
    line-height: 1.4;
}

.tooltip-box.visible {
    opacity: 1;
    transform: rotate(0deg);
}

/* --- Data Panels --- */
.data-panel {
    background: rgba(11, 22, 40, 0.85);
    border: 1px solid #8FA3BF;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 20px;
    margin: 40px 0;
    transition: transform 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.data-panel-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.data-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #7B8FA3;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.dataviz-svg {
    width: 100%;
    height: auto;
}

.axis-line {
    stroke: #7B8FA3;
    stroke-width: 1;
    opacity: 0.5;
}

.data-line {
    stroke: #C8D6E5;
    stroke-width: 2;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.2s ease;
}

.data-line.drawn {
    stroke-dashoffset: 0;
}

.data-area {
    fill: rgba(200, 214, 229, 0.06);
}

.bar {
    fill: rgba(200, 214, 229, 0.25);
    stroke: #C8D6E5;
    stroke-width: 1;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.bar.drawn {
    opacity: 1;
}

.pie-segment {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 1.2s ease;
}

.pie-segment.drawn {
    stroke-dashoffset: 0;
}

.timeline-dot {
    fill: #C8D6E5;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.timeline-dot.drawn {
    opacity: 1;
}

.svg-label {
    fill: #7B8FA3;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    letter-spacing: 0.1em;
}

.svg-label.caveat-label {
    fill: #E8C547;
    font-family: 'Caveat', cursive;
    font-size: 14px;
    letter-spacing: 0;
}

.svg-label.data-text {
    fill: #7B8FA3;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9px;
    letter-spacing: 0.05em;
}

/* --- Folio Dividers (Chrome Line + Diamond) --- */
.folio-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60vh;
    padding: 0 80px;
    position: relative;
    z-index: 1;
}

.chrome-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, #7B8FA3, #C8D6E5, #EEF2F7, #C8D6E5, #7B8FA3);
    opacity: 0.6;
}

.diamond-glyph {
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
    background: linear-gradient(135deg, #7B8FA3, #C8D6E5, #EEF2F7, #C8D6E5, #7B8FA3);
    margin: 0 20px;
    flex-shrink: 0;
}

/* --- Botanical Pressings --- */
.botanical-pressing {
    width: 120px;
    height: 120px;
    display: block;
    margin: 30px auto;
    opacity: 0.8;
}

/* --- Parallax Leaf Silhouettes --- */
.parallax-leaf {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    opacity: 0.5;
    will-change: transform;
}

.leaf-svg {
    width: 100%;
    height: 100%;
}

.leaf-body {
    fill: #3A2E24;
    opacity: 0.6;
}

.leaf-vein {
    fill: none;
    stroke: #7B8FA3;
    stroke-width: 1;
    opacity: 0.7;
}

.leaf-1 {
    width: 100px;
    top: 20%;
    right: 5%;
    transform: rotate(12deg);
}

.leaf-2 {
    width: 85px;
    top: 15%;
    left: 3%;
    transform: rotate(-18deg);
}

.leaf-3 {
    width: 90px;
    bottom: 10%;
    right: 8%;
    transform: rotate(25deg);
}

.leaf-4 {
    width: 95px;
    top: 30%;
    left: 5%;
    transform: rotate(-8deg);
}

.leaf-5 {
    width: 105px;
    bottom: 15%;
    right: 4%;
    transform: rotate(15deg);
}

/* Some leaves use regolith grey */
.leaf-2 .leaf-body,
.leaf-4 .leaf-body {
    fill: #A09484;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .folio {
        padding: 100px 30px 60px;
    }

    .folio-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .col-margin {
        border-left: none;
        border-top: 1px solid rgba(127, 163, 191, 0.15);
        padding-left: 0;
        padding-top: 30px;
    }

    .folio-title {
        font-size: 42px;
    }

    .folio-subtitle {
        font-size: 22px;
    }

    .folio-divider {
        height: 30vh;
        padding: 0 30px;
    }

    #hud-folio-label {
        display: none;
    }

    .parallax-leaf {
        display: none;
    }

    .col-main {
        padding-right: 0;
    }
}

@media (max-width: 600px) {
    .folio-title {
        font-size: 32px;
        letter-spacing: 0.1em;
    }

    .folio-subtitle {
        font-size: 18px;
    }

    .body-text {
        font-size: 15px;
    }

    .folio {
        padding: 80px 20px 40px;
    }

    .folio-divider {
        height: 20vh;
        padding: 0 20px;
    }
}
