/* =============================================
   martialaw.quest - Mid-Century Educational Design
   ============================================= */

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

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

body {
    font-family: 'IBM Plex Serif', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1.1vw, 18px);
    line-height: 1.75;
    color: #2A2A30;
    background: linear-gradient(180deg, #D4A850, #1A4A5A, #2A3050);
    background-size: 100% 300vh;
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
}

.logotype {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 700;
    font-size: clamp(32px, 5vw, 64px);
    color: #FAF4E8;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.logotype.visible {
    opacity: 1;
}

.section-heading {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 500;
    font-size: clamp(24px, 3.5vw, 48px);
    color: #2A2A30;
    margin-bottom: 24px;
    line-height: 1.2;
}

.body-text {
    color: #2A2A30;
    margin-bottom: 16px;
}

.data-label {
    font-family: 'DM Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 12px;
    fill: #2A2A30;
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
    padding: 40px 20px;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    max-width: 700px;
}

.hero-geometric {
    width: min(500px, 80vw);
    height: auto;
}

.geo-shape {
    transform: scale(0);
    transform-origin: center;
    transform-box: fill-box;
    transition: transform 0.6s ease-out;
}

.geo-shape.animated {
    transform: scale(1);
}

.hero-subtitle {
    font-family: 'IBM Plex Serif', Georgia, serif;
    font-size: clamp(14px, 1.2vw, 18px);
    color: #FAF4E8;
    opacity: 0.85;
    max-width: 500px;
    line-height: 1.6;
    opacity: 0;
    transition: opacity 0.8s ease-out 1.2s;
}

.hero-subtitle.visible {
    opacity: 0.85;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    animation: bobDown 2s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.5s ease-out 2s;
}

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

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

/* --- Content Slides --- */
.content-slide {
    max-width: 900px;
    margin: 0 auto 80px auto;
    background: rgba(250, 244, 232, 0.92);
    padding: 48px;
    border-radius: 2px;
    position: relative;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.content-slide.in-view {
    opacity: 1;
    transform: scale(1);
}

/* Spotlight radial gradient on each slide */
.content-slide::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 80px;
    background: radial-gradient(ellipse at center, rgba(212, 168, 80, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

/* --- Section Markers --- */
.section-marker {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.marker-shape {
    width: 60px;
    height: 60px;
}

/* --- Data Visualizations --- */
.data-viz {
    margin: 32px 0;
    overflow-x: auto;
}

.data-viz svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Timeline nodes */
.timeline-node {
    opacity: 0;
    transition: opacity 0.4s ease-out;
}

.timeline-node.revealed {
    opacity: 1;
}

/* Bar chart bars */
.bar-rect {
    transition: height 0.6s ease-out, y 0.6s ease-out;
}

/* Bar value labels */
.bar-value {
    transition: opacity 0.3s ease-out 0.6s;
}

/* Map highlights */
.map-highlight {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.map-highlight.revealed {
    opacity: 0.6;
}

.map-label {
    opacity: 0;
    transition: opacity 0.5s ease-out 0.3s;
}

.map-highlight.revealed + text.map-label,
.map-label.revealed {
    opacity: 1;
}

/* --- Data Color References (used by SVG inline and CSS) --- */
.timeline-node[fill="#D06848"],
.bar-rect[fill="#D06848"] {
    fill: #D06848;
}

.timeline-node[fill="#4A6A80"],
.bar-rect[fill="#4A6A80"] {
    fill: #4A6A80;
}

.timeline-node[fill="#5A8A5A"],
.bar-rect[fill="#5A8A5A"] {
    fill: #5A8A5A;
}

/* --- Section Decoration --- */
.section-decoration {
    margin-top: 32px;
}

.section-decoration svg {
    width: 100%;
    height: auto;
    opacity: 0.6;
}

/* --- Mechanism Grid --- */
.mechanism-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin-top: 32px;
}

.mechanism-card {
    text-align: center;
    padding: 24px;
}

.mechanism-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
}

.mechanism-title {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: #2A2A30;
    margin-bottom: 12px;
}

/* --- Consequences List --- */
.consequences-list {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.consequence-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.consequence-marker {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 8px;
}

.consequence-title {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: #2A2A30;
    margin-bottom: 8px;
}

/* --- Footer --- */
#site-footer {
    text-align: center;
    padding: 60px 20px 40px;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-geo {
    width: 200px;
    height: auto;
    margin-bottom: 20px;
}

.footer-text {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #FAF4E8;
    opacity: 0.7;
    margin-bottom: 8px;
}

.footer-small {
    font-size: 12px;
    opacity: 0.5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .content-slide {
        margin-left: 16px;
        margin-right: 16px;
        padding: 32px 24px;
    }

    .mechanism-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .hero-geometric {
        width: 90vw;
    }
}

@media (max-width: 480px) {
    .content-slide {
        padding: 24px 16px;
        margin-bottom: 48px;
    }

    .mechanism-card {
        padding: 16px;
    }
}

/* --- Closing decoration --- */
.closing-decoration {
    margin-top: 48px;
}
