/* Better Canada — Redesigned to match bettereu.com aesthetic */

/* ========================================================================
   Variables
   ======================================================================== */

:root {
  --bc-red: #dc2626;
  --bc-red-glow: rgba(220, 38, 38, 0.08);
  --bc-grey-light: #e5e5e5;
  --bc-text: #111;
  --bc-muted: #666;
  --bc-faint: #999;
  --bc-whisper: #aaa;
  --bc-bg: #fafaf8;
  --bc-surface: #fff;
  --bc-surface-alt: #f5f5f3;
  --bc-border: #e5e5e5;
  --bc-keep: #22c55e;
  --bc-keep-bg: #dcfce7;
  --bc-keep-text: #15803d;
  --bc-delete: #ef4444;
  --bc-delete-bg: #fee2e2;
  --bc-delete-text: #b91c1c;
  --bc-font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --bc-font-mono: "DM Mono", "Courier New", Courier, monospace;
  --bc-pad: clamp(24px, 7vw, 120px);
}

/* ========================================================================
   Reset & Base
   ======================================================================== */

.better-canada *,
.better-canada *::before,
.better-canada *::after {
  box-sizing: border-box;
}

html {
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  display: none;
}

body.better-canada {
  margin: 0;
  font-family: var(--bc-font-mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--bc-text);
  background: var(--bc-bg);
  overflow-x: hidden;
  scrollbar-width: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.better-canada::-webkit-scrollbar {
  display: none;
}

/* ========================================================================
   Shared Typography
   ======================================================================== */

.bc-eyebrow {
  font-family: var(--bc-font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bc-red);
  margin-bottom: 16px;
}

.bc-hero__content .bc-eyebrow {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.bc-eyebrow strong {
  color: var(--bc-text);
  font-weight: 500;
}

.bc-section-title {
  font-family: var(--bc-font-display);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 48px);
  color: var(--bc-text);
  margin: 0 0 12px 0;
  line-height: 1.1;
}

.bc-section-title em {
  font-style: italic;
  color: var(--bc-red);
}

.bc-section-desc {
  font-family: var(--bc-font-mono);
  font-size: 13px;
  color: var(--bc-faint);
  margin: 0;
  max-width: 560px;
  line-height: 1.7;
}

/* ========================================================================
   Animations
   ======================================================================== */

@keyframes bc-fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bc-fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes bc-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50%      { transform: translate(-50%, -50%) scale(1.15); opacity: 0.8; }
}

/* ========================================================================
   SECTION 1 — HERO
   ======================================================================== */

.bc-hero {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 var(--bc-pad);
  position: relative;
  overflow: hidden;
  background: var(--bc-surface);
}

/* Scattered maple leaves */
.bc-leaf {
  position: absolute;
  pointer-events: none;
  color: rgba(0, 0, 0, 0.07);
}

.bc-leaf--1 { width: 120px; top: 8%;  left: 5%;  transform: rotate(-25deg); }
.bc-leaf--2 { width: 80px;  top: 15%; right: 15%; transform: rotate(40deg); }
.bc-leaf--3 { width: 60px;  top: 55%; left: 12%; transform: rotate(15deg); }
.bc-leaf--4 { width: 100px; top: 70%; right: 8%;  transform: rotate(-50deg); }
.bc-leaf--5 { width: 50px;  top: 35%; left: 45%; transform: rotate(65deg); }
.bc-leaf--6 { width: 90px;  bottom: 10%; left: 30%; transform: rotate(-35deg); }
.bc-leaf--7 { width: 70px;  top: 5%;  right: 35%; transform: rotate(20deg); }

/* Glow blob */
.bc-hero::after {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--bc-red-glow) 0%, transparent 70%);
  pointer-events: none;
}

.bc-hero__inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
  position: relative;
  z-index: 1;
}

.bc-hero__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.bc-hero__content .bc-eyebrow {
  opacity: 0;
  animation: bc-fadeUp 0.6s ease forwards 0.2s;
}

.bc-hero__heading {
  font-family: var(--bc-font-display);
  font-size: clamp(44px, 7vw, 96px);
  font-weight: 400;
  line-height: 1.0;
  color: var(--bc-text);
  margin: 0 0 24px 0;
  max-width: 860px;
  opacity: 0;
  animation: bc-fadeUp 0.7s ease forwards 0.35s;
}

