/* ============================================================
   CRUMB — buildcrumb.com
   Dark fantasy. Ember on void. The room that knows you.
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --void:         #080610;
  --deep:         #0C0814;
  --surface:      #131020;
  --surface-hot:  #1C1830;
  --border:       #2E2248;
  --border-hot:   #5A3A8A;
  --ember:        #E07B54;
  --ember-glow:   #F4956A;
  --ember-dim:    #A0522D;
  --ember-hot:    #C84010;
  --teal:         #3D7A8A;
  --gold:         #FFD83C;
  --nav-builds:       #FF7B2C;
  --nav-discover:     #00CED1;
  --nav-constitution: #4169E1;
  --nav-getstarted:   #00E676;
  --nav-grimoire:     #9B30FF;
  --nav-recent:       #FFC23C;
  --cream:        #EBE1D2;
  --muted:        #6E6258;
  --softgray:     #C8C2D4;
  --purple:       #7846B4;
  --lavender:     #AF87DC;
  --moon:         #B4AEDC;
  --green:        #50C878;
  --red:          #C84040;
  --radius:       8px;
  --radius-lg:    14px;
  --transition:   0.18s ease;
  --font-display: 'Cinzel Decorative', serif;
  --font-heading: 'Cinzel', serif;
  --font-body:    'Inter', sans-serif;
  --max-w:        1200px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background:  var(--deep);
  color:       var(--cream);
  font-family: var(--font-body);
  font-size:   16px;
  line-height: 1.6;
  min-height:  100vh;
  overflow-x:  hidden;
}
a { color: inherit; text-decoration: none; }
input, textarea, select, button { font-family: inherit; }

/* ── Particle canvas ────────────────────────────────────────── */
#particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

/* ── Utility ────────────────────────────────────────────────── */
.gold { color: var(--ember); }
.section-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }
.section-label {
  font-family: var(--font-heading);
  font-size:   0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--ember-dim);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.section-title {
  font-family: var(--font-heading);
  font-size:   2.2rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 2.5rem;
  line-height: 1.2;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display:       inline-flex;
  align-items:   center;
  gap:           0.4rem;
  padding:       0.65rem 1.4rem;
  border-radius: var(--radius);
  font-family:   var(--font-heading);
  font-size:     0.85rem;
  font-weight:   600;
  letter-spacing: 0.04em;
  cursor:        pointer;
  border:        1px solid transparent;
  transition:    all var(--transition);
  white-space:   nowrap;
}
.btn-ember {
  background:   var(--ember);
  color:        #0A0810;
  border-color: var(--ember);
}
.btn-ember:hover {
  background:   var(--ember-glow);
  border-color: var(--ember-glow);
  box-shadow:   0 0 20px rgba(224,123,84,0.3);
}
.btn-outline {
  background:   transparent;
  color:        var(--ember);
  border-color: var(--ember-dim);
}
.btn-outline:hover {
  border-color: var(--ember);
  box-shadow:   0 0 12px rgba(224,123,84,0.15);
}
.btn-ghost {
  background:   transparent;
  color:        var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--cream); border-color: var(--border-hot); }
.btn-sm  { padding: 0.45rem 0.9rem; font-size: 0.78rem; }
.btn-lg  { padding: 0.85rem 2rem;   font-size: 0.95rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position:    relative;
  z-index:     100;
  display:     flex;
  align-items: center;
  justify-content: space-between;
  padding:     0 2rem;
  height:      64px;
  border-bottom: 1px solid var(--border);
  background:  rgba(8,6,16,0.85);
  backdrop-filter: blur(12px);
}
.nav-logo {
  display:     flex;
  align-items: center;
  gap:         0.6rem;
}
.logo-glyph {
  font-size:   1.6rem;
  color:       var(--ember);
  line-height: 1;
  filter:      drop-shadow(0 0 8px rgba(224,123,84,0.5));
}
.logo-glyph.large { font-size: 3rem; }
.logo-glyph.small { font-size: 1rem; }
.logo-text {
  font-family:    var(--font-display);
  font-size:      1.1rem;
  color:          var(--ember);
  letter-spacing: 0.12em;
}
.nav-links { display: flex; gap: 2rem; }
/* Mobile hamburger (CSS-only checkbox hack) — hidden on desktop; shown ≤768px below. */
.nav-toggle { display: none; }
.nav-burger { display: none; }
.nav-link {
  font-family:     var(--font-heading);
  font-size:       0.82rem;
  font-weight:     600;
  color:           var(--muted);
  letter-spacing:  0.06em;
  position:        relative;
  z-index:         1;
  text-decoration: none;
  transition:      color 0.3s ease, text-shadow 0.3s ease;
}
/* Each nav item has a signature colour — invisible at rest, revealed on hover. */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  transition: width 0.3s ease, background-color 0.3s ease;
}
.nav-link[data-nav="builds"]:hover {
  color: var(--nav-builds);
  text-shadow: 0 0 20px #FF7B2C80;
}
.nav-link[data-nav="builds"]:hover::after {
  width: 100%; background: var(--nav-builds); box-shadow: 0 0 12px #FF7B2C;
}
.nav-link[data-nav="discover"]:hover {
  color: var(--nav-discover);
  text-shadow: 0 0 20px #00CED180;
}
.nav-link[data-nav="discover"]:hover::after {
  width: 100%; background: var(--nav-discover); box-shadow: 0 0 12px #00CED1;
}
/* Shop — takes Discover's nav slot; brand ember accent, mirroring the nav pattern. */
.nav-link[data-nav="shop"]:hover {
  color: var(--ember);
  text-shadow: 0 0 20px #E07B5480;
}
.nav-link[data-nav="shop"]:hover::after {
  width: 100%; background: var(--ember); box-shadow: 0 0 12px #E07B54;
}
.nav-active-shop { color: var(--ember) !important; animation: none; }
.nav-link[data-nav="constitution"]:hover {
  color: var(--nav-constitution);
  text-shadow: 0 0 20px #4169E180;
}
.nav-link[data-nav="constitution"]:hover::after {
  width: 100%; background: var(--nav-constitution); box-shadow: 0 0 12px #4169E1;
}
.nav-link[data-nav="getstarted"]:hover {
  color: var(--nav-getstarted);
  text-shadow: 0 0 20px #00E67680;
}
.nav-link[data-nav="getstarted"]:hover::after {
  width: 100%; background: var(--nav-getstarted); box-shadow: 0 0 12px #00E676;
}
.nav-link[data-nav="recent"]:hover {
  color: var(--nav-recent);
  text-shadow: 0 0 20px #FFC23C80;
}
.nav-link[data-nav="recent"]:hover::after {
  width: 100%; background: var(--nav-recent); box-shadow: 0 0 12px #FFC23C;
}
.nav-link[data-nav="grimoire"]:hover {
  color: var(--nav-grimoire);
  text-shadow: 0 0 24px #9B30FF99;
}
.nav-link[data-nav="grimoire"]:hover::after {
  width: 100%; background: var(--nav-grimoire); box-shadow: 0 0 16px #9B30FF;
}

/* Grimoire — pure electric violet, alive in the dark. */
@keyframes grimoire-pulse {
  0%, 100% { color: var(--muted); text-shadow: none; }
  50%      { color: #7B2FFF;      text-shadow: 0 0 12px #7B2FFF55; }
}
.nav-link[data-nav="grimoire"] {
  animation: grimoire-pulse 3s ease-in-out infinite;
}
.nav-link[data-nav="grimoire"]:hover {
  animation: none;
  color: var(--nav-grimoire);
  text-shadow: 0 0 24px #9B30FF99;
}
@media (prefers-reduced-motion: reduce) {
  .nav-link[data-nav="grimoire"] { animation: none; }
}

/* Active page stays lit in its colour. */
.nav-active-builds       { color: var(--nav-builds)       !important; animation: none; }
.nav-active-discover     { color: var(--nav-discover)     !important; animation: none; }
.nav-active-constitution { color: var(--nav-constitution) !important; animation: none; }
.nav-active-getstarted   { color: var(--nav-getstarted)   !important; animation: none; }
.nav-active-recent       { color: var(--nav-recent)       !important; animation: none; }
.nav-active-grimoire {
  color: var(--nav-grimoire) !important;
  animation: none;
  text-shadow: 0 0 16px #9B30FF80;
}
/* Stop the resting pulse on the active Grimoire page (beats the data-nav rule). */
.nav-link[data-nav="grimoire"].nav-active-grimoire { animation: none; }

/* Grimoire ambient particle aura — a localized canvas behind just that word. */
.grimoire-aura-wrap {
  position: relative;
  display: inline-block;
}
.grimoire-aura-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 60px;
  pointer-events: none;
  z-index: 0;
}
.nav-auth { display: flex; align-items: center; gap: 0.75rem; }
.nav-profile {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
  padding:     0.3rem 0.7rem;
  border-radius: var(--radius);
  border:      1px solid var(--border);
  transition:  all var(--transition);
}
.nav-profile:hover { border-color: var(--ember-dim); }
.nav-crumb-tag {
  font-family:    var(--font-heading);
  font-size:      0.72rem;
  color:          var(--ember-dim);
  letter-spacing: 0.08em;
}
.nav-username {
  font-size:   0.82rem;
  color:       var(--cream);
}

