/* ============================================================
   SIGNAL — Dark Editorial AI News Platform
   Aesthetic: Luxury print intelligence meets terminal green
   ============================================================ */

:root {
    --bg:           #06060f;
    --bg-card:      #0c0c1a;
    --surface:      #111122;
    --surface-2:    #181830;
    --border:       rgba(255,255,255,0.06);
    --border-hi:    rgba(255,255,255,0.13);
    --text:         #ede8dd;
    --text-muted:   #8880a0;
    --text-dim:     #524e66;
    --accent:       #00ff88;
    --accent-dim:   rgba(0,255,136,0.10);
    --accent-glow:  rgba(0,255,136,0.22);
    --accent-dark:  rgba(0,255,136,0.06);
    --blue:         #5ba4f5;
    --reading-bg:   rgba(0,255,136,0.045);
    --reading-left: rgba(0,255,136,0.9);
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body:    'Crimson Pro', Georgia, 'Times New Roman', serif;
    --font-mono:    'JetBrains Mono', 'Courier New', monospace;
    --ease-out:     cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out:  cubic-bezier(0.65, 0, 0.35, 1);
}

/* ── RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.75;
    min-height: 100vh;
    overflow-x: hidden;
}
/* Remove the scroll kill from html/body */
html, body {
    overflow-x: visible; 
}


h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
button { cursor: pointer; font-family: inherit; }

/* Noise texture */
.noise-overlay {
    position: fixed; inset: 0; pointer-events: none; z-index: 9000;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    opacity: 0.8;
}

/* ── HEADER ─────────────────────────────────────────────── */
.site-header {
    position: sticky; top: 0; z-index: 500;
    background: rgba(6,6,15,0.94);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: 1440px; margin: 0 auto; padding: 0 2rem;
    display: flex; align-items: center; justify-content: space-between;
    height: 58px;
}
.header-left, .header-right {
    display: flex; align-items: center; gap: 0.5rem;
    font-family: var(--font-mono); font-size: 0.68rem;
    color: var(--text-muted); letter-spacing: 0.04em;
    flex: 1;
}
.header-right { justify-content: flex-end; }
.header-sep { color: var(--text-dim); }
.header-tag {
    /* --- Colors & Glow --- */
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(0, 255, 136, 0.3);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.1);
    
    /* --- The Centering Fix --- */
    display: inline-flex;
    align-items: center;      /* True vertical center */
    justify-content: center;   /* True horizontal center */
    
    height: 20px;             /* Fixed height ensures consistency across pages */
    padding: 0 10px;          /* Only horizontal padding */
    
    /* --- Typography Reset --- */
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 0;           /* CRITICAL: Stops font metrics from pushing text down */
    
    /* --- Polish --- */
    border-radius: 100px;
    white-space: nowrap;
    -webkit-font-smoothing: antialiased;
}
.site-logo {
    display: flex; align-items: center; gap: 5px;
    flex-shrink: 0; position: relative;
}
.logo-signal {
    font-family: var(--font-display); font-weight: 900;
    font-size: 1.65rem; letter-spacing: -0.025em; color: var(--text);
    transition: color 0.2s;
}
.site-logo:hover .logo-signal { color: var(--accent); }
.logo-dot { color: var(--accent); font-size: 0.65rem; margin-top: 2px; }

