/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background: #0d0f14;
    color: #c8ced8;
    /* palette: #1a1f28 #252d3a #2a2f38 #4a5568 #8a7453 */
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === GRAIN OVERLAY === */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
    opacity: 0.03;
}

.grain-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* === NOISE FIELD CANVAS === */
#noise-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

/* === BOKEH LAYER === */
.bokeh-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.bokeh {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(61,122,138,0.08), transparent 70%);
    pointer-events: none;
}

@keyframes drift-1 {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(15vw, -10vh); }
    50%  { transform: translate(-5vw, 20vh); }
    75%  { transform: translate(-15vw, -5vh); }
    100% { transform: translate(0, 0); }
}
@keyframes drift-2 {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(-20vw, 15vh); }
    50%  { transform: translate(10vw, -15vh); }
    75%  { transform: translate(20vw, 10vh); }
    100% { transform: translate(0, 0); }
}
@keyframes drift-3 {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(10vw, 20vh); }
    50%  { transform: translate(-20vw, -10vh); }
    75%  { transform: translate(5vw, -20vh); }
    100% { transform: translate(0, 0); }
}

/* === SPINE LINE === */
.spine-line {
    position: fixed;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100vh;
    background: #5a6b7d;
    opacity: 0.15;
    z-index: -1;
    transform: translateX(-0.5px);
}

/* === MASTHEAD === */
.masthead {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 200px 0 0 60px;
}

.masthead-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 200;
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    letter-spacing: 0.04em;
    line-height: 1.15;
    color: #c8ced8;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* === DETECTION CHAMBER === */
.detection-chamber {
    position: relative;
    z-index: 1;
}

/* === SIGNAL PEAK === */
.signal-peak {
    position: relative;
    background: #0d0f14;
    padding: 120px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.signal-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #3d7a8a;
    opacity: 0;
}

.signal-line.pulse {
    animation: signal-pulse 2s ease-in-out;
}

@keyframes signal-pulse {
    0%   { opacity: 0; }
    50%  { opacity: 0.4; }
    100% { opacity: 0; }
}

.signal-peak-content {
    max-width: 38em;
    padding: 0 2rem;
    text-align: center;
}

.signal-peak-content h1 {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    letter-spacing: 0.04em;
    line-height: 1.15;
    color: #c8ced8;
    margin-bottom: 1.5rem;
}

.signal-peak-content .signal-excerpt {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    line-height: 1.72;
    color: #c8ced8;
    margin-bottom: 1.5rem;
    max-width: 38em;
}

/* === META TAGS === */
.meta-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7a8d;
    display: block;
    margin-bottom: 1rem;
}

.meta-source {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7a8d;
    display: block;
    margin-top: 1rem;
}

/* === BLOB SEPARATORS === */
.blob-separator {
    width: 100%;
    height: 150px;
    display: block;
    overflow: visible;
}

.morphing-blob {
    fill: #3d7a8a;
    opacity: 0.06;
}

.blob-mid {
    margin: 40px 0;
}

/* === FIELD LINES (STORIES) === */
.field-line {
    position: relative;
    padding: 60px 0;
}

.field-line-content {
    max-width: 38em;
    padding: 2.5rem 2rem;
    background: rgba(26, 31, 40, 0.75);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: 2px;
    transition: backdrop-filter 300ms ease, background 300ms ease;
    transform: translateZ(0);
}

.field-line-content:hover {
    background: rgba(26, 31, 40, 0.88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.field-line:nth-child(odd) .field-line-content {
    margin-left: 8vw;
    margin-right: auto;
}

.field-line:nth-child(even) .field-line-content {
    margin-left: auto;
    margin-right: 8vw;
}

.field-line h2 {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    letter-spacing: 0.04em;
    line-height: 1.15;
    color: #c8ced8;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: color 400ms ease;
}

.field-line h2:hover {
    color: #3d7a8a;
}

.field-line p {
    color: #c8ced8;
    max-width: 38em;
}

/* === ARCHIVE GRADIENT === */
.archive-gradient {
    padding-bottom: 200px;
}

.archive-entry {
    opacity: calc(1 - var(--fade) * 0.12);
    filter: blur(calc(var(--fade) * 0.6px));
}

/* === LINK HOVER UNDERLINE === */
.field-line h2 {
    background-image: linear-gradient(#3d7a8a, #3d7a8a);
    background-size: 0% 1px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: color 400ms ease, background-size 400ms ease;
    padding-bottom: 2px;
}

.field-line h2:hover {
    background-size: 100% 1px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .masthead {
        padding: 120px 0 0 30px;
    }

    .field-line:nth-child(odd) .field-line-content,
    .field-line:nth-child(even) .field-line-content {
        margin-left: 1rem;
        margin-right: 1rem;
    }

    .signal-peak-content {
        padding: 0 1.5rem;
    }
}