/* ── Flash messages ─────────────────────────────────────────── */
.flash-container {
  position:   relative;
  z-index:    90;
  padding:    0 2rem;
  max-width:  var(--max-w);
  margin:     1rem auto 0;
}
.flash {
  padding:       0.75rem 1rem;
  border-radius: var(--radius);
  font-size:     0.88rem;
  margin-bottom: 0.5rem;
  border:        1px solid transparent;
}
.flash-success {
  background:  rgba(80,200,120,0.12);
  border-color: rgba(80,200,120,0.3);
  color:       var(--green);
}
.flash-error {
  background:  rgba(200,64,64,0.12);
  border-color: rgba(200,64,64,0.3);
  color:       #F08080;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  position:   relative;
  z-index:    1;
  padding:    3.5rem 2rem 5rem;
  text-align: center;
  overflow:   hidden;
}
.hero::before {
  content:  '';
  position: absolute;
  top: -200px; left: 50%; transform: translateX(-50%);
  width:  900px; height: 600px;
  background: radial-gradient(ellipse, rgba(224,123,84,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero-badge {
  display:        inline-block;
  padding:        0.3rem 0.8rem;
  border-radius:  100px;
  border:         1px solid var(--ember-dim);
  font-family:    var(--font-heading);
  font-size:      0.72rem;
  letter-spacing: 0.1em;
  color:          var(--ember-dim);
  text-transform: uppercase;
  margin-bottom:  1.5rem;
}
.hero-title {
  font-family:  var(--font-display);
  font-size:    clamp(2.24rem, 4.8vw, 4rem);
  line-height:  1.1;
  margin-bottom: 1.5rem;
  color:        var(--cream);
  /* Depth + glow (CSS only, brand accent). A subtle "lit from above" emboss — a faint
     white top edge over a soft dark bottom edge — gives the title dimension; two low-
     opacity ember halos (rgba 224,123,84 = --ember) make it emit a gentle light. Soft
     blur, no harsh offsets: premium and restrained, not neon. text-shadow never affects
     layout, so it can't overflow on narrow screens. */
  text-shadow:
    0 -1px 0   rgba(255, 255, 255, 0.14),
    0  1px 1px rgba(0, 0, 0, 0.42),
    0  0  16px rgba(224, 123, 84, 0.16),
    0  0  36px rgba(224, 123, 84, 0.09);
  /* Slow, gentle glow "breath" — same 6s rhythm as the device, so the hero breathes as
     one. Only the halo blur/opacity move; the emboss holds steady. */
  animation: hero-title-glow 6s ease-in-out infinite;
}
@keyframes hero-title-glow {
  0%, 100% {
    text-shadow:
      0 -1px 0   rgba(255, 255, 255, 0.14),
      0  1px 1px rgba(0, 0, 0, 0.42),
      0  0  15px rgba(224, 123, 84, 0.15),
      0  0  34px rgba(224, 123, 84, 0.08);
  }
  50% {
    text-shadow:
      0 -1px 0   rgba(255, 255, 255, 0.14),
      0  1px 1px rgba(0, 0, 0, 0.42),
      0  0  23px rgba(224, 123, 84, 0.24),
      0  0  48px rgba(224, 123, 84, 0.13);
  }
}
/* Accessibility: no breathing for users who ask for reduced motion (the static glow
   + emboss remain). */
@media (prefers-reduced-motion: reduce) {
  .hero-title { animation: none; }
}
.hero-sub {
  font-size:     1.05rem;
  color:         var(--muted);
  max-width:     560px;
  margin:        0 auto 2.5rem;
  line-height:   1.7;
}
.hero-code-box {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.5rem;
  max-width:     560px;
  margin:        0 auto 2rem;
}
.code-form {
  display:     flex;
  gap:         0.75rem;
  align-items: center;
  flex-wrap:   wrap;
}
.code-input-wrap {
  display:     flex;
  align-items: center;
  flex:        1;
  background:  var(--void);
  border:      1px solid var(--border);
  border-radius: var(--radius);
  padding:     0 0.75rem;
  min-width:   200px;
}
.code-prefix { color: var(--ember); font-size: 1.1rem; margin-right: 0.5rem; }
.code-input {
  background:  transparent;
  border:      none;
  outline:     none;
  color:       var(--cream);
  font-family: 'Courier New', monospace;
  font-size:   0.9rem;
  letter-spacing: 0.08em;
  padding:     0.65rem 0;
  width:       100%;
}
.code-input::placeholder { color: var(--muted); }
.code-hint {
  font-size:    0.78rem;
  color:        var(--muted);
  margin-top:   0.6rem;
  text-align:   left;
}
.stats-row {
  display:     flex;
  align-items: center;
  justify-content: center;
  gap:         1.5rem;
  flex-wrap:   wrap;
}
.stat { text-align: center; }
.stat-num {
  display:    block;
  font-family: var(--font-heading);
  font-size:  2rem;
  font-weight: 700;
  color:      var(--cream);
  line-height: 1;
}
.stat-num.gold { color: var(--ember); }
.stat-label {
  font-size:  0.78rem;
  color:      var(--muted);
  margin-top: 0.2rem;
}
.stat-divider { color: var(--border); font-size: 1.5rem; }

/* ── Hero media (placeholder — a real room photo drops in here) ─ */
.hero-media {
  position: absolute;
  inset:    0;
  z-index:  0;
  overflow: hidden;
  /* Dim-room-at-night placeholder until a real photo exists.
     An <img class="hero-photo"> dropped into .hero-media will cover this. */
  background:
    radial-gradient(60% 50% at 50% 32%,  rgba(224,123,84,0.12) 0%, transparent 70%),
    radial-gradient(90% 70% at 50% 118%, rgba(120,70,180,0.12) 0%, transparent 70%),
    linear-gradient(180deg, var(--deep) 0%, var(--void) 100%);
  animation: hero-breathe 7s ease-in-out infinite;
}
.hero-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-scrim {
  position: absolute;
  inset:    0;
  z-index:  1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(8,6,16,0.45) 0%,
    rgba(8,6,16,0.30) 40%,
    rgba(8,6,16,0.85) 100%);
}
@keyframes hero-breathe {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1;   }
}
@media (prefers-reduced-motion: reduce) {
  .hero-media { animation: none; }
}
.hero .hero-inner { position: relative; z-index: 2; }

/* ── Three-door action zone (owners · builders · browsers) ──── */
.hero-doors {
  display:   flex;
  gap:       1.5rem;
  max-width: 900px;
  margin:    0 auto 1.5rem;
}
/* Stack vertically on mobile, sit in a row on desktop. */
@media (max-width: 720px) { .hero-doors { flex-direction: column; } }
.door {
  flex:           1;
  display:        flex;
  flex-direction: column;
  align-items:    center;
  text-align:     center;
  gap:            0.55rem;
  background:      var(--surface);
  border:         1px solid var(--border);
  border-radius:  var(--radius-lg);
  padding:        1.75rem 1.25rem;
  transition:     transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.door:hover {
  transform:    translateY(-2px);
  border-color: var(--border-hot);
  box-shadow:   0 8px 28px rgba(0,0,0,0.35);
}
.door-icon { font-size: 2rem; line-height: 1; }
.door-icon.accent { color: var(--ember); }
.door-label {
  font-family: var(--font-heading);
  font-size:   1.1rem;
  font-weight: 700;
  color:       var(--ember);
}
.door-subtext {
  font-size:   0.82rem;
  color:       var(--muted);
  line-height: 1.55;
  flex:        1;   /* pushes the action to the bottom so all doors align */
}
.door .code-field-wrap { width: 100%; margin-top: 0.3rem; }
.door .btn { margin-top: 0.3rem; }
/* Door 1 — owners. The primary action: a brighter ember border. */
.door-code { border-color: var(--ember); }
.door-code:hover { border-color: var(--ember-glow); }
.door-code:focus-within {
  border-color: var(--ember);
  box-shadow:   0 0 18px rgba(224,123,84,0.18);
}
/* Primary hero door — the highlighted "Learn to build one" entrance. */
.door-primary { border-color: var(--ember); }
.door-primary:hover { border-color: var(--ember-glow); }

/* Grimoire door — purple button text, ember border like the others. */
.door-grimoire .btn { color: var(--nav-grimoire); }

/* ── Artifacts section ──────────────────────────────────────── */
.artifacts {
  position:   relative;
  z-index:    1;
  padding:    5rem 0;
  border-top: 1px solid var(--border);
}
.artifact-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap:                   1.5rem;
}
.artifact-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       2rem;
  transition:    all var(--transition);
  position:      relative;
  overflow:      hidden;
}
.artifact-card::before {
  content:  '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.ember-card::before   { background: radial-gradient(circle, rgba(224,123,84,0.06) 0%, transparent 60%); }
.ignis-card::before   { background: radial-gradient(circle, rgba(200,64,20,0.06) 0%, transparent 60%); }
.morpheus-card::before { background: radial-gradient(circle, rgba(120,70,180,0.06) 0%, transparent 60%); }
.artifact-card:hover::before { opacity: 1; }
.artifact-card:hover {
  border-color: var(--border-hot);
  transform:    translateY(-3px);
  box-shadow:   0 8px 32px rgba(0,0,0,0.4);
}
.artifact-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.artifact-name {
  font-family: var(--font-heading);
  font-size:   1.3rem;
  font-weight: 700;
  color:       var(--cream);
  margin-bottom: 0.2rem;
}
.artifact-title {
  font-size:     0.8rem;
  color:         var(--ember-dim);
  font-family:   var(--font-heading);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}
.artifact-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.6; margin-bottom: 1.2rem; }
.artifact-stats {
  display:     flex;
  gap:         0.75rem;
  flex-wrap:   wrap;
}
.artifact-stats span {
  font-family:    var(--font-heading);
  font-size:      0.72rem;
  color:          var(--ember-dim);
  background:     var(--void);
  padding:        0.2rem 0.5rem;
  border-radius:  4px;
  border:         1px solid var(--border);
}

/* ── Why section ────────────────────────────────────────────── */
.why {
  padding:    5rem 0;
  border-top: 1px solid var(--border);
}
.why-grid {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   4rem;
  align-items:           center;
}
@media (max-width: 768px) { .why-grid { grid-template-columns: 1fr; } }
.why-body { color: var(--muted); margin-bottom: 1rem; line-height: 1.7; }
.why-features { display: flex; flex-direction: column; gap: 1.5rem; }
.feature {
  display:     flex;
  gap:         1rem;
  align-items: flex-start;
}
.feature-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 0.1rem; }
.feature h4 {
  font-family: var(--font-heading);
  font-size:   0.92rem;
  font-weight: 600;
  color:       var(--cream);
  margin-bottom: 0.25rem;
}
.feature p { font-size: 0.85rem; color: var(--muted); }

/* ── Recent builders ────────────────────────────────────────── */
.recent {
  padding:    5rem 0;
  border-top: 1px solid var(--border);
}
.profile-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap:                   1rem;
  margin-bottom:         2rem;
}
.profile-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.5rem;
  display:       flex;
  flex-direction: column;
  align-items:   center;
  text-align:    center;
  transition:    all var(--transition);
  cursor:        pointer;
}
.profile-card:hover {
  border-color: var(--border-hot);
  transform:    translateY(-2px);
  box-shadow:   0 6px 24px rgba(0,0,0,0.3);
}
.profile-card-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  width:           100%;
  margin-bottom:   1rem;
}
.profile-avatar {
  width:         52px;
  height:        52px;
  border-radius: 50%;
  background:    var(--surface-hot);
  border:        1px solid var(--border);
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-family:   var(--font-heading);
  font-size:     1.4rem;
  font-weight:   700;
  color:         var(--ember);
  margin-bottom: 0.75rem;
}
.profile-card-name {
  font-family:   var(--font-heading);
  font-size:     0.95rem;
  font-weight:   600;
  color:         var(--cream);
  margin-bottom: 0.3rem;
}
.profile-card-devices { font-size: 0.78rem; color: var(--muted); }
.profile-card-location { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }
.discover-cta { text-align: center; }

/* ── CTA ────────────────────────────────────────────────────── */
.cta {
  padding:    5rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
}
.cta-inner { max-width: 560px; margin: 0 auto; }
.cta-title {
  font-family:   var(--font-display);
  font-size:     2.5rem;
  color:         var(--cream);
  margin-bottom: 1rem;
}
.cta-sub { color: var(--muted); margin-bottom: 2rem; }
.cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.cta-tertiary {
  display:     inline-block;
  margin-top:  1.5rem;
  font-size:   0.8rem;
  color:       var(--muted);
  transition:  color var(--transition);
}
.cta-tertiary:hover { color: var(--ember); }

/* ── Tags and badges ────────────────────────────────────────── */
.crumb-tag {
  font-family:    var(--font-heading);
  font-size:      0.72rem;
  font-weight:    600;
  letter-spacing: 0.1em;
  color:          var(--ember-dim);
  background:     rgba(224,123,84,0.08);
  padding:        0.2rem 0.45rem;
  border-radius:  4px;
  border:         1px solid var(--ember-dim);
}
.crumb-tag-lg {
  font-family:    var(--font-heading);
  font-size:      0.85rem;
  font-weight:    600;
  letter-spacing: 0.12em;
  color:          var(--ember);
  background:     rgba(224,123,84,0.1);
  padding:        0.3rem 0.7rem;
  border-radius:  var(--radius);
  border:         1px solid var(--ember-dim);
}
/* Community Member tags — neutral/muted, distinct from the ember Owner tags.
   Applied alongside .crumb-tag / .crumb-tag-lg so they inherit size + shape and
   only override the colour. */
.member-tag {
  color:      var(--muted);
  background: rgba(110,98,88,0.10);
  border:     1px solid var(--border);
}
.member-tag-lg {
  color:      var(--muted);
  background: rgba(110,98,88,0.10);
  border:     1px solid var(--border);
}

.founder-badge {
  font-family:    var(--font-heading);
  font-size:      0.68rem;
  font-weight:    600;
  letter-spacing: 0.08em;
  color:          #0A0810;
  background:     var(--ember);
  padding:        0.18rem 0.45rem;
  border-radius:  4px;
}
.founder-badge-lg {
  font-family:    var(--font-heading);
  font-size:      0.78rem;
  font-weight:    600;
  letter-spacing: 0.08em;
  color:          #0A0810;
  background:     var(--ember);
  padding:        0.3rem 0.7rem;
  border-radius:  var(--radius);
}
.founder-pip {
  color:     var(--ember);
  font-size: 0.9rem;
  filter:    drop-shadow(0 0 4px rgba(224,123,84,0.5));
}

