/* miris.bar — terminal séance, cool grays, humanist warmth */

:root {
    --bg-primary: #0E1117;
    --bg-secondary: #161B22;
    --surface: #1C2128;
    --rule: #3A3F47;
    --body: #B8BFC9;
    --heading: #D1D5DB;
    --muted: #4B5563;
    --accent: #6E8898;
    --accent-soft: #8B95A3;
    --col-width: 640px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background-color: var(--bg-primary);
    color: var(--body);
    font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    position: relative;
}

/* ---------- Atmospheric drifting curves ---------- */

.atmosphere {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.atmosphere .drift {
    position: absolute;
    left: -10%;
    width: 120%;
    height: 100%;
    opacity: 0.02;
}

.atmosphere .drift--a {
    top: -20%;
    height: 140%;
    animation: drift-a 60s linear infinite;
}

.atmosphere .drift--b {
    top: -10%;
    height: 130%;
    animation: drift-b 90s linear infinite;
    opacity: 0.025;
}

.atmosphere .drift--c {
    top: -5%;
    height: 120%;
    animation: drift-c 75s linear infinite;
    opacity: 0.018;
}

@keyframes drift-a {
    0%   { transform: translate3d(0,    0, 0); }
    50%  { transform: translate3d(-3%, -4%, 0); }
    100% { transform: translate3d(0,    0, 0); }
}

@keyframes drift-b {
    0%   { transform: translate3d(0,   0, 0); }
    50%  { transform: translate3d(2%,  3%, 0); }
    100% { transform: translate3d(0,   0, 0); }
}

@keyframes drift-c {
    0%   { transform: translate3d(0,    0, 0); }
    50%  { transform: translate3d(-2%,  2%, 0); }
    100% { transform: translate3d(0,    0, 0); }
}

/* ---------- Shared layout ---------- */

.column {
    position: relative;
    z-index: 2;
    max-width: var(--col-width);
    margin: 0 auto;
    padding: 0 24px;
}

section {
    position: relative;
    z-index: 1;
    padding: 18vh 0;
}

.section-heading {
    font-family: "Libre Franklin", "Inter", "Helvetica Neue", sans-serif;
    font-weight: 300;
    font-size: 32px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--heading);
    margin-bottom: 64px;
}

p {
    margin-bottom: 1.4em;
    color: var(--body);
}

.pull,
em.pull,
em {
    font-family: "Source Serif 4", Georgia, serif;
    font-weight: 300;
    font-style: italic;
    color: var(--accent-soft);
}

.pull {
    font-size: 22px;
    line-height: 1.55;
    display: block;
    margin-bottom: 1.4em;
}

a.inline-link {
    color: var(--body);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 600ms ease, border-color 600ms ease;
}

a.inline-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ---------- Section 0 — The Signal ---------- */

.signal {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.signal__inner {
    text-align: center;
    padding: 0 24px;
    max-width: 820px;
}

.signal__text {
    font-family: "Libre Franklin", "Inter", sans-serif;
    font-weight: 300;
    font-size: 28px;
    letter-spacing: 0.06em;
    color: var(--heading);
    line-height: 1.4;
    margin: 0;
}

.signal__typed {
    white-space: pre-wrap;
}

/* ---------- Cursor ---------- */

.cursor {
    display: inline-block;
    color: var(--body);
    font-family: "IBM Plex Mono", "Courier New", monospace;
    font-weight: 400;
    margin-left: 2px;
    animation: blink 1s steps(1, end) infinite;
}

.cursor--final {
    color: var(--accent-soft);
}

@keyframes blink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ---------- Section 1 — The Archive ---------- */

.archive {
    background-color: var(--bg-primary);
}

.log-entry {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 24px;
    padding: 32px 0;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 1200ms ease, transform 1200ms ease;
}

.log-entry.is-visible {
    opacity: 1;
    transform: none;
}

.log-entry__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
}

