/* ==========================================================================
   UI-Venus-2 project page — components.css
   Section content blocks: highlight cards, method stages, figures,
   safety layout + callout, BibTeX card.
   ========================================================================== */

/* Highlight cards */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 780px) { .cards { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 139, 244, 0.5);
  box-shadow: var(--shadow-soft);
}
.card .icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--ice);
  color: var(--venus);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.card .icon svg { width: 22px; height: 22px; }
.card h3 {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 19px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* Method stage cards */
.stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 860px) { .stages { grid-template-columns: 1fr; } }

.stage {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--venus-bright);
  border-radius: 14px;
  padding: 22px;
}
.stage .stage-no {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--venus);
}
.stage h3 {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 17.5px;
  margin: 8px 0 8px;
}
.stage p { margin: 0; font-size: 14.5px; color: var(--muted); }

/* Figures */
.figure {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  margin: 26px 0;
}
.figure img { border-radius: 8px; margin-inline: auto; }
.figure figcaption {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 12px;
  padding-inline: 6px;
}
.figure figcaption strong { color: var(--ink); }

/* Designed TODO placeholder for figures that are not final yet */
.figure-todo {
  border: 2px dashed rgba(59, 139, 244, 0.45);
  background:
    radial-gradient(28rem 14rem at 50% 0%, rgba(231, 244, 253, 0.9), rgba(246, 250, 254, 0.2)),
    var(--tbd-bg);
  border-radius: var(--radius);
  padding: 52px 24px;
  margin: 26px 0;
  text-align: center;
}
.figure-todo .glyph {
  font-size: 30px;
  color: var(--venus-bright);
  line-height: 1;
}
.figure-todo .title {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 18px;
  margin-top: 12px;
}
.figure-todo p {
  max-width: 560px;
  margin: 8px auto 0;
  font-size: 14px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Pipeline diagram (Method section) — inline SVG, page palette, and a looping
   "training run": stages light up in sequence while the connectors flow.
   -------------------------------------------------------------------------- */

.pipeline-fig { padding: 22px 18px 14px; }
.pipeline-svg { display: block; width: 100%; height: auto; }

.pipeline-svg .pl-panel {
  fill: rgba(231, 244, 253, 0.45);
  stroke: var(--line);
  stroke-width: 1;
}
.pipeline-svg .pl-stage {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-anchor: middle;
  fill: var(--venus-deep);
}
.pipeline-svg .pl-box {
  fill: #fff;
  stroke: rgba(59, 139, 244, 0.55);
  stroke-width: 1.6;
}
.pipeline-svg .pl-label {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 650;
  text-anchor: middle;
  fill: var(--ink);
}
.pipeline-svg .pl-chip-label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 650;
  text-anchor: middle;
  fill: var(--venus-deep);
}
.pipeline-svg .pl-ico {
  fill: none;
  stroke: var(--venus);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pipeline-svg .pl-merge { fill: url(#pl-merge-g); }
.pipeline-svg .pl-merge-label {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 750;
  text-anchor: middle;
  fill: #fff;
}
.pipeline-svg .pl-merge-sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-anchor: middle;
  fill: rgba(234, 244, 255, 0.8);
}
.pipeline-svg .pl-spark { fill: var(--sky); }

/* connectors: constant marching-dash flow */
.pipeline-svg .pl-flow {
  fill: none;
  stroke: rgba(59, 139, 244, 0.55);
  stroke-width: 2;
  stroke-dasharray: 6 7;
  animation: plDash 1.15s linear infinite;
}
@keyframes plDash { to { stroke-dashoffset: -13; } }

/* the 8s cascade: base -> mid -> five domains (staggered) -> merged model */
.pipeline-svg .pl-glow { animation: plGlow 8s ease-in-out infinite; animation-delay: var(--pl-d, 0s); }
.pipeline-svg .g-base  { --pl-d: 0s; }
.pipeline-svg .g-mid   { --pl-d: 1.2s; }
.pipeline-svg .g-merge { animation-name: plGlowMerge; --pl-d: 4.6s; }
@keyframes plGlow {
  0%, 16%, 100% { filter: none; }
  7% { filter: drop-shadow(0 0 9px rgba(59, 139, 244, 0.75)); }
}
@keyframes plGlowMerge {
  0%, 22%, 100% { filter: none; }
  8% { filter: drop-shadow(0 0 16px rgba(59, 139, 244, 0.9)); }
}
.pipeline-svg .pl-flow.d0 { animation: plDash 1.15s linear infinite, plSurge 8s ease-in-out infinite 0.7s; }
.pipeline-svg .pl-flow.d1 { animation: plDash 1.15s linear infinite, plSurge 8s ease-in-out infinite 2s; }
.pipeline-svg .pl-flow.d2 { animation: plDash 1.15s linear infinite, plSurge 8s ease-in-out infinite 4s; }
@keyframes plSurge {
  0%, 14%, 100% { stroke: rgba(59, 139, 244, 0.55); }
  6% { stroke: var(--venus); }
}
.pipeline-svg .pl-spark { animation: plTwinkle 8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.pipeline-svg .pl-spark.s2 { animation-delay: 0.9s; }
@keyframes plTwinkle {
  0%, 50%, 74%, 100% { opacity: 0.35; transform: scale(0.8); }
  62% { opacity: 1; transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .pipeline-svg .pl-flow, .pipeline-svg .pl-glow, .pipeline-svg .pl-spark { animation: none; }
}

/* Safety split layout */
.safety-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 860px) { .safety-grid { grid-template-columns: 1fr; } }

.callout {
  background: linear-gradient(160deg, var(--venus-deep), var(--venus));
  color: #eaf4ff;
  border-radius: var(--radius);
  padding: 30px 28px;
}
.callout .big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 56px;
  line-height: 1;
  color: #fff;
}
.callout .big small { font-size: 22px; font-weight: 600; }
.callout .cap {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}
.callout p { font-size: 14.5px; margin: 12px 0 0; opacity: 0.94; }

/* --------------------------------------------------------------------------
   BibTeX
   -------------------------------------------------------------------------- */

.bibtex-card {
  position: relative;
  background: var(--code-bg);
  border-radius: var(--radius);
  overflow: hidden;
}
.bibtex-card pre {
  margin: 0;
  padding: 26px 28px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--code-ink);
}
.copy-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--code-ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.16); }

