/* ─── legend.css ──────────────────────────────────────────────────────────────
   Legend-specific layout only.
   All tokens (incl. --font-heading, --font-sans, --font-mono, --border-mid,
   --inset-rule), reset, nav, and footer come from global.css (via head.njk).
   CSS-6: :root and [data-theme="carbon"] blocks stripped.
   Theme detection: document.documentElement.dataset.theme === 'carbon'
   Never: classList.contains / html.carbon-mode
   ─────────────────────────────────────────────────────────────────────────── */

/* ─── Legend main layout ─────────────────────────────────────────────────── */
.legend-main {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
}

/* ─── SPA mount point ────────────────────────────────────────────────────── */
#legend-spa-mount {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) clamp(1.25rem, 4vw, 2rem) 0;
  flex: 1;
}

/* ─── SPA chrome — wordmark ──────────────────────────────────────────────── */
.legend-wordmark {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--fg);
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  display: block;
}

/* ─── SPA chrome — query input ───────────────────────────────────────────── */
.legend-input-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 0.625rem;
}

.legend-input {
  width: 100%;
  background: var(--surface);
  border: var(--border-weight) solid var(--border);
  border-radius: 8px;
  padding: 0.9375rem 3rem 0.9375rem 1.125rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s, background var(--theme-transition);
  -webkit-font-smoothing: antialiased;
}

.legend-input::placeholder {
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--fg-muted);
}

.legend-input:focus {
  border-color: var(--border-mid);
}

/* Batch icon */
.legend-batch-btn {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legend-batch-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.legend-batch-btn:hover { color: var(--accent-hover); }

.legend-batch-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── Input tagline ──────────────────────────────────────────────────────── */
.legend-tagline {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
  padding-left: 0.125rem;
}

/* ─── Result area ────────────────────────────────────────────────────────── */
#legend-result { margin-top: 2.5rem; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #legend-spa-mount { padding-top: 2.5rem; }
  .legend-wordmark { font-size: 1.375rem; margin-bottom: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ─── Holding page ───────────────────────────────────────────────────────── */
/* Remove when Legend-6 SPA shell ships. index-spa.njk becomes index.njk.   */

.legend-holding {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) clamp(1.25rem, 4vw, 2rem) 0;
}

.legend-hero {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--fg);
  line-height: 1.75;
  max-width: 480px;
  margin: 0 0 0;
}

.legend-hero--second {
  margin-top: 0.25rem;
  margin-bottom: 1.5rem;
}

.legend-launch {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--fg-muted);
  margin: 0;
}

.legend-notes-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 0.5px solid var(--accent);
  padding-bottom: 0.5px;
  transition: color 0.2s, border-color 0.2s;
}

.legend-notes-link:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

@media (max-width: 600px) {
  .legend-holding { padding-top: 2.5rem; }
  .legend-hero { font-size: 1.0625rem; }
}