/* ux.css --- v3 UX primitives (F3).
 *
 * Plate 3 right panel --- Index Design columns:
 *   Plant Seed (Earth-emoji 🌍)    .earth-emoji, .seed-card
 *   Brain Note (Discoveries)       .brain-notes, .discovery-badge, .soil-discoveries (🧠)
 *   Piano Keys (hidden CONTROLS)   .piano-keys
 *
 * Scope: styles only add --- never overrides --- the existing terminal
 * stylesheet in index.html. Class names are all new to v3.
 *
 * Typography:
 *   - body copy / meta rows stay on the terminal's IBM Plex Mono.
 *   - the seed-card quote (ONE THIRST) uses EB Garamond italic,
 *     because Plate 3 renders the visitor's OWN QUOTES as literature.
 *   - piano keys stay monospace, 13px, because they are dev controls.
 */

/* ── Earth-emoji click target in the soil row ───────────────────────── */
/* The 🌍 glyph. F5 inserts it inline in refreshSoil() (garden.mjs:500-546).
 * Click handler is wired by F5 to plant-seed.mjs::onEarthEmojiClick. */

.soil .soil-earth,
.soil .earth-emoji {
  display: inline-block;
  margin-left: 0.35em;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  font-size: 1em;
  opacity: 0.82;
  transition: opacity 140ms ease, transform 140ms ease;
  user-select: none;
}

.soil .soil-earth:hover,
.soil .earth-emoji:hover,
.soil .soil-earth:focus-visible,
.soil .earth-emoji:focus-visible {
  opacity: 1;
  transform: translateY(-1px) scale(1.04);
  outline: none;
}

/* ── Soil-row 🧠 Discoveries counter ────────────────────────────────── */
/* Added by F5 inside refreshSoil()'s template. Style-matches .soil-count. */

.soil .soil-discoveries {
  color: inherit;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-left: 0.25em;
}

.soil .soil-discoveries.pulse {
  animation: soilDiscoveryPulse 900ms ease-out 1;
}

@keyframes soilDiscoveryPulse {
  0%   { opacity: 0.55; transform: scale(0.94); }
  40%  { opacity: 1;    transform: scale(1.12); }
  100% { opacity: 1;    transform: scale(1); }
}

/* ── .seed-card --- ONE THIRST surfacing below the soil row ─────────── */
/* Plate 3: hint arrives as the user's OWN QUOTES. Card is full-width,
 * sits between the soil row and the conversation body. */

.seed-card {
  display: none;
  margin: 10px 0 14px;
  padding: 14px 18px 16px;
  border-left: 2px solid var(--red, #D0342C);
  background: linear-gradient(
    180deg,
    rgba(208, 52, 44, 0.035),
    rgba(208, 52, 44, 0.00)
  );
  border-radius: 2px;
  line-height: 1.5;
}

.seed-card.entering {
  animation: seedCardSlideIn 360ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes seedCardSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.seed-card-label {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--ink-42, rgba(17, 17, 17, 0.42));
  margin-bottom: 6px;
}

.seed-card-token {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--red, #D0342C);
  margin-bottom: 8px;
}

.seed-card-quote {
  margin: 0 0 10px;
  padding: 0;
  font-family: 'EB Garamond', 'Georgia', 'Cambria', 'Times New Roman', serif;
  font-style: italic;
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink, #111);
  quotes: "\201C" "\201D" "\2018" "\2019";
}

.seed-card-quote::before { content: open-quote;  margin-right: 0.05em; }
.seed-card-quote::after  { content: close-quote; margin-left: 0.05em; }

.seed-card-meta {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--ink-42, rgba(17, 17, 17, 0.42));
  letter-spacing: 0.02em;
}

/* ── .brain-notes --- CERTIFY_Discovery panel (Plate 3 left) ────────── */
/* Hidden by default; revealed when Release fires and awardDiscovery runs. */

