/* ─── Tiderace Brand Colors ─────────────────────────────────────────────────── */
:root {
  --tiderace-rust:        #C75B39;
  --tiderace-rust-dark:   #9E3D20;
  --tiderace-rust-light:  #E07A58;
  --tiderace-rust-glow:   #C75B3922;
  --tiderace-black:       #0D0D0D;
  --tiderace-surface:     #141414;
  --tiderace-surface-2:   #1E1E1E;
  --tiderace-surface-3:   #262626;
  --tiderace-border:      #2E2E2E;
  --tiderace-white:       #F5F5F5;
  --tiderace-muted:       #888888;
}

/* ─── Override Material Theme ──────────────────────────────────────────────── */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color:          var(--tiderace-rust);
  --md-primary-fg-color--light:   var(--tiderace-rust-light);
  --md-primary-fg-color--dark:    var(--tiderace-rust-dark);
  --md-primary-bg-color:          var(--tiderace-white);
  --md-accent-fg-color:           var(--tiderace-rust-light);
  --md-default-bg-color:          var(--tiderace-black);
  --md-default-fg-color:          var(--tiderace-white);
  --md-default-fg-color--light:   #CCCCCC;
  --md-default-fg-color--lighter: var(--tiderace-muted);
  --md-code-bg-color:             var(--tiderace-surface);
  --md-code-fg-color:             #E0E0E0;
  --md-typeset-a-color:           var(--tiderace-rust-light);
}

/* ─── Header ───────────────────────────────────────────────────────────────── */
.md-header {
  background: var(--tiderace-black) !important;
  border-bottom: 1px solid var(--tiderace-border);
  box-shadow: 0 1px 20px rgba(199, 91, 57, 0.1);
}

.md-header__title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.md-logo {
  filter: brightness(1.1);
}

/* ─── Navigation ───────────────────────────────────────────────────────────── */
.md-nav__title {
  color: var(--tiderace-rust) !important;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.md-nav__link--active {
  color: var(--tiderace-rust-light) !important;
  font-weight: 600;
}

.md-nav__link:hover {
  color: var(--tiderace-rust-light) !important;
}

.md-sidebar {
  background: var(--tiderace-surface) !important;
}

/* ─── Tabs ─────────────────────────────────────────────────────────────────── */
.md-tabs {
  background: var(--tiderace-surface) !important;
  border-bottom: 1px solid var(--tiderace-border);
}

.md-tabs__link--active {
  border-bottom: 2px solid var(--tiderace-rust) !important;
  color: var(--tiderace-rust-light) !important;
}

/* ─── Code Blocks ──────────────────────────────────────────────────────────── */
.highlight {
  background: var(--tiderace-surface) !important;
  border: 1px solid var(--tiderace-border);
  border-radius: 6px;
}

.highlight pre {
  background: var(--tiderace-surface) !important;
}

code {
  background: var(--tiderace-surface-2) !important;
  color: var(--tiderace-rust-light) !important;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.85em;
}

pre code {
  color: #E0E0E0 !important;
  background: transparent !important;
  padding: 0;
}

/* ─── Admonitions ──────────────────────────────────────────────────────────── */
.md-typeset .admonition,
.md-typeset details {
  border-left: 4px solid var(--tiderace-rust) !important;
  background: var(--tiderace-surface) !important;
}

.md-typeset .admonition-title,
.md-typeset summary {
  background: var(--tiderace-rust-glow) !important;
  color: var(--tiderace-rust-light) !important;
}

/* ─── Tables ───────────────────────────────────────────────────────────────── */
.md-typeset table:not([class]) {
  border: 1px solid var(--tiderace-border);
  border-radius: 6px;
  overflow: hidden;
}

.md-typeset table:not([class]) th {
  background: var(--tiderace-surface-2) !important;
  color: var(--tiderace-rust-light) !important;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.md-typeset table:not([class]) tr:hover {
  background: var(--tiderace-surface-2) !important;
}

/* ─── Hero Section (homepage) ──────────────────────────────────────────────── */
.tiderace-hero {
  background: linear-gradient(135deg, var(--tiderace-black) 0%, var(--tiderace-surface-2) 100%);
  border: 1px solid var(--tiderace-border);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.tiderace-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, var(--tiderace-rust-glow) 0%, transparent 60%);
  pointer-events: none;
}

.tiderace-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--tiderace-white) !important;
  margin: 0 0 0.5rem;
  line-height: 1.1;
  border: none !important;
}

.tiderace-hero h1 span {
  color: var(--tiderace-rust) !important;
}

.tiderace-hero .tagline {
  font-size: 1.2rem;
  color: var(--tiderace-muted);
  margin: 0 0 2rem;
}

.tiderace-hero .badges {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.tiderace-hero .badge {
  background: var(--tiderace-surface-3);
  border: 1px solid var(--tiderace-border);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--tiderace-rust-light);
}

.tiderace-hero .cta {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tiderace-hero .btn-primary {
  background: var(--tiderace-rust);
  color: white;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s, transform 0.1s;
  display: inline-block;
}

.tiderace-hero .btn-primary:hover {
  background: var(--tiderace-rust-light);
  transform: translateY(-1px);
}

.tiderace-hero .btn-secondary {
  background: transparent;
  color: var(--tiderace-white);
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid var(--tiderace-border);
  text-decoration: none !important;
  transition: border-color 0.2s;
  display: inline-block;
}

.tiderace-hero .btn-secondary:hover {
  border-color: var(--tiderace-rust);
  color: var(--tiderace-rust-light);
}

/* ─── Feature Grid ─────────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.feature-card {
  background: var(--tiderace-surface);
  border: 1px solid var(--tiderace-border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.1s;
}

.feature-card:hover {
  border-color: var(--tiderace-rust);
  transform: translateY(-2px);
}

.feature-card .icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  color: var(--tiderace-white) !important;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  border: none !important;
}

.feature-card p {
  color: var(--tiderace-muted);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

/* ─── Benchmark Bar ────────────────────────────────────────────────────────── */
.bench-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.bench-label {
  width: 120px;
  color: var(--tiderace-muted);
  text-align: right;
  flex-shrink: 0;
}

.bench-bar-wrap {
  flex: 1;
  background: var(--tiderace-surface-2);
  border-radius: 3px;
  height: 20px;
  overflow: hidden;
}

.bench-bar {
  height: 100%;
  border-radius: 3px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  transition: width 0.8s ease;
}

.bench-bar.tiderace { background: var(--tiderace-rust); color: white; }
.bench-bar.pytest  { background: var(--tiderace-surface-3); color: var(--tiderace-muted); }

/* ─── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--tiderace-surface); }
::-webkit-scrollbar-thumb { background: var(--tiderace-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--tiderace-rust); }

/* ─── Footer ───────────────────────────────────────────────────────────────── */
.md-footer {
  background: var(--tiderace-surface) !important;
  border-top: 1px solid var(--tiderace-border);
}
