/* ========================================================================
   Foundationals — v1 visual language: clean grid, big symbols,
   minimal text per card, hierarchy + legend strip on top
   ======================================================================== */

/* ── Hierarchy bar (shared by every circuit-language page) ─────────── */
.hierarchy-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  background: #050505;
  border-bottom: 1px solid #1a1a1a;
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
}
.h-step {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #888;
  padding: 4px 10px;
  border-radius: 3px;
  background: transparent;
  transition: color 0.12s, background 0.12s;
}
.h-step:hover { background: #111; color: #fff; }
.h-step .h-num {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}
.h-step .h-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  margin-top: 1px;
}
.h-step.is-current        { color: #f5d76e; }
.h-step.is-current .h-num { color: #f5d76e; }
.h-step.is-current .h-label { color: #c9a347; }
.h-step.is-current { background: #1a1408; }
.h-step.is-root .h-num    { color: #ccc; }
.h-step.is-leaf .h-num    { color: #22d3ee; }
.h-step.is-leaf:hover .h-num { color: #5fe1f0; }
.h-step.is-future {
  color: #444;
  cursor: not-allowed;
  pointer-events: none;
}
.h-step.is-future .h-num    { color: #555; }
.h-step.is-future .h-label  { color: #333; }
.h-sep {
  color: #333;
  font-size: 1.1rem;
}

/* ── Sheet hero (clean, centered, like the v1 print sheet) ─────────── */
.sheet-hero {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}
.sheet-hero h1 {
  font-size: 1.8rem;
  margin: 0 0 0.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
}
.sheet-hero .dim-subtitle {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  color: #f5d76e;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
}

/* ── Legend strip ───────────────────────────────────────────────────── */
.legend-strip {
  background: #0a0a0a;
  border-top: 1px solid #1a1a1a;
  border-bottom: 1px solid #1a1a1a;
  padding: 1rem 1rem;
  margin-bottom: 2rem;
}
.legend-strip-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: #ccc;
  line-height: 1.3;
}
.legend-item svg { flex-shrink: 0; }
.legend-item em {
  display: block;
  color: #666;
  font-style: normal;
  font-size: 0.7rem;
  margin-top: 1px;
}
.legend-caption { flex-direction: column; align-items: flex-start; gap: 1px; }
.legend-cap-label { color: #666; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.legend-cap-example {
  font-family: ui-monospace, monospace;
  background: #050505;
  border: 1px solid #1a1a1a;
  padding: 2px 8px;
  border-radius: 3px;
  color: #22d3ee;
}

/* ── Page body ──────────────────────────────────────────────────────── */
.foundationals-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
}
.sheet-section-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f5d76e;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 1rem 0 0.4rem;
}
.sheet-section-help {
  text-align: center;
  color: #888;
  font-size: 0.88rem;
  max-width: 720px;
  margin: 0 auto 1.6rem;
  line-height: 1.5;
}

/* ── The 7-card grid ────────────────────────────────────────────────── */
.seven-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 0.5rem;
}
@media (min-width: 1100px) {
  /* On wide screens, force exactly 4 across so the seven cards lay out
     as 4 + 3 (mirrors the v1 5-across sheet aesthetic but adapted to
     seven, not ten, archetypes) */
  .seven-grid { grid-template-columns: repeat(4, 1fr); }
}

.fnd-card {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 5px;
  padding: 1rem 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.fnd-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}
.fnd-card .fnd-id {
  position: absolute;
  top: 0.4rem; left: 0.55rem;
  font-family: ui-monospace, monospace;
  font-size: 0.66rem;
  color: #444;
  letter-spacing: 0.08em;
}
.fnd-card .fnd-name {
  font-family: ui-monospace, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-align: center;
  margin-bottom: 0.6rem;
  margin-top: 0.2rem;
}
.fnd-card .fnd-symbol {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #050505;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.55rem;
  position: relative;
}
.fnd-card .fnd-symbol img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.fnd-card .fnd-tagline {
  text-align: center;
  font-size: 0.78rem;
  color: #999;
  font-style: italic;
  line-height: 1.3;
  min-height: 2.6em;
}
.fnd-card .fnd-prevalence {
  margin-top: 0.45rem;
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  color: #555;
}

/* Per-archetype color accents (left border + name color) */
.fnd-card[data-name="CONCENTRATE"]  { border-left: 3px solid #ef4444; }
.fnd-card[data-name="CONCENTRATE"]  .fnd-name { color: #ef4444; }
.fnd-card[data-name="CONCENTRATE"]:hover { border-color: #ef4444; }
.fnd-card[data-name="DISTRIBUTE"]   { border-left: 3px solid #22d3ee; }
.fnd-card[data-name="DISTRIBUTE"]   .fnd-name { color: #22d3ee; }
.fnd-card[data-name="DISTRIBUTE"]:hover { border-color: #22d3ee; }
.fnd-card[data-name="RADIATE"]      { border-left: 3px solid #fbbf24; }
.fnd-card[data-name="RADIATE"]      .fnd-name { color: #fbbf24; }
.fnd-card[data-name="RADIATE"]:hover { border-color: #fbbf24; }
.fnd-card[data-name="POLARIZE"]     { border-left: 3px solid #f5d76e; }
.fnd-card[data-name="POLARIZE"]     .fnd-name { color: #f5d76e; }
.fnd-card[data-name="POLARIZE"]:hover { border-color: #f5d76e; }
.fnd-card[data-name="TRIANGULATE"]  { border-left: 3px solid #6f9; }
.fnd-card[data-name="TRIANGULATE"]  .fnd-name { color: #6f9; }
.fnd-card[data-name="TRIANGULATE"]:hover { border-color: #6f9; }
.fnd-card[data-name="CUBIFY"]       { border-left: 3px solid #6b8bff; }
.fnd-card[data-name="CUBIFY"]       .fnd-name { color: #6b8bff; }
.fnd-card[data-name="CUBIFY"]:hover { border-color: #6b8bff; }
.fnd-card[data-name="FRUSTRATE"]    { border-left: 3px solid #b5f; }
.fnd-card[data-name="FRUSTRATE"]    .fnd-name { color: #b5f; }
.fnd-card[data-name="FRUSTRATE"]:hover { border-color: #b5f; }

/* ── Mix explainer ──────────────────────────────────────────────────── */
.mix-explainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.mix-fact {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-left: 3px solid #22d3ee;
  border-radius: 4px;
  padding: 0.9rem 1.1rem;
}
.mix-fact .mix-num {
  font-family: ui-monospace, monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: #22d3ee;
  margin-bottom: 0.3rem;
}
.mix-fact .mix-text {
  color: #bbb;
  font-size: 0.86rem;
  line-height: 1.5;
}
.mix-fact .mix-text b { color: #ddd; }

/* ── Drawer for foundational detail ─────────────────────────────────── */
.arch-drawer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}
.arch-drawer[hidden] { display: none; }
.arch-drawer-inner {
  background: #0a0a0a;
  border: 1px solid #222;
  border-radius: 6px;
  width: min(900px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem 2rem 2rem;
  position: relative;
}
.arch-drawer-close {
  position: absolute;
  top: 0.4rem; right: 0.7rem;
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 1.7rem;
  cursor: pointer;
  line-height: 1;
}
.arch-drawer-close:hover { color: #fff; }

.drawer-h1 {
  font-family: ui-monospace, monospace;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  margin: 0 0 0.3rem;
}
.drawer-long {
  font-size: 1.0rem;
  color: #ccc;
  margin: 0 0 0.8rem;
}
.drawer-desc {
  color: #bbb;
  line-height: 1.6;
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}
.drawer-section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: #888;
  margin: 1.2rem 0 0.5rem;
}
.drawer-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.drawer-features .chip {
  background: #1a1a1a;
  font-family: ui-monospace, monospace;
  font-size: 0.74rem;
  padding: 3px 8px;
  border-radius: 3px;
  color: #ccc;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.drawer-features .bar {
  display: inline-block;
  width: 50px; height: 4px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
}
.drawer-features .bar i {
  display: block; height: 100%;
  background: #f5d76e;
}
.drawer-purest {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
}
.drawer-purest a {
  text-decoration: none;
  background: #050505;
  border: 1px solid #1a1a1a;
  border-radius: 3px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  color: #ccc;
  transition: border-color 0.12s;
}
.drawer-purest a:hover { border-color: #f5d76e; color: #fff; }
.drawer-purest a img {
  width: 100%; aspect-ratio: 1/1; object-fit: contain;
  background: #050505; border: 1px solid #1a1a1a; border-radius: 2px;
}
.drawer-purest a span.purity {
  color: #f5d76e;
  font-weight: 600;
}