.bc-hero__heading em {
  font-style: italic;
  color: var(--bc-red);
}

.bc-hero__sub {
  font-family: var(--bc-font-mono);
  font-size: clamp(13px, 1.5vw, 16px);
  font-weight: 300;
  color: rgba(0, 0, 0, 0.45);
  max-width: 560px;
  line-height: 1.7;
  margin: 0 0 72px 0;
  opacity: 0;
  animation: bc-fadeUp 0.7s ease forwards 0.5s;
}

.bc-hero__sub strong {
  color: var(--bc-text);
  font-weight: 500;
}

/* ── Progress bar ── */

.bc-progress-wrap {
  width: 100%;
  max-width: 760px;
  opacity: 0;
  animation: bc-fadeUp 0.7s ease forwards 0.65s;
}

.bc-progress-track {
  position: relative;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 99px;
}

.bc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #f87171);
  border-radius: 99px;
  width: 0%;
  transition: width 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.bc-progress-marker {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  line-height: 1;
  transition: left 1.8s cubic-bezier(0.16, 1, 0.3, 1);
  animation: bc-pulse 2.5s ease-in-out infinite 2.5s;
}

.bc-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.bc-progress-label {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.35);
  letter-spacing: 0.05em;
}

.bc-progress-count {
  font-size: 13px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.6);
  letter-spacing: 0.04em;
}

.bc-progress-count strong {
  color: var(--bc-red);
  font-weight: 500;
}

/* ── Pie chart (SVG donut) ── */

.bc-hero__pie-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  opacity: 0;
  animation: bc-fadeIn 0.8s ease forwards 1s;
}

.bc-pie-container {
  position: relative;
  width: 220px;
  height: 220px;
}

.bc-pie-svg {
  width: 220px;
  height: 220px;
  transform: rotate(-90deg);
  filter: drop-shadow(0 8px 32px rgba(220, 38, 38, 0.12));
}

.bc-pie-track {
  fill: none;
  stroke: #f0f0ee;
  stroke-width: 28;
}

.bc-pie-keep {
  fill: none;
  stroke: var(--bc-grey-light);
  stroke-width: 28;
  stroke-linecap: butt;
}

.bc-pie-delete {
  fill: none;
  stroke: var(--bc-red);
  stroke-width: 28;
  stroke-linecap: butt;
  transition: stroke-dasharray 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bc-pie-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.bc-pie-pct {
  font-family: var(--bc-font-display);
  font-style: italic;
  font-size: 42px;
  color: var(--bc-red);
  line-height: 1;
}

.bc-pie-label {
  font-family: var(--bc-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bc-whisper);
  margin-top: 4px;
}

.bc-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: flex-start;
}

.bc-pie-legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--bc-font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #888;
}

.bc-pie-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bc-pie-legend__dot--delete {
  background: var(--bc-red);
}

.bc-pie-legend__dot--keep {
  background: var(--bc-grey-light);
}

/* ========================================================================
   SECTION 2 — CHART (vertical bars)
   ======================================================================== */

.bc-section-chart {
  width: 100vw;
  min-height: 100vh;
  background:
    radial-gradient(circle at 30% 20%, rgba(220, 38, 38, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(34, 197, 94, 0.03) 0%, transparent 50%),
    var(--bc-bg);
  display: flex;
  flex-direction: column;
}

.bc-chart-overlay {
  background: rgba(255, 255, 255, 0.92);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.bc-chart-container {
  width: 100%;
  margin: auto;
  padding: 80px var(--bc-pad) 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bc-chart-header {
  margin-bottom: 40px;
}

.bc-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 280px);
  overflow-x: auto;
  padding: 40px 0 30px 0;
  scrollbar-width: none;
  cursor: grab;
}

.bc-chart::-webkit-scrollbar {
  display: none;
}

.bc-chart.grabbing {
  cursor: grabbing;
}

.bc-chart__col {
  min-width: 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.bc-chart__bar {
  width: 100%;
  background: var(--bc-grey-light);
  border-radius: 6px;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.bc-chart__bar-fill {
  width: 100%;
  background: var(--bc-red);
  border-radius: 6px;
  position: relative;
}

.bc-chart__bar-active {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  animation: bc-pulse 2.5s ease-in-out infinite;
}

.bc-chart__year-label {
  margin-top: 6px;
  font-size: 10px;
  color: #555;
  font-family: var(--bc-font-mono);
}

.bc-chart-legend {
  margin-top: 25px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
  font-family: var(--bc-font-mono);
  color: var(--bc-muted);
}

.bc-chart-legend__swatch {
  width: 16px;
  height: 16px;
  display: inline-block;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}

.bc-chart-legend__swatch--total {
  background: var(--bc-grey-light);
}

.bc-chart-legend__swatch--reviewed {
  background: var(--bc-red);
}

/* ========================================================================
   SECTION 3 — VERDICTS
   ======================================================================== */

.bc-section-verdicts {
  width: 100%;
  min-height: 100vh;
  background: var(--bc-surface);
  padding: 80px var(--bc-pad);
  overflow-x: hidden;
}

.bc-verdicts-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 40px;
}

.bc-verdicts-title-block .bc-section-desc {
  margin-top: 0;
}

/* Year selector */

.bc-year-selector-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.bc-year-selector-label {
  font-family: var(--bc-font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bc-whisper);
}

.bc-year-selector {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--bc-border);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--bc-bg);
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}

