/* ============================================================
   TRL-DLTE landing page — additions on top of index.css
   (index.css is the recolored cua-suite stylesheet)
   ============================================================ */

/* ---- Logo mark (inline tri-grid SVG: table with a highlighted row x column x cell) ---- */
.logo-mark { display: block; }
.navbar-brand .logo-mark {
  width: 26px; height: 26px;
  overflow: visible;          /* let the rounded square's corners show while spinning */
  transform-origin: 50% 50%;
}
/* Hover the brand -> the logo spins clockwise, continuously, until the mouse leaves. */
.navbar-brand:hover .logo-mark { animation: trl-logo-spin 1.8s linear infinite; }
@keyframes trl-logo-spin { to { transform: rotate(360deg); } }

/* Hero logo: same hover-to-spin behavior as the navbar mark. */
.logo-container .logo-mark {
  overflow: visible;          /* let the rounded square's corners show while spinning */
  transform-origin: 50% 50%;
}
.logo-container .logo-mark:hover { animation: trl-logo-spin 1.8s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  .navbar-brand:hover .logo-mark,
  .logo-container .logo-mark:hover { animation: none; }
}

/* ---- Hero eyebrow ---- */
.hero-eyebrow {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* ---- Hero teaser image ---- */
.hero-teaser-wrap {
  margin: 1.5rem auto 1.25rem;
  max-width: 100%;   /* fill the hero column (was 740px — teaser read too small) */
}
.hero-teaser {
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(47, 42, 107, 0.14);
  border: 1px solid rgba(47, 42, 107, 0.10);
  background: #fff;
  display: block;
}

/* ---- Wide banner figures ---- */
.figure-wide {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Interactive demo (embedded voxel viewer) ---- */
.demo-wrap { margin: 1rem 0 0.5rem; }
.demo-frame {
  width: 100%;
  height: 660px;
  border: 1px solid rgba(47, 42, 107, 0.12);
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(47, 42, 107, 0.16);
  background: #f3f1fb;
  display: block;
}
.demo-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.demo-hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
}
.demo-hint i { color: var(--teal); margin-right: 0.25rem; }

@media (max-width: 768px) {
  .demo-frame { height: 460px; }
}

/* ---- Overview "why DLTE" featured card label ---- */
.component-card.featured::before { content: 'Key Finding'; }

/* ---- Results note ---- */
.results-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}
.results-note a { color: var(--teal); font-weight: 600; text-decoration: none; }
.results-note a:hover { text-decoration: underline; }

/* ---- Three Suites section ---- */
.component-card p.suite-tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--teal);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}
/* Repurpose the featured badge for the compositional (DLTE) suite card */
.suites-grid .component-card.featured::before { content: 'Compositional'; }

/* ---- Findings subsection heading ---- */
.subsection-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* ---- Findings: leaders-by-capability strip ---- */
.leaders-grid { margin-top: 1.5rem; }
.leaders-grid .component-card { padding: 1.5rem 1.25rem; }
.leader-list { list-style: none; margin: 0; padding: 0; }
.leader-list li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  line-height: 1.4;
}
.leader-list li:last-child { border-bottom: none; }
.leader-list strong { color: var(--text-primary); }

/* ---- Suite cards: per-suite key result + direct dataset link ---- */
.component-card .suite-result {
  font-size: 0.82rem;
  color: var(--text-primary);
  background: rgba(47, 42, 107, 0.05);
  border-left: 3px solid var(--teal);
  padding: 0.5rem 0.7rem;
  border-radius: 0 6px 6px 0;
  margin: 0.85rem 0 0.6rem;
  line-height: 1.45;
}
.component-card .suite-result strong { color: var(--teal); }
.component-card .suite-data-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
}
.component-card .suite-data-link:hover { text-decoration: underline; }
.component-card .suite-data-link i { font-size: 0.85em; }

/* ---- Hero datasets link row (3 direct dataset links) ---- */
.hero-datasets {
  display: table;                 /* shrink-to-fit box, centered via margin auto */
  margin: 1.2rem auto 0;
  max-width: 100%;
  text-align: center;
  font-size: 0.95rem;             /* was 0.85 — too small to notice */
  color: var(--text-primary);
  padding: 0.6rem 1.2rem;
  border: 1px solid rgba(109, 75, 196, 0.22);
  border-radius: 10px;
  background: rgba(109, 75, 196, 0.05);
}
.hero-datasets i { color: var(--teal); margin-right: 0.3rem; }
.hero-datasets a { color: var(--teal); font-weight: 600; text-decoration: none; }
.hero-datasets a:hover { text-decoration: underline; }