/* ── HERO ────────────────────────────────────────────────── */
.hero-section {
    position: relative; padding: 5rem 2rem 2.5rem;
    border-bottom: 1px solid var(--border); overflow: hidden;
}
.hero-section::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 70% 60% at 50% -10%, rgba(0,255,136,0.07) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 80% 50%, rgba(91,164,245,0.04) 0%, transparent 50%);
}
.hero-inner {
    max-width: 1440px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 1.25rem;
}
.hero-eyebrow {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-mono); font-size: 0.7rem;
    color: var(--accent); letter-spacing: 0.12em; text-transform: uppercase;
}
.hero-sep { color: rgba(0,255,136,0.3); }
.live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 var(--accent-glow);
    animation: pulse-live 2.2s ease-in-out infinite;
}
@keyframes pulse-live {
    0%   { box-shadow: 0 0 0 0   var(--accent-glow); }
    50%  { box-shadow: 0 0 0 6px transparent; }
    100% { box-shadow: 0 0 0 0   var(--accent-glow); }
}
.hero-headline {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 8.5vw, 8rem);
    font-weight: 900; line-height: 1.02; letter-spacing: -0.04em;
    background: linear-gradient(150deg, var(--text) 0%, rgba(237,232,221,0.65) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-headline em {
    font-style: italic;
    background: linear-gradient(135deg, var(--accent) 20%, #00cfff 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub {
    font-family: var(--font-body); font-weight: 300; font-size: 1.15rem;
    color: var(--text-muted); max-width: 55ch; line-height: 1.65;
}

/* Ticker */
.hero-ticker {
    display: flex; align-items: stretch;
    margin-top: 2rem; max-width: 1440px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 4px; overflow: hidden;
    font-family: var(--font-mono); font-size: 0.7rem;
}
.ticker-label {
    background: var(--accent); color: #000;
    padding: 9px 14px; font-weight: 700;
    letter-spacing: 0.12em; flex-shrink: 0;
    display: flex; align-items: center;
}
.ticker-wrap { overflow: hidden; flex: 1; display: flex; align-items: center; }
.ticker-track {
    display: flex; align-items: center; gap: 3rem;
    padding: 9px 1.5rem; white-space: nowrap;
    animation: ticker-scroll 40s linear infinite;
    color: var(--text-muted);
}
.ticker-cat { font-weight: 600; margin-right: 6px; }
.ticker-item::after { content: '  //  '; color: var(--text-dim); margin-left: 1rem; }
@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ── SECTION LABELS ──────────────────────────────────────── */
.section-label {
    display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem;
}
.section-label-text {
    font-family: var(--font-mono); font-size: 0.65rem; font-weight: 600;
    letter-spacing: 0.18em; color: var(--text-dim); white-space: nowrap;
}
.section-label-line {
    flex: 1; height: 1px;
    background: linear-gradient(to right, var(--border-hi), transparent);
}

/* ── FEATURED CARD ───────────────────────────────────────── */
.featured-section { padding: 2.5rem 2rem; border-bottom: 1px solid var(--border); }
.featured-inner { max-width: 1440px; margin: 0 auto; }
.featured-card {
    display: grid; grid-template-columns: 55% 45%;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden;
    transition: border-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.featured-card:hover {
    border-color: rgba(0,255,136,0.28);
    box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,255,136,0.08);
}
.featured-image-wrap {
    position: relative; height: 480px; overflow: hidden;
}
.featured-image { transition: transform 0.7s var(--ease-out); }
.featured-card:hover .featured-image { transform: scale(1.05); }
.featured-image-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to right, transparent 55%, var(--bg-card) 95%);
}
.featured-badge {
    position: absolute; top: 1.5rem; left: 1.5rem;
    background: var(--cat-color, var(--accent)); color: #000;
    font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 2px;
}
.featured-content {
    padding: 3rem 3rem 3rem 2rem;
    display: flex; flex-direction: column; justify-content: center; gap: 1.1rem;
}
.featured-meta {
    font-family: var(--font-mono); font-size: 0.68rem;
    color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.meta-sep { color: var(--text-dim); }
.featured-headline {
    font-size: clamp(1.7rem, 2.8vw, 2.9rem); font-weight: 700;
    letter-spacing: -0.025em; line-height: 1.15;
}
.featured-sub {
    font-weight: 300; font-size: 1.05rem; color: var(--text-muted); line-height: 1.65;
    font-style: italic;
}
.featured-cta {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--accent); color: #000;
    font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.08em; padding: 10px 18px; border-radius: 4px;
    width: fit-content; margin-top: 0.5rem;
    transition: gap 0.2s, transform 0.2s, box-shadow 0.2s;
}
.featured-card:hover .featured-cta {
    gap: 12px; transform: translateX(2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}
.cta-arrow { font-size: 1rem; }

/* ── SECONDARY GRID ──────────────────────────────────────── */
.secondary-section { padding: 2.5rem 2rem; border-bottom: 1px solid var(--border); }
.secondary-inner { max-width: 1440px; margin: 0 auto; }
.secondary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.secondary-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 6px; overflow: hidden; display: flex; flex-direction: column;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.secondary-card:hover {
    border-color: var(--border-hi); transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.secondary-image-wrap { position: relative; height: 240px; overflow: hidden; flex-shrink: 0; }
.secondary-image { transition: transform 0.5s var(--ease-out); }
.secondary-card:hover .secondary-image { transform: scale(1.06); }
.secondary-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(12,12,26,0.65) 0%, transparent 55%);
}
.card-badge {
    position: absolute; top: 0.75rem; left: 0.75rem;
    background: var(--cat-color, var(--accent)); color: #000;
    font-family: var(--font-mono); font-size: 0.58rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
    padding: 3px 8px; border-radius: 2px;
}
.secondary-content {
    padding: 1.4rem 1.5rem 1.6rem;
    display: flex; flex-direction: column; gap: 0.55rem; flex: 1;
}
.card-meta {
    font-family: var(--font-mono); font-size: 0.63rem;
    color: var(--text-dim); display: flex; align-items: center; gap: 0.4rem;
}
.secondary-headline { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; }
.secondary-sub {
    font-size: 0.9rem; color: var(--text-muted); line-height: 1.55;
    font-weight: 300; font-style: italic; flex: 1;
}

