/* ============================================================
   perso.news - Personalized News
   Dark-neon, layered-depth, tilt-3d aesthetic
   ============================================================ */

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

:root {
    --news-dark: #0A0A18;
    --neon-blue: #3080FF;
    --neon-magenta: #FF3080;
    --neon-amber: #FFB030;
    --text-white: #F0F0F8;
    --depth-gray: #282838;
    --ticker-green: #30FF80;

    --font-mono: 'Space Mono', monospace;
    --font-sans: 'Inter', sans-serif;

    --tilt-x: 0deg;
    --tilt-y: 0deg;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--news-dark);
    color: var(--text-white);
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: clamp(14px, 0.9vw, 16px);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- NEWS FLASH HERO --- */
.news-flash {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    perspective: 1000px;
    background: var(--news-dark);
}

/* Depth SVG layers */
.depth-layers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.depth-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease-out;
}

.depth-svg--back {
    transform: translateZ(-60px) scale(1.06);
}

.depth-svg--mid {
    transform: translateZ(-30px) scale(1.03);
}

.depth-svg--front {
    transform: translateZ(0px);
}

/* Neon accent strips */
.neon-strips {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.neon-strip {
    position: absolute;
    height: 2px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.neon-strip--blue {
    top: 20%;
    left: 5%;
    width: 30%;
    background: var(--neon-blue);
    box-shadow: 0 0 12px var(--neon-blue), 0 0 30px rgba(48, 128, 255, 0.3);
}

.neon-strip--magenta {
    top: 50%;
    right: 5%;
    width: 25%;
    background: var(--neon-magenta);
    box-shadow: 0 0 12px var(--neon-magenta), 0 0 30px rgba(255, 48, 128, 0.3);
}

.neon-strip--amber {
    top: 75%;
    left: 15%;
    width: 35%;
    background: var(--neon-amber);
    box-shadow: 0 0 12px var(--neon-amber), 0 0 30px rgba(255, 176, 48, 0.3);
}

.neon-strip.visible {
    opacity: 1;
}

/* Hero content */
.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
    transition: transform 0.15s ease-out;
}

.hero-title {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: clamp(36px, 5vw, 72px);
    color: var(--text-white);
    letter-spacing: -0.02em;
    min-height: 1.2em;
}

.hero-title .cursor {
    display: inline-block;
    width: 3px;
    height: 0.85em;
    background: var(--neon-blue);
    margin-left: 2px;
    animation: blink 0.6s step-end infinite;
    vertical-align: text-bottom;
}

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

.hero-tagline {
    font-family: var(--font-sans);
    font-size: clamp(14px, 1.2vw, 18px);
    color: rgba(240, 240, 248, 0.5);
    margin-top: 16px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease 0.8s, transform 0.6s ease 0.8s;
}

.hero-tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- PRIORITY LAYERS --- */
.priority-layers {
    position: relative;
    perspective: 1000px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 24px 120px;
}

/* Priority layer sections */
.priority-layer {
    position: relative;
    margin-bottom: 80px;
    transform-style: preserve-3d;
}

.priority-layer--breaking {
    z-index: 3;
    opacity: 1;
}

.priority-layer--trending {
    z-index: 2;
    opacity: 0.92;
}

.priority-layer--deep {
    z-index: 1;
    opacity: 0.84;
}

/* Layer headers */
.layer-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.priority-label {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 12px;
    border-radius: 2px;
}

.priority-label--blue {
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
    text-shadow: 0 0 8px rgba(48, 128, 255, 0.4);
}

.priority-label--magenta {
    color: var(--neon-magenta);
    border: 1px solid var(--neon-magenta);
    text-shadow: 0 0 8px rgba(255, 48, 128, 0.4);
}

.priority-label--amber {
    color: var(--neon-amber);
    border: 1px solid var(--neon-amber);
    text-shadow: 0 0 8px rgba(255, 176, 48, 0.4);
}

.neon-line {
    flex: 1;
    height: 2px;
}

.neon-line--blue {
    background: linear-gradient(90deg, var(--neon-blue), transparent);
    box-shadow: 0 0 8px rgba(48, 128, 255, 0.3);
}

.neon-line--magenta {
    background: linear-gradient(90deg, var(--neon-magenta), transparent);
    box-shadow: 0 0 8px rgba(255, 48, 128, 0.3);
}

.neon-line--amber {
    background: linear-gradient(90deg, var(--neon-amber), transparent);
    box-shadow: 0 0 8px rgba(255, 176, 48, 0.3);
}

/* Cards grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* News cards */
.news-card {
    background: var(--depth-gray);
    border-radius: 6px;
    padding: 28px 24px;
    position: relative;
    transform-style: preserve-3d;
    transform: perspective(800px) rotateX(var(--card-tilt-x, 0deg)) rotateY(var(--card-tilt-y, 0deg));
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, opacity 0.2s ease;
    cursor: default;
    overflow: hidden;
    border-top: 2px solid transparent;

    /* Entry animation */
    opacity: 0;
    animation: cardEnter 0.3s ease forwards;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

/* Card neon accents by type */
.news-card--breaking {
    border-top-color: var(--neon-blue);
    box-shadow: 0 4px 24px rgba(48, 128, 255, 0.1), 0 0 0 1px rgba(48, 128, 255, 0.08);
}

.news-card--breaking:hover {
    box-shadow: 0 8px 40px rgba(48, 128, 255, 0.2), 0 0 0 1px rgba(48, 128, 255, 0.15);
}

.news-card--trending {
    border-top-color: var(--neon-magenta);
    box-shadow: 0 4px 24px rgba(255, 48, 128, 0.1), 0 0 0 1px rgba(255, 48, 128, 0.08);
}

.news-card--trending:hover {
    box-shadow: 0 8px 40px rgba(255, 48, 128, 0.2), 0 0 0 1px rgba(255, 48, 128, 0.15);
}

.news-card--deep {
    border-top-color: var(--neon-amber);
    box-shadow: 0 4px 24px rgba(255, 176, 48, 0.1), 0 0 0 1px rgba(255, 176, 48, 0.08);
}

.news-card--deep:hover {
    box-shadow: 0 8px 40px rgba(255, 176, 48, 0.2), 0 0 0 1px rgba(255, 176, 48, 0.15);
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: perspective(800px) rotateX(-10deg) translateY(20px);
    }
    to {
        opacity: 1;
        transform: perspective(800px) rotateX(0deg) translateY(0);
    }
}

.news-card:nth-child(1) { animation-delay: 0.1s; }
.news-card:nth-child(2) { animation-delay: 0.2s; }
.news-card:nth-child(3) { animation-delay: 0.3s; }

.card-priority {
    display: inline-block;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 8px;
    border-radius: 2px;
    margin-bottom: 14px;
    transition: text-shadow 0.2s ease;
}

.news-card:hover .card-priority {
    text-shadow: 0 0 12px currentColor;
}

.card-title {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: clamp(15px, 1.2vw, 18px);
    line-height: 1.4;
    color: var(--text-white);
    margin-bottom: 12px;
}

.card-excerpt {
    font-family: var(--font-sans);
    font-size: clamp(13px, 0.85vw, 15px);
    line-height: 1.7;
    color: rgba(240, 240, 248, 0.65);
    margin-bottom: 18px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(240, 240, 248, 0.4);
}

.card-source {
    color: rgba(240, 240, 248, 0.5);
}

.card-time {
    color: rgba(240, 240, 248, 0.35);
}

/* --- TICKER STREAM --- */
.ticker-stream {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--news-dark);
    border-top: 2px solid var(--ticker-green);
    box-shadow: 0 -4px 20px rgba(48, 255, 128, 0.1);
    overflow: hidden;
    height: 40px;
    display: flex;
    align-items: center;
}

.ticker-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: tickerScroll 60s linear infinite;
    will-change: transform;
}

.ticker-stream:hover .ticker-track {
    animation-play-state: paused;
}

@keyframes tickerScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.ticker-item {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--ticker-green);
    padding: 0 40px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ticker-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    animation: dotPulse 2s ease-in-out infinite;
}

.ticker-dot--green { background: var(--ticker-green); }
.ticker-dot--blue { background: var(--neon-blue); }
.ticker-dot--magenta { background: var(--neon-magenta); }
.ticker-dot--amber { background: var(--neon-amber); }

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

/* --- Dimming other cards on hover --- */
.priority-layer.has-hover .news-card:not(:hover) {
    opacity: 0.85;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--news-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--depth-gray);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(48, 128, 255, 0.3);
}

/* Body bottom padding for ticker */
body {
    padding-bottom: 44px;
}
