/* ============================================================
   diplomacy.day — styles.css
   Cold War signals intelligence station, goblincore aesthetic
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-bg: #0E0E14;
    --section-bg: #16161E;
    --elevated-surface: #1C1C24;
    --border-rule: #5A5A6E;
    --body-text: #9A9AB0;
    --emphasis-text: #C8C8D8;
    --accent-green: #4A7C59;
    --accent-warm: #8B6B4A;
    --danger-red: #7A3B3B;
    --highlight-glow: #3D6B5A;

    --font-primary: 'Share Tech Mono', monospace;
    --font-secondary: 'IBM Plex Mono', monospace;
    --font-display: 'Major Mono Display', monospace;

    --scroll-progress: 0;
    --particle-hue: 145;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--deep-bg);
    color: var(--body-text);
    font-family: var(--font-primary);
    font-size: clamp(0.88rem, 1.6vw, 1.05rem);
    font-weight: 400;
    line-height: 1.85;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Scan Line Overlay (CRT effect) --- */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(14, 14, 20, 0.03) 2px,
        rgba(14, 14, 20, 0.03) 4px
    );
}

/* --- Particle Canvas --- */
#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* --- Stratum (Section) Base --- */
.stratum {
    position: relative;
    width: 100%;
    z-index: 2;
}

.stratum-content {
    position: relative;
}

/* --- Reading Column --- */
.reading-column {
    max-width: 52ch;
    margin: 0 auto;
    padding: 8vh 1.5rem;
}

/* --- Stratum 0: Landing --- */
.stratum-0 {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--deep-bg);
}

.stratum-0-content {
    text-align: center;
    padding: 2rem;
}

.site-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--emphasis-text);
    line-height: 1.2;
    margin-bottom: 2rem;
    text-transform: lowercase;
}

.designation {
    font-family: var(--font-primary);
    font-size: clamp(0.7rem, 1.2vw, 0.88rem);
    letter-spacing: 0.12em;
    color: var(--border-rule);
    text-transform: uppercase;
    line-height: 1.6;
}

.designation.sub {
    color: var(--accent-green);
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* --- Stratum 1: Signal Analysis --- */
.stratum-1 {
    min-height: 120vh;
    background-color: var(--section-bg);
}

/* --- Stratum 2: Artifact Gallery --- */
.stratum-2 {
    min-height: 130vh;
    background-color: var(--deep-bg);
}

.stratum-2 .reading-column {
    max-width: 60ch;
}

/* --- Stratum 3: Transmission Log --- */
.stratum-3 {
    min-height: 100vh;
    background-color: var(--elevated-surface);
}

/* --- Stratum 4: Field Notes --- */
.stratum-4 {
    min-height: 90vh;
    background-color: var(--section-bg);
}

/* --- Transition Zones --- */
.transition-zone {
    position: relative;
    height: 15vh;
    width: 100%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        to bottom,
        transparent,
        hsl(var(--particle-hue), 8%, 8%),
        transparent
    );
}

.transition-zone::after {
    content: '';
    display: block;
    width: 60%;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--border-rule),
        transparent
    );
}

/* --- Section Headings --- */
.section-heading {
    font-family: var(--font-primary);
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    font-weight: 400;
    color: var(--emphasis-text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 4vh;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-rule);
}

/* --- Section Designator --- */
.section-designator {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    letter-spacing: 0.15em;
    color: var(--border-rule);
    margin-bottom: 3vh;
    opacity: 0.6;
}

/* --- Specimen Number --- */
.specimen-number {
    position: absolute;
    top: 2rem;
    right: 1.5rem;
    font-family: var(--font-display);
    font-size: clamp(0.6rem, 1vw, 0.75rem);
    letter-spacing: 0.1em;
    color: var(--border-rule);
    opacity: 0.5;
}

/* --- Dashed Margin Content --- */
.dashed-margin-content {
    border-left: 1px dashed var(--border-rule);
    padding-left: 1.5rem;
}

.dashed-margin-content p {
    margin-bottom: 1.8rem;
}

.dashed-margin-content p:last-child {
    margin-bottom: 0;
}

/* --- Annotations (inline code-style) --- */
.annotation {
    color: var(--accent-green);
    font-family: var(--font-secondary);
    font-weight: 400;
    font-size: 0.95em;
}

/* --- Redaction Bars --- */
.redacted {
    background-color: var(--danger-red);
    color: transparent;
    user-select: none;
    padding: 0 0.3em;
    cursor: pointer;
    transition: background-color 0.4s ease, opacity 0.4s ease;
    position: relative;
}

.redacted:hover {
    background-color: rgba(122, 59, 59, 0.4);
    color: rgba(200, 200, 216, 0.35);
}

/* --- Specimen Cards --- */
.specimen-card {
    border: 1px solid var(--border-rule);
    margin-bottom: 6vh;
    transform: translateX(calc(var(--i, 0) * 1.2vw));
    background-color: var(--section-bg);
    position: relative;
}

.specimen-card:last-child {
    margin-bottom: 0;
}

/* --- Specimen Image --- */
.specimen-image {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-rule);
    height: 22vh;
    min-height: 180px;
}

.specimen-image::before {
    content: '';
    position: absolute;
    inset: 0;
    filter: url(#noise-filter);
    opacity: 0.08;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.6s ease;
}

.specimen-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(14, 14, 20, 0.7) 100%);
    pointer-events: none;
    z-index: 3;
}

.specimen-image:hover::before {
    opacity: 0.15;
}

/* Placeholder patterns for specimen images (CSS-generated) */
.specimen-image-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--elevated-surface);
    position: relative;
    overflow: hidden;
    filter: grayscale(85%) sepia(20%) contrast(1.1) brightness(0.85);
    transition: filter 0.6s ease;
}