/* ── MAIN GRID ───────────────────────────────────────────── */
.grid-section { padding: 2.5rem 2rem 5rem; }
.grid-inner { max-width: 1440px; margin: 0 auto; }
.articles-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem;
}
.article-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 6px; overflow: hidden; display: flex; flex-direction: column;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.article-card:hover {
    border-color: var(--border-hi); transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(0,0,0,0.4);
}
.card-image-wrap { position: relative; height: 195px; overflow: hidden; flex-shrink: 0; }
.card-image { transition: transform 0.5s var(--ease-out); }
.article-card:hover .card-image { transform: scale(1.07); }
.card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(12,12,26,0.6) 0%, transparent 55%);
}
.card-content {
    padding: 1.1rem 1.3rem 1.4rem;
    display: flex; flex-direction: column; gap: 0.5rem; flex: 1;
}
.card-headline { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.card-sub {
    font-size: 0.875rem; color: var(--text-muted); line-height: 1.55;
    font-weight: 300; font-style: italic; flex: 1;
}
.card-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 0.7rem; border-top: 1px solid var(--border); margin-top: auto;
}
.audio-badge {
    display: flex; align-items: center; gap: 5px;
    font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600;
    color: var(--accent); background: var(--accent-dim);
    border: 1px solid rgba(0,255,136,0.15);
    padding: 3px 8px; border-radius: 20px;
}
.card-date { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-dim); }

/* ── ARTICLE PAGE ────────────────────────────────────────── */
.article-page { min-height: 100vh; }

.article-hero {
    position: relative; height: 58vh; min-height: 360px; max-height: 620px; overflow: hidden;
}
.article-hero-image {
    animation: hero-pan 18s ease-in-out infinite alternate;
}
@keyframes hero-pan {
    from { transform: scale(1.04) translateX(-1%); }
    to   { transform: scale(1.04) translateX(1%); }
}
.article-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(6,6,15,0.25) 0%,
        rgba(6,6,15,0.1) 30%,
        rgba(6,6,15,0.8) 80%,
        rgba(6,6,15,0.97) 100%
    );
}
.article-hero-nav {
    position: absolute; top: 1.5rem; left: 2rem;
}
.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: 0.7rem; color: rgba(237,232,221,0.75);
    letter-spacing: 0.05em; padding: 6px 12px;
    background: rgba(6,6,15,0.5); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px; backdrop-filter: blur(8px);
    transition: color 0.2s, border-color 0.2s;
}
.back-link:hover { color: var(--accent); border-color: rgba(0,255,136,0.3); }
.article-hero-badge {
    position: absolute; bottom: 2rem; left: 2rem;
}
.article-category-badge {
    display: inline-block;
    background: var(--cat-color, var(--accent)); color: #000;
    font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
    padding: 5px 12px; border-radius: 2px;
}

.article-container { max-width: 760px; margin: 0 auto; padding: 3rem 2rem 6rem; }