.bc-year-selector::-webkit-scrollbar {
  display: none;
}

.bc-year-selector.grabbing {
  cursor: grabbing;
}

.bc-year-btn {
  background: none;
  border: none;
  padding: 8px 14px;
  font-family: var(--bc-font-mono);
  font-size: 13px;
  cursor: pointer;
  color: var(--bc-muted);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.bc-year-btn:not(:last-child) {
  border-right: 1px solid var(--bc-border);
}

.bc-year-btn:hover {
  background: #f0f0ee;
  color: var(--bc-text);
}

.bc-year-btn.active {
  background: var(--bc-red);
  color: #fff;
}

/* Stat pills */

.bc-verdicts-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.bc-stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--bc-muted);
  letter-spacing: 0.04em;
}

.bc-stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bc-stat-dot--total  { background: var(--bc-red); }
.bc-stat-dot--keep   { background: var(--bc-keep); }
.bc-stat-dot--delete { background: var(--bc-delete); }

.bc-stat-pill strong {
  color: var(--bc-text);
  font-weight: 500;
}

/* Table */

.bc-table-wrap {
  width: 100%;
  border: 1px solid var(--bc-border);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.bc-table {
  min-width: 600px;
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: var(--bc-font-mono);
}

.bc-table thead tr {
  background: var(--bc-surface-alt);
  border-bottom: 1px solid var(--bc-border);
}

.bc-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bc-faint);
  white-space: nowrap;
}

.bc-table tbody tr {
  border-bottom: 1px solid #f0f0ee;
  transition: background 0.1s;
}

.bc-table tbody tr:last-child {
  border-bottom: none;
}

.bc-table tbody tr:hover {
  background: var(--bc-bg);
}

.bc-table tbody td {
  padding: 14px 16px;
  vertical-align: top;
  color: #333;
  line-height: 1.5;
}

.bc-td-verdict {
  width: 80px;
}

.bc-td-title {
  max-width: 220px;
  font-weight: 500;
}

.bc-td-summary,
.bc-td-reason {
  max-width: 260px;
}

.bc-truncate {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #444;
  cursor: default;
}

