/* Betsy — 2009 BMW 335d E90 build site
   Dark automotive: matte black / charcoal / steel */

:root {
  --bg: #0c0d0f;
  --bg-elevated: #141619;
  --bg-card: #1a1c20;
  --bg-card-hover: #22252b;
  --border: #2a2e35;
  --border-subtle: #1e2126;
  --text: #e8eaed;
  --text-muted: #9aa0a8;
  --text-dim: #6b7280;
  --accent: #c4ccd6;
  --steel: #8b95a3;
  --steel-bright: #b8c0cc;
  --danger: #c45c5c;
  --warn: #c9a227;
  --ok: #5a9a6e;
  --info: #5b8ab5;
  --paused: #9a7b4f;
  --hold: #b87a3a;
  --radius: 10px;
  --nav-h: 56px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "Consolas", "Liberation Mono", monospace;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--steel-bright);
  text-decoration: none;
}
a:hover {
  color: #fff;
}

img {
  max-width: 100%;
  display: block;
}

/* —— Nav —— */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(12, 13, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-brand {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-brand span {
  color: var(--steel);
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 0.15rem;
  list-style: none;
  margin-left: auto;
}

.nav-links a {
  display: block;
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-radius: 6px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover,
.nav-links a:focus {
  color: var(--text);
  background: var(--bg-card);
}

/* —— Layout —— */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
section:last-of-type {
  border-bottom: none;
}

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

h1, h2, h3 {
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  margin-bottom: 1.25rem;
  color: var(--text);
}

h3 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  color: var(--steel-bright);
}

.lede {
  color: var(--text-muted);
  max-width: 42rem;
  margin-bottom: 1.5rem;
  font-size: 0.98rem;
}

/* —— Hero —— */
.hero {
  padding-top: 2.75rem;
  padding-bottom: 3rem;
}

.hero-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.hero-title {
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--steel-bright);
  margin-bottom: 0.5rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-bottom: 1.75rem;
}

.badge-stage {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--bg-card);
}

.vin {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .photo-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.photo-panel {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(145deg, #1a1c20 0%, #121418 55%, #0e1012 100%);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.photo-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 12px,
      rgba(255, 255, 255, 0.015) 12px,
      rgba(255, 255, 255, 0.015) 24px
    );
  pointer-events: none;
}

.photo-panel .panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  position: relative;
}

.photo-panel .panel-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  position: relative;
  max-width: 16rem;
}

/* —— Vision —— */
.vision-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow);
}

.vision-card p {
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
}
.vision-card p:last-child {
  margin-bottom: 0;
}

.vision-card strong {
  color: var(--text);
  font-weight: 600;
}

/* —— Cards grid —— */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }
}

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  transition: border-color 0.15s, background 0.15s;
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: #3a404a;
}

.card-name {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.45rem;
  align-items: center;
}

.card-notes {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.card-amount {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--steel-bright);
}

/* —— Status badges —— */
.badge {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-installed {
  background: rgba(90, 154, 110, 0.15);
  color: #7dba90;
  border-color: rgba(90, 154, 110, 0.35);
}
.badge-at_shop {
  background: rgba(91, 138, 181, 0.15);
  color: #7eacd4;
  border-color: rgba(91, 138, 181, 0.35);
}
.badge-ordered {
  background: rgba(139, 149, 163, 0.15);
  color: var(--steel-bright);
  border-color: rgba(139, 149, 163, 0.35);
}
.badge-in_transit {
  background: rgba(91, 138, 181, 0.18);
  color: #8eb8dc;
  border-color: rgba(91, 138, 181, 0.4);
}
.badge-on_hold {
  background: rgba(184, 122, 58, 0.15);
  color: #d4a066;
  border-color: rgba(184, 122, 58, 0.4);
}
.badge-paused {
  background: rgba(154, 123, 79, 0.15);
  color: #c4a576;
  border-color: rgba(154, 123, 79, 0.4);
}
.badge-cancelled {
  background: rgba(196, 92, 92, 0.12);
  color: #d48888;
  border-color: rgba(196, 92, 92, 0.35);
}
.badge-quote {
  background: rgba(201, 162, 39, 0.12);
  color: #d4b84a;
  border-color: rgba(201, 162, 39, 0.35);
}
.badge-needs_confirm {
  background: rgba(201, 162, 39, 0.14);
  color: #e0c45c;
  border-color: rgba(201, 162, 39, 0.4);
}

/* —— Subsection —— */
.subsection {
  margin-top: 2rem;
}

.subsection h3 {
  margin-bottom: 0.35rem;
}

.confirm-callout {
  background: rgba(201, 162, 39, 0.06);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}
.confirm-callout p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* —— Tables —— */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  -webkit-overflow-scrolling: touch;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 640px;
}

table.data-table th,
table.data-table td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

table.data-table th {
  background: var(--bg-elevated);
  color: var(--steel);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 650;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
table.data-table th:hover {
  color: var(--text);
}
table.data-table th .sort-ind {
  opacity: 0.45;
  margin-left: 0.25rem;
  font-size: 0.65rem;
}

table.data-table tbody tr:last-child td {
  border-bottom: none;
}
table.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

table.data-table .num {
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: nowrap;
}

.spend-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  margin-top: 1.15rem;
  padding: 1rem 1.15rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.spend-stat .label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}
.spend-stat .value {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--steel-bright);
  font-weight: 600;
}

.disclaimer {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
}

/* —— Status / issues —— */
.issue-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.issue-list li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: flex-start;
}

.issue-list .issue-text {
  color: var(--text-muted);
  flex: 1;
  min-width: 12rem;
}

.direction-box {
  margin-top: 1.5rem;
  padding: 1.25rem 1.35rem;
  background: var(--bg-elevated);
  border-left: 3px solid var(--steel);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.direction-box p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}
.direction-box p:last-child {
  margin-bottom: 0;
}

/* —— Shop —— */
.shop-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  max-width: 32rem;
}
.shop-card h3 {
  margin-bottom: 0.5rem;
}
.shop-card address {
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}
.shop-card .shop-note {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* —— Research empty —— */
.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--bg-elevated);
}
.empty-state p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.empty-state .fake-link {
  color: var(--steel);
  font-size: 0.85rem;
  opacity: 0.7;
  pointer-events: none;
}

/* —— Footer —— */
.site-footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* —— Loading / error —— */
.loading,
.error-msg {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.error-msg {
  color: var(--danger);
}

/* —— Misc —— */
.muted {
  color: var(--text-muted);
}
.count-pill {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-weight: 500;
  vertical-align: middle;
}