/* Article Header */
.article-header { margin-bottom: 2.5rem; }
.article-headline {
    font-size: clamp(2rem, 5.5vw, 3.75rem); font-weight: 500;
    letter-spacing: -0.035em; line-height: 1.08; margin-bottom: 1.2rem;
}
.article-subheading {
    font-family: var(--font-body); font-size: 1.3rem; font-weight: 300;
    font-style: italic; color: var(--text-muted); line-height: 1.65;
    margin-bottom: 1.8rem;
}
.article-byline {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: 1.2rem 0;
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.byline-avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    background: var(--surface-2); border: 1px solid var(--border-hi);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 1.3rem; font-weight: 900;
    color: var(--accent);
}
.byline-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 120px; }
.byline-name { font-weight: 500; font-size: 0.95rem; }
.byline-role { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-muted); letter-spacing: 0.04em; }
.byline-meta {
    font-family: var(--font-mono); font-size: 0.63rem; color: var(--text-dim);
    display: flex; align-items: center; gap: 0.4rem; margin-left: auto;
}

/* ── AUDIO PLAYER ────────────────────────────────────────── */
.audio-player {
    position: -webkit-sticky; /* Support for Safari */
    position: sticky; 
    top: 60px; /* Adjust this to match your header's height */
    z-index: 200;
    
    margin: 2rem 0 3rem; /* Added bottom margin so it doesn't overlap content */
    background: rgba(6, 6, 15, 0.96);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border: 1px solid var(--border-hi);
    border-radius: 10px; 
    padding: 1rem 1.4rem;
    
    display: flex; 
    align-items: center; 
    gap: 1.25rem;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    transition: border-color 0.4s, box-shadow 0.4s;
    
    /* Ensure it doesn't cause horizontal scroll */
    max-width: 100%;
    box-sizing: border-box;
}

.audio-player.playing {
    border-color: rgba(0,255,136,0.35);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 24px rgba(0,255,136,0.08);
}

/* Play button */
.play-btn {
    position: relative; width: 50px; height: 50px; flex-shrink: 0;
    border-radius: 50%; border: none;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s var(--ease-out), box-shadow 0.3s;
}
.play-btn:hover { transform: scale(1.1); box-shadow: 0 0 24px var(--accent-glow); }
.play-btn:active { transform: scale(0.94); }
.play-icon, .pause-icon { width: 20px; height: 20px; color: #000; position: relative; z-index: 1; }
.play-rings { position: absolute; inset: 0; pointer-events: none; }
.ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 1.5px solid var(--accent); opacity: 0;
}
.playing .ring { animation: sonar-ring 2.4s ease-out infinite; }
.playing .ring-2 { animation-delay: 0.8s; }
.playing .ring-3 { animation-delay: 1.6s; }
@keyframes sonar-ring {
    0%   { transform: scale(1);   opacity: 0.7; }
    100% { transform: scale(2.5); opacity: 0;   }
}
.hidden { display: none !important; }
.player-center { 
    flex: 1;                /* This tells it to take up the middle space */
    display: flex; 
    flex-direction: column; 
    gap: 5px; 
    min-width: 150px;      /* Minimum usable size */
    max-width: 300px;      /* Increased from 100px to look normal */
    margin: 0 auto;        /* Centers it if the bar is wider than 400px */
}

.player-right { 
    display: flex; 
    align-items: center; 
    gap: 0.6rem; 
    flex: 1;               /* Added this */
    justify-content: flex-end; /* Pushes buttons to the far right */
}

.player-left { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
    flex: 1;               /* Added this */
}