/* ── Founder notice ─────────────────────────────────────────── */
.founder-notice {
  display:       flex;
  align-items:   flex-start;
  gap:           0.75rem;
  background:    rgba(224,123,84,0.06);
  border:        1px solid var(--ember-dim);
  border-radius: var(--radius);
  padding:       1rem;
  margin-bottom: 1.5rem;
}
.founder-dot {
  width:         8px;
  height:        8px;
  border-radius: 50%;
  background:    var(--ember);
  flex-shrink:   0;
  margin-top:    0.35rem;
  box-shadow:    0 0 6px var(--ember);
}
.founder-notice p { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.founder-notice strong { color: var(--ember); }

/* Redeem card — shown on a Member's own profile to upgrade to Owner. */
.redeem-card {
  background:    linear-gradient(180deg, rgba(224,123,84,0.06), var(--surface));
  border:        1px solid var(--ember-dim);
  border-radius: var(--radius-lg);
  padding:       1.5rem;
  margin-bottom: 2rem;
}
.redeem-title { font-family: var(--font-heading); font-size: 1.2rem; color: var(--cream); margin: 0 0 0.4rem; }
.redeem-sub   { font-size: 0.88rem; color: var(--muted); line-height: 1.6; margin: 0 0 1rem; }
.redeem-form  { display: flex; flex-direction: column; gap: 0.75rem; max-width: 440px; }
.redeem-hint  { font-size: 0.78rem; color: var(--muted); margin: 0.85rem 0 0; }

/* ── Auth pages ─────────────────────────────────────────────── */
.auth-page {
  position:   relative;
  z-index:    1;
  min-height: calc(100vh - 64px);
  display:    flex;
  align-items: center;
  justify-content: center;
  padding:    3rem 1.5rem;
}
.auth-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       2.5rem;
  width:         100%;
  max-width:     520px;
}
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-title {
  font-family: var(--font-heading);
  font-size:   1.8rem;
  font-weight: 700;
  color:       var(--cream);
  margin:      0.75rem 0 0.5rem;
}
.auth-sub { font-size: 0.88rem; color: var(--muted); line-height: 1.5; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; color: var(--muted); }
.gold-link { color: var(--ember); transition: color var(--transition); }
.gold-link:hover { color: var(--teal); }

/* ── Forms ──────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-row {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   1rem;
}
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }
.form-label {
  font-family:    var(--font-heading);
  font-size:      0.78rem;
  font-weight:    600;
  letter-spacing: 0.06em;
  color:          var(--muted);
  text-transform: uppercase;
}
.required { color: var(--ember); }
.form-input {
  background:    var(--void);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       0.7rem 0.9rem;
  color:         var(--cream);
  font-size:     0.9rem;
  transition:    border-color var(--transition), box-shadow var(--transition);
  width:         100%;
}
.form-input:focus {
  outline:      none;
  border-color: var(--ember-dim);
  box-shadow:   0 0 0 2px rgba(224,123,84,0.1);
}
.form-input::placeholder { color: var(--muted); }
.form-textarea { resize: vertical; min-height: 80px; }
.select-input { cursor: pointer; }
.field-hint { font-size: 0.75rem; color: var(--muted); }
.form-divider {
  display:     flex;
  align-items: center;
  gap:         0.75rem;
  color:       var(--muted);
  font-size:   0.78rem;
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.form-divider::before,
.form-divider::after {
  content:  '';
  flex:     1;
  height:   1px;
  background: var(--border);
}
.code-group { margin-bottom: 0.5rem; }
.code-field-wrap {
  display:     flex;
  align-items: center;
  background:  var(--void);
  border:      1px solid var(--ember-dim);
  border-radius: var(--radius);
  padding:     0 0.9rem;
  box-shadow:  0 0 0 1px rgba(224,123,84,0.08);
}
.code-field-wrap:focus-within {
  border-color: var(--ember);
  box-shadow:   0 0 12px rgba(224,123,84,0.15);
}
.code-field-icon { color: var(--ember); font-size: 1rem; margin-right: 0.6rem; }
.code-field {
  background:  transparent;
  border:      none;
  outline:     none;
  color:       var(--cream);
  font-family: 'Courier New', monospace;
  font-size:   1rem;
  letter-spacing: 0.12em;
  padding:     0.75rem 0;
  width:       100%;
  text-transform: uppercase;
}
.code-field::placeholder { color: var(--muted); letter-spacing: 0.08em; }

/* ── Profile page ───────────────────────────────────────────── */
.profile-page { position: relative; z-index: 1; }
.profile-header {
  border-bottom: 1px solid var(--border);
  padding:       3rem 2rem 2rem;
  background:    linear-gradient(180deg, rgba(224,123,84,0.03) 0%, transparent 100%);
}
.profile-header-inner {
  max-width:   var(--max-w);
  margin:      0 auto;
  display:     flex;
  gap:         2rem;
  align-items: flex-start;
}
.profile-avatar-lg {
  width:           80px;
  height:          80px;
  border-radius:   50%;
  background:      var(--surface-hot);
  border:          2px solid var(--border);
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-family:     var(--font-heading);
  font-size:       2rem;
  font-weight:     700;
  color:           var(--ember);
  flex-shrink:     0;
}
.profile-info { flex: 1; }
.profile-badges { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.profile-username {
  font-family:   var(--font-heading);
  font-size:     2rem;
  font-weight:   700;
  color:         var(--cream);
  margin-bottom: 0.3rem;
}
.profile-location { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.6rem; }
.profile-bio { color: var(--muted); font-size: 0.92rem; max-width: 560px; margin-bottom: 0.75rem; }
.profile-meta { display: flex; gap: 0.75rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); }
.meta-dot { color: var(--border); }
.profile-actions { flex-shrink: 0; }
.profile-body { max-width: var(--max-w); margin: 0 auto; padding: 2.5rem 2rem; }

/* ── Ecosystem ──────────────────────────────────────────────── */
.ecosystem-section { margin-bottom: 2.5rem; }
.section-heading {
  font-family:   var(--font-heading);
  font-size:     1rem;
  font-weight:   600;
  color:         var(--cream);
  display:       flex;
  align-items:   center;
  gap:           0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.section-heading-icon { color: var(--ember); }
.device-count {
  font-size:  0.75rem;
  color:      var(--muted);
  font-weight: 400;
  margin-left: auto;
}
.device-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.device-card {
  display:       flex;
  align-items:   center;
  gap:           1rem;
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1rem 1.25rem;
  transition:    border-color var(--transition);
}
.device-card:hover { border-color: var(--border-hot); }
.device-card.device-ember { border-left: 3px solid var(--ember); }
.device-card.device-ignis  { border-left: 3px solid var(--ember-hot); }
.device-card.device-morpheus { border-left: 3px solid var(--purple); }
.device-card.device-custom { border-left: 3px solid var(--border-hot); }
.device-icon { font-size: 1.8rem; flex-shrink: 0; }
.device-info { flex: 1; }
.device-name {
  font-family:   var(--font-heading);
  font-size:     0.95rem;
  font-weight:   600;
  color:         var(--cream);
  margin-bottom: 0.2rem;
}
.device-desc { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.2rem; }
.device-added { font-size: 0.72rem; color: var(--muted); }
.device-remove-form { flex-shrink: 0; }
.btn-remove {
  background:    transparent;
  border:        1px solid var(--border);
  border-radius: 50%;
  width:         28px;
  height:        28px;
  color:         var(--muted);
  cursor:        pointer;
  font-size:     1.1rem;
  display:       flex;
  align-items:   center;
  justify-content: center;
  transition:    all var(--transition);
}
.btn-remove:hover { border-color: var(--red); color: var(--red); }
.add-device-section {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.5rem;
}
.add-device-title {
  font-family:   var(--font-heading);
  font-size:     0.88rem;
  font-weight:   600;
  color:         var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.add-device-form { display: flex; flex-direction: column; gap: 0.75rem; }
.add-device-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.add-device-row .form-input { flex: 1; min-width: 160px; }
.empty-state { text-align: center; padding: 2rem; color: var(--muted); font-size: 0.9rem; }

/* ── Discover page ──────────────────────────────────────────── */
.discover-page {
  position:  relative;
  z-index:   1;
  max-width: var(--max-w);
  margin:    0 auto;
  padding:   3rem 2rem;
}
.discover-header { text-align: center; margin-bottom: 3rem; }
.discover-title {
  font-family:   var(--font-display);
  font-size:     3rem;
  color:         var(--cream);
  margin-bottom: 0.5rem;
}
.discover-sub { color: var(--muted); margin-bottom: 2rem; }
.search-form { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.search-input {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       0.65rem 1rem;
  color:         var(--cream);
  font-size:     0.9rem;
  width:         280px;
  transition:    border-color var(--transition);
}
.search-input:focus { outline: none; border-color: var(--ember-dim); }
.search-input::placeholder { color: var(--muted); }
.search-results-label { font-size: 0.82rem; color: var(--muted); margin-top: 1rem; }
.discover-count { color: var(--ember-dim); font-size: 0.9rem; margin-top: 0.25rem; }

/* ── Discover sort toolbar ───────────────────────────────── */
.discover-toolbar { display: flex; justify-content: center; margin-bottom: 1.75rem; }

/* ── Playground — static preview of the future live network map ── */
.playground {
  position:      relative;
  z-index:       1;
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  background:    linear-gradient(180deg, rgba(224,123,84,0.04), var(--surface));
  padding:       1.25rem 1.25rem 1.5rem;
  margin:        0 auto 2.5rem;
  max-width:     720px;
}
.playground-bar { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.85rem; }
.playground-title { font-family: var(--font-heading); font-size: 1rem; color: var(--cream); margin: 0; }
.playground-soon {
  font-family:    var(--font-heading);
  font-size:      0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--ember-dim);
}
.playground-canvas {
  display:       block;
  width:         100%;
  height:        240px;
  border-radius: var(--radius);
  background:    radial-gradient(circle at 50% 40%, rgba(123,108,255,0.05), transparent 70%);
}
.playground-caption {
  font-size:   0.82rem;
  color:       var(--muted);
  line-height: 1.6;
  margin:      0.85rem 0 0;
  text-align:  center;
}
.playground-empty {
  text-align:    center;
  padding:       2.5rem 1rem;
  color:         var(--muted);
  font-size:     0.9rem;
  border:        1px dashed var(--border);
  border-radius: var(--radius);
}
/* Constellation hover tooltip — device name only. pointer-events:none so it never
   blocks the canvas hit-detection underneath it. */
.constellation-tooltip {
  position:       absolute;
  display:        none;
  transform:      translate(-50%, -100%);
  pointer-events: none;
  z-index:        50;
  background:     var(--surface);
  color:          var(--cream);
  border:         1px solid var(--border);
  border-radius:  6px;
  padding:        0.3rem 0.55rem;
  font-family:    var(--font-heading);
  font-size:      0.75rem;
  white-space:    nowrap;
  box-shadow:     0 6px 20px rgba(0,0,0,0.4);
}

.discover-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap:                   1.25rem;
}
.builder-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.5rem;
  display:       flex;
  flex-direction: column;
  align-items:   center;
  text-align:    center;
  transition:    all var(--transition);
  cursor:        pointer;
}
.builder-card:hover {
  border-color: var(--border-hot);
  transform:    translateY(-3px);
  box-shadow:   0 8px 32px rgba(0,0,0,0.4);
}
.builder-card-top {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  width:           100%;
  margin-bottom:   1rem;
}
.builder-avatar {
  width:           56px;
  height:          56px;
  border-radius:   50%;
  background:      var(--surface-hot);
  border:          1px solid var(--border);
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-family:     var(--font-heading);
  font-size:       1.5rem;
  font-weight:     700;
  color:           var(--ember);
  margin-bottom:   0.75rem;
}
.builder-username {
  font-family:   var(--font-heading);
  font-size:     1rem;
  font-weight:   600;
  color:         var(--cream);
  margin-bottom: 0.2rem;
}
.builder-location { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.5rem; }
.builder-bio {
  font-size:     0.8rem;
  color:         var(--muted);
  line-height:   1.5;
  margin-bottom: 0.75rem;
}
.builder-devices {
  display:     flex;
  flex-wrap:   wrap;
  gap:         0.4rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.device-pip {
  font-size:     0.72rem;
  color:         var(--muted);
  background:    var(--void);
  padding:       0.18rem 0.45rem;
  border-radius: 4px;
  border:        1px solid var(--border);
}
.device-pip-ember   { border-color: rgba(224,123,84,0.3); }
.device-pip-ignis   { border-color: rgba(200,64,16,0.3); }
.device-pip-morpheus { border-color: rgba(120,70,180,0.3); }
.device-pip-more { font-size: 0.72rem; color: var(--muted); }
.device-pip-empty { font-size: 0.72rem; color: var(--border); font-style: italic; }
.builder-joined { font-size: 0.72rem; color: var(--muted); margin-top: auto; padding-top: 0.5rem; }
.empty-discover {
  text-align: center;
  padding:    4rem 2rem;
  color:      var(--muted);
}
.empty-discover p { margin-bottom: 1.5rem; font-size: 1rem; }

/* ── Bring one home ─────────────────────────────────────────── */
.getone {
  padding:    5rem 0;
  border-top: 1px solid var(--border);
}
.getone-grid {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   1.5rem;
}
@media (max-width: 640px) { .getone-grid { grid-template-columns: 1fr; } }
.getone-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       2rem;
  display:       flex;
  flex-direction: column;
  gap:           0.75rem;
  transition:    border-color var(--transition);
}
.getone-card:hover { border-color: var(--border-hot); }
.getone-card h3 {
  font-family: var(--font-heading);
  font-size:   1.2rem;
  font-weight: 700;
  color:       var(--cream);
}
.getone-card p { font-size: 0.9rem; color: var(--muted); line-height: 1.65; flex: 1; }
.getone-card .btn { align-self: flex-start; margin-top: 0.5rem; }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding:    3rem 2rem;
  margin-top: 4rem;
  position:   relative;
  z-index:    1;
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; text-align: center; }
.footer-brand {
  display:     flex;
  align-items: center;
  justify-content: center;
  gap:         0.5rem;
  margin-bottom: 0.5rem;
}
.footer-name {
  font-family:    var(--font-display);
  font-size:      0.9rem;
  color:          var(--ember-dim);
  letter-spacing: 0.12em;
}
.footer-tagline { font-size: 0.82rem; color: var(--muted); margin-bottom: 1rem; }
.footer-links {
  display:         flex;
  justify-content: center;
  gap:             2rem;
  margin-bottom:   1rem;
}
.footer-links a { font-size: 0.82rem; color: var(--muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--teal); }
.footer-copy { font-size: 0.72rem; color: var(--border); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Mobile nav: the burger shows; the section links + auth collapse into an in-flow
     dropdown that opens when the burger (checkbox) is tapped. No JS — navigating to a
     link reloads the page, which resets the checkbox and closes the menu. */
  .nav { flex-wrap: wrap; height: auto; min-height: 64px; }
  .nav-burger {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 2.4rem; height: 2.4rem;
    font-size: 1.3rem; color: var(--cream); cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--radius);
  }
  .nav-burger::before { content: '☰'; }
  #nav-toggle:checked ~ .nav-burger::before { content: '✕'; }
  .nav-links, .nav-auth {
    display: none;
    flex-basis: 100%; width: 100%;
    flex-direction: column; align-items: stretch; gap: 0.4rem;
  }
  #nav-toggle:checked ~ .nav-links,
  #nav-toggle:checked ~ .nav-auth { display: flex; }
  .nav-links { padding: 0.6rem 0 0; }
  .nav-link  { padding: 0.55rem 0.25rem; }
  .nav-auth  { padding: 0.5rem 0 0.6rem; border-top: 1px solid var(--border); margin-top: 0.4rem; }
  .logout-form, .nav-profile { width: 100%; }

  .hero-title { font-size: 2rem; }
  .section-title { font-size: 1.7rem; }
  .profile-header-inner { flex-direction: column; }
  .profile-actions { width: 100%; }
}
@media (max-width: 480px) {
  .nav { padding: 0 1rem; }
  .hero { padding: 2rem 1rem 3rem; }
  .code-form { flex-direction: column; }
  .code-input-wrap { width: 100%; }
  .auth-card { padding: 1.5rem; }
}

