/* Version: 2.0.4 */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Crimson+Pro:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --void: #0a0a0f;
    --thought: #e8e4dc;
    --spark: #ff6b35;
    --dream: #7b68ee;
    --whisper: #2d2d3a;
    --echo: #4a4a5c;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Crimson Pro', Georgia, serif;
    background: var(--void);
    color: var(--thought);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Floating neural particles */
.neural-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
}

.synapse {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--dream);
    border-radius: 50%;
    animation: drift 20s infinite ease-in-out;
}

.synapse:nth-child(odd) {
    background: var(--spark);
    animation-duration: 25s;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    25% { transform: translate(100px, -50px) scale(1.5); opacity: 0.8; }
    50% { transform: translate(-50px, 100px) scale(0.5); opacity: 0.2; }
    75% { transform: translate(80px, 80px) scale(1.2); opacity: 0.6; }
}

/* Navigation as constellation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 2rem;
    mix-blend-mode: difference;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--thought);
    text-decoration: none;
    position: relative;
}

.logo::before {
    content: '◈';
    margin-right: 0.5rem;
    animation: pulse-glow 3s infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; text-shadow: 0 0 20px var(--spark); }
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.nav-links a {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--thought);
    text-decoration: none;
    opacity: 0.6;
    transition: all 0.3s;
    position: relative;
}

.nav-links a:hover {
    opacity: 1;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--spark);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Opening ritual */
.opening {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
}

.opening::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(123,104,238,0.1) 0%, transparent 70%);
    animation: breathe 8s infinite ease-in-out;
}

@keyframes breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

.koan {
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 400;
    line-height: 1.1;
    max-width: 900px;
    position: relative;
    z-index: 1;
}

.koan em {
    font-style: italic;
    color: var(--spark);
}

.koan-sub {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0.4;
    margin-top: 3rem;
}

.scroll-hint {
    position: absolute;
    bottom: 3rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    opacity: 0.3;
    animation: float 2s infinite ease-in-out;
}

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

/* Main content river */
main {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem 6rem;
}

/* Transmission blocks (articles) */
.transmission {
    margin-bottom: 8rem;
    position: relative;
}

.transmission::before {
    content: '';
    position: absolute;
    left: -100px;
    top: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--echo), transparent);
}

.transmission-number {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--spark);
    margin-bottom: 1rem;
}

.transmission-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.transmission-title a {
    color: var(--thought);
    text-decoration: none;
    transition: color 0.3s;
}

.transmission-title a:hover {
    color: var(--spark);
}

.transmission-body {
    font-size: 1.2rem;
    line-height: 1.9;
    opacity: 0.8;
    max-width: 700px;
}

.transmission-meta {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    opacity: 0.4;
    margin-top: 2rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.enter-thought {
    display: inline-block;
    margin-top: 2rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--thought);
    text-decoration: none;
    padding: 1rem 2rem;
    border: 1px solid var(--echo);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.enter-thought::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,107,53,0.2), transparent);
    transition: left 0.5s;
}

.enter-thought:hover::before {
    left: 100%;
}

.enter-thought:hover {
    border-color: var(--spark);
    box-shadow: 0 0 30px rgba(255,107,53,0.2);
}

/* The wall of echoes (article grid) */
.echo-wall {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--whisper);
    margin: 8rem 0;
}

.echo {
    background: var(--void);
    padding: 3rem 2rem;
    transition: all 0.5s;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    display: block;
}

.echo:hover {
    background: var(--whisper);
}

.echo::after {
    content: '→';
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    opacity: 0;
    transition: all 0.3s;
    color: var(--spark);
}

.echo:hover::after {
    opacity: 1;
    transform: translateX(5px);
}

.echo-tag {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--dream);
    margin-bottom: 1rem;
}

.echo-title {
    font-size: 1.3rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--thought);
}

.echo-fragment {
    font-size: 0.95rem;
    opacity: 0.5;
    line-height: 1.6;
    color: var(--thought);
}

/* Section title */
.section-title {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    opacity: 0.4;
    margin-bottom: 4rem;
    text-align: center;
}

/* Interlude / question */
.interlude {
    text-align: center;
    padding: 8rem 2rem;
    border-top: 1px solid var(--whisper);
    border-bottom: 1px solid var(--whisper);
    margin: 6rem 0;
}

.interlude-symbol {
    font-size: 3rem;
    margin-bottom: 2rem;
    animation: rotate-slow 20s infinite linear;
}

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

.interlude-text {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Signal capture (newsletter) */
.signal-capture {
    background: linear-gradient(135deg, var(--whisper) 0%, var(--void) 100%);
    padding: 5rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.signal-capture::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 50px,
        rgba(123,104,238,0.03) 50px,
        rgba(123,104,238,0.03) 51px
    );
    animation: scan 10s infinite linear;
}

@keyframes scan {
    from { transform: translateY(0); }
    to { transform: translateY(50px); }
}

.signal-title {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.signal-prompt {
    font-size: 1.8rem;
    max-width: 500px;
    margin: 0 auto 2rem;
    position: relative;
    z-index: 1;
}

.signal-form {
    display: flex;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.signal-form input {
    flex: 1;
    background: transparent;
    border: 1px solid var(--echo);
    padding: 1rem 1.5rem;
    color: var(--thought);
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
}

.signal-form input::placeholder {
    color: var(--echo);
}

.signal-form button {
    background: var(--spark);
    border: none;
    padding: 1rem 2rem;
    color: var(--void);
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s;
}

.signal-form button:hover {
    background: var(--thought);
}

/* Footer as fading signal */
footer {
    padding: 6rem 2rem 3rem;
    text-align: center;
    opacity: 0.4;
}

.footer-logo {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.3em;
    margin-bottom: 2rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.footer-links a {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--thought);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-end {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
}

/* Probability marker */
.probability-marker {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    opacity: 0.3;
    color: var(--spark);
    z-index: 1000;
}

/* Full article page */
.full-article {
    padding-top: 10rem;
}

.full-article .transmission-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 2rem;
}

.article-content {
    font-size: 1.25rem;
    line-height: 2;
    opacity: 0.9;
}

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

.article-content h2 {
    font-size: 1.8rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--thought);
}

.article-content h3 {
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--thought);
}