.player-info  { display: flex; flex-direction: column; gap: 1px; }
.player-label { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; }
.player-status { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); min-width: 140px; }
.player-centerX { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; max-width: 100px;}
.progress-track {
    height: 3px; background: var(--surface-2); border-radius: 3px; overflow: hidden; cursor: pointer;
}
.progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(to right, var(--accent), #00cfff);
    border-radius: 3px;
    transition: width 0.5s var(--ease-out);
}
.progress-labels {
    font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-dim);
    display: flex; gap: 0;
}
/* 1. Unify the shapes of all 4 buttons */
/* Unify all buttons in the right group */
.speed-btn, .stop-btn, .settings-btn, .loop-btn {
    width: 36px;
    height: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

/* Icons sizing */
.player-right svg {
    width: 16px;
    height: 16px;
}

/* Stop Square inside the button */
.stop-square {
    width: 10px;
    height: 10px;
    background: currentColor; /* Matches the text-muted or accent color */
    border-radius: 1px;
}

/* Hover States */
.speed-btn:hover, .stop-btn:hover, .settings-btn:hover, .loop-btn:hover {
    color: var(--accent);
    border-color: rgba(0, 255, 136, 0.3);
    background: var(--accent-dark);
}

/* Active State for Loop and Settings */
.loop-btn.is-active, .settings-btn.is-active {
    color: var(--accent);
    border-color: var(--accent);
    filter: drop-shadow(0 0 4px var(--accent));
}

/* Speed Button Font */
.speed-btn {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
}
.voice-menu {
    position: absolute;
    top: 60px;        /* ← pushes menu DOWN below the player */
    bottom: auto;     /* ← cancels any inherited bottom value */
    right: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 1000;
    width: 250px;
}

.voice-menu.hidden { display: none; }

.voice-menu select {
    width: 100%;
    background: #111;
    color: white;
    border: 1px solid var(--border);
    padding: 5px;
    font-size: 0.8rem;
    margin-top: 8px;
}





/* Reading hint */
.reading-hint {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 0.65rem;
    color: var(--text-dim); background: var(--surface);
    border: 1px solid var(--border); border-radius: 5px;
    padding: 8px 14px; margin-top: 0.75rem;
    opacity: 0; transform: translateY(-4px);
    transition: opacity 0.4s, transform 0.4s;
    pointer-events: none;
}
.reading-hint.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ── ARTICLE BODY ────────────────────────────────────────── */
.article-body {
    margin-top: 2.5rem;
    font-family: var(--font-body); font-size: 1.22rem;
    line-height: 1.88; color: #d5d0c5;
}
.article-paragraph {
    margin-bottom: 1.8rem; padding: 0.6rem 0 0.6rem 1.4rem;
    border-left: 3px solid transparent; border-radius: 0 4px 4px 0;
    transition: background 0.35s var(--ease-out), border-color 0.35s var(--ease-out),
                color 0.35s, padding-left 0.3s var(--ease-out);
    outline: none;
}
.article-paragraph:hover:not(.reading) {
    border-left-color: rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.015);
    cursor: pointer;
}
.article-paragraph:focus-visible {
    border-left-color: var(--blue);
    box-shadow: inset 0 0 0 1px rgba(91,164,245,0.2);
}
.article-paragraph.reading {
    background: var(--reading-bg);
    border-left-color: var(--reading-left);
    padding-left: 1.8rem; color: var(--text);
    box-shadow: inset 3px 0 16px rgba(0,255,136,0.05);
}
.article-paragraph.was-read { color: #8c8780; }

/* Pull quote */
.pull-quote {
    margin: 2.5rem 0;
    padding: 1.75rem 2rem;
    border-top: 2px solid var(--accent);
    border-bottom: 1px solid var(--border);
    background: var(--accent-dark);
    border-radius: 0 6px 6px 0;
    border-left: none;
}
.pull-quote-text {
    font-family: var(--font-display); font-style: italic;
    font-size: 1.45rem; line-height: 1.5; font-weight: 400;
    color: var(--text); letter-spacing: -0.01em;
}
.pull-quote-text::before { content: '"'; color: var(--accent); font-size: 2rem; line-height: 0; vertical-align: -0.3em; margin-right: 4px; }
.pull-quote-text::after  { content: '"'; color: var(--accent); font-size: 2rem; line-height: 0; vertical-align: -0.3em; margin-left:  4px; }

/* Article End */
.article-end { margin-top: 3.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.article-divider {
    display: flex; align-items: center; justify-content: center; gap: 1.5rem;
    color: var(--text-dim); font-size: 0.6rem;
}
.article-divider::before, .article-divider::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(to right, transparent, var(--border-hi));
}
.article-divider::after { background: linear-gradient(to left, transparent, var(--border-hi)); }
.end-meta {
    font-family: var(--font-mono); font-size: 0.68rem;
    color: var(--text-dim); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.end-category { font-weight: 700; }
.back-btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 0.72rem;
    color: var(--accent); letter-spacing: 0.06em;
    border: 1px solid rgba(0,255,136,0.25); border-radius: 4px;
    padding: 9px 16px; width: fit-content;
    background: var(--accent-dark);
    transition: gap 0.2s, background 0.2s, box-shadow 0.2s;
}
.back-btn:hover { gap: 12px; background: var(--accent-dim); box-shadow: 0 0 16px var(--accent-glow); }

/* ── FOOTER ──────────────────────────────────────────────── */
.site-footer {
    background: var(--surface); border-top: 1px solid var(--border); padding: 3rem 2rem;
}
.footer-inner {
    max-width: 1440px; margin: 0 auto;
    display: flex; flex-direction: column; align-items: center; gap: 1.25rem; text-align: center;
}
.footer-brand { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.footer-logo { display: flex; align-items: center; gap: 5px; }
.footer-tagline { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-dim); letter-spacing: 0.12em; }
.footer-links {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 2rem;
    font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted);
}
.footer-links span {
    transition: color 0.2s; cursor: default;
}
.footer-links span:hover { color: var(--accent); }
.footer-copy { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-dim); max-width: 55ch; text-align: center; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .featured-card { grid-template-columns: 1fr; }
    .featured-image-wrap { height: 280px; }
    .featured-image-overlay { background: linear-gradient(to top, var(--bg-card) 5%, transparent 55%); }
    .featured-content { padding: 2rem; }
}
@media (max-width: 768px) {
    .header-left, .header-right { display: none; }
    .secondary-grid { grid-template-columns: 1fr; }
    .articles-grid { grid-template-columns: 1fr; }
    .hero-section { padding: 3rem 1.25rem 2rem; }
    .audio-player { flex-wrap: wrap; padding: 0.9rem 1rem; }
    .player-center { order: 3; flex-basis: 100%; }
    .article-hero { height: 42vh; }
    .byline-meta { display: none; }
    .pull-quote { margin: 2rem 0; padding: 1.25rem 1.5rem; }
    .pull-quote-text { font-size: 1.25rem; }
}
@media (max-width: 500px) {
    .article-container { padding: 2rem 1.1rem 4rem; }
    .article-headline { font-size: 1.2rem; }
    .article-body { font-size: 1.1rem; }
    .hero-headline { font-size: 3rem; }
    .featured-inner, .secondary-inner, .grid-inner { padding: 0; }
}