.specimen-card:hover .specimen-image-placeholder {
    filter: grayscale(85%) sepia(20%) contrast(1.1) brightness(0.85) hue-rotate(80deg);
}

.placeholder-pattern {
    position: absolute;
    inset: 0;
}

/* Pattern: Radio equipment — concentric circles and lines */
.pattern-radio {
    background:
        radial-gradient(circle at 30% 50%, var(--border-rule) 0px, transparent 1px) 0 0 / 12px 12px,
        radial-gradient(circle at 70% 40%, var(--accent-warm) 0px, transparent 1px) 0 0 / 18px 18px,
        repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(90, 90, 110, 0.15) 20px, rgba(90, 90, 110, 0.15) 21px),
        repeating-linear-gradient(0deg, transparent, transparent 15px, rgba(90, 90, 110, 0.1) 15px, rgba(90, 90, 110, 0.1) 16px),
        radial-gradient(ellipse at 50% 50%, rgba(74, 124, 89, 0.12) 0%, transparent 70%);
    opacity: 0.6;
}

/* Pattern: Antenna array — diagonal lines and crosses */
.pattern-antenna {
    background:
        repeating-linear-gradient(45deg, transparent, transparent 30px, rgba(90, 90, 110, 0.2) 30px, rgba(90, 90, 110, 0.2) 31px),
        repeating-linear-gradient(-45deg, transparent, transparent 30px, rgba(90, 90, 110, 0.15) 30px, rgba(90, 90, 110, 0.15) 31px),
        repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(139, 107, 74, 0.1) 60px, rgba(139, 107, 74, 0.1) 62px),
        radial-gradient(circle at 50% 30%, rgba(74, 124, 89, 0.08) 0%, transparent 50%);
    opacity: 0.5;
}

/* Pattern: Cipher machine — grid with dots */
.pattern-cipher {
    background:
        radial-gradient(circle at 50% 50%, rgba(90, 90, 110, 0.3) 1px, transparent 1px) 0 0 / 16px 16px,
        radial-gradient(circle at 50% 50%, rgba(139, 107, 74, 0.2) 1px, transparent 1px) 8px 8px / 16px 16px,
        repeating-linear-gradient(0deg, transparent, transparent 48px, rgba(90, 90, 110, 0.1) 48px, rgba(90, 90, 110, 0.1) 49px),
        repeating-linear-gradient(90deg, transparent, transparent 32px, rgba(90, 90, 110, 0.08) 32px, rgba(90, 90, 110, 0.08) 33px);
    opacity: 0.5;
}

/* --- Specimen Caption --- */
.specimen-caption {
    padding: 1.5rem;
}

.specimen-label {
    display: block;
    font-family: var(--font-primary);
    font-size: clamp(0.72rem, 1.1vw, 0.85rem);
    letter-spacing: 0.1em;
    color: var(--accent-green);
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.caption-text {
    font-family: var(--font-secondary);
    font-size: clamp(0.78rem, 1.3vw, 0.92rem);
    font-weight: 300;
    font-style: italic;
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: var(--body-text);
}

/* --- Timestamp --- */
.timestamp {
    color: var(--accent-warm);
    font-family: var(--font-secondary);
    font-weight: 400;
    font-style: normal;
    font-size: 0.9em;
}

/* --- Transmission Log --- */
.transmission-log {
    border-left: 1px dashed var(--border-rule);
    padding-left: 1.5rem;
}

.log-entry pre {
    font-family: var(--font-secondary);
    font-size: clamp(0.78rem, 1.3vw, 0.92rem);
    font-weight: 300;
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: var(--body-text);
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.log-divider {
    border: none;
    border-top: 1px solid rgba(90, 90, 110, 0.3);
    margin: 2.5vh 0;
}

/* --- Field Notes (Stratum 4) --- */
.final-rule {
    border: none;
    border-top: 1px solid var(--border-rule);
    margin: 4vh 0 2vh;
}

.datestamp {
    font-family: var(--font-secondary);
    font-size: clamp(0.7rem, 1vw, 0.82rem);
    color: var(--accent-warm);
    letter-spacing: 0.05em;
    line-height: 1.6;
    opacity: 0.8;
}

/* --- Vignette shadow for specimen images --- */
.specimen-image {
    box-shadow: inset 0 0 30px rgba(14, 14, 20, 0.5);
}

/* --- Noise texture background for landing --- */
.stratum-0 {
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(14, 14, 20, 0.06) 2px,
            rgba(14, 14, 20, 0.06) 4px
        ),
        var(--deep-bg);
}

/* --- Selection Style --- */
::selection {
    background: var(--highlight-glow);
    color: var(--emphasis-text);
}

/* --- Link styles (for any future links) --- */
a {
    color: var(--highlight-glow);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-green);
}

/* --- Responsive adjustments --- */
@media (max-width: 768px) {
    .reading-column {
        padding: 6vh 1.2rem;
    }

    .specimen-card {
        transform: none;
    }

    .specimen-number {
        position: relative;
        top: auto;
        right: auto;
        display: block;
        margin-bottom: 1rem;
        text-align: right;
    }

    .stratum-0-content {
        padding: 1rem;
    }

    .site-title {
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .designation {
        font-size: clamp(0.6rem, 2.5vw, 0.78rem);
    }

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

@media (max-width: 480px) {
    .reading-column {
        padding: 4vh 1rem;
    }

    .specimen-caption {
        padding: 1rem;
    }

    .dashed-margin-content {
        padding-left: 1rem;
    }

    .transmission-log {
        padding-left: 1rem;
    }
}
