/* ===================================================
   The Quantum Qanary — Dashboard Styles
   Dark mode, card-based layout, responsive
   =================================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f172a;
  color: #f1f5f9;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: #06b6d4;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 48px 0;
}

.subsection {
  margin-top: 40px;
}

/* --- Header --- */
.site-header {
  padding: 32px 0 16px;
  border-bottom: 1px solid #334155;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

.header-content {
  text-align: center;
}

.site-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.canary-icon {
  display: inline-block;
  margin-right: 4px;
}

.site-subtitle {
  color: #94a3b8;
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 8px;
}

.last-updated {
  color: #64748b;
  font-size: 0.85rem;
}

/* --- Section Titles --- */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.subsection-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #e2e8f0;
}

.section-subhead {
  font-size: 0.95rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.section-desc {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

/* ===========================================
   ALERT STATUS HERO
   =========================================== */
.hero-alert {
  padding: 48px 0 40px;
  border-bottom: 1px solid #334155;
}

.alert-grid {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 36px;
}

/* Traffic light */
.traffic-light-wrap {
  flex-shrink: 0;
}

.traffic-light {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #0c1222;
  border: 2px solid #334155;
  border-radius: 32px;
  padding: 16px 14px;
  width: 64px;
  align-items: center;
}

.light {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #334155;
  transition: all 0.4s ease;
  position: relative;
}

.light-inner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1e293b;
  transition: all 0.4s ease;
}

/* Dimmed states */
.light-green .light-inner { background: #1a3a2a; }
.light-yellow .light-inner { background: #3a3520; }
.light-orange .light-inner { background: #3a2a18; }
.light-red .light-inner { background: #3a1a1a; }

/* Active states with glow */
.light-green.active { border-color: #22c55e; box-shadow: 0 0 20px rgba(34, 197, 94, 0.5), 0 0 40px rgba(34, 197, 94, 0.2); }
.light-green.active .light-inner { background: #22c55e; box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3); }

.light-yellow.active { border-color: #eab308; box-shadow: 0 0 20px rgba(234, 179, 8, 0.5), 0 0 40px rgba(234, 179, 8, 0.2); }
.light-yellow.active .light-inner { background: #eab308; box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3); }

.light-orange.active { border-color: #f97316; box-shadow: 0 0 20px rgba(249, 115, 22, 0.5), 0 0 40px rgba(249, 115, 22, 0.2); }
.light-orange.active .light-inner { background: #f97316; box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3); }

.light-red.active { border-color: #ef4444; box-shadow: 0 0 20px rgba(239, 68, 68, 0.5), 0 0 40px rgba(239, 68, 68, 0.2); }
.light-red.active .light-inner { background: #ef4444; box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3); }

/* Alert info */
.alert-info {
  flex: 1;
}

.alert-level-label {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.alert-level-desc {
  font-size: 1.1rem;
  color: #cbd5e1;
  line-height: 1.5;
}

/* Triggered timeline */
.triggered-section {
  margin-bottom: 28px;
}

.triggered-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 24px;
}

.triggered-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: #334155;
}

.triggered-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}

.triggered-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
  position: absolute;
  left: -22px;
}

.triggered-dot.dot-GREEN { background: #22c55e; }
.triggered-dot.dot-YELLOW { background: #eab308; }
.triggered-dot.dot-ORANGE { background: #f97316; }
.triggered-dot.dot-RED { background: #ef4444; }

.triggered-date {
  color: #64748b;
  font-size: 0.85rem;
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
  min-width: 72px;
  flex-shrink: 0;
}

.triggered-event {
  color: #e2e8f0;
  font-size: 0.95rem;
}

/* Watch items */
.watch-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.watch-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.watch-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.watch-tag-ORANGE { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.watch-tag-RED { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.watch-tag-YELLOW { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.watch-tag-GREEN { background: rgba(34, 197, 94, 0.2); color: #22c55e; }

/* ===========================================
   Q-DAY DISTANCE
   =========================================== */
.qday-hero {
  text-align: center;
  padding: 32px 0 24px;
}

.qday-number {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.qday-label {
  color: #94a3b8;
  font-size: 1rem;
}

/* Component bar */
.components-bar {
  display: flex;
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #1e293b;
}

.component-segment {
  height: 100%;
  transition: width 0.6s ease;
  position: relative;
}

.component-segment:first-child {
  border-radius: 8px 0 0 8px;
}

.component-segment:last-child {
  border-radius: 0 8px 8px 0;
}

/* Component detail cards */
.components-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.comp-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px 16px;
}

.comp-name {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 4px;
}

.comp-weight {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 6px;
}

.comp-progress-bar {
  height: 6px;
  border-radius: 3px;
  background: #334155;
  overflow: hidden;
  margin-bottom: 4px;
}

.comp-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.comp-detail-text {
  font-size: 0.85rem;
  color: #cbd5e1;
}

.caveat-text {
  color: #64748b;
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
  padding: 8px 0;
}

/* ===========================================
   CANARY LADDERS
   =========================================== */
.ladders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.ladder-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 24px;
}

.ladder-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.ladder-subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 20px;
}

.ladder {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ladder-rung {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-left: 3px solid #334155;
  position: relative;
  transition: background 0.2s ease;
}

.ladder-rung:hover {
  background: rgba(255, 255, 255, 0.02);
}

.ladder-rung:last-child {
  border-left-color: transparent;
}

.ladder-rung.rung-achieved {
  border-left-color: #22c55e;
}

.ladder-rung.rung-canary {
  border-left-color: #eab308;
}

.ladder-rung.rung-qday {
  border-left-color: #ef4444;
}

.ladder-rung.rung-current {
  border-left-color: #06b6d4;
}

.rung-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.rung-icon-achieved {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.rung-icon-pending {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

.rung-icon-canary {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.rung-icon-qday {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.rung-icon-current {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
}

.rung-body {
  flex: 1;
  min-width: 0;
}

.rung-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
}

.rung-bits {
  font-size: 0.8rem;
  color: #64748b;
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
}

.rung-signal {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 2px;
}

.rung-date {
  font-size: 0.75rem;
  color: #64748b;
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
}

.classical-context {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(100, 116, 139, 0.1);
  border: 1px solid #334155;
  border-radius: 8px;
}

.classical-context-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 4px;
}

.classical-context-text {
  font-size: 0.85rem;
  color: #cbd5e1;
}

/* ===========================================
   HARDWARE CHART
   =========================================== */
.chart-wrap {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px;
  position: relative;
}

.chart-wrap canvas {
  width: 100% !important;
  max-height: 400px;
}

.roadmap-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.roadmap-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.roadmap-tag-year {
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
  color: #06b6d4;
  font-weight: 600;
}

/* ===========================================
   PQC ADOPTION TABLE
   =========================================== */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #334155;
}

.pqc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.pqc-table thead {
  background: #1e293b;
}

.pqc-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: #94a3b8;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #334155;
}

.pqc-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #1e293b;
  color: #e2e8f0;
}

.pqc-table tbody tr {
  background: #0f172a;
  transition: background 0.15s ease;
}

.pqc-table tbody tr:hover {
  background: #1a2540;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-deployed { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.badge-in_development { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.badge-testing { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.badge-not_started { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }

.category-label {
  font-size: 0.78rem;
  color: #94a3b8;
  text-transform: capitalize;
}

/* ===========================================
   BLOCKCHAIN CARDS
   =========================================== */
.blockchain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.chain-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s ease;
}

.chain-card:hover {
  border-color: #475569;
}

.chain-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.chain-name {
  font-size: 1.05rem;
  font-weight: 600;
}

.chain-ticker {
  font-size: 0.8rem;
  color: #64748b;
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
  margin-left: 6px;
}

.chain-status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: capitalize;
}

.chain-badge-in_development { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.chain-badge-planned { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.chain-badge-discussed { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.chain-badge-not_acknowledged { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }
.chain-badge-testnet { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.chain-badge-mainnet { background: rgba(34, 197, 94, 0.15); color: #22c55e; }

.chain-detail {
  font-size: 0.88rem;
  color: #cbd5e1;
  margin-bottom: 8px;
  line-height: 1.5;
}

.chain-exposure {
  font-size: 0.82rem;
  color: #94a3b8;
  padding: 6px 10px;
  background: rgba(239, 68, 68, 0.06);
  border-radius: 6px;
  border-left: 3px solid rgba(239, 68, 68, 0.3);
}

/* ===========================================
   CHARTS SIDE BY SIDE
   =========================================== */
.charts-side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.chart-card {
  flex: 1;
}

.chart-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.funding-note {
  margin-top: 12px;
  font-size: 0.85rem;
  color: #94a3b8;
}

.funding-note strong {
  color: #06b6d4;
}

/* ===========================================
   MOSCA'S THEOREM
   =========================================== */
.mosca-explainer {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.6;
}

.mosca-explainer strong {
  color: #06b6d4;
}

.mosca-calculator {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 28px;
}

.mosca-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.mosca-slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mosca-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.mosca-value {
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
  font-weight: 700;
  color: #06b6d4;
  font-size: 1.1rem;
}

/* Range slider styling */
.mosca-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #334155;
  outline: none;
  cursor: pointer;
}

.mosca-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #06b6d4;
  border: 2px solid #0f172a;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

.mosca-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #06b6d4;
  border: 2px solid #0f172a;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

.mosca-result {
  text-align: center;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.mosca-result-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.mosca-result-warning {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.mosca-result-safe {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.mosca-result-text {
  font-size: 1.15rem;
  font-weight: 600;
}

.mosca-result-danger .mosca-result-text { color: #ef4444; }
.mosca-result-warning .mosca-result-text { color: #eab308; }
.mosca-result-safe .mosca-result-text { color: #22c55e; }

/* Mosca timeline bar */
.mosca-timeline {
  padding: 0 4px;
}

.mosca-bar-container {
  position: relative;
  height: 32px;
  background: #0f172a;
  border-radius: 8px;
  overflow: visible;
  margin-bottom: 8px;
}

.mosca-bar {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 8px;
  transition: width 0.4s ease, left 0.4s ease;
}

.mosca-bar-shelf {
  background: rgba(6, 182, 212, 0.3);
  border: 1px solid rgba(6, 182, 212, 0.5);
  left: 0;
  z-index: 1;
}

.mosca-bar-migration {
  background: rgba(139, 92, 246, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.5);
  z-index: 2;
}

.mosca-bar-threat-line {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 3px;
  background: #ef4444;
  border-radius: 2px;
  z-index: 3;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  transition: left 0.4s ease;
}

.mosca-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
}

.label-shelf { color: #06b6d4; }
.label-migration { color: #a78bfa; }
.label-threat { color: #ef4444; }

/* ===========================================
   FOOTER
   =========================================== */
.site-footer {
  padding: 48px 0 32px;
  border-top: 1px solid #334155;
  background: #0c1222;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #e2e8f0;
}

.footer-col p {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.6;
}

.footer-list {
  list-style: none;
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.8;
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid #1e293b;
  font-size: 0.82rem;
  color: #475569;
}

/* ===========================================
   PLACEHOLDER STATES
   =========================================== */
.placeholder-msg {
  text-align: center;
  padding: 48px 24px;
  color: #64748b;
  font-size: 0.95rem;
}

.placeholder-msg .placeholder-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 900px) {
  .ladders-grid {
    grid-template-columns: 1fr;
  }

  .charts-side-by-side {
    grid-template-columns: 1fr;
  }

  .alert-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .traffic-light {
    flex-direction: row;
    border-radius: 24px;
    width: auto;
    padding: 10px 16px;
  }

  .qday-number {
    font-size: 2.5rem;
  }

  .site-title {
    font-size: 1.75rem;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }

  .section {
    padding: 32px 0;
  }

  .mosca-inputs {
    grid-template-columns: 1fr;
  }

  .components-detail {
    grid-template-columns: 1fr 1fr;
  }

  .blockchain-grid {
    grid-template-columns: 1fr;
  }

  .pqc-table th,
  .pqc-table td {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}