/* ── ANIMATIONS / PAGE LOAD ──────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero-eyebrow { animation: fadeInUp 0.6s var(--ease-out) 0.1s both; }
.hero-headline { animation: fadeInUp 0.7s var(--ease-out) 0.2s both; }
.hero-sub      { animation: fadeInUp 0.7s var(--ease-out) 0.35s both; }
.hero-ticker   { animation: fadeInUp 0.6s var(--ease-out) 0.5s both; }
.featured-card { animation: fadeInUp 0.7s var(--ease-out) 0.1s both; }
.article-header { animation: fadeInUp 0.65s var(--ease-out) 0.05s both; }
.audio-player  { animation: fadeInUp 0.6s var(--ease-out) 0.15s both; }

/* ── SLOT NAVIGATION (prev/next per category) ────────────── */
.featured-slot,
.secondary-slot,
.article-slot  { position: relative; }




.slot-nav {
    display: flex; 
    align-items: center; 
    gap: 0.5rem;
    background: rgba(6,6,15,0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-hi);
    border-radius: 6px; 
    padding: 5px 8px;
    z-index: 10; /* Keep it above the image and text */
}

.slot-nav--card {
    position: absolute; 
    top: 0.75rem;   /* Pin to top */
    right: 0.75rem; /* Pin to right */
    bottom: auto;   /* Reset previous bottom if necessary */
}
.slot-nav--featured {
    position: absolute; 
    top: 1.75rem;   /* Pin to top */
    right: 1.75rem; /* Pin to right */
    bottom: auto;   /* Reset previous bottom if necessary */
}


.nav-btn {
    width: 28px; height: 28px; border-radius: 4px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-muted); display: flex; align-items: center; justify-content: center;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.nav-btn:hover:not(:disabled) {
    color: var(--accent); border-color: rgba(0,255,136,0.35); background: var(--accent-dark);
}
.nav-btn:disabled { opacity: 0.25; cursor: not-allowed; }

