/* ================================================
   SUPPLY CHAIN OBSERVER - Styles
   Investigative journalism editorial experience
   ================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0e1830;
    color: #d0d4dc;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.85;
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: 'Libre Franklin', 'Helvetica Neue', sans-serif;
    font-weight: 700;
    line-height: 1.15;
    color: #d0d4dc;
}

h2 {
    font-size: clamp(28px, 4.5vw, 52px);
    margin-bottom: 1.2em;
    letter-spacing: -0.02em;
}

h3 {
    font-size: clamp(22px, 3vw, 36px);
    margin-bottom: 1em;
    letter-spacing: -0.01em;
}

p {
    margin-bottom: 1.2em;
}

p:last-child {
    margin-bottom: 0;
}

/* --- HERO SECTION --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0e1830;
    overflow: hidden;
}

#hero-diagram {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 1.5s ease;
}

#hero-diagram.visible {
    opacity: 1;
}

#supply-chain-svg {
    width: 90%;
    max-width: 1200px;
    height: auto;
}

/* Sketch-style SVG elements */
.sketch-node {
    fill: none;
    stroke: #6a7a8a;
    stroke-width: 2;
    opacity: 0;
}

.sketch-node.drawn {
    opacity: 1;
}

.sketch-arrow {
    stroke: #6a7a8a;
    stroke-width: 2;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    opacity: 0.7;
}

.sketch-arrow.drawn {
    stroke-dashoffset: 0;
}

.sketch-label {
    font-family: 'Fira Mono', monospace;
    font-size: 11px;
    fill: #6a7a8a;
    text-anchor: middle;
    opacity: 0;
}

.sketch-label.drawn {
    opacity: 0.8;
}

.sketch-dot {
    fill: #d4a040;
    opacity: 0;
}

.sketch-dot.drawn {
    opacity: 0.6;
}

/* Hero content */
#hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease 0.8s, transform 1.2s ease 0.8s;
}

#hero-content.visible {
    opacity: 1;
    transform: translateY(0);
}

#hero-title {
    font-family: 'Libre Franklin', 'Helvetica Neue', sans-serif;
    font-weight: 900;
    font-size: clamp(36px, 7vw, 80px);
    letter-spacing: 0.08em;
    line-height: 1.05;
    color: #d0d4dc;
    text-shadow: 0 2px 40px rgba(10, 16, 32, 0.8);
    margin-bottom: 0.4em;
}

#hero-subtitle {
    font-family: 'Source Serif 4', Georgia, serif;
    font-style: italic;
    font-size: clamp(14px, 1.8vw, 20px);
    color: #6a7a8a;
    letter-spacing: 0.04em;
}

/* Scroll indicator */
#hero-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 1s ease 2s;
    z-index: 2;
}

#hero-scroll-indicator.visible {
    opacity: 0.6;
}

#hero-scroll-indicator span {
    font-family: 'Fira Mono', monospace;
    font-size: 11px;
    color: #6a7a8a;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#hero-scroll-indicator svg {
    animation: scrollBounce 2s ease-in-out infinite;
}

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

/* --- EDITORIAL SPREADS --- */
.editorial-spread {
    position: relative;
    padding: 80px 5vw 60px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Investigation Blue section backgrounds for alternating spreads */
#spread-analysis {
    background-color: #2a4a7a;
    border-radius: 0;
    max-width: 100%;
    padding-left: calc((100% - 1400px) / 2 + 5vw);
    padding-right: calc((100% - 1400px) / 2 + 5vw);
}

#spread-analysis .section-tag {
    color: #d4a040;
}

#spread-analysis .data-card {
    background-color: #0e1830;
}

/* Section headers/tags */
.spread-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.section-tag {
    font-family: 'Libre Franklin', 'Helvetica Neue', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.2em;
    color: #d4a040;
    text-transform: uppercase;
    white-space: nowrap;
}

.tag-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, #d4a040, transparent);
    opacity: 0.4;
}

/* --- MARBLE PANELS --- */
.marble-panel {
    background-color: #e8e0d4;
    color: #0e1830;
    padding: clamp(30px, 4vw, 60px);
    position: relative;
    overflow: hidden;
}

/* Marble veining effect */
.marble-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, transparent 40%, rgba(210, 200, 185, 0.04) 41%, rgba(210, 200, 185, 0.04) 42%, transparent 43%),
        linear-gradient(125deg, transparent 55%, rgba(190, 180, 165, 0.04) 56%, rgba(190, 180, 165, 0.04) 57%, transparent 58%),
        linear-gradient(140deg, transparent 30%, rgba(200, 190, 175, 0.03) 31%, rgba(200, 190, 175, 0.03) 32%, transparent 33%),
        linear-gradient(150deg, transparent 70%, rgba(180, 170, 155, 0.04) 71%, rgba(180, 170, 155, 0.04) 72%, transparent 73%),
        linear-gradient(130deg, transparent 20%, rgba(195, 185, 170, 0.03) 21%, rgba(195, 185, 170, 0.03) 22%, transparent 23%);
    pointer-events: none;
}

.marble-panel h2,
.marble-panel h3 {
    color: #0e1830;
}

.marble-panel p {
    color: #0a1020;
    line-height: 1.85;
}

.marble-panel .data-annotation {
    font-family: 'Fira Mono', monospace;
    font-size: 12px;
    color: #6a7a8a;
    border-top: 1px solid rgba(106, 122, 138, 0.3);
    padding-top: 1em;
    margin-top: 1.5em;
}

/* --- LAYOUT VARIANTS --- */

/* Full-width spread */
.spread-full-width {
    width: 100%;
}