.bc-truncate:hover {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.bc-truncated-tag {
  display: inline-block;
  font-family: var(--bc-font-mono);
  font-size: 9px;
  color: var(--bc-whisper);
  background: #f3f3ee;
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Verdict badges */

.bc-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bc-badge--keep {
  background: var(--bc-keep-bg);
  color: var(--bc-keep-text);
}

.bc-badge--delete {
  background: var(--bc-delete-bg);
  color: var(--bc-delete-text);
}

/* Empty state */

.bc-empty-state {
  padding: 60px 24px;
  text-align: center;
  color: #bbb;
  font-family: var(--bc-font-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
}

/* Pagination */

.bc-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.bc-pagination-info {
  font-size: 12px;
  color: var(--bc-whisper);
  letter-spacing: 0.04em;
}

.bc-pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bc-page-btn {
  background: none;
  border: 1px solid var(--bc-border);
  border-radius: 6px;
  padding: 6px 12px;
  font-family: var(--bc-font-mono);
  font-size: 12px;
  cursor: pointer;
  color: #555;
  transition: all 0.15s;
  min-width: 36px;
  text-align: center;
}

.bc-page-btn:hover:not(:disabled) {
  border-color: var(--bc-red);
  color: var(--bc-red);
}

.bc-page-btn.active {
  background: var(--bc-red);
  border-color: var(--bc-red);
  color: #fff;
}

.bc-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.bc-page-ellipsis {
  border: none;
  cursor: default;
  color: #ccc;
}

/* ========================================================================
   SECTION 4 — PROMPT (light theme)
   ======================================================================== */

.bc-section-prompt {
  width: 100%;
  background: var(--bc-bg);
  padding: 80px var(--bc-pad);
  border-top: 1px solid var(--bc-border);
}

.bc-prompt-header {
  margin-bottom: 40px;
}

.bc-prompt-block {
  border: 1px solid var(--bc-border);
  border-radius: 12px;
  overflow: hidden;
  max-width: 860px;
}

.bc-prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bc-surface-alt);
  border-bottom: 1px solid var(--bc-border);
}

.bc-prompt-model {
  font-family: var(--bc-font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--bc-whisper);
}

.bc-prompt-copy {
  background: none;
  border: 1px solid var(--bc-border);
  border-radius: 6px;
  padding: 4px 12px;
  font-family: var(--bc-font-mono);
  font-size: 11px;
  color: var(--bc-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.bc-prompt-copy:hover {
  border-color: var(--bc-red);
  color: var(--bc-red);
}

.bc-prompt-copy--copied {
  border-color: var(--bc-keep);
  color: var(--bc-keep);
}

.bc-prompt-body {
  margin: 0;
  padding: 24px;
  font-family: var(--bc-font-mono);
  font-size: 12px;
  line-height: 1.8;
  color: #333;
  background: var(--bc-surface);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 500px;
  overflow-y: auto;
}

/* ========================================================================
   SECTION 5 — METHODOLOGY
   ======================================================================== */

.bc-section-method {
  width: 100%;
  background: var(--bc-surface);
  padding: 80px var(--bc-pad);
  border-top: 1px solid var(--bc-border);
}

.bc-method-header {
  margin-bottom: 40px;
}

.bc-method-body {
  max-width: 720px;
  line-height: 1.8;
}

.bc-method-body p {
  margin-bottom: 1.25rem;
  font-family: var(--bc-font-mono);
  font-size: 13px;
  color: var(--bc-muted);
}

.bc-method-body strong {
  color: var(--bc-text);
  font-weight: 600;
}

.bc-method-body a {
  color: var(--bc-red);
  text-decoration: underline;
  text-decoration-color: rgba(220, 38, 38, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s;
}

.bc-method-body a:hover {
  text-decoration-color: var(--bc-red);
}

.bc-method-body ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.25rem;
}

.bc-method-body li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  font-family: var(--bc-font-mono);
  font-size: 13px;
  color: var(--bc-muted);
}

.bc-method-body li::before {
  content: "\2014";
  position: absolute;
  left: 0;
  color: var(--bc-whisper);
}

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

.bc-footer {
  padding: 3rem var(--bc-pad);
  border-top: 1px solid var(--bc-border);
  background: var(--bc-bg);
}

.bc-footer p {
  font-family: var(--bc-font-mono);
  font-size: 12px;
  color: var(--bc-whisper);
  margin: 0;
}

.bc-footer a {
  color: var(--bc-muted);
  text-decoration: none;
}

.bc-footer a:hover {
  color: var(--bc-red);
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */

@media (max-width: 768px) {
  .bc-hero__pie-wrap {
    display: none;
  }

  .bc-hero__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .bc-verdicts-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .bc-year-selector-wrap {
    align-items: flex-start;
  }

  .bc-chart {
    height: calc(100vh - 320px);
  }

  .bc-leaf { display: none; }
}

@media (max-width: 600px) {
  .bc-hero__content .bc-eyebrow {
    flex-wrap: wrap;
    white-space: normal;
  }

}

@media (max-width: 480px) {
  .bc-hero__heading {
    font-size: clamp(32px, 8vw, 48px);
  }

  .bc-hero__sub {
    margin-bottom: 48px;
  }

  .bc-verdicts-stats {
    gap: 16px;
  }

  .bc-chart__col {
    min-width: 20px;
  }
}
