/* Dark theme (default) — matches isaiprofitable.com */
:root,
html.dark {
  --bg: #18181b;
  --text: #ffffff;
  --sub: #9ca3af;
  --border: #52525b;
  --border-inner: #3f3f46;
  --panel: #18181b;
  --track: #3f3f46;
  --spend: #e8533a;
  --revenue: #4ade80;
  --accent: #e8533a;
  --btn-border: #71717a;
  --btn-text: #9ca3af;
  --btn-hover-border: #d4d4d8;
  color-scheme: dark;
}

html.light {
  --bg: #fafafa;
  --text: #111827;
  --sub: #6b7280;
  --border: #e5e7eb;
  --border-inner: #e5e7eb;
  --panel: #f9fafb;
  --track: #f3f4f6;
  --spend: #e8533a;
  --revenue: #15803d;
  --accent: #e8533a;
  --btn-border: #d1d5db;
  --btn-text: #6b7280;
  --btn-hover-border: #111827;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.accent {
  color: var(--accent);
}

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2rem 1rem 1.5rem;
}

@media (min-width: 1024px) {
  .hero {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    padding: 2.5rem 1.5rem 2rem;
  }
}

.hero-left,
.hero-right {
  max-width: 32rem;
}

.hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
}

@media (min-width: 1024px) {
  .hero-right {
    align-items: flex-end;
    text-align: right;
  }
}

.hero-title {
  margin: 0;
  font-size: clamp(48px, 12vw, 80px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-answer {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(120px, 22vw, 200px);
  line-height: 0.92;
  color: var(--accent);
}

.hero-sub {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sub);
}

@media (min-width: 640px) {
  .hero-sub {
    font-size: 1.125rem;
  }
}

/* Stats row */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-card {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-inner);
}

@media (min-width: 768px) {
  .stat-card {
    border-bottom: none;
    border-right: 1px solid var(--border-inner);
  }

  .stat-card:last-child {
    border-right: none;
  }
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.stat-value-good {
  color: var(--revenue);
}

.stat-value-bad {
  color: var(--accent);
}

.stat-label {
  margin-top: 0.25rem;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sub);
}

@media (min-width: 640px) {
  .stat-label {
    font-size: 0.75rem;
  }
}

/* Panels */
.panel {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border-inner);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--sub);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 1px;
}

.swatch-pledge {
  background: var(--spend);
}

.swatch-actual {
  background: var(--revenue);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sort-label {
  font-size: 0.75rem;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sort-select,
.btn {
  font: inherit;
  font-size: 0.75rem;
  border: 1px solid var(--btn-border);
  background: var(--bg);
  color: var(--btn-text);
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

.sort-select option {
  background: #27272a;
  color: #ffffff;
}

.sort-select:hover,
.btn:hover {
  color: var(--text);
  border-color: var(--btn-hover-border);
}

/* Event table */
.table-head,
.event-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) 6.5rem;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1.5rem;
}

.table-head {
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sub);
  border-bottom: 1px solid var(--border);
}

.event-row {
  border-bottom: 1px solid var(--border-inner);
}

.event-row:last-child {
  border-bottom: none;
}

.event-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.event-sub {
  margin-top: 0.2rem;
  font-size: 0.65rem;
  color: var(--sub);
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.bar-line {
  display: grid;
  grid-template-columns: 3.5rem 1fr 3.5rem;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.65rem;
  color: var(--sub);
}

.bar-track {
  height: 0.55rem;
  background: var(--track);
  border-radius: 1px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 1px;
  transition: width 0.4s ease;
}

.bar-fill-pledge {
  background: var(--spend);
}

.bar-fill-actual {
  background: var(--revenue);
}

.bar-hours {
  text-align: right;
  font-size: 0.7rem;
  color: var(--sub);
}

.bar-hours-pledge {
  color: var(--spend);
}

.bar-hours-actual {
  color: var(--revenue);
}

.ghost-rate {
  text-align: right;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.ghost-rate.ok {
  color: var(--revenue);
}

/* Sections */
.section-title {
  margin: 0;
  padding: 1rem 1.5rem 0;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sub);
}

.timeline-list {
  padding: 1rem 1.5rem 1.25rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-inner);
}

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

.timeline-date {
  font-size: 0.7rem;
  color: var(--sub);
}

.timeline-body strong {
  color: var(--text);
}

.timeline-body p {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--sub);
  line-height: 1.5;
}

.chart-wrap {
  padding: 1rem 1.5rem 1.5rem;
}

/* Footer */
.footer {
  padding: 2rem 1.5rem 2.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer h3 {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sub);
}

.footer p,
.footer li {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--sub);
}

.footer strong {
  color: var(--text);
}

.footer ul {
  margin: 0;
  padding-left: 1.1rem;
}

.footer-note {
  margin-top: 1.5rem;
  font-size: 0.7rem;
  color: var(--sub);
  letter-spacing: 0.05em;
}