.ts {
    font-family: "IBM Plex Mono", "Courier New", monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.ts--date {
    color: var(--rule);
}

.log-entry__body p {
    margin: 0;
}

.divider {
    display: block;
    width: 100%;
    height: 24px;
    margin: 8px 0;
    opacity: 0.7;
}

@media (max-width: 640px) {
    .log-entry {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .log-entry__meta {
        flex-direction: row;
        gap: 16px;
    }
}

/* ---------- Section 2 — The Gallery ---------- */

.gallery {
    background-color: var(--bg-primary);
}

.illustration {
    margin: 96px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1400ms ease, transform 1400ms ease;
}

.illustration.is-visible {
    opacity: 1;
    transform: none;
}

.line-illustration {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 0 auto 32px;
    height: auto;
}

.line-illustration .ink {
    stroke-dasharray: 2400;
    stroke-dashoffset: 2400;
    transition: stroke-dashoffset 2800ms ease;
}

.illustration.is-visible .line-illustration .ink {
    stroke-dashoffset: 0;
}

.line-illustration .wave {
    transform-origin: 160px 40px;
    opacity: 0;
    animation: wave-pulse 4s ease-out infinite;
}

.line-illustration .wave-1 { animation-delay: 0s; }
.line-illustration .wave-2 { animation-delay: 1.2s; }
.line-illustration .wave-3 { animation-delay: 2.4s; }

@keyframes wave-pulse {
    0%   { opacity: 0; transform: scale(0.4); }
    20%  { opacity: 0.8; }
    100% { opacity: 0; transform: scale(1.6); }
}

.illustration__caption {
    font-family: "Source Serif 4", Georgia, serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    color: var(--body);
    text-align: left;
}

/* ---------- Section 3 — The Transmission ---------- */

.transmission {
    position: relative;
    min-height: 100vh;
    background-color: var(--bg-primary);
    animation: bg-shift 30s ease-in-out infinite;
    overflow: hidden;
    padding: 22vh 0;
}

@keyframes bg-shift {
    0%   { background-color: #0E1117; }
    50%  { background-color: #131820; }
    100% { background-color: #0E1117; }
}

.transmission__field {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.55;
}

.transmission__field .curves {
    width: 100%;
    height: 100%;
}

.transmission__field .curve {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1;
    opacity: 0.5;
    stroke-dasharray: 4000;
    stroke-dashoffset: 0;
    transform-origin: center;
}

.transmission__field .curve-1 { animation: flow-a 12s ease-in-out infinite; opacity: 0.45; }
.transmission__field .curve-2 { animation: flow-b 14s ease-in-out infinite; opacity: 0.35; }
.transmission__field .curve-3 { animation: flow-c 16s ease-in-out infinite; opacity: 0.4; }
.transmission__field .curve-4 { animation: flow-a 18s ease-in-out infinite reverse; opacity: 0.3; }
.transmission__field .curve-5 { animation: flow-b 20s ease-in-out infinite reverse; opacity: 0.32; }
.transmission__field .curve-6 { animation: flow-c 22s ease-in-out infinite; opacity: 0.28; }

@keyframes flow-a {
    0%, 100% { transform: translate3d(0,    0, 0) scaleY(1); }
    50%      { transform: translate3d(-2%, 8px, 0) scaleY(1.05); }
}

@keyframes flow-b {
    0%, 100% { transform: translate3d(0,    0, 0) scaleY(1); }
    50%      { transform: translate3d(2%, -10px, 0) scaleY(0.95); }
}

@keyframes flow-c {
    0%, 100% { transform: translate3d(0,    0, 0); }
    50%      { transform: translate3d(-1%, 6px, 0); }
}

.transmission__copy {
    position: relative;
    z-index: 3;
    background: linear-gradient(180deg, rgba(14,17,23,0) 0%, rgba(14,17,23,0.55) 18%, rgba(14,17,23,0.55) 82%, rgba(14,17,23,0) 100%);
    padding-top: 80px;
    padding-bottom: 80px;
}

/* ---------- Section 4 — The Threshold ---------- */

.threshold {
    background-color: var(--bg-primary);
    padding-bottom: 30vh;
}

.threshold__line {
    transition: opacity 800ms ease, color 800ms ease;
}

.threshold__line--last {
    margin-top: 80px;
    font-family: "Libre Franklin", "Inter", sans-serif;
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--accent-soft);
}

/* ---------- Compass-rose glyph (persistent) ---------- */

.compass {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 48px;
    height: 48px;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    z-index: 50;
    transition: transform 600ms ease, opacity 800ms ease;
}

.compass:hover {
    transform: scale(1.06);
}

.compass__svg {
    width: 100%;
    height: 100%;
    display: block;
}

.compass__rose {
    transform-origin: 32px 32px;
    animation: rose-rotate 30s linear infinite;
}

@keyframes rose-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.compass.is-pulsing {
    animation: compass-pulse 1800ms ease-out 1;
}

@keyframes compass-pulse {
    0%   { transform: scale(1);   opacity: 1; }
    50%  { transform: scale(1.25); opacity: 0.6; }
    100% { transform: scale(1);   opacity: 1; }
}

/* ---------- Navigation overlay ---------- */

.nav-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(28, 33, 40, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 600ms ease;
}

.nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.nav-overlay__inner {
    text-align: left;
    padding: 32px;
    max-width: 480px;
    width: 100%;
}

.nav-overlay__label {
    font-family: "IBM Plex Mono", "Courier New", monospace;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.08em;
    margin-bottom: 32px;
}

.nav-overlay__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-overlay__list li {
    margin-bottom: 16px;
}

.nav-overlay__list a {
    font-family: "Libre Franklin", "Inter", sans-serif;
    font-weight: 300;
    font-size: 22px;
    letter-spacing: 0.06em;
    color: var(--heading);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 4px;
    transition: color 400ms ease, border-color 400ms ease;
}

.nav-overlay__list a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.nav-overlay__close {
    margin-top: 48px;
    font-family: "IBM Plex Mono", "Courier New", monospace;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.04em;
}

/* ---------- Mobile adjustments ---------- */

@media (max-width: 640px) {
    body {
        font-size: 17px;
    }
    .section-heading {
        font-size: 24px;
        margin-bottom: 40px;
    }
    .signal__text {
        font-size: 20px;
    }
    .pull {
        font-size: 19px;
    }
    .compass {
        right: 18px;
        bottom: 18px;
        width: 40px;
        height: 40px;
    }
    section {
        padding: 12vh 0;
    }
}