.article-content strong {
    color: var(--spark);
}

.article-content em {
    font-style: italic;
}

.article-content ul,
.article-content ol {
    margin: 1.5rem 0 2rem 2rem;
}

.article-content li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.article-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    border-left: 3px solid var(--spark);
    background: var(--whisper);
    font-style: italic;
}

.article-content blockquote p {
    margin-bottom: 0.5rem;
}

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

.article-content a {
    color: var(--spark);
    text-decoration: none;
    border-bottom: 1px solid var(--echo);
    transition: border-color 0.3s;
}

.article-content a:hover {
    border-color: var(--spark);
}

.article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--whisper);
}

.article-footer a {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--thought);
    text-decoration: none;
    opacity: 0.6;
    transition: all 0.3s;
}

.article-footer a:hover {
    opacity: 1;
    color: var(--spark);
}

/* Tags in article */
.tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tag {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--whisper);
    color: var(--thought);
    padding: 0.4rem 0.8rem;
    opacity: 0.6;
}

/* No articles message */
.no-articles {
    text-align: center;
    padding: 10rem 2rem;
}

.no-articles h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.no-articles p {
    opacity: 0.6;
    font-size: 1.2rem;
}

.no-articles a {
    color: var(--spark);
    text-decoration: none;
}

/* Admin page styles */
.admin-page {
    padding-top: 8rem;
}

.admin-form {
    background: var(--whisper);
    padding: 3rem;
    margin-bottom: 3rem;
}

.admin-form label {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.admin-form textarea {
    width: 100%;
    background: var(--void);
    border: 1px solid var(--echo);
    color: var(--thought);
    padding: 1.5rem;
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.1rem;
    line-height: 1.8;
    resize: vertical;
    margin-bottom: 1.5rem;
}

.admin-form textarea:focus {
    outline: none;
    border-color: var(--spark);
}

.admin-form button {
    background: var(--spark);
    border: none;
    padding: 1rem 2.5rem;
    color: var(--void);
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.3s;
}

.admin-form button:hover {
    background: var(--thought);
}

.info-box {
    background: var(--whisper);
    padding: 2rem;
}

.info-box h3 {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.info-box ol {
    margin-left: 1.5rem;
    opacity: 0.7;
}

.info-box li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.success,
.error {
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
}

.success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.4);
    color: #6fdc8c;
}

.error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #ff6b6b;
}

/* Login form */
.login-form {
    max-width: 400px;
    margin: 0 auto;
    padding-top: 20vh;
}

.login-form h2 {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 3rem;
}

.login-form label {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    opacity: 0.6;
}

.login-form input[type="password"] {
    width: 100%;
    background: transparent;
    border: 1px solid var(--echo);
    padding: 1rem 1.5rem;
    color: var(--thought);
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--spark);
}

.login-form button {
    width: 100%;
    background: var(--spark);
    border: none;
    padding: 1rem 2rem;
    color: var(--void);
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.3s;
}

.login-form button:hover {
    background: var(--thought);
}

/* Responsive */
@media (max-width: 900px) {
    .echo-wall {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    .transmission::before {
        display: none;
    }

    header {
        padding: 1.5rem;
    }

    main {
        padding: 0 1.5rem 4rem;
    }
}

@media (max-width: 600px) {
    .koan {
        font-size: clamp(1.8rem, 10vw, 3rem);
    }

    .transmission-title {
        font-size: 1.5rem;
    }

    .transmission-body {
        font-size: 1.1rem;
    }

    .footer-links {
        gap: 1.5rem;
    }
}

/* Old posts page */
.old-posts-page {
    padding-top: 10rem;
}

.old-posts-page .section-title {
    margin-bottom: 3rem;
}

.old-posts-list {
    list-style: none;
    max-width: 800px;
    margin: 0 auto;
}

.old-post-item {
    display: flex;
    align-items: baseline;
    gap: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--whisper);
}

.old-post-date {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--echo);
    flex-shrink: 0;
    min-width: 140px;
}

.old-post-title {
    font-size: 1.1rem;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s;
}

.old-post-title:hover {
    color: var(--spark);
}

.no-old-posts {
    text-align: center;
    opacity: 0.6;
    font-size: 1.2rem;
    padding: 4rem 0;
}

.old-posts-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--whisper);
}

.old-posts-footer a {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--thought);
    text-decoration: none;
    opacity: 0.6;
    transition: all 0.3s;
}

.old-posts-footer a:hover {
    opacity: 1;
    color: var(--spark);
}

/* Link to old posts on frontpage */
.old-posts-link {
    text-align: center;
    margin-top: 3rem;
}

.old-posts-link a {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s;
    padding: 1rem 2rem;
    border: 1px solid var(--echo);
    display: inline-block;
}

.old-posts-link a:hover {
    border-color: var(--spark);
    color: var(--spark);
}

@media (max-width: 600px) {
    .old-post-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .old-post-date {
        min-width: auto;
    }
}