/* ============================================================
   BUILDS — community build platform
   ============================================================ */
.builds-page {
  position:  relative;
  z-index:   1;
  max-width: 900px;
  margin:    0 auto;
  padding:   3rem 2rem 5rem;
}
.builds-header { margin-bottom: 2rem; }
.builds-title {
  font-family:   var(--font-display);
  font-size:     clamp(2.2rem, 5vw, 3rem);
  color:         var(--cream);
  margin-bottom: 0.4rem;
}
.builds-sub { color: var(--muted); font-size: 1rem; }
.back-link {
  display:        inline-block;
  font-family:    var(--font-heading);
  font-size:      0.8rem;
  color:          var(--ember-dim);
  margin-bottom:  1.5rem;
  transition:     color var(--transition);
}
.back-link:hover { color: var(--teal); }

/* Forum head (forum page) */
.forum-head { display: flex; flex-direction: column; }
.forum-head-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.forum-ember-head .builds-title { color: var(--ember); }

/* ── Forum sections ──────────────────────────────────────── */
.forum-section { margin-bottom: 2.5rem; }
.forum-section-title {
  font-family:    var(--font-heading);
  font-size:      0.78rem;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color:          var(--ember-dim);
  margin:         0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom:  1px solid var(--border);
}

/* ── Forum cards ─────────────────────────────────────────── */
.forum-cards {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap:                   1rem;
  margin-bottom:         0;
}
.forum-card {
  display:       flex;
  gap:           1rem;
  align-items:   flex-start;
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.5rem;
  transition:    all var(--transition);
}
.forum-card:hover {
  border-color: var(--border-hot);
  transform:    translateY(-2px);
  box-shadow:   0 8px 28px rgba(0,0,0,0.35);
}
.forum-card-icon { font-size: 1.8rem; flex-shrink: 0; line-height: 1.2; }
.forum-card-body { display: flex; flex-direction: column; }
.forum-card-name {
  font-family:   var(--font-heading);
  font-size:     1.1rem;
  font-weight:   700;
  color:         var(--cream);
  margin-bottom: 0.3rem;
  display:       flex;
  align-items:   center;
  gap:           0.4rem;
}
.forum-card-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.5; margin-bottom: 0.5rem; }
.forum-card-count {
  font-family:    var(--font-heading);
  font-size:      0.72rem;
  letter-spacing: 0.05em;
  color:          var(--ember-dim);
}
.pin-dot { color: var(--teal); font-size: 0.7rem; }
/* Ember forum — stronger gold border + subtle glow */
.forum-card.forum-ember {
  border-color: var(--ember-dim);
  background:   linear-gradient(180deg, rgba(224,123,84,0.06), var(--surface));
  box-shadow:   0 0 0 1px rgba(224,123,84,0.12), 0 0 24px rgba(224,123,84,0.08);
}
.forum-card.forum-ember:hover {
  border-color: var(--ember);
  box-shadow:   0 0 0 1px rgba(224,123,84,0.25), 0 0 32px rgba(224,123,84,0.15);
}

/* ── Toolbar + sort tabs ─────────────────────────────────── */
.builds-toolbar {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             1rem;
  flex-wrap:       wrap;
  margin-bottom:   1.5rem;
}
.sort-tabs {
  display:       flex;
  gap:           0.3rem;
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       0.25rem;
}
.sort-tab {
  font-family:   var(--font-heading);
  font-size:     0.8rem;
  font-weight:   600;
  color:         var(--muted);
  padding:       0.4rem 0.95rem;
  border-radius: 6px;
  transition:    all var(--transition);
}
.sort-tab:hover { color: var(--cream); }
.sort-tab.active { background: var(--surface-hot); color: var(--ember); }

/* ── Build feed cards ────────────────────────────────────── */
.build-feed { display: flex; flex-direction: column; gap: 1rem; }
.build-card {
  display:       flex;
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow:      hidden;
  transition:    all var(--transition);
}
.build-card:hover {
  border-color: var(--border-hot);
  box-shadow:   0 6px 24px rgba(0,0,0,0.3);
}

/* Vote column */
.vote-col {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  padding:        1rem 0.85rem;
  background:     rgba(0,0,0,0.15);
  flex-shrink:    0;
}
.vote-form {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            0.2rem;
  border:         none;
  background:     none;
}
.vote-btn {
  background:  none;
  border:      none;
  cursor:      pointer;
  color:       var(--muted);
  font-size:   0.95rem;
  line-height: 1;
  padding:     0.1rem 0.2rem;
  transition:  color var(--transition), filter var(--transition);
}
button.vote-btn:hover { color: var(--ember); }
.vote-btn.voted { color: var(--ember); filter: drop-shadow(0 0 6px rgba(224,123,84,0.4)); }
.vote-btn.voted-down { color: var(--lavender); }
.vote-btn.disabled { color: var(--border); cursor: default; }
.vote-score {
  font-family: var(--font-heading);
  font-size:   0.85rem;
  font-weight: 700;
  color:       var(--cream);
}

.build-card-content {
  flex:           1;
  display:        flex;
  flex-direction: column;
  padding:        1.1rem 1.25rem;
  min-width:      0;
}
.build-card-main { display: block; }
.build-card-top { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.forum-tag {
  font-family:    var(--font-heading);
  font-size:      0.7rem;
  letter-spacing: 0.05em;
  color:          var(--ember-dim);
  background:     rgba(224,123,84,0.07);
  border:         1px solid var(--ember-dim);
  border-radius:  4px;
  padding:        0.12rem 0.45rem;
}
.pin-tag { font-family: var(--font-heading); font-size: 0.68rem; color: var(--teal); }
/* Discussion-post badge — neutral, distinct from the ember build forum-tag. */
.kind-tag {
  font-family:    var(--font-heading);
  font-size:      0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color:          var(--muted);
  background:     rgba(110,98,88,0.12);
  border:         1px solid var(--border);
  border-radius:  4px;
  padding:        0.12rem 0.4rem;
}
.build-card-title {
  font-family:   var(--font-heading);
  font-size:     1.2rem;
  font-weight:   700;
  color:         var(--cream);
  line-height:   1.25;
  margin-bottom: 0.35rem;
  transition:    color var(--transition);
}
.build-card:hover .build-card-title { color: var(--ember); }
.build-card-meta {
  display:       flex;
  align-items:   center;
  gap:           0.4rem;
  flex-wrap:     wrap;
  font-size:     0.78rem;
  color:         var(--muted);
  margin-bottom: 0.6rem;
}
.build-card-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.6; margin-bottom: 0.75rem; }
.build-card-tags { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Difficulty stars */
.difficulty { display: inline-flex; gap: 0.08rem; }
.difficulty .star { font-size: 0.82rem; line-height: 1; }
.difficulty .star.on  { color: var(--ember); }
.difficulty .star.off { color: var(--border); }
.tag-time { font-size: 0.76rem; color: var(--muted); font-family: var(--font-heading); }

.build-card-foot {
  display:       flex;
  align-items:   center;
  gap:           1.25rem;
  margin-top:    0.9rem;
  padding-top:   0.75rem;
  border-top:    1px solid var(--border);
}
.foot-link { font-size: 0.8rem; color: var(--muted); transition: color var(--transition); }
.foot-link:hover { color: var(--ember); }
.foot-download { color: var(--ember-dim); }
.badge-review {
  font-family:    var(--font-heading);
  font-size:      0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color:          var(--muted);
  background:     var(--surface-hot);
  border:         1px solid var(--border);
  border-radius:  4px;
  padding:        0.15rem 0.5rem;
}

/* ── Single post ─────────────────────────────────────────── */
.post-page {
  position:  relative;
  z-index:   1;
  max-width: 820px;
  margin:    0 auto;
  padding:   3rem 2rem 5rem;
}
.post-full {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       2rem;
  margin-bottom: 2rem;
}
.post-images { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.post-thumb {
  display:       block;
  width:         120px;
  height:        120px;
  border-radius: var(--radius);
  overflow:      hidden;
  border:        1px solid var(--border);
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition); }
.post-thumb:hover img { transform: scale(1.05); }
.post-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.5rem; }
.post-vote { background: none; padding: 0; }
.post-head-main { flex: 1; min-width: 0; }
.post-title {
  font-family:   var(--font-heading);
  font-size:     1.8rem;
  font-weight:   700;
  color:         var(--cream);
  line-height:   1.2;
  margin:        0.5rem 0 0.6rem;
}
.post-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); }
.post-section { margin-bottom: 1.75rem; }
.post-section:last-child { margin-bottom: 0; }
.post-section-title {
  font-family:    var(--font-heading);
  font-size:      1rem;
  font-weight:    600;
  color:          var(--cream);
  display:        flex;
  align-items:    center;
  gap:            0.5rem;
  margin-bottom:  1rem;
  padding-bottom: 0.6rem;
  border-bottom:  1px solid var(--border);
}
.pst-icon { color: var(--ember); }
.post-description { color: var(--cream); opacity: 0.85; line-height: 1.8; white-space: pre-wrap; }

