/* ===================================================================
   KRONOS OPINIONS — The Opinion Layer
   Minimal, opinion-forward design. The content IS the product.
   =================================================================== */

:root {
    --bg: #0d1117;
    --bg-card: #161b22;
    --bg-hover: #1c2129;
    --border: #30363d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --text-dim: #484f58;
    --accent: #f78166;
    --accent-hover: #ffa28b;
    --link: #58a6ff;
    --proof: #3fb950;
    --arrow-warn: #d29922;
    --spectrum-low: #f85149;
    --spectrum-mid: #8b949e;
    --spectrum-high: #3fb950;
    --radius: 8px;
    --max-width: 900px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ─────────────────────────────────── */
.nav {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}
.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-brand:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; gap: 1.25rem; align-items: center; font-size: 0.9rem; }
.nav-links a { color: var(--text-muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-user { color: var(--accent) !important; font-weight: 600; }
.nav-login { 
    background: var(--accent); 
    color: var(--bg) !important; 
    padding: 0.35rem 0.85rem; 
    border-radius: var(--radius); 
    font-weight: 600;
}
.nav-login:hover { background: var(--accent-hover); text-decoration: none; }

/* ── Main ────────────────────────────────── */
.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
    flex: 1;
}

/* ── Hero ────────────────────────────────── */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}
.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--accent), #ffa28b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ── Categories ──────────────────────────── */
.categories { margin-bottom: 2rem; }
.category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}
.category-card {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: all 0.15s;
}
.category-card:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--accent);
    text-decoration: none;
}

/* ── Section ─────────────────────────────── */
.section { margin-bottom: 2.5rem; }
.section-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ── Topic Grid ──────────────────────────── */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.topic-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.15s;
    color: var(--text);
    display: block;
}
.topic-card:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    text-decoration: none;
    transform: translateY(-1px);
}
.topic-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}
.topic-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.topic-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.topic-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ── Topic Page ──────────────────────────── */
.topic-page { max-width: 700px; margin: 0 auto; }
.topic-header { margin-bottom: 2rem; }
.topic-header h1 { font-size: 2rem; margin: 0.5rem 0; }
.topic-cat-link {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}
.topic-description {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    line-height: 1.7;
}
.topic-source {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* ── Spectrum ────────────────────────────── */
.spectrum-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.spectrum-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.spectrum-low { color: var(--spectrum-low); }
.spectrum-high { color: var(--spectrum-high); }
.spectrum-bar {
    position: relative;
    height: 40px;
    margin: 0.5rem 0;
}
.spectrum-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--spectrum-low), var(--spectrum-mid), var(--spectrum-high));
    border-radius: 2px;
    transform: translateY(-50%);
}
.spectrum-flag {
    position: absolute;
    top: -12px;
    transform: translateX(-50%);
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.15s;
}
.spectrum-flag:hover { transform: translateX(-50%) scale(1.3); }
.spectrum-count {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

/* ── Flag Form ───────────────────────────── */
.flag-form-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.flag-form h3 { margin-bottom: 1rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.optional { font-weight: 400; color: var(--text-dim); font-size: 0.8rem; }
.form-group textarea,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
}
.form-group textarea:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}
.slider-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.slider-label-left { color: var(--spectrum-low); font-size: 0.8rem; min-width: 60px; }
.slider-label-right { color: var(--spectrum-high); font-size: 0.8rem; min-width: 60px; text-align: right; }
.position-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: linear-gradient(90deg, var(--spectrum-low), var(--spectrum-mid), var(--spectrum-high));
    border-radius: 3px;
    outline: none;
}
.position-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}
.slider-value {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.rating-input { max-width: 100px !important; }

/* ── Buttons ─────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.btn-flag {
    background: var(--accent);
    color: var(--bg);
    width: 100%;
}
.btn-flag:hover { background: var(--accent-hover); }
.btn-login {
    background: var(--accent);
    color: var(--bg) !important;
    text-decoration: none !important;
}
.btn-login:hover { background: var(--accent-hover); }
.btn-login-submit {
    background: var(--accent);
    color: var(--bg);
    width: 100%;
}
.flag-note {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.75rem;
    text-align: center;
}

/* ── Existing Flag ───────────────────────── */
.existing-flag { margin-bottom: 1.5rem; }
.your-flag-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 0.75rem 0;
}
.flag-position { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.flag-statement { font-style: italic; color: var(--text); }
.change-notice { font-size: 0.85rem; color: var(--text-dim); font-style: italic; }

/* ── Proof Badge ─────────────────────────── */
.proof-badge, .proof-link {
    color: var(--proof) !important;
    font-size: 0.8rem;
    font-weight: 600;
}
.proof-badge:hover, .proof-link:hover { text-decoration: underline; }
.proof-pending { color: var(--text-dim); font-size: 0.8rem; }
.arrow-warning { color: var(--arrow-warn); font-size: 0.8rem; }

/* ── Login Prompt ────────────────────────── */
.login-prompt {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 2rem;
}
.login-prompt h3 { margin-bottom: 0.5rem; }
.login-prompt p { color: var(--text-muted); margin-bottom: 1rem; }

/* ── Flags List ──────────────────────────── */
.flags-section { margin-top: 2rem; }
.flags-section h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.count { color: var(--text-dim); font-weight: 400; }
.flags-list { display: flex; flex-direction: column; gap: 0.75rem; }
.flag-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.flag-card.flag-arrow { border-color: var(--arrow-warn); opacity: 0.7; }
.flag-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.flag-user { font-weight: 700; color: var(--accent) !important; }
.flag-pos-badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.flag-rating {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
}
.flag-text {
    color: var(--text);
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}
.flag-card-footer {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}
.flag-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

/* ── Category Tabs ───────────────────────── */
.page-header {
    margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 2rem; }
.page-header p { color: var(--text-muted); }
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}
.cat-tab {
    padding: 0.4rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.cat-tab:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.cat-tab.active { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }

/* ── User Page ───────────────────────────── */
.user-page { max-width: 700px; margin: 0 auto; }
.user-header { margin-bottom: 2rem; }
.user-header h1 { font-size: 2rem; }
.user-stats { color: var(--text-muted); font-size: 0.9rem; }
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-entry { position: relative; margin-bottom: 1.5rem; }
.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
    margin-left: 3px;
}
.timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.timeline-topic { font-weight: 700; color: var(--accent) !important; }
.timeline-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

