/* ============ The Living Test Suite — davidguevara.dev v2 ============ */

@font-face {
  font-family: "Fira Code";
  src: url("../fonts/FiraCode-VF.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #101216;
  --bg-raised: #171A21;
  --line: #262B35;
  --fg: #E8E3D8;
  --muted: #7A828E;
  --pass: #6BD98E;
  --pend: #E3B341;
  --fail: #F47067;
  --cmd: #56D4DD;
  --mono: "Fira Code", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--mono);
}

a {
  color: var(--cmd);
}

:focus-visible {
  outline: 2px solid var(--cmd);
  outline-offset: 3px;
  border-radius: 2px;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- status bar ---------- */

.statusbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  background: color-mix(in srgb, var(--bg-raised) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

.statusbar-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.statusbar-run {
  display: flex;
  align-items: center;
  gap: 10px;
}

.statusbar-host {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.statusbar-count {
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: color 0.4s;
}

.statusbar-count.all-pass {
  color: var(--pass);
}

/* ---------- badges ---------- */

.badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 3px;
  transition: background 0.3s, color 0.3s;
}

.badge-run {
  background: color-mix(in srgb, var(--pend) 18%, transparent);
  color: var(--pend);
}

.badge-pass {
  background: color-mix(in srgb, var(--pass) 18%, transparent);
  color: var(--pass);
}

/* ---------- hero ---------- */

.hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 88px;
  padding-bottom: 48px;
}

.boot {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 36px;
}

.boot-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  opacity: 0;
  animation: boot-in 0.05s forwards;
}

.boot-line:nth-child(1) { animation-delay: 0.15s; }
.boot-line:nth-child(2) { animation-delay: 0.7s; }

.prompt {
  color: var(--cmd);
}

@keyframes boot-in {
  to { opacity: 1; }
}

.thesis {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(2rem, 6.5vw, 4.4rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  display: flex;
  flex-direction: column;
  gap: 0.1em;
}

.thesis-line {
  opacity: 0;
  transform: translateY(14px);
  animation: rise-in 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

.thesis-line:nth-child(1) { animation-delay: 1.1s; }
.thesis-line:nth-child(2) { animation-delay: 1.35s; }

.thesis em {
  font-style: normal;
}

.thesis .ship { color: var(--pass); }
.thesis .break { color: var(--pend); }

@keyframes rise-in {
  to {
    opacity: 1;
    transform: none;
  }
}

.subline {
  color: var(--muted);
  max-width: 620px;
  margin-top: 28px;
  opacity: 0;
  animation: rise-in 0.5s 1.6s forwards;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
  opacity: 0;
  animation: rise-in 0.5s 1.75s forwards;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--cmd);
  text-decoration: none;
  padding: 10px 18px;
  border: 1px solid color-mix(in srgb, var(--cmd) 45%, transparent);
  border-radius: 5px;
  transition: background 0.2s, border-color 0.2s;
}

.btn::before { content: "[ "; color: var(--muted); }
.btn::after { content: " ]"; color: var(--muted); }

.btn:hover {
  background: color-mix(in srgb, var(--cmd) 10%, transparent);
  border-color: var(--cmd);
}

.btn-solid {
  background: var(--cmd);
  color: var(--bg);
  border-color: var(--cmd);
}

.btn-solid::before,
.btn-solid::after {
  color: color-mix(in srgb, var(--bg) 55%, transparent);
}

.btn-solid:hover {
  background: color-mix(in srgb, var(--cmd) 85%, white);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.8rem;
}

/* ---------- spec sections ---------- */

.spec {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}

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

.spec-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
}

.spec-name::before {
  content: "▸ ";
  color: var(--muted);
}

.describe {
  font-size: 0.88rem;
  color: var(--cmd);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.describe-meta {
  font-size: 0.76rem;
  color: var(--muted);
}

.describe-block {
  margin-bottom: 40px;
}

.describe-block:last-child {
  margin-bottom: 0;
}

/* ---------- assertions ---------- */

.assertions {
  list-style: none;
}

.assertion {
  display: flex;
  gap: 14px;
  padding: 7px 0;
  color: var(--muted);
  transition: color 0.45s;
}

.assertion.passed {
  color: var(--fg);
}

.tick {
  flex-shrink: 0;
  width: 1.1em;
  font-family: var(--mono);
  line-height: 1.65;
}

.tick::before {
  content: "○";
  color: var(--muted);
}

.assertion.passed .tick::before {
  content: "✓";
  color: var(--pass);
  display: inline-block;
  animation: tick-pop 0.18s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes tick-pop {
  from { transform: scale(0.4); }
  to { transform: scale(1); }
}

.assertion-text {
  font-size: 0.98rem;
}

/* ---------- project cards ---------- */

.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.project-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  transition: border-color 0.45s, color 0.45s;
}

.project-card.passed {
  border-color: color-mix(in srgb, var(--pass) 30%, var(--line));
}

.project-status {
  display: flex;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.project-card.passed .project-status {
  color: var(--pass);
}

.project-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.project-desc {
  font-size: 0.92rem;
  color: var(--muted);
  flex-grow: 1;
}

.project-card.passed .project-desc {
  color: color-mix(in srgb, var(--fg) 78%, var(--muted));
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.68rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 7px;
}

/* ---------- coverage ---------- */

.coverage {
  display: flex;
  flex-direction: column;
}

.coverage-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

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

.coverage dt {
  font-size: 0.85rem;
  color: var(--cmd);
}

.coverage dd {
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---------- fail block + summary ---------- */

.fail-block {
  background: color-mix(in srgb, var(--fail) 7%, var(--bg-raised));
  border: 1px solid color-mix(in srgb, var(--fail) 30%, var(--line));
  border-radius: 8px;
  padding: 20px 24px;
  font-size: 0.88rem;
  margin-bottom: 28px;
}

.fail-line {
  color: var(--fail);
  font-weight: 600;
  margin-bottom: 8px;
}

.cross {
  margin-right: 6px;
}

.fail-detail {
  color: var(--muted);
  padding-left: 26px;
}

.summary {
  font-size: 0.92rem;
  padding: 20px 0;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.summary-label {
  display: inline-block;
  width: 70px;
  color: var(--muted);
}

#summary-passed {
  color: var(--pass);
  font-weight: 600;
}

.known-issue {
  color: var(--fail);
}

/* ---------- contact ---------- */

.contact-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.contact-text {
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 28px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 32px 24px 48px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- responsive ---------- */

@media (max-width: 560px) {
  body {
    font-size: 1rem;
  }

  .statusbar-host {
    display: none;
  }

  .spec {
    padding: 56px 0;
  }

  .coverage-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .boot-line,
  .thesis-line,
  .subline,
  .hero-ctas {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .assertion,
  .project-card,
  .badge,
  .statusbar-count {
    transition: none;
  }

  .assertion.passed .tick::before {
    animation: none;
  }
}