/* Hardware checklist */
.hardware-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.hardware-list li label {
  display:     flex;
  align-items: center;
  gap:         0.6rem;
  font-size:   0.9rem;
  color:       var(--muted);
  cursor:      pointer;
}
.hardware-list input[type="checkbox"] { accent-color: var(--ember); width: 16px; height: 16px; flex-shrink: 0; }

/* Wiring + code — monospace on void */
.wiring-block, .code-block {
  background:    var(--void);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1rem 1.1rem;
  font-family:   'Courier New', monospace;
  font-size:     0.85rem;
  line-height:   1.7;
  color:         var(--cream);
  white-space:   pre-wrap;
  overflow-x:    auto;
}
.code-block { white-space: pre; }
.code-block code { font-family: inherit; background: none; color: inherit; padding: 0; }
.code-block .hljs { background: transparent; color: var(--cream); padding: 0; }
.code-actions { margin-bottom: 0.75rem; }
.badge-review-lg {
  display:        inline-block;
  font-size:      0.8rem;
  letter-spacing: 0;
  text-transform: none;
  padding:        0.6rem 1rem;
}

/* ── Comments ────────────────────────────────────────────── */
.comments { margin-top: 1rem; }
.comment-form { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; margin-bottom: 2rem; }
.comment-form textarea { width: 100%; }
.comment-signin, .comment-empty { color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; }
.comment-list { display: flex; flex-direction: column; gap: 1.25rem; }
.comment-thread { display: flex; flex-direction: column; gap: 0.75rem; }
.comment { display: flex; gap: 0.75rem; }
.comment.reply {
  margin-left:  2.5rem;
  padding-left: 1rem;
  border-left:  2px solid var(--border);
}
.comment-vote { flex-shrink: 0; }
.vote-form-sm .vote-btn { font-size: 0.8rem; }
.vote-form-sm .vote-score { font-size: 0.78rem; }
.comment-body-wrap { flex: 1; min-width: 0; }
.comment-meta {
  display:       flex;
  align-items:   center;
  gap:           0.4rem;
  flex-wrap:     wrap;
  font-size:     0.76rem;
  color:         var(--muted);
  margin-bottom: 0.3rem;
}
.comment-author { color: var(--cream); font-weight: 500; }
.reply-to { color: var(--ember-dim); }
.comment-text { font-size: 0.9rem; color: var(--muted); line-height: 1.6; white-space: pre-wrap; }
.reply-box { margin-top: 0.4rem; }
.reply-toggle {
  font-family: var(--font-heading);
  font-size:   0.74rem;
  color:       var(--ember-dim);
  cursor:      pointer;
  list-style:  none;
  display:     inline-block;
}
.reply-toggle::-webkit-details-marker { display: none; }
.reply-toggle:hover { color: var(--ember); }
.reply-box[open] .reply-toggle { color: var(--ember); }
.reply-form { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; margin-top: 0.6rem; }
.reply-form textarea { width: 100%; }

/* ── New build form extras ───────────────────────────────── */
.build-form-card { max-width: 640px; }
.image-input { margin-bottom: 0.5rem; }
.wiring-input, .code-input { font-family: 'Courier New', monospace; font-size: 0.85rem; }
.field-optional { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ── Admin review ────────────────────────────────────────── */
.review-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.5rem;
  margin-bottom: 1.5rem;
}
.review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.review-title { font-family: var(--font-heading); font-size: 1.2rem; color: var(--cream); margin-bottom: 0.3rem; }

/* ── Builds responsive ───────────────────────────────────── */
@media (max-width: 600px) {
  .builds-page, .post-page { padding: 2rem 1.25rem 4rem; }
  .post-full { padding: 1.5rem; }
  .comment.reply { margin-left: 1rem; padding-left: 0.75rem; }
  .post-thumb { width: 90px; height: 90px; }
}

/* ============================================================
   LANDING — transition line, network ticker, get-started cards
   ============================================================ */

/* ── Transition line (between hero and network) ──────────── */
.transition { display: flex; justify-content: center; }
.transition-line {
  font-family: var(--font-heading);
  color:       var(--ember-dim);
  font-size:   1.1rem;
  text-align:  center;
  padding:     3rem 2rem;
  max-width:   640px;
  line-height: 1.7;
}

/* ── Live network ticker ─────────────────────────────────── */
.ticker-section {
  position:      relative;
  z-index:       1;
  background:    var(--void);
  border-top:    1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding:       4rem 0;
  overflow:      hidden;
}
.ticker-heading {
  font-family:   var(--font-heading);
  font-size:     clamp(1.6rem, 4vw, 2.2rem);
  font-weight:   700;
  color:         var(--ember);
  text-align:    center;
  margin-bottom: 2.5rem;
}
.ticker {
  overflow: hidden;
  /* fade the left and right edges */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.ticker-inner {
  display:     flex;
  align-items: center;
  width:       max-content;
  animation:   ticker-scroll 40s linear infinite;
}
.ticker-inner:hover { animation-play-state: paused; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }   /* list is duplicated → -50% is one full loop */
}
/* Spacing via margin (not flex gap) so -50% lands seamlessly on the loop seam. */
.ticker-card {
  display:       flex;
  align-items:   center;
  gap:           0.55rem;
  flex-shrink:   0;
  white-space:   nowrap;
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       0.7rem 1.1rem;
  margin-right:  1.25rem;
  transition:    all var(--transition);
}
.ticker-card:hover {
  border-color: var(--ember-dim);
  transform:    translateY(-2px);
  box-shadow:   0 6px 18px rgba(0,0,0,0.3);
}
.ticker-glyph { color: var(--ember); font-size: 0.95rem; }
.ticker-name  { font-family: var(--font-heading); font-weight: 600; color: var(--cream); font-size: 0.92rem; }
.ticker-tag   { font-family: var(--font-heading); font-size: 0.74rem; color: var(--ember-dim); letter-spacing: 0.06em; }
.ticker-member { color: var(--muted); }
.ticker-meta  { font-size: 0.74rem; color: var(--muted); }
.ticker-founder {
  width:         6px;
  height:        6px;
  border-radius: 50%;
  background:    var(--ember);
  box-shadow:    0 0 5px var(--ember);
  flex-shrink:   0;
}
.ticker-loc   { font-size: 0.72rem; color: var(--muted); }
.ticker-sep   { color: var(--ember-dim); font-size: 1.1rem; margin-right: 1.25rem; flex-shrink: 0; }
.ticker-cta   { text-align: center; margin-top: 2.5rem; }
.ticker-empty { text-align: center; color: var(--muted); margin-bottom: 1.5rem; }
@media (prefers-reduced-motion: reduce) {
  .ticker-inner { animation: none; }
}

/* ── Get Started cards (landing section 4) ───────────────── */
.start-section { padding: 5rem 0; }
.start-cards {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   1.5rem;
}
@media (max-width: 640px) { .start-cards { grid-template-columns: 1fr; } }
.start-card {
  background:     var(--surface);
  border:         1px solid var(--border);
  border-radius:  var(--radius-lg);
  padding:        2rem;
  display:        flex;
  flex-direction: column;
  gap:            0.75rem;
  transition:     all var(--transition);
}
.start-card:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.start-card.warm {
  border-color: var(--ember-dim);
  background:   linear-gradient(180deg, rgba(224,123,84,0.06), var(--surface));
}
.start-card.warm:hover {
  border-color: var(--ember);
  box-shadow:   0 0 0 1px rgba(224,123,84,0.18), 0 8px 32px rgba(0,0,0,0.4);
}
.start-card.cool { border-color: var(--border-hot); }
.start-card.cool:hover { border-color: var(--lavender); }
.start-card-icon  { font-size: 2rem; }
.start-card-title { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; color: var(--cream); }
.start-card-body  { font-size: 0.92rem; color: var(--muted); line-height: 1.65; flex: 1; }
.start-card-links { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }

/* ============================================================
   GET STARTED PAGE
   ============================================================ */
.getstarted-page {
  position:  relative;
  z-index:   1;
  max-width: 820px;
  margin:    0 auto;
  padding:   4rem 2rem 5rem;
}
.getstarted-header { text-align: center; margin-bottom: 3.5rem; }
.getstarted-title {
  font-family:   var(--font-display);
  font-size:     clamp(2.5rem, 6vw, 3.5rem);
  color:         var(--cream);
  margin-bottom: 0.75rem;
}
.getstarted-sub { color: var(--muted); font-size: 1.05rem; }
.paths { display: flex; flex-direction: column; gap: 1.5rem; }
.path-card {
  display:       flex;
  gap:           1.5rem;
  align-items:   flex-start;
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       2rem;
  transition:    all var(--transition);
}
.path-card:hover {
  border-color: var(--border-hot);
  transform:    translateY(-3px);
  box-shadow:   0 8px 32px rgba(0,0,0,0.4);
}
.path-icon {
  font-size:   2rem;
  color:       var(--ember);
  line-height: 1.2;
  flex-shrink: 0;
  filter:      drop-shadow(0 0 8px rgba(224,123,84,0.3));
}
.path-body  { flex: 1; min-width: 0; }
.path-title { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 700; color: var(--cream); margin-bottom: 0.6rem; }
.path-text  { font-size: 0.92rem; color: var(--muted); line-height: 1.7; margin-bottom: 1.25rem; }
.getstarted-divider { height: 1px; background: var(--border); margin: 3.5rem 0; }
.getstarted-foot { text-align: center; max-width: 620px; margin: 0 auto; }
.getstarted-foot-text { font-size: 1rem; color: var(--muted); line-height: 1.8; margin-bottom: 1.5rem; }
@media (max-width: 600px) {
  .path-card { flex-direction: column; gap: 1rem; }
}

/* ============================================================
   GRIMOIRE — a library of uncomfortable questions
   ============================================================ */
.grimoire-page {
  position:  relative;
  z-index:   1;
  max-width: 820px;
  margin:    0 auto;
  padding:   4rem 2rem 5rem;
}
.grimoire-header { text-align: center; margin-bottom: 4rem; }
.grimoire-title {
  font-family:   var(--font-display);
  font-size:     clamp(2.5rem, 6vw, 3.5rem);
  color:         var(--cream);
  margin-bottom: 1.25rem;
}
.grimoire-sub {
  font-size:   1.05rem;
  color:       var(--muted);
  line-height: 1.8;
  max-width:   620px;
  margin:      0 auto 1.25rem;
}
.grimoire-note { font-size: 0.8rem; color: var(--ember-dim); font-style: italic; }