/* ── Login Page ──────────────────────────── */
.login-page { max-width: 450px; margin: 0 auto; text-align: center; }
.login-page h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.login-intro { color: var(--text-muted); margin-bottom: 1.5rem; }
.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: left;
}
.login-note { font-size: 0.8rem; color: var(--text-dim); margin-top: 1rem; text-align: center; }

/* ── About Page ──────────────────────────── */
.about-page { max-width: 700px; margin: 0 auto; }
.about-page h1 { font-size: 2rem; margin-bottom: 1.5rem; }
.contract {
    font-size: 1.15rem;
    font-style: italic;
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0 2rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.about-section { margin-bottom: 2rem; }
.about-section h2 { font-size: 1.3rem; margin-bottom: 0.75rem; color: var(--accent); }
.about-section p { color: var(--text-muted); margin-bottom: 0.5rem; }
.about-section ul, .about-section ol { padding-left: 1.5rem; color: var(--text-muted); }
.about-section li { margin-bottom: 0.5rem; }
.rules-list li { margin-bottom: 0.75rem; }

/* ── How It Works ────────────────────────── */
.cta-section { text-align: center; }
.cta-section h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.how-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    text-align: left;
}
.how-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.how-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.how-card h3 { margin-bottom: 0.5rem; font-size: 1rem; }
.how-card p { font-size: 0.85rem; color: var(--text-muted); }

/* ── Empty State ─────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-dim);
}
.empty-state h2 { margin-bottom: 0.5rem; color: var(--text-muted); }

/* ── Footer ──────────────────────────────── */
.footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 1rem;
    margin-top: auto;
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dim);
}
.footer-sub { margin-top: 0.25rem; }
.footer a { color: var(--text-muted); }

/* ── Responsive ──────────────────────────── */
@media (max-width: 600px) {
    .hero h1 { font-size: 1.8rem; }
    .topic-grid { grid-template-columns: 1fr; }
    .how-grid { grid-template-columns: 1fr; }
    .slider-container { flex-direction: column; }
    .slider-label-left, .slider-label-right { text-align: center; min-width: auto; }
    .nav-links { gap: 0.75rem; font-size: 0.8rem; }
}