.nav-counter {
    font-family: var(--font-mono); font-size: 0.62rem;
    color: var(--text-muted); white-space: nowrap; padding: 0 2px;
}

/* Slot loading state */
.slot-generating {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.75rem; background: var(--surface);
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-dim);
}
.gen-spinner {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--border-hi);
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton placeholders */
.skeleton-headline {
    height: 1.4rem; background: var(--surface-2); border-radius: 3px;
    animation: shimmer 1.6s ease-in-out infinite;
    width: 85%;
}
.skeleton-sub {
    height: 1rem; background: var(--surface-2); border-radius: 3px;
    animation: shimmer 1.6s ease-in-out 0.2s infinite;
    width: 65%; margin-top: 0.5rem;
}
@keyframes shimmer {
    0%,100% { opacity: 0.4; }
    50%      { opacity: 0.7; }
}

/* Slot transition when navigating */
.slot-transitioning { opacity: 0.4; pointer-events: none; transition: opacity 0.2s; }

/* Article position badge */
.article-position {
    background: var(--accent-dim); color: var(--accent);
    border: 1px solid rgba(0,255,136,0.2);
    font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600;
    padding: 2px 8px; border-radius: 20px; letter-spacing: 0.05em;
}

.ui-logger {
        position: fixed;
        bottom: 20px;
        left: 20px;
        width: 300px;
        max-height: 200px;
        background: rgba(0, 0, 0, 0.85);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-left: 3px solid #00ff41; /* "Matrix" green signal */
        color: #eee;
        font-family: 'Courier New', monospace;
        font-size: 0.75rem;
        z-index: 9999;
        pointer-events: none; /* Don't block clicks to the app */
        display: flex;
        flex-direction: column;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

    .logger-header {
        background: rgba(255, 255, 255, 0.05);
        padding: 5px 10px;
        font-weight: bold;
        color: #888;
        letter-spacing: 1px;
    }

    .logger-content {
        padding: 10px;
        overflow-y: hidden;
        display: flex;
        flex-direction: column-reverse; /* Newest logs at top */
    }

    .log-entry {
        margin-bottom: 4px;
        line-height: 1.2;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 2px;
    }

    .log-time { color: #666; margin-right: 8px; }
    .log-msg { color: #00ff41; }
    .ticker-container {
        background: #000;
        border: 1px solid #333;
        padding: 5px 10px;
        overflow: hidden;
        white-space: nowrap;
        font-family: 'Courier New', monospace;
    }
    .ticker-text {
        color: #00ff41; /* Philly Dev Green */
        font-size: 0.85rem;
        transition: opacity 0.2s;
    }
/* ── LEGAL / PAGE STYLING ────────────────────────────────── */
.legal-page {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.legal-header {
    margin-bottom: 4rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
}

.legal-title {
    font-size: 3.5rem;
    margin: 1rem 0;
    letter-spacing: -0.02em;
}

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

.legal-section {
    margin-bottom: 3rem;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.legal-content p {
    color: var(--text);
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.dev-alert {
    background: var(--accent-dark);
    border: 1px solid var(--accent-dim);
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    margin-top: 4rem;
}

code {
    font-family: var(--font-mono);
    background: var(--surface);
    padding: 2px 6px;
    color: var(--blue);
}
.contact-action-zone {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.static-node {
    background: var(--bg-card);
    border-left: 3px solid var(--accent); /* Brand accent indicator */
    padding: 1.5rem;
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
}

.node-label {
    color: var(--text-dim);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-right: 1.5rem;
}

.node-address {
    font-size: 1.1rem; /* Slightly larger for readability */
    color: var(--accent); /* Terminal green */
    letter-spacing: 0.02em;
}

/* Maintain consistency with your existing button style */
.submit-btn {
    width: fit-content;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-hi);
    padding: 0.8rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    transition: background 0.2s;
}

.submit-btn:hover {
    background: var(--surface-2);
}
.terminal-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text);
}

.terminal-table th {
    text-align: left;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border-hi);
    padding: 1rem;
}

.terminal-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.terminal-table tr:hover {
    background: var(--surface);
}
.logger-content {
    /* Allow text selection/copying */
    user-select: text !important;
    -webkit-user-select: text !important;

    /* Enable scrolling */
    overflow-y: auto !important;
    max-height: 300px; /* Or whatever height you prefer */
    
    /* Ensure the mouse can actually click it */
    pointer-events: auto !important;
}

/* Ensure the container doesn't block the mouse */
.ui-logger {
    pointer-events: auto !important;
}
/* 1. The parent container must be relative */
.controls-container, .button-wrapper { 
    position: relative; 
    display: flex;
    gap: 10px;
}

/* Ensure paragraphs look like normal text */
.article-paragraph {
    cursor: text; 
}

/* Signal Toggle Switch Container */
.toggle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 8px;
    user-select: none;
    -webkit-user-select: none;
}

/* The Label Text (PLAY ALL) */
.toggle-label {
    font-family: var(--font-mono);
    font-size: 0.52rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
    text-transform: uppercase;
    text-align: center;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* The Switch Wrapper */
.signal-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    cursor: pointer;
    caret-color: transparent;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Hidden Native Checkbox */
.signal-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* The Slider Track */
.signal-switch .slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--surface-2);
    border: 1px solid var(--border-hi);
    border-radius: 20px;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* The Switch Handle (Circle) */
.signal-switch .slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-dim);
    border-radius: 50%;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- ACTIVE / CHECKED STATES --- */

/* Slider Track Glow */
.signal-switch input:checked + .slider {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Handle Movement & Color */
.signal-switch input:checked + .slider:before {
    transform: translateX(16px);
    background-color: var(--accent);
    box-shadow: 0 0 5px var(--accent);
}

/* Browser Focus State */
.signal-switch input:focus + .slider {
    box-shadow: 0 0 12px var(--accent-glow);
}

/* Text Label Active State */
#playAllToggle:checked ~ .toggle-label {
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}
/* Ensure the "PLAY ALL" text matches your mono aesthetic */
.toggle-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
}