/* Books */
.grim-book { margin-bottom: 4rem; }
.grim-book-num {
  font-family:    var(--font-heading);
  font-size:      0.8rem;
  font-weight:    600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          var(--ember);
}
.grim-book-title {
  font-family: var(--font-heading);
  font-size:   1.9rem;
  font-weight: 700;
  color:       var(--softgray);
  margin:      0.4rem 0 0.5rem;
  line-height: 1.2;
}
.grim-book-subtitle { font-size: 0.95rem; color: var(--muted); line-height: 1.6; max-width: 640px; }
.grim-book-divider { border: none; border-top: 1px solid var(--border); margin: 1.75rem 0; }

/* Questions */
.grim-questions { display: flex; flex-direction: column; gap: 1.25rem; }
.grim-question {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.75rem;
}
.grim-question-text {
  font-family: var(--font-heading);
  font-size:   1.2rem;
  font-weight: 600;
  line-height: 1.45;
  color:       var(--softgray);
}

/* Entries */
.grim-entries {
  list-style:     none;
  display:        flex;
  flex-direction: column;
  gap:            1.25rem;
  margin-top:     1.25rem;
  padding-top:    1.25rem;
  border-top:     1px solid var(--border);
}
.grim-entry { display: flex; flex-direction: column; gap: 0.35rem; }
.grim-entry-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.grim-entry-title { font-family: var(--font-heading); font-size: 1rem; font-weight: 600; color: var(--gold); }
.grim-entry-annotation { font-size: 0.88rem; color: var(--muted); line-height: 1.65; }
.grim-entry-link {
  align-self:  flex-start;
  font-family: var(--font-heading);
  font-size:   0.82rem;
  font-weight: 600;
  color:       var(--teal);
  transition:  color var(--transition);
}
.grim-entry-link:hover { color: var(--ember-glow); }
.grim-entry-empty { font-size: 0.9rem; color: var(--muted); font-style: italic; margin-top: 1rem; }

/* Format tag pills */
.fmt-tag {
  font-family:    var(--font-heading);
  font-size:      0.66rem;
  font-weight:    600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding:        0.15rem 0.5rem;
  border-radius:  100px;
  border:         1px solid var(--border);
  color:          var(--muted);
  background:     var(--void);
}
.fmt-tag.fmt-video { color: var(--teal);  border-color: var(--teal); }
.fmt-tag.fmt-book  { color: var(--ember); border-color: var(--ember-dim); }

/* Between books */
.grim-book-sep { border: none; border-top: 1px solid var(--border); max-width: 200px; margin: 0 auto 4rem; opacity: 0.5; }
.grim-footer { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 3rem; }

/* ── Grimoire admin dashboard ─────────────────────────────── */
.admin-grim-book {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.5rem;
  margin-bottom: 1.5rem;
}
.admin-grim-book-head {
  display:         flex;
  align-items:     baseline;
  justify-content: space-between;
  gap:             1rem;
  flex-wrap:       wrap;
  margin-bottom:   1rem;
}
.admin-grim-q { border-top: 1px solid var(--border); padding: 1rem 0; }
.admin-grim-q-text { color: var(--ember); font-family: var(--font-heading); font-size: 0.95rem; margin-bottom: 0.4rem; line-height: 1.4; }
.admin-grim-entry {
  font-size:   0.85rem;
  color:       var(--muted);
  margin:      0.3rem 0 0.3rem 1.25rem;
  display:     flex;
  gap:         0.6rem;
  align-items: center;
  flex-wrap:   wrap;
}
.admin-actions { display: inline-flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.admin-link {
  font-size:   0.74rem;
  font-family: var(--font-heading);
  color:       var(--ember-dim);
  background:  none;
  border:      none;
  padding:     0;
  cursor:      pointer;
  transition:  color var(--transition);
}
.admin-link:hover { color: var(--ember); }
.admin-link.danger { color: var(--red); }
.admin-link.danger:hover { color: #F08080; }
.admin-inline-form { display: inline; }

/* ── Build character sheets ─────────────────────────────────────────────────
   Devices as characters: pips, stat blocks, portraits, lore. Additive only —
   no existing selectors are modified, so the admin review page is untouched.
   Filled pip = var(--ember); empty pip = var(--border), matching .star on/off. */

/* Pips (shared: post sheet, cards, rail, tooltips carry the meanings) */
.char-pips { display: inline-flex; align-items: center; gap: 0.12rem; }
.char-pips .pip { font-size: 0.8rem; line-height: 1; }
.char-pips .pip.on  { color: var(--ember); filter: drop-shadow(0 0 3px rgba(224,123,84,0.45)); }
.char-pips .pip.off { color: var(--border); }
.char-pips .pip-label {
  font-family:    var(--font-heading);
  font-size:      0.62rem;
  letter-spacing: 0.12em;
  color:          var(--muted);
  margin-right:   0.35rem;
}

/* Single build page — name + role + tagline */
.char-role {
  font-family:     var(--font-heading);
  font-size:       0.95rem;
  letter-spacing:  0.08em;
  text-transform:  uppercase;
  color:           var(--ember);
  margin:          0.35rem 0 0;
}
.char-tagline {
  font-family: var(--font-body);
  font-style:  italic;
  color:       var(--softgray);
  margin:      0.25rem 0 0;
  font-size:   1rem;
}

/* Portrait — framed main image with a glyph fallback */
.char-portrait-wrap { margin: 1.6rem 0; }
.char-portrait {
  display:         flex;
  align-items:     center;
  justify-content: center;
  width:           100%;
  max-width:       320px;
  aspect-ratio:    1 / 1;
  margin:          0 auto;
  background:      var(--void);
  border:          1px solid var(--border-hot);
  border-radius:   var(--radius-lg);
  overflow:        hidden;
  box-shadow:      0 0 24px rgba(224,123,84,0.12), inset 0 0 40px rgba(0,0,0,0.5);
}
.char-portrait img { width: 100%; height: 100%; object-fit: cover; }
.char-portrait-glyph {
  font-size: 5rem;
  opacity:   0.85;
  filter:    drop-shadow(0 0 12px rgba(224,123,84,0.4));
}
.char-extra-imgs { margin-top: 0.75rem; justify-content: center; }

/* Stat block — five pip rows with meanings */
.stat-block { display: flex; flex-direction: column; gap: 0.55rem; }
.stat-row {
  display:               grid;
  grid-template-columns: 4rem auto 1fr;
  align-items:           center;
  gap:                   0.85rem;
}
.stat-row-label {
  font-family:    var(--font-heading);
  font-size:      0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--cream);
}
.stat-row .char-pips .pip { font-size: 1.05rem; }
.stat-row-meaning { font-size: 0.8rem; color: var(--muted); }
@media (max-width: 600px) {
  .stat-row { grid-template-columns: 3.6rem auto; }
  .stat-row-meaning { grid-column: 1 / -1; font-size: 0.74rem; }
}

/* Abilities / Lore — multi-line text, escaped, newlines preserved (never |safe) */
.char-abilities, .char-lore {
  white-space: pre-wrap;
  color:       var(--softgray);
  line-height: 1.6;
  font-size:   0.96rem;
}
.char-lore { font-style: italic; color: var(--moon); }

/* The Build — mechanics header */
.the-build-head .the-build-meta {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
  margin-top:  0.45rem;
  font-size:   0.85rem;
  color:       var(--muted);
}
.the-build-label { font-family: var(--font-heading); letter-spacing: 0.06em; }

/* "Start here" beginner rail — the Khan-Academy front door */
.start-here {
  margin:        1.5rem 0 2.5rem;
  padding:       1.5rem;
  background:    linear-gradient(135deg, rgba(224,123,84,0.08), rgba(120,70,180,0.06));
  border:        1px solid var(--border-hot);
  border-radius: var(--radius-lg);
}
.start-here-head { margin-bottom: 1.1rem; }
.start-here-title {
  font-family: var(--font-display);
  font-size:   1.4rem;
  color:       var(--ember-glow);
  margin:      0;
}
.start-here-sub { color: var(--softgray); margin: 0.3rem 0 0; font-size: 0.92rem; }
.start-here-rail {
  display:           flex;
  gap:               1rem;
  overflow-x:        auto;
  padding-bottom:    0.4rem;
  scroll-snap-type:  x mandatory;
}
.start-here-card {
  flex:            0 0 auto;
  width:           160px;
  scroll-snap-align: start;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  gap:             0.45rem;
  padding:         1rem 0.8rem;
  text-align:      center;
  background:      var(--surface);
  border:          1px solid var(--border);
  border-radius:   var(--radius);
  text-decoration: none;
  transition:      all var(--transition);
}
.start-here-card:hover {
  border-color: var(--ember);
  transform:    translateY(-3px);
  box-shadow:   0 6px 20px rgba(0,0,0,0.35);
}
.start-here-portrait {
  width:           72px;
  height:          72px;
  border-radius:   50%;
  overflow:        hidden;
  display:         flex;
  align-items:     center;
  justify-content: center;
  background:      var(--void);
  border:          1px solid var(--border-hot);
}
.start-here-portrait img { width: 100%; height: 100%; object-fit: cover; }
.start-here-glyph { font-size: 2rem; filter: drop-shadow(0 0 8px rgba(224,123,84,0.4)); }
.start-here-name {
  font-family: var(--font-heading);
  font-size:   0.92rem;
  color:       var(--cream);
  line-height: 1.2;
}
.start-here-role {
  font-size:      0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--ember-dim);
}
.start-here-go {
  margin-top:     auto;
  font-family:    var(--font-heading);
  font-size:      0.72rem;
  letter-spacing: 0.08em;
  color:          var(--ember);
}

/* ── Builds index: Lego-thesis hero + numbered learning path ────────────────
   Presentation-only, additive. New .builds-hero* classes (NOT .builds-header,
   which builds_forum.html still uses). Existing variables only. */

/* Hero / manifesto — matches the getstarted/grimoire header pattern */
.builds-hero { text-align: center; margin-bottom: 2.75rem; }
.builds-hero-title {
  font-family: var(--font-display);
  font-size:   clamp(2.2rem, 6vw, 3.5rem);
  line-height: 1.12;
  color:       var(--cream);
  margin:      0 0 1.1rem;
}
.builds-hero-title .accent {
  color:  var(--ember);
  filter: drop-shadow(0 0 14px rgba(224,123,84,0.45));
}
.builds-hero-lead {
  font-size:   1.05rem;
  color:       var(--softgray);
  line-height: 1.8;
  max-width:   640px;
  margin:      0 auto;
}

/* Start-here rail — framed as the immediate beginner door */
.start-here { box-shadow: 0 0 34px rgba(224,123,84,0.10); }
.start-here-eyebrow {
  display:        inline-block;
  font-family:    var(--font-heading);
  font-size:      0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          var(--ember);
  margin-bottom:  0.5rem;
}

/* The numbered climb — a connecting spine threads the four steps top → bottom */
.builds-path { position: relative; margin-bottom: 2.5rem; }
.path-step {
  position:      relative;
  padding-left:  3.4rem;
  margin-bottom: 2.75rem;
}
/* connector: from below this step's number down to the next step's number */
.path-step:not(:last-child)::before {
  content:    '';
  position:   absolute;
  left:       18px;
  top:        42px;
  bottom:     -2.75rem;
  width:      2px;
  background: linear-gradient(to bottom, var(--border-hot), var(--border));
  opacity:    0.5;
}
.path-step-head { margin-bottom: 1.1rem; }
.path-step-num {
  position:        absolute;
  left:            0;
  top:             0;
  width:           38px;
  height:          38px;
  border-radius:   50%;
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-family:     var(--font-display);
  font-size:       0.92rem;
  font-weight:     700;
  color:           var(--ember);
  background:      var(--surface-hot);
  border:          1px solid var(--border-hot);
}
.path-step-headtext { min-width: 0; }
/* Restyle the (index-only) section title into a real heading inside the path */
.path-step .forum-section-title {
  font-family:    var(--font-heading);
  font-size:      1.18rem;
  font-weight:    700;
  text-transform: none;
  letter-spacing: 0.02em;
  color:          var(--cream);
  margin:         0;
  padding:        0;
  border:         none;
}
.path-step-intro {
  font-size:   0.92rem;
  color:       var(--softgray);
  line-height: 1.6;
  margin:      0.3rem 0 0;
}

