/* components: nav, hero, pills, cards, tables, panels, close */

/* nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem var(--sp-4);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  transition: transform var(--t-med) var(--ease);
}
.nav__brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fg);
  font-size: 1rem;
}
.nav__brand .dot { color: var(--accent); }
.nav__links { display: flex; gap: var(--sp-3); align-items: center; }
.nav__links a {
  font-size: var(--fs-micro);
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-soft);
}
.nav__links a:hover { color: var(--accent); text-decoration: none; }
.theme-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-soft);
  width: 2rem; height: 2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 700px) {
  .nav__links a { display: none; }
}

/* hero */
.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 7rem var(--sp-4) var(--sp-5);
}
.hero h1 { max-width: 17ch; }
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero .lead { margin-top: var(--sp-3); max-width: 52ch; }
.hero__glow {
  position: absolute;
  width: 640px; height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 65%);
  top: -140px; right: -180px;
  pointer-events: none;
}

/* proof pills */
.pills { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.pill {
  border: 1px solid var(--pill-border);
  background: var(--pill-bg);
  color: var(--pill-fg);
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  font-size: var(--fs-small);
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  white-space: nowrap;
}
.pill b { font-family: var(--font-mono); font-size: 1.02rem; color: var(--fg); }

/* stat cards */
.stat-card {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: var(--sp-3);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
}
.stat-card .stat-v {
  font-family: var(--font-mono);
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  font-weight: 600;
  color: var(--fg);
  line-height: 1.1;
  display: block;
}
.stat-card .stat-l { font-size: var(--fs-small); color: var(--fg-soft); margin-top: var(--sp-1); display: block; }
.stat-card .stat-src { font-size: var(--fs-micro); font-family: var(--font-mono); color: var(--fg-mute); margin-top: var(--sp-2); display: block; }

/* cost cards (problem section) */
.cost-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: var(--sp-3);
  background: var(--bg-soft);
}
.cost-card h3 { font-size: 1rem; color: var(--fg); display: flex; gap: 0.5rem; align-items: center; }
.cost-card h3 .idx { color: var(--accent); font-family: var(--font-mono); font-size: var(--fs-micro); }
.cost-card p { font-size: var(--fs-small); margin-top: var(--sp-1); }

/* comparison table wrap */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  overflow: auto hidden;
  background: var(--bg-raise);
  box-shadow: var(--shadow);
}
.table-wrap table { font-size: var(--fs-small); }
.table-wrap thead { background: var(--bg-sunken); }
.table-wrap td:first-child { color: var(--fg); font-weight: 500; }
td .yes { color: var(--ok); font-family: var(--font-mono); }
td .no { color: var(--fg-mute); font-family: var(--font-mono); }

/* hard questions panel */
.hardq { display: grid; gap: var(--sp-2); }
.hardq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--bg-raise);
  overflow: hidden;
}
.hardq summary {
  cursor: pointer;
  list-style: none;
  padding: var(--sp-3);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--fg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
}
.hardq summary::-webkit-details-marker { display: none; }
.hardq summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.2rem;
  transition: transform var(--t-fast) var(--ease);
}
.hardq details[open] summary::after { transform: rotate(45deg); }
.hardq .hardq__a { padding: 0 var(--sp-3) var(--sp-3); }
.hardq .hardq__a p { font-size: var(--fs-small); }

/* pipeline stages */
.pipeline { display: grid; gap: var(--sp-2); counter-reset: stage; }
.stage {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: var(--sp-3);
  background: var(--bg-raise);
  position: relative;
}
.stage__n {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.4rem;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--border-soft);
}
.stage h3 { font-size: 1.05rem; }
.stage p { font-size: var(--fs-small); margin-top: 0.3rem; }

/* provenance */
.provenance {
  border-left: 2px solid var(--accent);
  padding-left: var(--sp-3);
  max-width: var(--maxw-prose);
}

/* fit / archetype cards */
.fit-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: var(--sp-3);
  background: var(--bg-soft);
}
.fit-card h3 { font-size: 1rem; color: var(--fg); }
.fit-card p { font-size: var(--fs-small); margin-top: var(--sp-1); }

/* close */
.close-sec {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
}
.close-sec h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); max-width: 20ch; }
.close-sec h2 em { font-style: normal; color: var(--accent); }

/* appendix link row */
.appendix-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 0.65rem 1.1rem;
  margin-top: var(--sp-3);
  color: var(--fg-soft);
}
.appendix-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* footnote row */
.basis-note {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--fg-mute);
  border-top: 1px solid var(--border-soft);
  padding-top: var(--sp-2);
  margin-top: var(--sp-4);
  max-width: none;
}

/* proof.html specifics */
.proof-header { padding-top: 7rem; }
.proof-block { margin-top: var(--sp-5); }
.cite-list { font-size: var(--fs-small); }
.cite-list li { margin-bottom: 0.7rem; }
.cite-list .venue { color: var(--fg); font-weight: 500; }
.cite-list .tag {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
  color: var(--fg-mute);
  margin-left: 0.4rem;
}
.tag--indexed { color: var(--ok); border-color: var(--ok); }