/* ---- Inside-CTbench: balanced 2x2 capability grid (4 cards) ---- */
@media (min-width: 720px) {
  #ctbench .components-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 840px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---- Inside-Rbench: centered 2-up (2 cards — avoid the stranded 3rd column) ---- */
@media (min-width: 720px) {
  #rbench .components-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 840px;          /* same card width as the CTbench 2x2 above */
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---- Demo nav pill: gradient call-to-action with shine + glow, so it grabs the eye ---- */
.content-nav .nav-item.nav-cta {
  position: relative;
  overflow: hidden;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  box-shadow: 0 2px 10px rgba(109, 75, 196, 0.45);
  animation: nav-cta-glow 1.9s ease-in-out infinite;
}
.content-nav .nav-item.nav-cta.active { color: #fff; }          /* keep white text when scrolled-to */
.content-nav .nav-item.nav-cta i { font-size: 0.72em; margin-right: 0.32em; }
.content-nav .nav-item.nav-cta:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(109, 75, 196, 0.6);
}
/* a light streak that sweeps across the pill on a loop */
.content-nav .nav-item.nav-cta::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 55%; height: 100%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-200%) skewX(-18deg);
  animation: nav-cta-shine 2.6s ease-in-out infinite;
}
@keyframes nav-cta-glow {
  0%, 100% { box-shadow: 0 2px 10px rgba(109, 75, 196, 0.40); }
  50%      { box-shadow: 0 2px 18px 3px rgba(109, 75, 196, 0.70); }
}
@keyframes nav-cta-shine {
  0%   { transform: translateX(-200%) skewX(-18deg); }
  55%  { transform: translateX(320%)  skewX(-18deg); }
  100% { transform: translateX(320%)  skewX(-18deg); }   /* hold, then repeat */
}
@media (prefers-reduced-motion: reduce) {
  .content-nav .nav-item.nav-cta { animation: none; box-shadow: 0 2px 12px rgba(109, 75, 196, 0.5); }
  .content-nav .nav-item.nav-cta::after { display: none; }
}

/* ============================================================
   Eye-candy layer: hero animated backdrop, scroll hint,
   scroll-reveal + stat count-up (driven by static/js/index.js)
   ============================================================ */

