/* Interactive widget styles for the Merrin build story
   (articles/merrin-development-journey/). Loaded only by that page, after
   tailwind.css, styles.css, and article.css. Prose stays in article.css; this
   file covers the labs, meters, chat showcase, and future switcher. */

/* ---- Hero portrait (wide screens only; it lives in the page margin) ---- */
.article-hero--story {
  position: relative;
  background: radial-gradient(
    60% 55% at 78% 22%,
    rgba(124, 58, 237, 0.16),
    transparent 70%
  );
  border-radius: 24px;
}
.story-portrait {
  display: none;
}
@media (min-width: 1100px) {
  .story-portrait {
    display: block;
    position: absolute;
    top: 92px;
    right: -220px;
    width: 180px;
    transform: rotate(-5deg);
    animation: story-bob 6s ease-in-out infinite;
  }
  .story-portrait img {
    display: block;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.1),
      0 0 0 6px rgba(124, 58, 237, 0.08),
      0 26px 60px rgba(0, 0, 0, 0.55);
  }
  .story-note {
    position: absolute;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(19, 19, 24, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 11px;
    line-height: 1.35;
    white-space: nowrap;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  }
  .story-note--one {
    top: -8px;
    left: -108px;
    transform: rotate(-6deg);
  }
  .story-note--two {
    bottom: -6px;
    right: -74px;
    transform: rotate(4deg);
  }
}
@keyframes story-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-5deg);
  }
  50% {
    transform: translateY(-10px) rotate(-2deg);
  }
}

/* ---- Shared lab panel ---- */
.lab {
  margin: 34px 0;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(19, 19, 24, 0.6);
}
.lab-tag {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c084fc;
  margin-bottom: 10px;
}
.lab-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: #f1f5f9;
}
.lab-note {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #64748b;
}

/* ---- Pills (shared by fork, chat, and future switchers) ---- */
.lab-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lab-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
  border-radius: 999px;
  min-height: 40px;
  padding: 8px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.lab-btn:hover {
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
}
.lab-btn[aria-pressed='true'] {
  background: #6d28d9;
  border-color: #7c3aed;
  color: #ffffff;
}
.lab-btn:focus-visible {
  outline: 2px solid rgba(168, 85, 247, 0.8);
  outline-offset: 2px;
}

/* ---- Fork: two output cells ---- */
.lab-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.lab-cell {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}
.lab-cell-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}
.lab-cell-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: #cbd5e1;
}
.lab-verdict {
  margin: 14px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
  color: #c4b5fd;
}

/* ---- Model lab ---- */
.model-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  align-items: stretch;
}
.model-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.model-btn {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
  font: inherit;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.model-btn:hover {
  border-color: rgba(255, 255, 255, 0.26);
}
.model-btn[aria-pressed='true'] {
  border-color: rgba(168, 85, 247, 0.7);
  background: rgba(168, 85, 247, 0.12);
  color: #ffffff;
}
.model-btn:focus-visible {
  outline: 2px solid rgba(168, 85, 247, 0.8);
  outline-offset: 2px;
}
.model-name {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
}
.model-name small {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
}
.model-track {
  display: block;
  margin-top: 9px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.model-fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
}
.model-detail {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(124, 58, 237, 0.07);
}
.model-detail .lab-tag {
  margin-bottom: 6px;
}
.model-size {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 40px;
  line-height: 1.05;
  color: #e9d5ff;
  margin: 0 0 10px;
}
.model-detail h3 {
  margin: 0 0 8px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  color: #f8fafc;
}
.model-detail p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #94a3b8;
}

/* ---- Voice benchmark: stat band + meters ---- */
.stat-band {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  margin: 34px 0;
  padding: 22px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.stat-number {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(52px, 9vw, 80px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: #c084fc;
  white-space: nowrap;
}
.stat-copy {
  font-size: 14px;
  line-height: 1.6;
  color: #94a3b8;
}
.stat-copy strong {
  display: block;
  font-size: 15.5px;
  color: #f1f5f9;
  margin-bottom: 4px;
}
.meter-block {
  margin: 26px 0 34px;
}
.meter-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #94a3b8;
  margin: 14px 0 6px;
}
.meter {
  height: 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.meter-fill {
  display: block;
  height: 100%;
  border-radius: 99px;
}
.meter-fill--base {
  width: 6%;
  background: #22d3ee;
}
.meter-fill--slow {
  width: 88%;
  background: linear-gradient(90deg, #7c3aed, #c084fc);
}

/* ---- Memory path: step flow ---- */
.step-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.step-btn {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  color: #94a3b8;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.step-btn:hover {
  border-color: rgba(255, 255, 255, 0.26);
  color: #e2e8f0;
}
.step-btn[aria-pressed='true'] {
  background: #6d28d9;
  border-color: #7c3aed;
  color: #ffffff;
}
.step-btn:focus-visible {
  outline: 2px solid rgba(168, 85, 247, 0.8);
  outline-offset: 2px;
}
.step-num {
  font-size: 10px;
  font-weight: 500;
  color: #64748b;
}
.step-btn[aria-pressed='true'] .step-num {
  color: #ddd6fe;
}
.step-detail {
  margin-top: 14px;
  padding: 14px 16px;
  min-height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13.5px;
  line-height: 1.6;
  color: #cbd5e1;
}
.step-detail strong {
  display: block;
  color: #f1f5f9;
  margin-bottom: 2px;
}

/* ---- Chat showcase ---- */
.chat-screen {
  margin-top: 14px;
  min-height: 190px;
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}
.chat-user {
  align-self: flex-end;
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  background: rgba(100, 116, 139, 0.35);
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.5;
}
.chat-ai-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 90%;
}
.chat-orb {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a5a1fa, #7165f6);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}
.chat-ai {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.6;
  color: #e2e8f0;
}
.chat-screen[data-mode='first'] .chat-ai {
  margin-top: 0;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}
.chat-screen[data-mode='mirrored'] .chat-ai {
  margin-top: 0;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px 16px 16px 4px;
  background: rgba(255, 255, 255, 0.06);
}
.chat-caption {
  min-height: 62px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: #94a3b8;
}
.chat-caption b {
  color: #e2e8f0;
}

/* ---- Future switcher ---- */
.future-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.future-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: center;
  min-height: 200px;
  padding-top: 20px;
}
.future-content h3 {
  margin: 0 0 10px;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.2;
  color: #ffffff;
}
.future-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #94a3b8;
}
.future-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 150px;
  padding: 20px;
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(124, 58, 237, 0.14),
    rgba(124, 58, 237, 0.04)
  );
}
.future-overline {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4b5fd;
}
.future-example {
  margin: 8px 0 0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 21px;
  line-height: 1.4;
  color: #f5f3ff;
}

/* ---- Responsive ---- */
@media (max-width: 680px) {
  .lab {
    padding: 18px 16px;
  }
  .lab-cols,
  .model-grid,
  .future-content {
    grid-template-columns: 1fr;
  }
  .stat-band {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .step-btn {
    font-size: 10.5px;
    padding: 10px 2px;
  }
  .future-content {
    min-height: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-portrait {
    animation: none;
  }
  .lab-btn,
  .model-btn,
  .step-btn {
    transition: none;
  }
}