.brain-notes {
  display: none;
  margin: 12px 0;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--ink-12, rgba(17, 17, 17, 0.12));
  border-bottom: 1px solid var(--ink-12, rgba(17, 17, 17, 0.12));
  background: rgba(17, 17, 17, 0.015);
}

.brain-notes[style*="display: block"],
.brain-notes[style*="display:block"] {
  animation: brainNotesReveal 520ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes brainNotesReveal {
  from { opacity: 0; transform: translateY(-4px); max-height: 0; }
  to   { opacity: 1; transform: translateY(0);    max-height: 800px; }
}

.brain-notes-header {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  margin-bottom: 8px;
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--ink-64, rgba(17, 17, 17, 0.64));
}

.brain-notes-glyph {
  font-size: 14px;
}

.brain-notes-label {
  font-weight: 500;
}

.brain-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.brain-notes-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(17, 17, 17, 0.08);
}

.brain-notes-item:last-child { border-bottom: 0; }

.brain-notes-text {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink, #111);
  flex: 1;
}

.brain-notes-time {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--ink-42, rgba(17, 17, 17, 0.42));
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── .discovery-badge --- inline CERTIFY_Discovery badge ────────────── */
/* Rendered into #body by brain-note.mjs::awardDiscovery. Part III Ch 31
 * default (a): marginal gloss in the conversation flow. */

.out.discovery-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  margin: 4px 0;
  padding: 4px 10px;
  border-left: 2px solid var(--red, #D0342C);
  background: rgba(208, 52, 44, 0.05);
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--ink-64, rgba(17, 17, 17, 0.64));
}

.discovery-badge .discovery-glyph {
  font-size: 13px;
}

.discovery-badge .discovery-label {
  font-style: italic;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--red, #D0342C);
}

.discovery-badge .discovery-text {
  color: var(--ink, #111);
}

/* ── .piano-keys --- hidden dev controls, Cmd+K toggles ─────────────── */
/* Fixed-position overlay-ish panel. Stays out of flow so it does NOT
 * disturb the terminal body layout when toggled. */

.piano-keys {
  display: none;
  position: fixed;
  right: 24px;
  bottom: 64px;
  width: 320px;
  max-width: calc(100vw - 48px);
  max-height: 70vh;
  overflow-y: auto;
  padding: 10px 12px 12px;
  background: #FCFCFA;
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 2px;
  box-shadow:
    0 1px 2px rgba(17, 17, 17, 0.06),
    0 8px 24px rgba(17, 17, 17, 0.12);
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--ink, #111);
  z-index: 9000;
}

.piano-keys-header {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.12);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--ink-64, rgba(17, 17, 17, 0.64));
}

.piano-keys-glyph {
  font-size: 14px;
}

.piano-keys-label {
  flex: 1;
  font-weight: 500;
}

.piano-keys-close {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 2px;
  padding: 1px 6px;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--ink-64, rgba(17, 17, 17, 0.64));
  cursor: pointer;
}

.piano-keys-close:hover {
  border-color: var(--red, #D0342C);
  color: var(--red, #D0342C);
}

.piano-keys-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.piano-keys-key {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 2px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink, #111);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.piano-keys-key:hover,
.piano-keys-key:focus-visible {
  border-color: var(--red, #D0342C);
  background: rgba(208, 52, 44, 0.04);
  outline: none;
}

.piano-keys-foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(17, 17, 17, 0.12);
  font-size: 10px;
  color: var(--ink-42, rgba(17, 17, 17, 0.42));
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* Print: all three v3 panels stay suppressed.
 * The terminal's existing @media print rules already handle the core UI. */
@media print {
  .seed-card,
  .brain-notes,
  .piano-keys,
  .out.discovery-badge {
    display: none !important;
  }
}

/* Reduced-motion: disable entrance / pulse animations. */
@media (prefers-reduced-motion: reduce) {
  .seed-card.entering,
  .brain-notes[style*="display: block"],
  .brain-notes[style*="display:block"],
  .soil .soil-discoveries.pulse {
    animation: none !important;
  }
}
