/* ==========================================================================
   Libra Engine -- public schematic ( /map/ )
   Inherits tokens, fonts, and the .le-shell layout grid from ../styles.css.
   Adds the cascade layout and the staggered station reveal (adapted from the
   Rising Compass methodology cflow). Type scale matches the LE style guide.
   ========================================================================== */

:root {
  --map-violet: #9933ff;
  --map-blue:   #3388ff;
  --map-green:  #33cc55;
  --map-orange: #ffbb33;
  --map-red:    #ff3333;
}

/* .map-main also carries .le-shell, so width comes from the global grid. */
.map-main {
  min-height: 100vh;
  padding-bottom: 96px;
}

/* --- top bar / back ----------------------------------------------------- */
.map-back {
  display: inline-block;
  margin: 28px 0 0;
  font-family: 'Cormorant SC', serif;
  font-size: 0.94rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--le-ink-dim);
  text-decoration: none;
}
.map-back:hover { color: var(--le-gold); }

/* --- hero --------------------------------------------------------------- */
.map-hero {
  text-align: center;
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--le-rule);
}
.map-eyebrow {
  font-family: 'Cormorant SC', serif;
  font-size: 1.01rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--le-gold);
  margin: 0 0 14px;
}
/* h1: held to the same modest size as the homepage title */
.map-title {
  font-family: 'Cormorant SC', serif;
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3rem);
  letter-spacing: 0.16em;
  color: var(--le-ink-bright);
  margin: 0 0 16px;
  line-height: 1.05;
}
.map-kicker {
  font-style: italic;
  font-size: 1.42rem;
  color: var(--le-ink-dim);
  max-width: 56ch;
  margin: 0 auto;
}

/* --- section scaffold --------------------------------------------------- */
.map-section { padding: 52px 0 0; }
.map-section-label {
  font-family: 'Cormorant SC', serif;
  font-size: 1.01rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--le-gold);
  text-align: center;
  margin: 0 0 6px;
}
.map-section-note {
  text-align: center;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--le-ink-dim);
  max-width: 52ch;
  margin: 0 auto 30px;
}

/* --- the cascade spine -------------------------------------------------- */
.map-spine {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.map-node {
  position: relative;
  background: var(--le-bg-soft);
  border: 1px solid var(--le-rule);
  border-radius: 12px;
  padding: 22px 24px;
  margin: 0 auto;
  width: 100%;
  max-width: 640px;
}
/* connector line down to the next node */
.map-node:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -34px;
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--le-gold), transparent);
  transform: translateX(-0.5px);
}
.map-node + .map-node { margin-top: 34px; }

.map-node-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.map-dot {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--le-gold);
  background: radial-gradient(circle at 50% 38%, rgba(216,182,100,0.20), transparent 70%);
  display: flex; align-items: center; justify-content: center;
  color: var(--le-gold);
}
.map-dot svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.map-node-eyebrow {
  font-family: 'Cormorant SC', serif;
  font-size: 0.79rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--le-ink-dim);
  margin: 0 0 1px;
}
.map-node-name {
  font-family: 'Cormorant SC', serif;
  font-weight: 600;
  font-size: 1.94rem;
  letter-spacing: 0.04em;
  color: var(--le-ink-bright);
  margin: 0;
  line-height: 1.1;
}
.map-node-desc {
  font-size: 1.18rem;
  line-height: 1.6;
  color: var(--le-ink);
  margin: 0;
}
.map-node-meta {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--le-rule);
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--le-ink-dim);
}
.map-node-meta b { color: var(--le-ink); font-weight: 400; }
.map-node-meta .owns { color: var(--le-gold); }

/* charge spectrum mini (instrument node) */
.map-spectrum { margin-top: 14px; }
.map-spectrum-bar {
  position: relative;
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}
.map-spectrum-bar span { flex: 1 1 0; }
.map-seg.violet { background: var(--map-violet); }
.map-seg.blue   { background: var(--map-blue); }
.map-seg.green  { background: var(--map-green); }
.map-seg.orange { background: var(--map-orange); }
.map-seg.red    { background: var(--map-red); }
.map-spectrum-ends {
  display: flex;
  justify-content: space-between;
  font-family: 'Cormorant SC', serif;
  font-size: 0.79rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--le-ink-dim);
  margin-top: 6px;
}