/* Green glow when active */
#playAllToggle:checked + .slider {
    background-color: var(--accent-dark);
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Ensure the "PLAY ALL" text matches your mono aesthetic */
.toggle-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
}

/* Green glow when active */
#playAllToggle:checked + .slider {
    background-color: var(--accent-dark);
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}
/* This makes the text glow green when the switch is ON */
#playAllToggle:checked ~ .toggle-label {
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
    transition: all 0.3s ease;
}
/* If toggle-label is a sibling of the signal-switch label */
.signal-switch:has(#playAllToggle:checked) ~ .toggle-label {
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
    transition: all 0.3s ease;
}

/* OR, the most reliable way using :has() on the container */
.toggle-container:has(#playAllToggle:checked) .toggle-label {
    color: var(--accent) !important;
    text-shadow: 0 0 8px var(--accent-glow) !important;
}

/* ── X LINK STYLING ──────────────────────────────────────── */
.x-link-container {
    display: flex; /* Flex layout from block 1 for full width centering */
    align-items: center;
    justify-content: center; /* Perfect horizontal centering */
    gap: 0.4rem;
    color: var(--text-muted); /* Keeps the "Visit" text dim */
    font-family: var(--font-body);
    font-size: 14px; /* Integrated from block 2 */
    margin: 1.5rem 0;
}

.x-link {
    display: inline-flex;
    align-items: center;
    gap: 4px; /* Tighter gap from block 2 */
    font-family: var(--font-mono); /* Matches the tech aesthetic */
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none; /* Strips default underline */
    letter-spacing: 0.05em;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.2s, text-shadow 0.2s, color 0.2s;
}

/* FORCING GREEN COLOR HERE */
.x-link span,
.x-link svg {
    color: var(--accent) !important; /* Forces the text to be #00ff88 green */
    fill: var(--accent) !important;  /* Forces the icon to match */
}

/* Hover States for Glow */
.x-link:hover {
    border-color: var(--accent);
}

.x-link:hover span {
    text-shadow: 0 0 8px var(--accent-glow); /* Neon green glow on hover */
}

.x-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
/* FORCING GREEN COLOR HERE */
.x-link-container,  /* Added this to turn the "Visit" text green too */
.x-link span,
.x-link svg {
    color: var(--accent) !important; /* Forces the text to be #00ff88 green */
    fill: var(--accent) !important;  /* Forces the icon to match */
}