/* shared.css - used by all pages */
:root {
  --bg: #0d1117; --surface: #161b22; --surface2: #1c2230;
  --border: rgba(255,255,255,0.08); --border2: rgba(255,255,255,0.14);
  --blue: #58a6ff; --blue-dim: #1f6feb; --blue-bg: rgba(88,166,255,0.06); --blue-bg2: rgba(88,166,255,0.12);
  --text: #e6edf3; --text2: #8b949e; --text3: #6e7681;
  --red: #f85149; --red-bg: rgba(248,81,73,0.08);
  --amber: #d29922; --amber-bg: rgba(210,153,34,0.08);
  --green: #3fb950; --green-bg: rgba(63,185,80,0.08);
  --purple: #bc8cff; --purple-bg: rgba(188,140,255,0.08);
  --serif: 'DM Serif Display', serif; --sans: 'DM Sans', sans-serif; --mono: 'DM Mono', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.6; overflow-x: hidden; }

/* NAV */
nav { position: sticky; top: 0; z-index: 100; background: rgba(13,17,23,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-logo { font-family: var(--serif); font-size: 1.3rem; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.nav-logo-dot { width: 8px; height: 8px; background: var(--blue); border-radius: 50%; animation: livepulse 2s infinite; flex-shrink: 0; }
@keyframes livepulse { 0%,100%{opacity:1;box-shadow:0 0 0 0 rgba(88,166,255,0.4)} 50%{opacity:0.7;box-shadow:0 0 0 6px rgba(88,166,255,0)} }
.nav-links { display: flex; gap: 0; }
.nav-links a { color: var(--text2); text-decoration: none; font-size: 0.82rem; font-weight: 500; letter-spacing: 0.02em; padding: 0 1rem; height: 60px; display: flex; align-items: center; border-bottom: 2px solid transparent; transition: all 0.2s; }
.nav-links a:hover { color: var(--text); border-bottom-color: var(--blue); }
.nav-links a.active { color: var(--blue); border-bottom-color: var(--blue); }
.nav-cta { background: var(--blue-dim); color: #fff; border: none; padding: 7px 16px; font-family: var(--sans); font-size: 0.78rem; font-weight: 500; cursor: pointer; border-radius: 6px; transition: background 0.2s; text-decoration: none; }
.nav-cta:hover { background: var(--blue); }

/* TICKER */
.ticker-wrap { background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 0; overflow: hidden; white-space: nowrap; }
.ticker-inner { display: inline-flex; animation: tick 50s linear infinite; }
.ticker-item { font-family: var(--mono); font-size: 0.68rem; color: var(--text2); padding: 0 2.5rem; display: inline-flex; align-items: center; gap: 10px; }
.ticker-item::before { content: ''; width: 6px; height: 6px; background: var(--blue); border-radius: 50%; flex-shrink: 0; opacity: 0.6; }
@keyframes tick { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }

/* COMMON */
.container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }
.section-label { font-family: var(--mono); font-size: 0.68rem; color: var(--blue); letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 1rem; display: flex; align-items: center; gap: 10px; }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.page-header { padding: 4rem 0 3rem; border-bottom: 1px solid var(--border); }
.page-title { font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.5rem); color: var(--text); margin-bottom: 0.75rem; }
.page-desc { color: var(--text2); font-size: 0.95rem; max-width: 560px; font-weight: 300; line-height: 1.7; }

/* STATUS PILLS */
.status-pill { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em; padding: 3px 10px; border-radius: 100px; font-weight: 500; display: inline-block; }
.pill-hot { background: var(--red-bg); color: var(--red); border: 1px solid rgba(248,81,73,0.2); }
.pill-developing { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(88,166,255,0.2); }
.pill-fading { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(210,153,34,0.2); }
.pill-resolved { background: var(--green-bg); color: var(--green); border: 1px solid rgba(63,185,80,0.2); }

/* CARDS */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-top: 2rem; }
.story-card { background: var(--surface); padding: 1.75rem; display: flex; flex-direction: column; gap: 1rem; transition: background 0.2s; cursor: pointer; position: relative; overflow: hidden; text-decoration: none; color: inherit; }
.story-card:hover { background: var(--surface2); }
.story-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.story-card.hot::before { background: var(--red); }
.story-card.developing::before { background: var(--blue); }
.story-card.fading::before { background: var(--amber); }
.story-card.resolved::before { background: var(--green); }
.card-meta { display: flex; align-items: center; justify-content: space-between; }
.card-date { font-family: var(--mono); font-size: 0.65rem; color: var(--text3); }
.card-title { font-family: var(--serif); font-size: 1.08rem; color: var(--text); line-height: 1.35; }
.card-summary { font-size: 0.8rem; color: var(--text2); line-height: 1.6; font-weight: 300; }
.card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.card-category { font-family: var(--mono); font-size: 0.62rem; color: var(--text3); letter-spacing: 0.08em; }
.card-arrow { font-size: 0.8rem; color: var(--blue); opacity: 0; transition: opacity 0.2s; }
.story-card:hover .card-arrow { opacity: 1; }

/* SKELETON */
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal { background: var(--surface); border: 1px solid var(--border2); border-radius: 16px 16px 0 0; width: 100%; max-width: 680px; max-height: 85vh; overflow-y: auto; transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1); }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-handle { width: 36px; height: 4px; background: var(--border2); border-radius: 2px; margin: 1rem auto 0; }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.modal-close { font-family: var(--mono); font-size: 0.7rem; color: var(--text2); background: none; border: 1px solid var(--border2); padding: 4px 10px; cursor: pointer; border-radius: 6px; flex-shrink: 0; transition: all 0.2s; }
.modal-close:hover { color: var(--text); border-color: var(--text); }
.modal-body { padding: 1.5rem; }

