/* ============================================
   riron.org - Neubrutalist Academic Journal
   Palette: Warm Sepia / Aged Parchment
   Typography: Space Mono + IBM Plex Mono
   ============================================ */

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

/* Selection */
::selection {
    background: #C9956B;
    color: #fff;
}

::-moz-selection {
    background: #C9956B;
    color: #fff;
}

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

body {
    background: #F5E6D0;
    color: #1A1A1A;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    position: relative;
}

/* ============================================
   Grain Overlay
   ============================================ */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.08;
    mix-blend-mode: multiply;
    transition: opacity 0.8s ease;
}

#grain-overlay.intensified {
    opacity: 0.12;
}

/* ============================================
   Crop Marks
   ============================================ */
.crop-mark {
    position: fixed;
    width: 12px;
    height: 12px;
    z-index: 9998;
    pointer-events: none;
}

.crop-mark::before,
.crop-mark::after {
    content: '';
    position: absolute;
    background: #3D2B1F;
}

.crop-mark::before {
    width: 12px;
    height: 2px;
}

.crop-mark::after {
    width: 2px;
    height: 12px;
}

.crop-tl {
    top: 16px;
    left: 16px;
}
.crop-tl::before { top: 0; left: 0; }
.crop-tl::after { top: 0; left: 0; }

.crop-tr {
    top: 16px;
    right: 16px;
}
.crop-tr::before { top: 0; right: 0; }
.crop-tr::after { top: 0; right: 0; }

.crop-bl {
    bottom: 16px;
    left: 16px;
}
.crop-bl::before { bottom: 0; left: 0; }
.crop-bl::after { bottom: 0; left: 0; }

.crop-br {
    bottom: 16px;
    right: 16px;
}
.crop-br::before { bottom: 0; right: 0; }
.crop-br::after { bottom: 0; right: 0; }

/* ============================================
   Navigation
   ============================================ */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #F5E6D0;
    border-bottom: 2px solid #1A1A1A;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 9000;
}

.nav-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1A1A1A;
}

.nav-link {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: #6B5344;
    cursor: pointer;
}

.nav-link:hover {
    color: #1A1A1A;
}

/* ============================================
   Folio Counter
   ============================================ */
#folio {
    position: fixed;
    bottom: 24px;
    right: 32px;
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: #6B5344;
    z-index: 9000;
    letter-spacing: 0.05em;
}

/* ============================================
   Marginal Rule
   ============================================ */
#marginal-rule {
    position: fixed;
    top: 56px;
    left: calc(50% - 15% - 320px - 8px);
    width: 1px;
    height: calc(100vh - 56px);
    background: rgba(201, 149, 107, 0.3);
    z-index: 100;
    pointer-events: none;
}

/* ============================================
   Opening Section
   ============================================ */
#opening {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 56px;
}

.opening-content {
    text-align: left;
    margin-inline-start: -15%;
}

.site-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #1A1A1A;
    line-height: 1.1;
    margin-bottom: 24px;
}

.site-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #6B5344;
    letter-spacing: 0.04em;
}

/* ============================================
   Content Sections
   ============================================ */
.content-section {
    position: relative;
    min-height: 90vh;
    padding: 80px 40px 40px;
}

.section-inner {
    position: relative;
    max-width: 1000px;
    margin-inline-start: calc(50% - 15% - 320px);
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* Section Numerals (watermark) */
.section-numeral {
    position: absolute;
    top: -40px;
    left: -20px;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    color: #D4A574;
    opacity: 0.2;
    z-index: 0;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

/* Reading Column */
.reading-column {
    max-width: 640px;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

/* Marginal Column */
.marginal-column {
    width: 280px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 60px;
}

/* ============================================
   Content Blocks (Neubrutalist)
   ============================================ */
.content-block {
    border: 4px solid #1A1A1A;
    background: #F5E6D0;
    padding: 32px;
    position: relative;
    box-shadow: 8px 8px 0 #5C3D2E;
    margin-bottom: -12px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 400ms ease, transform 400ms ease;
}

.content-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Marginal Notes */
.marginal-note {
    background: #E8D5B8;
    padding: 20px;
    border: 4px solid #1A1A1A;
    box-shadow: 8px 8px 0 #5C3D2E;
}

.marginal-note p {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #6B5344;
}

/* ============================================
   Typography
   ============================================ */
.section-header {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #1A1A1A;
    border-bottom: 8px solid #1A1A1A;
    padding-bottom: 16px;
    margin-bottom: 32px;
    margin-left: -72px;
    padding-left: 72px;
    position: relative;
    z-index: 2;
}

.body-text p {
    margin-bottom: 24px;
    color: #1A1A1A;
}

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

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton .skeleton-placeholder {
    display: block;
}

.skeleton.revealed .skeleton-placeholder {
    display: none;
}

.skeleton .body-text,
.skeleton .section-header,
.skeleton .marginal-note p {
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

.skeleton.revealed .body-text,
.skeleton.revealed .section-header,
.skeleton.revealed .marginal-note p {
    visibility: visible;
    height: auto;
    overflow: visible;
}

.skeleton-placeholder {
    position: relative;
    overflow: hidden;
    background: #E8D5B8;
    border: 4px solid #1A1A1A;
}

.skeleton-heading {
    height: 48px;
    margin-bottom: 16px;
}

.skeleton-note {
    height: 60px;
    margin-bottom: 12px;
}

.skeleton-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: -200px;
    width: 200px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 165, 116, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -200px; }
    100% { left: 100%; }
}

/* ============================================
   Break Bands
   ============================================ */
.break-band {
    width: 100vw;
    height: 6px;
    background: #2E1F14;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin: 60px 0 20px;
}

/* ============================================
   Wave Separators
   ============================================ */
.wave-separator {
    position: relative;
    width: 100vw;
    height: 40px;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 40px;
    overflow: hidden;
}

.wave-separator svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wave-primary {
    stroke: #3D2B1F;
    stroke-width: 2;
    fill: none;
}

.wave-echo {
    stroke: #C9956B;
    stroke-width: 1;
    fill: none;
    opacity: 0.5;
}

/* ============================================
   Terminal Section
   ============================================ */
#terminal {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
}

.terminal-content {
    text-align: center;
}

.terminal-content .content-block {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 40px;
}

.terminal-text {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #1A1A1A;
    margin-bottom: 32px;
}

.terminal-rule {
    width: 200px;
    height: 4px;
    background: #1A1A1A;
    margin: 0 auto;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .section-inner {
        flex-direction: column;
        margin-inline-start: 20px;
        margin-inline-end: 20px;
    }

    .marginal-column {
        width: 100%;
        padding-top: 20px;
    }

    .reading-column {
        max-width: 100%;
    }

    .section-header {
        margin-left: -32px;
        padding-left: 32px;
    }

    .opening-content {
        margin-inline-start: 0;
        padding: 0 20px;
    }

    #marginal-rule {
        display: none;
    }

    #navbar {
        padding: 0 20px;
    }

    .content-section {
        padding: 60px 20px 20px;
    }
}

@media (max-width: 600px) {
    .section-header {
        margin-left: 0;
        padding-left: 0;
        font-size: clamp(1.4rem, 5vw, 2rem);
    }

    .content-block {
        padding: 20px;
        box-shadow: 6px 6px 0 #5C3D2E;
    }

    .marginal-note {
        padding: 16px;
        box-shadow: 6px 6px 0 #5C3D2E;
    }

    .section-numeral {
        font-size: clamp(3rem, 8vw, 5rem);
    }
}
