/* ============================================
   FATA ORGANA — Site Styles
   Aesthetic: Intercepted transmissions, 
   declassified archives, signal noise
   ============================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

/* --- Variables --- */
:root {
    --bg-deep: #0a0a0c;
    --bg-surface: #111114;
    --bg-elevated: #1a1a1f;
    --text-primary: #c8c5bd;
    --text-dim: #6b6860;
    --text-bright: #e8e5dd;
    --accent: #c4a35a;
    --accent-dim: #8a7340;
    --signal-green: #4a7a4a;
    --signal-red: #7a3a3a;
    --border: #2a2a2f;
    --border-light: #3a3a40;
    --mono: 'JetBrains Mono', 'Courier New', monospace;
    --serif: 'EB Garamond', 'Georgia', serif;
    --max-width: 820px;
    --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--serif);
    font-size: 1.1rem;
    line-height: 1.7;
    position: relative;
    overflow-x: hidden;
}

/* --- Overlays (subtle texture) --- */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Navigation --- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem var(--gutter);
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-logo {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* --- Landing / Hero --- */
.landing {
    position: relative;
    z-index: 2;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.hero {
    position: relative;
    z-index: 2;
    padding: 6rem 0 4rem;
    text-align: center;
}

.signal-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--signal-green);
    margin-bottom: 2rem;
}

.signal-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--signal-green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.title {
    font-family: var(--mono);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 300;
    letter-spacing: 0.3em;
    color: var(--text-bright);
    margin-bottom: 1rem;
    position: relative;
}

/* Subtle glitch on hover */
.glitch:hover {
    animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 1px); }
    40% { transform: translate(2px, -1px); }
    60% { transform: translate(-1px, -1px); }
    80% { transform: translate(1px, 1px); }
    100% { transform: translate(0); }
}

.subtitle {
    font-family: var(--mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}

.tagline {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--accent-dim);
    max-width: 480px;
    margin: 0 auto;
}

/* --- Hook / VU Meter Player --- */
.hook {
    margin: 3rem 0;
}

.vu-player-wrapper {
    max-width: 420px;
    margin: 0 auto;
    text-align: center;
}

.vu-player-wrapper .fragment-label {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(196, 163, 90, 0.3);
    margin-bottom: 1rem;
}

#vu-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

#vu-player canvas {
    border: 1px solid rgba(196, 163, 90, 0.12);
    transition: border-color 0.3s ease;
}

#vu-player canvas:hover {
    border-color: rgba(196, 163, 90, 0.25);
}

.vu-progress-wrap {
    width: 380px;
    height: 3px;
    background: rgba(42, 42, 47, 0.8);
    cursor: pointer;
    position: relative;
}

.vu-progress-bar {
    height: 100%;
    width: 0%;
    background: rgba(196, 163, 90, 0.4);
    transition: width 0.1s linear;
}

.vu-status {
    font-family: var(--mono);
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(196, 163, 90, 0.35);
    margin-top: 0.75rem;
    transition: color 0.3s ease;
}

@media (max-width: 480px) {
    #vu-player canvas,
    .vu-progress-wrap {
        width: 100% !important;
    }
    
    #vu-player canvas {
        height: auto !important;
    }
}

/* --- Status Block --- */
.status-block {
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 1.5rem 2rem;
    margin: 2rem 0 4rem;
    font-family: var(--mono);
    font-size: 0.75rem;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.status-row:last-child {
    border-bottom: none;
}

.status-key {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

.status-value {
    color: var(--text-primary);
}

.blink {
    animation: blink 3s ease-in-out infinite;
}

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

/* --- Entry Cards --- */
.entry-points {
    display: grid;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    margin-bottom: 4rem;
}

.entry-card {
    display: block;
    padding: 2rem;
    background: var(--bg-surface);
    text-decoration: none;
    color: inherit;
    transition: background 0.3s ease;
}

.entry-card:hover {
    background: var(--bg-elevated);
}

.entry-card h2 {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}

.entry-card p {
    font-size: 0.95rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.entry-status {
    font-family: var(--mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-dim);
}

/* --- Development / Transmission Log --- */
.dev-log {
    margin-bottom: 4rem;
}

.dev-log h2 {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.dev-log-note {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.log-entries {
    font-family: var(--mono);
    font-size: 0.75rem;
}

.log-entry {
    display: flex;
    gap: 2rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(42, 42, 47, 0.5);
}

.log-date {
    color: var(--text-dim);
    white-space: nowrap;
    min-width: 7rem;
}

.log-message {
    color: var(--text-primary);
}

/* --- Footer --- */
.site-footer {
    position: relative;
    z-index: 2;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem var(--gutter);
    border-top: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    text-align: center;
}

.footer-sub {
    margin-top: 0.5rem;
    color: var(--accent-dim);
}

/* --- Page Template (for sub-pages) --- */
.page-content {
    position: relative;
    z-index: 2;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 4rem var(--gutter);
}

.page-content h1 {
    font-family: var(--mono);
    font-size: 1.2rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}

.page-content .page-subtitle {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin-bottom: 3rem;
}

.page-content h2 {
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
}

.page-content p {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.page-content p + p {
    text-indent: 1.5rem;
}

/* --- Archive / Document List --- */
.doc-list {
    list-style: none;
}

.doc-list li {
    border-bottom: 1px solid var(--border);
}

.doc-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.doc-list a:hover {
    color: var(--text-bright);
}

.doc-title {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-primary);
}

.doc-meta {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .site-nav {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .status-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .log-entry {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .hero {
        padding: 4rem 0 3rem;
    }
}
