/* ========================================
   THE HIVE v2 - LIGHT
   Warm. Alive. White background.
   ======================================== */

:root {
    /* Light palette */
    --bg: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --border: rgba(0, 0, 0, 0.15);

    /* Text */
    --text: #1a1a1a;
    --text-secondary: rgba(26, 26, 26, 0.7);
    --text-muted: rgba(26, 26, 26, 0.45);

    /* Accent colors - slightly deeper for contrast on white */
    --amber: #d97706;
    --amber-soft: rgba(217, 119, 6, 0.1);
    --blue: #2563eb;
    --blue-soft: rgba(37, 99, 235, 0.1);
    --green: #16a34a;
    --green-soft: rgba(22, 163, 74, 0.1);
    --purple: #9333ea;
    --purple-soft: rgba(147, 51, 234, 0.1);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 40px;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo img {
    height: 50px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.05);
}

.nav-cta {
    background: var(--amber) !important;
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 100px;
    margin-left: 8px;
    font-weight: 600;
}

.nav-cta:hover {
    background: #b45309 !important;
}

@media (max-width: 768px) {
    .nav { padding: 0 20px; }
    .nav-links { display: none; }
}

/* ========================================
   AMBIENT BACKGROUND
   ======================================== */

.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.honeycomb-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23d97706' fill-opacity='0.12'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

#swarmCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ========================================
   CONTAINER
   ======================================== */

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 40px 60px;
}

@media (max-width: 768px) {
    .container { padding: 80px 20px 48px; }
}

/* ========================================
   HEADER
   ======================================== */

.header {
    text-align: center;
    margin-bottom: 60px;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
}

.honeycomb-icon {
    width: 70px;
    height: 60px;
    filter: drop-shadow(0 4px 12px rgba(217, 119, 6, 0.25));
}

.honeycomb-svg {
    width: 100%;
    height: 100%;
}

.hex {
    opacity: 0.6;
    transition: opacity 0.4s ease;
}

.hex-center {
    opacity: 1;
    animation: hex-breathe-center 3s ease-in-out infinite;
}

.hex-1 { animation: hex-breathe 3s ease-in-out infinite 0s; }
.hex-2 { animation: hex-breathe 3s ease-in-out infinite 0.5s; }
.hex-3 { animation: hex-breathe 3s ease-in-out infinite 1s; }
.hex-4 { animation: hex-breathe 3s ease-in-out infinite 1.5s; }
.hex-5 { animation: hex-breathe 3s ease-in-out infinite 2s; }
.hex-6 { animation: hex-breathe 3s ease-in-out infinite 2.5s; }

@keyframes hex-breathe {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.9; }
}

@keyframes hex-breathe-center {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

.header .title {
    font-family: 'Orbitron', sans-serif;
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 0.2em;
    background: linear-gradient(135deg, #f59e0b, #b45309);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.beta-badge {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    background: rgba(217, 119, 6, 0.15);
    color: #b45309;
    -webkit-text-fill-color: #b45309;
    padding: 4px 10px;
    border-radius: 100px;
    vertical-align: middle;
    margin-left: 12px;
    border: 1px solid rgba(217, 119, 6, 0.3);
}

.header .powered-by {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.header .powered-by .kitchin-link {
    color: var(--text-secondary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.header .powered-by .kitchin-link:hover {
    color: var(--amber);
}

.tagline {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--amber);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

@media (max-width: 768px) {
    .header .title { font-size: 32px; letter-spacing: 0.15em; }
}

/* ========================================
   STATS ROW
   ======================================== */

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

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

@media (max-width: 500px) {
    .stats-row { grid-template-columns: 1fr; }
}

.stat-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.stat-card.primary { border-left: 3px solid var(--amber); }
.stat-card.blue { border-left: 3px solid var(--blue); }
.stat-card.green { }
.stat-card.purple { border-left: 3px solid var(--purple); }

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-card.primary .stat-icon { background: var(--amber-soft); color: var(--amber); }
.stat-card.blue .stat-icon { background: var(--blue-soft); color: var(--blue); }
.stat-card.green .stat-icon { background: var(--green-soft); color: var(--green); }
.stat-card.purple .stat-icon { background: var(--purple-soft); color: var(--purple); }

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -1px;
    line-height: 1;
}

.stat-card.primary .stat-value { color: var(--amber); }
.stat-card.blue .stat-value { color: var(--blue); }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.purple .stat-value { color: var(--purple); }

.stat-sublabel {
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 8px;
    height: 8px;
    background: var(--amber);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

/* ========================================
   SECTION HEADERS
   ======================================== */

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-muted);
}

.badge.accent {
    background: var(--amber-soft);
    color: var(--amber);
}

/* ========================================
   LIVE FEED
   ======================================== */

.live-feed-section {
    margin-bottom: 40px;
}

.live-feed-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 800px) {
    .live-feed-grid { grid-template-columns: 1fr; }
}

.live-feed {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    height: 180px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.live-feed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 1));
    pointer-events: none;
    border-radius: 0 0 16px 16px;
}

.feed-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

.feed-icon {
    font-size: 18px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--amber-soft);
    border-radius: 10px;
}

.feed-content {
    flex: 1;
}

.feed-text {
    font-size: 14px;
    color: var(--text);
}

.feed-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ========================================
   TWO COLUMNS
   ======================================== */

.two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

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

.card-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ========================================
   LEADERBOARD
   ======================================== */

.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
}

.leaderboard-rank {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    width: 28px;
    color: var(--text-muted);
}

.leaderboard-rank.gold { color: #b45309; }
.leaderboard-rank.silver { color: #6b7280; }
.leaderboard-rank.bronze { color: #92400e; }

.leaderboard-name {
    flex: 1;
    font-size: 14px;
}

.leaderboard-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--amber);
}

/* ========================================
   HEALTH STATS
   ======================================== */

.health-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
}

.health-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.health-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
}

/* ========================================
   PATTERNS
   ======================================== */

.patterns-section {
    margin-bottom: 40px;
}

.patterns-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

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

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

.pattern-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pattern-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.12);
}

.pattern-cohort {
    font-size: 12px;
    font-weight: 600;
    color: var(--amber);
    margin-bottom: 8px;
}

.pattern-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.pattern-confidence {
    display: flex;
    align-items: center;
    gap: 10px;
}

.confidence-bar {
    flex: 1;
    height: 4px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: var(--amber);
    border-radius: 2px;
}

.confidence-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--amber);
}

/* ========================================
   REGIONAL
   ======================================== */

.regional-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.regional-card {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.regional-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

.regional-item {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.regional-item:last-child { border-bottom: none; }

.regional-item span {
    color: var(--amber);
    font-weight: 500;
}

/* ========================================
   TIMING
   ======================================== */

.timing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.timing-card {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.timing-cohort {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.timing-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    font-weight: 600;
    color: var(--blue);
    margin-bottom: 2px;
}

.timing-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.footer p {
    font-size: 14px;
    color: var(--text-secondary);
}

.footer #totalContributors {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--amber);
}

.footer-privacy {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ========================================
   SCROLLBAR
   ======================================== */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.15); }

/* Counter animation pop */
.counter-animate {
    animation: counter-pop 0.3s ease-out;
}

@keyframes counter-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
