/**
 * Epstein Arrest Counter - Styles
 * Dark, stark, monospaced. White on black.
 */

/* LCD/digital font: add fonts/digital.ttf (e.g. Digital-7 from dafont.com) for full effect */
@font-face {
    font-family: 'Digital LCD';
    src: url('fonts/digital.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #050505;
    --text: #F0F0F0;
    --text-dim: #888;
    --accent: #c0c0c0;
    --font-mono: 'Roboto Mono', 'Courier New', Courier, monospace;
    --font-lcd: 'Digital LCD', var(--font-mono);
    --space: 1.25rem;
    --max-width: 42rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    line-height: 1.6;
    min-height: 100vh;
}

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space) 1rem 3rem;
}

/* ----- Hero / Counter ----- */
.hero {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 0;
}

.hero-heading {
    margin: 0 0 0.75rem;
    font-size: clamp(1rem, 4vw, 1.5rem);
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.15em;
    color: var(--text);
}

.counter-wrap {
    margin: 0;
    font-size: clamp(4rem, 20vw, 12rem);
    font-weight: 300;
    letter-spacing: 0.02em;
    line-height: 1;
    font-family: var(--font-lcd);
}

.counter {
    display: inline-block;
    position: relative;
    color: var(--text);
    font-family: var(--font-lcd);
    text-shadow: 0 0 0.05em currentColor, 0 0 0.15em rgba(240, 240, 240, 0.3);
}

/* Glitch layers (cloned by JS for RGB shift) */
.counter.glitch::before,
.counter.glitch::after {
    content: attr(data-value);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    font-family: inherit;
}

.counter.glitch::before {
    color: rgba(255, 255, 255, 0.5);
    animation: glitch-1 0.5s ease-in-out infinite;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    transform: translate(-0.5px, 0);
}

.counter.glitch::after {
    color: rgba(255, 255, 255, 0.4);
    animation: glitch-2 0.6s ease-in-out infinite;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    transform: translate(0.5px, 0);
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(-0.5px, 0); opacity: 0.6; }
    50% { transform: translate(0.5px, 0); opacity: 0.4; }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0.5px, 0); opacity: 0.5; }
    50% { transform: translate(-0.5px, 0); opacity: 0.3; }
}

/* Occasional subtle flicker */
@keyframes glitch-flicker {
    0%, 95%, 100% { opacity: 1; }
    97% { opacity: 0.92; }
    99% { opacity: 1; }
}

.counter.glitch {
    animation: glitch-flicker 4s infinite;
}

.reduce-motion .counter.glitch,
.reduce-motion .counter.glitch::before,
.reduce-motion .counter.glitch::after {
    animation: none;
}

.hero-sub {
    margin: 1.5rem 0 0;
    font-size: 0.875rem;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

/* ----- Section titles ----- */
.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin: 0 0 var(--space);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #222;
}

/* ----- News list ----- */
.news {
    margin-top: 3rem;
}

/* Vertical scrolling ticker (seamless loop) */
.news-ticker {
    height: 12rem;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, transparent, black 8%, black 92%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 8%, black 92%, transparent);
}

.news-ticker-inner {
    animation: news-scroll 40s linear infinite;
}

.news-ticker-inner:hover {
    animation-play-state: paused;
}

@keyframes news-scroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.news-ticker .news-list {
    margin: 0;
}

.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-item {
    margin: 0;
    border-bottom: 1px solid #1a1a1a;
}

.news-item-content {
    display: block;
    padding: 0.75rem 0;
    color: var(--text);
}

.news-title {
    display: block;
    margin-bottom: 0.25rem;
}

.news-title .redacted {
    background: #F0F0F0;
    color: transparent;
    user-select: none;
}

.news-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.news-empty {
    color: var(--text-dim);
    font-size: 0.875rem;
}

/* ----- Timeline ----- */
.timeline {
    margin-top: 3rem;
}

.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1px solid #222;
    margin-left: 0;
    padding-left: 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: 10em 1fr;
    gap: 1.5rem;
    padding: 0.75rem 0 0.75rem 1rem;
    border-bottom: 1px solid #1a1a1a;
    align-items: start;
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-date {
    font-size: 0.8125rem;
    color: var(--text-dim);
    white-space: nowrap;
}

.timeline-event {
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.5;
}

@media (max-width: 480px) {
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        padding-left: 0;
    }

    .timeline-date {
        white-space: normal;
    }
}

/* ----- Share ----- */
.share {
    margin-top: 3rem;
}

.share-links {
    margin: 0;
}

.share-links a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--text-dim);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.share-links a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.sep {
    margin: 0 0.5rem;
    color: var(--text-dim);
}

/* ----- Mobile-first: already minimal; ensure touch targets ----- */
@media (max-width: 480px) {
    .hero {
        min-height: 50vh;
    }

    .counter-wrap {
        font-size: clamp(3rem, 18vw, 6rem);
    }

    .news-item-content {
        padding: 1rem 0;
    }
}