/* First Light — the brightest, the clear entrance to the climb */
.path-step-first .path-step-num {
  color:        var(--void);
  background:    var(--ember);
  border-color: var(--ember-glow);
  box-shadow:   0 0 18px rgba(224,123,84,0.55);
}
.path-step-first .forum-section-title { color: var(--ember-glow); }
.path-step-first .path-step-intro { color: var(--cream); }

/* Mini character cards in the feeds (build posts only) */
.build-card-content.is-build-char { position: relative; }
.is-build-char .build-card-top,
.is-build-char .build-card-title { padding-right: 64px; }
.build-card-thumb {
  position:      absolute;
  top:           0.9rem;
  right:         0.9rem;
  width:         54px;
  height:        54px;
  border-radius: var(--radius);
  overflow:      hidden;
  border:        1px solid var(--border-hot);
}
.build-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.build-card-role {
  font-family:    var(--font-heading);
  font-size:      0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--ember-dim);
  margin:         0.1rem 0 0;
}
.build-card-tags .char-pips { margin-right: 0.4rem; }

/* New-build form — stat selectors */
.stat-inputs { display: flex; flex-direction: column; gap: 0.5rem; }
.stat-input-row { display: flex; align-items: center; gap: 0.75rem; }
.stat-input-label {
  font-family:    var(--font-heading);
  font-size:      0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--cream);
  width:          4rem;
}
.stat-select { width: auto; min-width: 4.5rem; padding: 0.4rem 0.5rem; }

/* ── /builds → Foundations invitation (one prominent link to /learn) ───────── */
.builds-foundations-link {
  display:        inline-block;
  margin-top:     1.4rem;
  padding:        0.6rem 1.2rem;
  font-family:    var(--font-heading);
  font-size:      0.9rem;
  letter-spacing: 0.03em;
  color:          var(--void);
  background:     var(--ember);
  border-radius:  var(--radius);
  box-shadow:     0 0 20px rgba(224,123,84,0.35);
  transition:     all var(--transition);
}
.builds-foundations-link:hover {
  background: var(--ember-glow);
  transform:  translateY(-2px);
  box-shadow: 0 6px 24px rgba(224,123,84,0.45);
}

/* ── Learn / curriculum page — scaffolded course, Khan-style ───────────────── */
.learn-page {
  position:  relative;
  z-index:   1;
  max-width: 820px;
  margin:    0 auto;
  padding:   4rem 2rem 5rem;
}
.learn-hero { text-align: center; margin-bottom: 3.5rem; }
.learn-title {
  font-family: var(--font-display);
  font-size:   clamp(2.3rem, 6vw, 3.4rem);
  color:       var(--cream);
  margin:      0 0 1rem;
}
.learn-lead {
  font-size:   1.05rem;
  color:       var(--softgray);
  line-height: 1.8;
  max-width:   600px;
  margin:      0 auto;
}
.learn-course {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.75rem;
  margin-bottom: 1.75rem;
  transition:    border-color var(--transition);
}
.learn-course:hover { border-color: var(--border-hot); }
.learn-course-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.25rem; }
.learn-course-icon {
  font-size:   2rem;
  line-height: 1.1;
  flex-shrink: 0;
  filter:      drop-shadow(0 0 8px rgba(224,123,84,0.3));
}
.learn-course-headtext { min-width: 0; }
.learn-course-num {
  display:        block;
  font-family:    var(--font-heading);
  font-size:      0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color:          var(--ember-dim);
  margin-bottom:  0.25rem;
}
.learn-course-title {
  font-family: var(--font-heading);
  font-size:   1.3rem;
  font-weight: 700;
  color:       var(--cream);
  margin:      0;
}
.learn-course-desc { color: var(--muted); font-size: 0.92rem; margin: 0.35rem 0 0; line-height: 1.6; }
.learn-lessons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.learn-lesson {
  display:       flex;
  align-items:   center;
  gap:           0.9rem;
  padding:       0.8rem 0.9rem;
  background:    var(--void);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  transition:    border-color var(--transition);
}
.learn-lesson:hover { border-color: var(--ember-dim); }
.learn-lesson-num {
  flex-shrink:     0;
  width:           1.8rem;
  height:          1.8rem;
  display:         flex;
  align-items:     center;
  justify-content: center;
  border-radius:   50%;
  background:      var(--surface-hot);
  border:          1px solid var(--border-hot);
  font-family:     var(--font-heading);
  font-size:       0.82rem;
  color:           var(--ember);
}
.learn-lesson-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.learn-lesson-title { color: var(--cream); font-size: 0.96rem; }
.learn-lesson-desc { color: var(--muted); font-size: 0.82rem; }
.learn-watch {
  flex-shrink:    0;
  font-family:    var(--font-heading);
  font-size:      0.8rem;
  letter-spacing: 0.04em;
  color:          var(--ember);
  white-space:    nowrap;
  transition:     color var(--transition);
}
a.learn-watch:hover { color: var(--ember-glow); }
.learn-watch-soon { color: var(--muted); }
.learn-empty { color: var(--muted); font-style: italic; }
@media (max-width: 600px) {
  .learn-lesson { flex-wrap: wrap; }
}

/* ── Homepage hero redesign: interactive CRUMB device + intent doors ─────────
   Appended overrides (later cascade) the earlier .hero-inner / .hero-doors rules.
   Existing variables + dark-fantasy aesthetic. Additive; nothing else touched. */
.hero-inner { max-width: 1040px; }
.hero-stage {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             clamp(1.5rem, 4vw, 3.5rem);
  flex-wrap:       wrap;
}
.hero-copy { text-align: left; max-width: 460px; }
.hero-copy .hero-title {
  font-size:     clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 0.7rem;
}
.hero-copy .hero-sub {
  font-size: 1.12rem;
  color:     var(--softgray);
  margin:    0;
  max-width: 380px;
}

/* The device */
.hero-device {
  position:    relative;
  width:       clamp(220px, 40vw, 380px);   /* larger, commanding centerpiece */
  flex-shrink: 0;
}
.crumb-device {
  width:     100%;
  height:    auto;
  display:   block;
  filter:    drop-shadow(0 0 15px rgba(224,123,84,0.26));
  animation: crumb-breathe 6s ease-in-out infinite;   /* slow, subtle breathing */
}
@keyframes crumb-breathe {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(224,123,84,0.2)); }
  50%      { filter: drop-shadow(0 0 24px rgba(224,123,84,0.4)); }
}
.hero-device:hover .crumb-device {
  animation-play-state: paused;          /* hover reaction: brighter, steady glow */
  filter: drop-shadow(0 0 36px rgba(244,149,106,0.6));
}
.cd-body      { fill: var(--surface); }
.cd-body-edge { fill: none; stroke: var(--border-hot); stroke-width: 2; }
.cd-screen    { fill: var(--void); stroke: var(--border); stroke-width: 1.5; }
/* Top light = a show-off RGB LED: a vivid dot whose hue — and its glow bloom —
   rotate through the full spectrum. hue-rotate at the end of the filter chain
   spins the colour of the dot AND its drop-shadows together, so the glow always
   matches the LED. ~8s/cycle: noticeable but calm. */