/* Two-thirds + one-third columns */
.spread-columns {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Layered panel (overlapping effect) */
.layered-panel {
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 40px rgba(10, 16, 32, 0.3);
}

/* Data cards (one-third column) */
.data-card {
    background-color: #0a1020;
    padding: 28px;
    border-left: 3px solid #d4a040;
    position: relative;
    overflow: hidden;
}

.data-card + .data-card {
    margin-top: 20px;
}

.data-label {
    display: block;
    font-family: 'Fira Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6a7a8a;
    margin-bottom: 8px;
}

.data-value {
    display: block;
    font-family: 'Libre Franklin', 'Helvetica Neue', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 3.5vw, 42px);
    color: #d0d4dc;
    line-height: 1.2;
    margin-bottom: 6px;
}

.data-unit {
    font-size: 0.5em;
    color: #6a7a8a;
    font-weight: 400;
}

.data-change {
    display: block;
    font-family: 'Fira Mono', monospace;
    font-size: 12px;
    color: #6a7a8a;
}

.data-change.negative {
    color: #d4a040;
}

/* Layered spread (diagram behind panel) */
.spread-layered {
    position: relative;
    min-height: 500px;
}

.layer-background {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.35;
}

.inline-diagram {
    width: 100%;
    max-width: 800px;
    height: auto;
}

.route-path {
    fill: none;
    stroke: #6a7a8a;
    stroke-width: 2;
    stroke-dasharray: 8 6;
    opacity: 0.6;
}

.port-marker {
    fill: none;
    stroke: #d4a040;
    stroke-width: 2;
}

.port-label {
    font-family: 'Fira Mono', monospace;
    font-size: 9px;
    fill: #6a7a8a;
    text-anchor: middle;
    letter-spacing: 0.1em;
}

.layer-content {
    position: relative;
    z-index: 2;
    margin-top: 60px;
    margin-left: 10%;
    max-width: 65%;
    box-shadow: -8px 8px 40px rgba(10, 16, 32, 0.5);
}

/* Narrow text column */
.spread-narrow {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 40px;
    align-items: start;
    max-width: 1000px;
    margin: 0 auto;
}

.narrow-panel {
    position: relative;
    z-index: 2;
}

.narrow-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding-top: 20px;
}

.sidebar-diagram {
    width: 100%;
    max-width: 200px;
    height: auto;
}

.sketch-node-small {
    fill: none;
    stroke: #6a7a8a;
    stroke-width: 1.5;
}

.sketch-label-small {
    font-family: 'Fira Mono', monospace;
    font-size: 9px;
    fill: #6a7a8a;
    text-anchor: middle;
}

.sketch-arrow-small {
    stroke: #6a7a8a;
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
}

.sidebar-note {
    padding: 16px;
    border-left: 2px solid #d4a040;
    position: relative;
}

.note-marker {
    font-family: 'Libre Franklin', 'Helvetica Neue', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #d4a040;
    display: block;
    margin-bottom: 8px;
}

.sidebar-note p {
    font-family: 'Fira Mono', monospace;
    font-size: 12px;
    color: #6a7a8a;
    line-height: 1.7;
}

/* --- SKELETON LOADING --- */
.skeleton-block {
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: opacity 0.5s ease;
}

.skeleton-block.hidden {
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.skeleton-line {
    height: 16px;
    border-radius: 3px;
    background: linear-gradient(
        90deg,
        rgba(106, 122, 138, 0.15) 0%,
        rgba(106, 122, 138, 0.3) 50%,
        rgba(106, 122, 138, 0.15) 100%
    );
    background-size: 400% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

/* Skeleton in marble panels */
.marble-panel .skeleton-line {
    background: linear-gradient(
        90deg,
        rgba(14, 24, 48, 0.08) 0%,
        rgba(14, 24, 48, 0.18) 50%,
        rgba(14, 24, 48, 0.08) 100%
    );
    background-size: 400% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

.skeleton-line-title {
    height: 28px;
    width: 70%;
    margin-bottom: 6px;
}

.skeleton-line-long {
    width: 100%;
}

.skeleton-line-medium {
    width: 75%;
}

.skeleton-line-short {
    width: 45%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Content reveal */
.content-reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    position: absolute;
    pointer-events: none;
}

.content-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
    position: relative;
    pointer-events: auto;
}

/* --- FOOTER --- */
#site-footer {
    padding: 60px 5vw 40px;
    max-width: 1400px;
    margin: 60px auto 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-title {
    font-family: 'Libre Franklin', 'Helvetica Neue', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.15em;
    color: #d0d4dc;
}

.footer-desc {
    font-family: 'Source Serif 4', Georgia, serif;
    font-style: italic;
    font-size: 14px;
    color: #6a7a8a;
}

.footer-line {
    height: 1px;
    background: linear-gradient(to right, #6a7a8a, transparent);
    opacity: 0.3;
}

.footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-note {
    font-family: 'Fira Mono', monospace;
    font-size: 11px;
    color: #6a7a8a;
    letter-spacing: 0.02em;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .spread-columns {
        grid-template-columns: 1fr;
    }

    .spread-narrow {
        grid-template-columns: 1fr;
    }

    .layer-content {
        margin-left: 0;
        max-width: 100%;
    }

    .narrow-sidebar {
        flex-direction: row;
        align-items: start;
    }

    .sidebar-diagram {
        max-width: 140px;
    }
}

@media (max-width: 600px) {
    .editorial-spread {
        padding: 50px 4vw 40px;
    }

    #hero-title {
        letter-spacing: 0.04em;
    }

    .narrow-sidebar {
        flex-direction: column;
    }

    .data-card {
        padding: 20px;
    }
}