/* STORY PAGE */
.story-page { max-width: 780px; margin: 0 auto; padding: 3rem 2rem 6rem; }
.story-page-back { font-family: var(--mono); font-size: 0.72rem; color: var(--text2); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 2rem; transition: color 0.2s; }
.story-page-back:hover { color: var(--blue); }
.story-page-eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 1rem; flex-wrap: wrap; }
.story-page-title { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.8rem); color: var(--text); line-height: 1.15; margin-bottom: 1.5rem; }
.story-page-summary { font-size: 1.05rem; color: var(--text2); line-height: 1.8; font-weight: 300; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.story-section-title { font-family: var(--mono); font-size: 0.65rem; color: var(--blue); letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 1rem; }
.story-analysis-box { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; margin-bottom: 2rem; }
.story-analysis-text { font-size: 0.92rem; color: var(--text2); line-height: 1.8; font-weight: 300; }
.story-meta-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 2rem; }
.story-meta-cell { background: var(--surface); padding: 1rem; }
.story-meta-label { font-family: var(--mono); font-size: 0.58rem; color: var(--text3); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px; }
.story-meta-value { font-family: var(--serif); font-size: 1.4rem; color: var(--text); line-height: 1; }
.story-meta-value.blue { color: var(--blue); }
.impact-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.impact-fill { height: 100%; background: var(--blue); border-radius: 3px; transition: width 1s ease-out; }
.timeline-list { display: flex; flex-direction: column; margin-bottom: 2rem; }
.tl-item { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); position: relative; padding-left: 1.5rem; }
.tl-item::before { content: ''; position: absolute; left: 0; top: 1.4rem; width: 8px; height: 8px; border-radius: 50%; background: var(--border2); }
.tl-item.latest::before { background: var(--blue); box-shadow: 0 0 0 3px rgba(88,166,255,0.2); }
.tl-date { font-family: var(--mono); font-size: 0.65rem; color: var(--text3); white-space: nowrap; min-width: 80px; padding-top: 2px; }
.tl-event { font-size: 0.88rem; color: var(--text2); line-height: 1.5; font-weight: 300; }
.tl-item.latest .tl-event { color: var(--text); }

/* FOOTER */
footer { background: var(--bg); border-top: 1px solid var(--border); padding: 2rem 0; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 2rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-copy { font-family: var(--mono); font-size: 0.65rem; color: var(--text3); }
.footer-links { display: flex; gap: 2rem; }
.footer-links a { font-family: var(--mono); font-size: 0.65rem; color: var(--text3); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--blue); }
.footer-status { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.65rem; color: var(--green); }
.footer-status span { width: 6px; height: 6px; background: var(--green); border-radius: 50%; animation: pulse2 2s infinite; }
@keyframes pulse2 { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* FADE UP */
.fade-up { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* RESPONSIVE */
@media(max-width:1024px) { .cards-grid { grid-template-columns: repeat(2,1fr); } .story-meta-grid { grid-template-columns: repeat(2,1fr); } }
@media(max-width:768px) { .nav-links { display: none; } .cards-grid { grid-template-columns: 1fr; } .story-meta-grid { grid-template-columns: repeat(2,1fr); } }