.cd-sensor {
  fill:      #ff2d2d;
  filter:    drop-shadow(0 0 4px #ff2d2d) drop-shadow(0 0 10px #ff2d2d);
  animation: cd-rgb 8s linear infinite;
}
@keyframes cd-rgb {
  from { filter: drop-shadow(0 0 4px #ff2d2d) drop-shadow(0 0 10px #ff2d2d) hue-rotate(0deg); }
  to   { filter: drop-shadow(0 0 4px #ff2d2d) drop-shadow(0 0 10px #ff2d2d) hue-rotate(360deg); }
}
/* Robotic eyes: each "eye" is a little dark lens/display (rounded rect) holding a
   glowing block-pupil that slides inside to track the cursor. Blink = the lens
   collapsing to a horizontal dash (.cd-eyes scaleY below), not a human eyelid. */
.cd-eye       { fill: var(--surface-hot); stroke: var(--ember-dim); stroke-width: 1.5; }
.cd-pupil     { fill: var(--ember-glow); filter: drop-shadow(0 0 5px rgba(244,149,106,0.9)); }
.cd-eyes      { transform-box: fill-box; transform-origin: center; transition: transform 0.12s ease; }
.cd-eyes.blink { transform: scaleY(0.08); }     /* JS toggles this for a quick blink */
/* Mouth: one curved stroke; JS swaps the path `d` per message (smooth where supported) */
.cd-mouth     { fill: none; stroke: var(--ember); stroke-width: 3; stroke-linecap: round; transition: d 0.45s ease; }
/* Bottom light = a heartbeat: warm-red glow that beats lub-dub, then rests.
   The keyframe cadence is two close beats (lub at 6%, dub at 21%, the dub a touch
   stronger) then a long quiet rest (30%→100%) — so it reads as a living pulse,
   not an even sine. ~1.5s/cycle. */
.cd-led {
  fill:             #E8462E;
  transform-box:    fill-box;
  transform-origin: center;
  filter:           drop-shadow(0 0 4px rgba(232,70,46,0.6));
  animation:        cd-heartbeat 1.5s ease-in-out infinite;
}
@keyframes cd-heartbeat {
  0%   { filter: drop-shadow(0 0 3px  rgba(232,70,46,0.5));  transform: scale(1);    }
  6%   { filter: drop-shadow(0 0 11px rgba(232,70,46,0.95)); transform: scale(1.30); }  /* lub */
  13%  { filter: drop-shadow(0 0 5px  rgba(232,70,46,0.6));  transform: scale(1.02); }
  21%  { filter: drop-shadow(0 0 14px rgba(232,70,46,1));    transform: scale(1.38); }  /* dub */
  30%  { filter: drop-shadow(0 0 3px  rgba(232,70,46,0.5));  transform: scale(1);    }
  100% { filter: drop-shadow(0 0 3px  rgba(232,70,46,0.5));  transform: scale(1);    }  /* rest */
}

/* Rotating greeting overlaid on the lower screen (HTML, so it wraps) */
.cd-greet {
  position:     absolute;
  left: 16%; right: 16%;
  top:          56%;
  text-align:   center;
  font-family:  var(--font-body);
  font-size:    clamp(0.5rem, 1.5vw, 0.72rem);
  line-height:  1.35;
  color:        var(--ember-glow);
  opacity:      1;
  transition:   opacity 0.45s ease;
  pointer-events: none;
}
.cd-greet.fade { opacity: 0; }

/* Intent doors (Learn / Build / Explore) */
.hero-doors {
  display:        flex;
  flex-direction: column;
  gap:            0.7rem;
  max-width:      360px;
  margin:         1.8rem 0 0;
}
.hero-door {
  display:         flex;
  align-items:     center;
  gap:             0.9rem;
  padding:         0.85rem 1.1rem;
  background:      var(--surface);
  border:          1px solid var(--border);
  border-radius:   var(--radius-lg);
  text-decoration: none;
  transition:      transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.hero-door:hover {
  transform:    translateY(-2px);
  border-color: var(--border-hot);
  box-shadow:   0 6px 22px rgba(0,0,0,0.35);
}
.hero-door-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.hero-door-text { display: flex; flex-direction: column; text-align: left; }
.hero-door-label {
  font-family: var(--font-heading);
  font-size:   1.05rem;
  font-weight: 700;
  color:       var(--cream);
}
.hero-door-sub { font-size: 0.8rem; color: var(--muted); }
.hero-door-primary {
  border-color: var(--ember);
  background:   linear-gradient(135deg, rgba(224,123,84,0.14), rgba(224,123,84,0.04));
  box-shadow:   0 0 22px rgba(224,123,84,0.18);
}
.hero-door-primary .hero-door-label { color: var(--ember-glow); }
.hero-door-primary:hover { border-color: var(--ember-glow); box-shadow: 0 6px 26px rgba(224,123,84,0.3); }

/* Mobile: device stacks above the copy; copy + doors centre */
@media (max-width: 760px) {
  .hero-stage { flex-direction: column; }
  .hero-copy  { text-align: center; max-width: 460px; }
  .hero-copy .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-doors { margin-left: auto; margin-right: auto; }
}

/* Respect reduced-motion: kill breathing/idle motion (eyes still track on move) */
@media (prefers-reduced-motion: reduce) {
  .crumb-device { animation: none; filter: drop-shadow(0 0 15px rgba(224,123,84,0.26)); }
  .cd-eyes  { transition: none; }
  .cd-greet { transition: none; }
  .cd-mouth { transition: none; }
  /* Freeze the indicator lights: calm static dot, steady warm glow — no cycle/pulse. */
  .cd-sensor { animation: none; fill: var(--ember-dim); filter: none; }
  .cd-led    { animation: none; transform: none; filter: drop-shadow(0 0 4px rgba(224,123,84,0.6)); }
}

/* ── /builds: curated build-guide library — staircase + capstones ──────────── */
.builds-section { margin-bottom: 3.5rem; }
.builds-section-head { margin-bottom: 1.6rem; }
.builds-section-eyebrow {
  display:        inline-block;
  font-family:    var(--font-heading);
  font-size:      0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          var(--ember-dim);
  margin-bottom:  0.5rem;
}
.builds-section-title {
  font-family: var(--font-display);
  font-size:   clamp(1.6rem, 3.5vw, 2.2rem);
  color:       var(--cream);
  margin:      0 0 0.5rem;
}
.builds-section-intro {
  color:       var(--softgray);
  line-height: 1.7;
  max-width:   620px;
  margin:      0;
  font-size:   0.96rem;
}
.builds-empty { color: var(--muted); font-style: italic; }

/* The staircase — a connecting spine threads the numbered rungs top → bottom */
.guide-staircase { position: relative; }
.guide-step { position: relative; padding-left: 3.4rem; margin-bottom: 1rem; }
.guide-step:not(:last-child)::before {
  content:    '';
  position:   absolute;
  left:       17px;
  top:        42px;
  bottom:     -1rem;
  width:      2px;
  background: linear-gradient(to bottom, var(--border-hot), var(--border));
  opacity:    0.5;
}
.guide-step-num {
  position:        absolute;
  left:            0;
  top:             0;
  width:           36px;
  height:          36px;
  border-radius:   50%;
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-family:     var(--font-display);
  font-size:       0.9rem;
  font-weight:     700;
  color:           var(--ember);
  background:      var(--surface-hot);
  border:          1px solid var(--border-hot);
}
.guide-step-first .guide-step-num {
  color:        var(--void);
  background:    var(--ember);
  border-color: var(--ember-glow);
  box-shadow:   0 0 16px rgba(224,123,84,0.5);
}

/* Guide card — name + one-liner + stats on the left; CTA/coming-soon on the right */
.guide-card {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             1rem;
  background:      var(--surface);
  border:          1px solid var(--border);
  border-radius:   var(--radius-lg);
  padding:         1.1rem 1.3rem;
  text-decoration: none;
  transition:      transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
a.guide-card-live:hover {
  transform:    translateY(-2px);
  border-color: var(--border-hot);
  box-shadow:   0 6px 22px rgba(0,0,0,0.35);
}
.guide-step-first .guide-card {
  border-color: var(--ember);
  background:   linear-gradient(135deg, rgba(224,123,84,0.10), rgba(224,123,84,0.03));
}
.guide-card-soon { border-style: dashed; opacity: 0.92; }
.guide-card-body { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.guide-card-name {
  font-family: var(--font-heading);
  font-size:   1.05rem;
  font-weight: 700;
  color:       var(--cream);
}
.guide-card-role {
  font-family:    var(--font-heading);
  font-size:      0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--ember-dim);
}
.guide-card-desc { font-size: 0.86rem; color: var(--muted); line-height: 1.5; }
.guide-card-stats { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 0.2rem; }
.guide-soon-badge {
  flex-shrink:    0;
  font-family:    var(--font-heading);
  font-size:      0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color:          var(--ember-dim);
  border:         1px solid var(--border-hot);
  border-radius:  100px;
  padding:        0.3rem 0.7rem;
  white-space:    nowrap;
}
.guide-card-go {
  flex-shrink:    0;
  font-family:    var(--font-heading);
  font-size:      0.8rem;
  letter-spacing: 0.04em;
  color:          var(--ember);
  white-space:    nowrap;
}

/* ── Collapsible guide sections (native <details>, no JS) ──────────────────────
   Depth (wiring, troubleshooting, Ask-AI, photos, read-first) tucked into labeled
   dropdowns so the essentials stay in front of the builder. Matches the site: a
   surface bar with a heading-font label and an ember chevron that flips when open. */
.guide-collapse {
  border:        1px solid var(--border);
  border-radius: var(--radius);
  background:    var(--surface);
  margin-bottom: 1rem;
}
.guide-collapse-summary {
  list-style:  none;
  cursor:      pointer;
  display:     flex;
  align-items: center;
  gap:         0.6rem;
  padding:     0.85rem 1.1rem;
  font-family: var(--font-heading);
  font-size:   1rem;
  font-weight: 600;
  color:       var(--cream);
  user-select: none;
  transition:  color var(--transition);
}
.guide-collapse-summary::-webkit-details-marker { display: none; }
.guide-collapse-summary::after {
  content:     '▾';
  margin-left: auto;
  color:       var(--ember-dim);
  transition:  transform var(--transition);
}
.guide-collapse[open] > .guide-collapse-summary::after { transform: rotate(180deg); }
.guide-collapse[open] > .guide-collapse-summary,
.guide-collapse-summary:hover { color: var(--ember-glow); }
.guide-collapse-body {
  padding:    1rem 1.1rem 1.1rem;
  border-top: 1px solid var(--border);
}

/* ── Compact staircase guide nav — ← Previous · jump menu · Next → in one tight row.
   The <select> flexes to fill the middle and shrinks on mobile (min-width:0) so it
   never overflows; arrows stay on their ends and wrap only if truly narrow. */
.guide-nav {
  display:       flex;
  align-items:   center;
  gap:           0.6rem;
  margin-bottom: 1.5rem;
  flex-wrap:     wrap;
}
.guide-nav-link {
  font-family: var(--font-heading);
  font-size:   0.8rem;
  font-weight: 600;
  color:       var(--ember);
  white-space: nowrap;
  transition:  color var(--transition);
}
.guide-nav-link:hover { color: var(--ember-glow); }
.guide-nav-link.disabled { color: var(--muted); opacity: 0.45; pointer-events: none; }
.guide-nav-jump {
  flex:          1;
  min-width:     0;
  font-family:   var(--font-body);
  font-size:     0.82rem;
  color:         var(--cream);
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       0.35rem 0.6rem;
  cursor:        pointer;
}
.guide-nav-jump:hover { border-color: var(--border-hot); }
/* Mobile: the <select> won't reliably shrink on a shared flex row (iOS/WebKit keeps its
   long-option intrinsic width, overflowing the narrow viewport and taking the bar
   off-screen). Give it its own full-width row — it can't overflow or collapse there —
   with ← Previous / Next → sharing the row above. Two short rows, all tappable. */
@media (max-width: 600px) {
  .guide-nav { justify-content: space-between; }
  .guide-nav-jump { order: 2; flex-basis: 100%; width: 100%; }
}

/* Pinned glossary/reference card — sits ABOVE the numbered staircase. Visually
   distinct from the ember build cards: teal accent, no rung number, no stars, so it
   reads as "a reference to keep handy" rather than "step 1". Teal-rgba glow mirrors
   the ember-rgba shadow technique already used on .guide-step-first .guide-card. */
.guide-reference-card {
  display:       block;
  background:    var(--surface);
  border:        1px solid var(--teal);
  border-radius: var(--radius-lg);
  padding:       1.05rem 1.25rem;
  margin-bottom: 1.75rem;
  transition:    box-shadow var(--transition);
}
.guide-reference-card:hover { box-shadow: 0 0 18px rgba(61,122,138,0.28); }
.guide-reference-eyebrow {
  display:        block;
  font-family:    var(--font-heading);
  font-size:      0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color:          var(--teal);
  margin-bottom:  0.35rem;
}
.guide-reference-name {
  display:     block;
  font-family: var(--font-heading);
  font-size:   1.1rem;
  font-weight: 700;
  color:       var(--cream);
}
.guide-reference-sub { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }

/* The Founding Three — secondary capstone grid, visually distinct from the staircase */
.builds-section-founding { margin-top: 1rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }
.founding-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap:                   1rem;
}
.founding-grid .guide-card {
  flex-direction: column;
  align-items:    flex-start;
  border-color:   var(--ember-dim);
  background:     linear-gradient(160deg, rgba(224,123,84,0.06), var(--surface) 60%);
}
.founding-grid .guide-card-go { margin-top: 0.6rem; }
@media (max-width: 600px) {
  .guide-card { flex-direction: column; align-items: flex-start; }
  .guide-soon-badge, .guide-card-go { margin-top: 0.5rem; }
}

/* ── Build guide (tutorial) display — clean, readable, additive ─────────────── */
.guide-meta {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
  margin:      0.4rem 0 1.5rem;
  font-size:   0.9rem;
  color:       var(--muted);
}
.guide-images { margin-bottom: 1.75rem; flex-wrap: wrap; }
/* Free-text guide bodies: escaped + newlines preserved (numbered steps, line breaks). */
.guide-text {
  white-space: pre-wrap;
  color:       var(--softgray);
  line-height: 1.75;
  font-size:   0.98rem;
}
.guide-steps { line-height: 1.9; }

/* Ask AI — the standout copy-a-prompt block */
.ask-ai {
  background:    linear-gradient(135deg, rgba(224,123,84,0.09), rgba(120,70,180,0.05));
  border:        1px solid var(--border-hot);
  border-radius: var(--radius-lg);
  padding:       1.5rem;
}
.ask-ai-lead { color: var(--softgray); margin: 0 0 1rem; font-size: 0.95rem; line-height: 1.6; }
.ask-ai-box {
  position:      relative;
  background:    var(--void);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1rem 1rem 1.1rem;
  margin-bottom: 1rem;
}
.ask-ai-prompt {
  white-space:  pre-wrap;
  word-break:   break-word;
  font-family:  'Courier New', monospace;
  font-size:    0.86rem;
  line-height:  1.6;
  color:        var(--cream);
  margin:       0 0 0.9rem;
  max-height:   320px;
  overflow:     auto;
}
.ask-ai-copy { white-space: nowrap; }
.ask-ai-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.guide-next .guide-text { color: var(--cream); }

/* Build photos — inline responsive gallery (build guides only; additive, leaves
   the shared .post-images/.post-thumb untouched so discussion posts are unchanged). */
.guide-gallery {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:                   0.75rem;
}
.guide-gallery-item {
  display:       block;
  border:        1px solid var(--border);
  border-radius: var(--radius);
  overflow:      hidden;
  background:    var(--void);            /* frames letterboxed images; bounds a broken one */
  transition:    border-color var(--transition);
}
.guide-gallery-item:hover { border-color: var(--border-hot); }
.guide-gallery-item img {
  display:    block;
  width:      100%;
  height:     260px;
  object-fit: contain;                   /* show the whole photo, no crop, no blow-out */
  transition: transform var(--transition);
}
.guide-gallery-item:hover img { transform: scale(1.03); }
@media (max-width: 600px) {
  .guide-gallery { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .guide-gallery-item img { height: 200px; }
}

/* Manual build <-> Learn cross-links (optional; hidden when empty) */
.guide-crosslink { margin-bottom: 1.75rem; }
.learn-build-link {
  flex-shrink:    0;
  font-family:    var(--font-heading);
  font-size:      0.78rem;
  letter-spacing: 0.04em;
  color:          var(--teal);
  white-space:    nowrap;
  margin-left:    0.6rem;
  transition:     color var(--transition);
}
a.learn-build-link:hover { color: var(--lavender); }
