/* "Draw with your own AI assistant" (landing/ai.js, #80): a dark terminal window (macOS chrome,
   monospace, a blinking block caret) and, overlapping it, the lab-report page the figure lands on.
   The terminal and the paper keep their own colours in both themes. */

.dl-ai { padding-bottom: var(--dl-space); }
.dl-ai h2 { font-size: var(--dl-h2); letter-spacing: -0.02em; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.dl-soon {
  font: 600 0.8rem var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px; padding: 4px 10px;
}

.dl-ai-stage { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; margin-top: 28px; }

.term {
  --t-bg: #1c1d24; --t-bar: #26272f; --t-ink: #d9dce3; --t-dim: #8a8f9c;
  --t-pink: #f08ab8; --t-green: #8fd19e; --t-blue: #8cc4ff;
  grid-column: 1 / 2; grid-row: 1; border-radius: 14px; overflow: hidden; background: var(--t-bg); color: var(--t-ink);
  box-shadow: 0 40px 80px -40px rgba(20, 22, 40, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  font: 400 0.9rem/1.65 ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--t-bar); }
.term-bar .dot { width: 12px; height: 12px; border-radius: 50%; }
.term-bar .r { background: #ff5f57; } .term-bar .y { background: #febc2e; } .term-bar .g { background: #28c840; }
.term-title { flex: 1; text-align: center; margin-right: 56px; color: var(--t-dim); font-size: 0.8rem; }
.term-body { padding: 18px 20px 26px; min-height: 290px; }
.term .ln { white-space: pre-wrap; overflow-wrap: anywhere; }
.term .cwd { color: var(--t-green); }
.term .sym { color: var(--t-dim); }
.term .you { margin: 10px 0 14px; color: #fff; }
.term .t-tool { color: var(--t-pink); font-weight: 600; margin-top: 4px; }
.term .t-out { color: var(--t-dim); }
.term .t-link { color: var(--t-blue); }
.term .t-say { color: var(--t-ink); margin-top: 12px; }
.term .caret { display: inline-block; width: 0.6em; height: 1.1em; vertical-align: text-bottom; background: var(--t-ink); margin-left: 2px; animation: dl-caret 1s steps(1) infinite; }
.is-done .term .caret { animation: none; opacity: 0; }
@keyframes dl-caret { 50% { opacity: 0; } }

/* While playing, the assistant's lines appear one by one. */
.is-playing .term .ln.t-tool, .is-playing .term .ln.t-out, .is-playing .term .ln.t-say { opacity: 0; transform: translateY(4px); transition: opacity 260ms, transform 260ms var(--dl-ease); }
.is-playing .term .ln.on { opacity: 1; transform: none; }

.report {
  grid-column: 2 / 3; grid-row: 1; margin: 132px 14px 0 -48px; position: relative;
  background: #fdfcfa; color: #2a2d3a; border-radius: 6px; padding: 26px 26px 22px;
  box-shadow: 0 30px 60px -30px rgba(20, 22, 40, 0.55), 0 0 0 1px rgba(20, 22, 40, 0.08);
  transform: rotate(1.2deg); transition: transform 600ms var(--dl-ease);
}
.report:hover { transform: rotate(0deg) translateY(-4px); }
.report-kicker { margin: 0 0 4px; font: 500 0.72rem var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: #7a7f8e; }
.report h3 { margin: 0 0 14px; font: 600 1.15rem var(--font-display); color: #262a4a !important; }
.report-text { display: grid; gap: 7px; margin-bottom: 16px; }
.report-text span { height: 7px; border-radius: 4px; background: #e6e3ea; }
.report-text .short { width: 62%; }
.report img { display: block; width: 100%; height: auto; }
.report figcaption { margin-top: 10px; font-size: 0.8rem; line-height: 1.45; color: #555a68; }
.is-playing .report img, .is-playing .report figcaption { opacity: 0; transform: translateY(10px) scale(0.98); transition: opacity 500ms, transform 700ms var(--dl-ease); }
.is-done .report img, .is-done .report figcaption { opacity: 1; transform: none; }

.dl-ai-cta { margin: 26px 0 0; font-weight: 600; }

@media (max-width: 760px) {
  .dl-ai-stage { grid-template-columns: minmax(0, 1fr); }
  .term { grid-column: 1; grid-row: 1; font-size: 0.8rem; }
  .term-body { min-height: 0; }
  .report { grid-column: 1; grid-row: 2; margin: -18px 14px 0; transform: rotate(0.8deg); }
}