/* ---- Hero backdrop: a slowly drifting table grid + floating "cells" ---- */
.hero { overflow: hidden; }
.hero .container { position: relative; z-index: 1; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-bg-grid {
  position: absolute;
  inset: -56px;                                  /* covers the one-tile pan loop */
  background-image:
    linear-gradient(rgba(109, 75, 196, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109, 75, 196, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 90% 75% at 50% 30%, #000 35%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 75% at 50% 30%, #000 35%, transparent 78%);
  animation: hero-grid-pan 64s linear infinite;
}
@keyframes hero-grid-pan { to { transform: translate(44px, 44px); } }

/* Floating cells echo the logo palette: purple / blue / amber */
.hero-cell {
  position: absolute;
  border-radius: 7px;
  background: rgba(109, 75, 196, 0.08);
  border: 1px solid rgba(109, 75, 196, 0.12);
  animation: hero-cell-float ease-in-out infinite alternate;
}
.hero-cell.blue  { background: rgba(47, 111, 208, 0.08); border-color: rgba(47, 111, 208, 0.13); }
.hero-cell.amber { background: rgba(245, 158, 11, 0.10); border-color: rgba(245, 158, 11, 0.16); }
.hero-cell.c1 { width: 34px; height: 34px; top: 12%; left: 5%;    animation-duration: 9s; }
.hero-cell.c2 { width: 20px; height: 20px; top: 38%; left: 9%;    animation-duration: 12s;   animation-delay: -3s; }
.hero-cell.c3 { width: 26px; height: 26px; top: 68%; left: 4.5%;  animation-duration: 10s;   animation-delay: -6s; }
.hero-cell.c4 { width: 38px; height: 38px; top: 16%; right: 5%;   animation-duration: 11s;   animation-delay: -2s; }
.hero-cell.c5 { width: 18px; height: 18px; top: 47%; right: 9%;   animation-duration: 8s;    animation-delay: -5s; }
.hero-cell.c6 { width: 28px; height: 28px; top: 74%; right: 4%;   animation-duration: 13s;   animation-delay: -8s; }
.hero-cell.c7 { width: 14px; height: 14px; top: 30%; left: 13%;   animation-duration: 10.5s; animation-delay: -1.5s; }
@keyframes hero-cell-float {
  from { transform: translateY(7px)  rotate(-2deg); }
  to   { transform: translateY(-9px) rotate(3deg); }
}
@media (max-width: 900px) { .hero-cell { display: none; } }  /* side gutters vanish on narrow screens */

/* ---- Scroll hint: bobbing chevron chip, fades once the reader scrolls ---- */
.hero-scroll-hint {
  position: fixed;
  left: 50%;
  bottom: 1.1rem;
  z-index: 60;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: var(--teal);
  font-size: 1rem;
  border: 1px solid rgba(109, 75, 196, 0.25);
  box-shadow: 0 4px 16px rgba(47, 42, 107, 0.18);
  transform: translateX(-50%);
  animation: hint-bob 1.7s ease-in-out infinite;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.hero-scroll-hint:hover { color: #fff; background: var(--teal); }
.hero-scroll-hint.hint-hidden { opacity: 0; visibility: hidden; }
@keyframes hint-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-7px); }
}
@media (max-width: 768px) { .hero-scroll-hint { display: none; } }

/* ---- Scroll-reveal (classes added by JS; without JS nothing is ever hidden) ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.reveal-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .hero-bg-grid, .hero-cell, .hero-scroll-hint { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
@media print {
  .hero-scroll-hint { display: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---- DLTE pipeline: a signal cascades through the four stages (1 -> 2 -> 3 -> star) ---- */
.pipeline-steps .step-number { position: relative; }
.pipeline-steps .step-number::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--teal);
  opacity: 0;
  pointer-events: none;
  animation: step-ping 5.6s ease-out infinite;     /* 4 slots x 1.4s */
}
.pipeline-steps .pipeline-step:nth-child(2) .step-number::after { animation-delay: 1.4s; }
.pipeline-steps .pipeline-step:nth-child(3) .step-number::after { animation-delay: 2.8s; }
.pipeline-steps .pipeline-step:nth-child(4) .step-number::after { animation-delay: 4.2s; border-color: #f59e0b; }
@keyframes step-ping {
  0%   { transform: scale(0.75); opacity: 0.9; }
  20%  { transform: scale(2.0);  opacity: 0; }
  100% { transform: scale(2.0);  opacity: 0; }
}

/* The card itself glows briefly while its stage is "active" */
.pipeline-steps .pipeline-step { animation: step-active 5.6s ease-in-out infinite; }
.pipeline-steps .pipeline-step:nth-child(2) { animation-delay: 1.4s; }
.pipeline-steps .pipeline-step:nth-child(3) { animation-delay: 2.8s; }
.pipeline-steps .pipeline-step:nth-child(4) { animation-delay: 4.2s; animation-name: step-active-amber; }
@keyframes step-active {
  0%, 20%, 100% { border-color: rgba(0, 0, 0, 0.06); box-shadow: var(--shadow-sm); }
  8%            { border-color: rgba(109, 75, 196, 0.45); box-shadow: 0 6px 22px rgba(109, 75, 196, 0.22); }
}
@keyframes step-active-amber {
  0%, 20%, 100% { border-color: rgba(0, 0, 0, 0.06); box-shadow: var(--shadow-sm); }
  8%            { border-color: rgba(245, 158, 11, 0.55); box-shadow: 0 6px 22px rgba(245, 158, 11, 0.22); }
}
@media (prefers-reduced-motion: reduce) {
  .pipeline-steps .pipeline-step,
  .pipeline-steps .step-number::after { animation: none; }
}

/* ---- Hero title: flowing gradient across the whole title + a bright sweeping band ---- */
.publication-title.title-shine {
  background: linear-gradient(105deg,
    #2f2a6b 0%,
    #6d4bc4 18%,
    #2f6fd0 36%,
    #cdbcf9 50%,   /* the bright glint that sweeps through */
    #2f6fd0 64%,
    #6d4bc4 82%,
    #2f2a6b 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: title-flow 5s linear infinite;
}
@keyframes title-flow {
  from { background-position: 100% 0; }   /* glint enters left ... */
  to   { background-position: 0% 0; }     /* ... and exits right */
}

/* ---- Lightbox: click any large figure to inspect it full screen ---- */
.zoomable { cursor: zoom-in; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 2rem;
  background: rgba(24, 20, 54, 0.93);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  cursor: zoom-out;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 94vw;
  max-height: 84vh;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.lightbox-caption {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: center;
  max-width: 920px;
}
.lightbox-hint {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

/* ---- Floating mini voxel cube (jump-to-demo widget) ---- */
.mini-cube-widget {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s ease;
}
.mini-cube-widget.cube-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
}
.mini-cube-link { display: block; text-decoration: none; }
.mini-cube-scene {
  display: block;
  width: 58px;
  height: 58px;
  perspective: 240px;
  filter: drop-shadow(0 6px 16px rgba(47, 42, 107, 0.35));
}
.mini-cube {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: cube-spin 10s linear infinite;
}
.mini-cube-widget:hover .mini-cube { animation-duration: 3.5s; }   /* spins up on hover */
.mini-cube .face {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  /* 3x3 voxel grid lines on every face */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.38) 1.5px, transparent 1.5px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.38) 1.5px, transparent 1.5px);
  background-size: calc(100% / 3) calc(100% / 3);
}
.mini-cube .f-front  { background-color: #8a63e0; transform: rotateY(0deg)    translateZ(29px); }
.mini-cube .f-back   { background-color: #5b3fa8; transform: rotateY(180deg)  translateZ(29px); }
.mini-cube .f-right  { background-color: #6d4bc4; transform: rotateY(90deg)   translateZ(29px); }
.mini-cube .f-left   { background-color: #6d4bc4; transform: rotateY(-90deg)  translateZ(29px); }
.mini-cube .f-top    { background-color: #9d7bf0; transform: rotateX(90deg)   translateZ(29px); }
.mini-cube .f-bottom { background-color: #5b3fa8; transform: rotateX(-90deg)  translateZ(29px); }
@keyframes cube-spin {
  from { transform: rotateX(-22deg) rotateY(0deg); }
  to   { transform: rotateX(-22deg) rotateY(360deg); }
}
.mini-cube-tip {
  background: #fff;
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(109, 75, 196, 0.25);
  box-shadow: 0 4px 14px rgba(47, 42, 107, 0.16);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.mini-cube-widget:hover .mini-cube-tip { opacity: 1; transform: translateX(0); }
.mini-cube-close {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(109, 75, 196, 0.3);
  background: #fff;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.mini-cube-widget:hover .mini-cube-close { opacity: 1; }
.mini-cube-close:hover { color: var(--teal); }
@media (max-width: 768px) { .mini-cube-widget { display: none; } }

/* ---- BibTeX copy: a tiny burst of "table cells" ---- */
.cell-confetti {
  position: fixed;
  z-index: 110;
  border-radius: 2px;
  pointer-events: none;
  animation: confetti-pop 1.25s cubic-bezier(0.16, 0.66, 0.35, 1) forwards;
}
@keyframes confetti-pop {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  45%  { transform: translate(calc(var(--dx) * 0.6), var(--dy)) rotate(calc(var(--rot) * 0.5)); opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 220px)) rotate(var(--rot)); opacity: 0; }
}

/* ---- Demo frame: rotating gradient ring around the crown-jewel viewer ---- */
.demo-wrap {
  position: relative;
  padding: 3px;                       /* ring thickness */
  border-radius: 17px;
  overflow: hidden;                   /* clips the rotating gradient square */
  box-shadow: 0 12px 40px rgba(109, 75, 196, 0.22);
}
.demo-wrap::before {
  content: "";
  position: absolute;
  left: -50%;
  top: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(#6d4bc4 0deg, #2f6fd0 95deg, #8a63e0 185deg, #f59e0b 245deg, #6d4bc4 360deg);
  animation: ring-spin 9s linear infinite;
}
@keyframes ring-spin { to { transform: rotate(360deg); } }
.demo-frame {
  position: relative;
  z-index: 1;
  border: none;                       /* the ring replaces the old static border */
  box-shadow: none;
}

/* ---- Hero cursor glow: a soft light that follows the mouse over the grid ---- */
.hero-glow {
  position: absolute;
  left: 0;
  top: 0;
  width: 90px;            /* bright core ~ one 44px grid cell */
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(109, 75, 196, 0.32) 0%,
    rgba(47, 111, 208, 0.12) 45%,
    transparent 72%);
  transform: translate3d(calc(var(--gx, 50%) - 45px), calc(var(--gy, 30%) - 45px), 0);
  transition: transform 0.08s ease-out, opacity 0.45s ease;
  opacity: 0;
  pointer-events: none;
}
.hero-glow.on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .publication-title.title-shine { animation: none; background-position: 50% 0; }  /* static, glint centered */
  .mini-cube { animation: none; transform: rotateX(-22deg) rotateY(35deg); }
  .cell-confetti { display: none; }
  .demo-wrap::before { animation: none; }      /* static multi-color ring */
  .hero-glow { display: none; }
}
@media print {
  .mini-cube-widget, .lightbox { display: none; }
}