/* --- the two flanking columns ------------------------------------------ */
.map-rails {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.map-rail {
  background: var(--le-bg-soft);
  border: 1px solid var(--le-rule);
  border-left: 3px solid var(--le-gold);
  border-radius: 0 12px 12px 0;
  padding: 20px 22px;
}
.map-rail-name {
  font-family: 'Cormorant SC', serif;
  font-weight: 600;
  font-size: 1.46rem;
  letter-spacing: 0.06em;
  color: var(--le-ink-bright);
  margin: 0 0 8px;
}
.map-rail-who {
  font-family: 'Cormorant SC', serif;
  font-size: 0.79rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--le-gold);
  margin: 0 0 8px;
}
.map-rail p { font-size: 1.1rem; line-height: 1.6; color: var(--le-ink); margin: 0; }
.map-rail-link { margin: 14px 0 0 !important; }
.map-rail-link a {
  font-family: 'Cormorant SC', serif;
  font-size: 0.94rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--le-gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.map-rail-link a:hover { color: var(--le-gold-bright); border-bottom-color: var(--le-gold); }

/* --- lens chips --------------------------------------------------------- */
.map-lenses {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.map-lens {
  border: 1px solid var(--le-rule);
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--le-bg-soft);
  font-family: 'Cormorant SC', serif;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--le-ink);
}
.map-lens.is-live { border-color: var(--le-gold); color: var(--le-ink-bright); }
.map-lens .tag {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--le-ink-dim);
  margin-left: 7px;
}
.map-lens.is-live .tag { color: var(--le-gold); }

/* --- portfolio grid ----------------------------------------------------- */
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.map-cell {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--le-bg-soft);
  border: 1px solid var(--le-rule);
  border-radius: 10px;
  padding: 16px 18px;
  transition: border-color 0.2s, transform 0.2s;
}
a.map-cell:hover { border-color: var(--le-gold); transform: translateY(-2px); }
.map-cell-name {
  font-family: 'Cormorant SC', serif;
  font-weight: 600;
  font-size: 1.37rem;
  letter-spacing: 0.05em;
  color: var(--le-ink-bright);
  margin: 0 0 3px;
}
.map-cell-desc { font-size: 1.01rem; line-height: 1.5; color: var(--le-ink-dim); margin: 0; }

/* --- status legend ------------------------------------------------------ */
.map-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: center;
  font-size: 1.06rem;
  color: var(--le-ink);
}
.map-status span { display: inline-flex; align-items: center; gap: 7px; }
.map-status i {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; font-style: normal;
}
.map-status .live    i { background: var(--map-green); }
.map-status .soon    i { background: var(--le-gold); }
.map-status .planned i { background: var(--le-ink-dim); }
.map-status .wip     i { background: var(--map-blue); }

/* --- closing note ------------------------------------------------------- */
.map-coda {
  margin-top: 56px;
  padding: 26px 28px;
  border: 1px solid var(--le-rule);
  border-radius: 12px;
  text-align: center;
  background: var(--le-bg-soft);
}
.map-coda p { font-style: italic; font-size: 1.18rem; line-height: 1.65; color: var(--le-ink-dim); margin: 0 auto; max-width: 58ch; }

/* --- replay ------------------------------------------------------------- */
.map-replay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 34px auto 0;
  background: transparent;
  border: 1px solid var(--le-rule);
  border-radius: 999px;
  color: var(--le-ink-dim);
  font-family: 'Cormorant SC', serif;
  font-size: 0.89rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 9px 18px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.map-replay:hover { color: var(--le-gold); border-color: var(--le-gold); }
.map-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.map-center { text-align: center; }

/* --- staggered reveal (progressive enhancement) ------------------------- */
@keyframes map-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.map-anim .map-reveal { opacity: 0; }
.map-reveal.flash { animation: map-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }

@media (prefers-reduced-motion: reduce) {
  .map-anim .map-reveal { opacity: 1; }
  .map-reveal.flash { animation: none; }
  a.map-cell:hover { transform: none; }
}

/* --- responsive --------------------------------------------------------- */
@media (max-width: 640px) {
  .map-main { padding-bottom: 72px; }
  .map-rails { grid-template-columns: 1fr; }
  .map-node { padding: 18px 18px; }
}
