/* Research & Development band (qis_research_figures.php), directly below Institute Credentials.
   Navy band; Publications (gold) and Patents (blue / rose / green stages) panels, then a strip with the
   single figures. Bars are drawn to scale from the data; they grow once on entry (js/qis-research-figures.js)
   and show full length without JavaScript or with reduced motion. Text contrast on #0b2545 is 5.4:1 or more. */
.qis-rd {
  --rd-navy: #0b2545;
  --rd-ink: #ffffff;
  --rd-soft: #c5d0e0;
  --rd-gold: #ffb347;
  --rd-blue: #6aa8f0;
  --rd-rose: #ff7a8a;
  --rd-green: #45c98f;
  --rd-line: rgba(197, 208, 224, 0.18);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* Aurora in the band's own four accents over deep navy. */
  background:
    radial-gradient(36rem 20rem at 6% 8%, rgba(255, 179, 71, 0.22), transparent 68%),
    radial-gradient(30rem 22rem at 58% 120%, rgba(255, 122, 138, 0.16), transparent 70%),
    radial-gradient(34rem 24rem at 102% 4%, rgba(106, 168, 240, 0.24), transparent 70%),
    radial-gradient(24rem 16rem at 96% 96%, rgba(69, 201, 143, 0.16), transparent 70%),
    linear-gradient(160deg, #0d2b52 0%, #081c36 100%);
  color: var(--rd-ink);
  font-family: 'Open Sans', Arial, sans-serif;
}
/* Blueprint grid (fine 12px, major 60px) as on a patent drawing sheet, fading out from the centre. */
.qis-rd::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(197, 208, 224, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(197, 208, 224, 0.11) 1px, transparent 1px),
    linear-gradient(rgba(197, 208, 224, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(197, 208, 224, 0.045) 1px, transparent 1px);
  background-size: 60px 60px, 60px 60px, 12px 12px, 12px 12px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 40%, #000 20%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 90% at 50% 40%, #000 20%, transparent 80%);
}
/* Circuit traces drawn in from the top-right corner. */
.qis-rd::after {
  content: "";
  position: absolute;
  top: -10px;
  right: -20px;
  z-index: -1;
  width: 420px;
  height: 300px;
  opacity: 0.5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 300' fill='none' stroke='%236aa8f0' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M420 40H300l-30 30H180'/%3E%3Cpath d='M420 80H320l-40 40v60l-30 30H150'/%3E%3Cpath d='M420 130h-60l-20 20v100'/%3E%3Cpath d='M360 0v20l-25 25h-95'/%3E%3Cpath d='M420 200h-40l-20 20v80' stroke='%2345c98f'/%3E%3Cpath d='M250 0v12l-18 18h-80' stroke='%23ffb347'/%3E%3Cg fill='%230b2545'%3E%3Ccircle cx='180' cy='70' r='4'/%3E%3Ccircle cx='150' cy='210' r='4'/%3E%3Ccircle cx='340' cy='250' r='4'/%3E%3Ccircle cx='240' cy='45' r='4'/%3E%3Ccircle cx='360' cy='300' r='4' stroke='%2345c98f'/%3E%3Ccircle cx='152' cy='30' r='4' stroke='%23ffb347'/%3E%3C/g%3E%3C/svg%3E") no-repeat right top / contain;
  -webkit-mask-image: linear-gradient(225deg, #000 30%, transparent 85%);
  mask-image: linear-gradient(225deg, #000 30%, transparent 85%);
  pointer-events: none;
}
.qis-rd__inner { position: relative; max-width: 980px; margin: 0 auto; padding: 40px 24px 36px; }
.qis-rd__title {
  margin: 0 0 22px;
  color: var(--rd-ink);
  font-family: 'QIS Serif', Georgia, 'Times New Roman', serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.qis-rd__title::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  margin-top: 12px;
  border-radius: 2px;
  background: var(--rd-gold);
}

.qis-rd__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; }
.qis-rd__panel {
  --rd-accent: var(--rd-gold);
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px 24px 24px;
  border: 1px solid var(--rd-line);
  border-top-color: rgba(255, 255, 255, 0.26);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.03));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--rd-ink);
  text-decoration: none;
  transition: border-color 0.2s ease-out, background-color 0.2s ease-out;
}
.qis-rd__panel--pat { --rd-accent: var(--rd-blue); }
a.qis-rd__panel:hover, a.qis-rd__panel:focus { color: var(--rd-ink); text-decoration: none; }
a.qis-rd__panel:hover { border-color: rgba(197, 208, 224, 0.42); background: rgba(255, 255, 255, 0.07); }
.qis-rd a:focus-visible { outline: 3px solid var(--rd-gold); outline-offset: 3px; }

/* Icons: outline in the label colour, accent part in the item's colour. */
.qis-rd__icon {
  flex: none;
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.qis-rd__icon .a { stroke: var(--rd-accent); }
.qis-rd__icon circle.a, .qis-rd__panel--pub .qis-rd__icon .a { fill: color-mix(in srgb, var(--rd-accent) 22%, transparent); }

.qis-rd__head { display: flex; align-items: center; gap: 10px; color: var(--rd-soft); }
.qis-rd__name { color: var(--rd-soft); font-size: 17px; font-weight: 600; line-height: 1.3; }
.qis-rd__head .qis-rd__name { color: var(--rd-ink); font-size: 19px; }

.qis-rd__big, .qis-rd__mid, .qis-rd__stage-text b {
  font-family: 'Sora', 'Open Sans', Arial, sans-serif;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.qis-rd__big { margin: 18px 0 16px; color: var(--rd-gold); font-size: 68px; line-height: 0.95; }

/* Publications bar: whole track = all publications, gold = the Scopus share. */
.qis-rd__track {
  position: relative;
  display: block;
  height: 12px;
  margin-top: auto;
  border-radius: 6px;
  background: rgba(255, 179, 71, 0.26);
  overflow: hidden;
}
.qis-rd__fill, .qis-rd__bar > span {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  transform-origin: left center;
}
.qis-rd__fill { background: var(--rd-gold); }
.qis-rd__part { margin-top: 10px; color: var(--rd-soft); font-size: 16px; }
.qis-rd__part b {
  color: var(--rd-gold);
  font-family: 'Sora', 'Open Sans', Arial, sans-serif;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Patents: three stages, bars to scale against Filed. */
.qis-rd__stages { display: grid; gap: 14px; margin-top: 18px; }
.qis-rd__stage {
  --rd-accent: var(--rd-blue);
  display: grid;
  grid-template-columns: 34px 150px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: var(--rd-soft);
}
.qis-rd__stage--2 { --rd-accent: var(--rd-rose); }
.qis-rd__stage--3 { --rd-accent: var(--rd-green); }
.qis-rd__stage-text { font-size: 16px; white-space: nowrap; }
.qis-rd__stage-text b { color: var(--rd-ink); font-size: 26px; margin-right: 2px; }
.qis-rd__stage--1 .qis-rd__stage-text b { font-size: 36px; }
.qis-rd__bar { display: block; height: 14px; border-radius: 7px; background: rgba(197, 208, 224, 0.1); overflow: hidden; }
.qis-rd__bar > span { background: var(--rd-accent); }

/* Strip: the single figures. */
.qis-rd__more {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
  border-top: 1px solid var(--rd-line);
}
.qis-rd__fact {
  --rd-accent: var(--rd-gold);
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 18px 24px 4px;
  color: var(--rd-soft);
  text-decoration: none;
}
.qis-rd__fact--2 { --rd-accent: var(--rd-green); border-left: 1px solid var(--rd-line); }
.qis-rd__fact .qis-rd__icon { width: 40px; height: 40px; }
.qis-rd__fact .qis-rd__icon .a { fill: color-mix(in srgb, var(--rd-accent) 22%, transparent); }
a.qis-rd__fact:hover, a.qis-rd__fact:focus { color: var(--rd-soft); text-decoration: none; }
a.qis-rd__fact:hover .qis-rd__name { color: var(--rd-ink); }
.qis-rd__mid { color: var(--rd-ink); font-size: 40px; line-height: 1; }
.qis-rd__mid small { color: var(--rd-accent); font-size: 0.55em; font-weight: 600; letter-spacing: 0; }

/* Growth on entry: armed by the script, so bars are full without it. */
.qis-rd.is-armed .qis-rd__fill, .qis-rd.is-armed .qis-rd__bar > span { transform: scaleX(0); }
.qis-rd.is-grown .qis-rd__fill, .qis-rd.is-grown .qis-rd__bar > span {
  transform: scaleX(1);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 0.14s + 0.1s);
}

@media (max-width: 860px) {
  .qis-rd__grid { grid-template-columns: minmax(0, 1fr); }
  .qis-rd__big { font-size: 60px; margin: 14px 0; }
  .qis-rd__track { margin-top: 0; }
}
@media (max-width: 520px) {
  .qis-rd::after { top: auto; bottom: -20px; width: 260px; height: 186px; opacity: 0.32; transform: scaleY(-1); }
  .qis-rd__inner { padding: 32px 16px 28px; }
  .qis-rd__title { font-size: 26px; margin-bottom: 18px; }
  .qis-rd__panel { padding: 18px 18px 20px; }
  .qis-rd__big { font-size: 52px; }
  .qis-rd__stage { grid-template-columns: 28px 118px minmax(0, 1fr); gap: 10px; }
  .qis-rd__stage .qis-rd__icon { width: 28px; height: 28px; }
  .qis-rd__stage-text { font-size: 14px; }
  .qis-rd__stage-text b { font-size: 21px; }
  .qis-rd__stage--1 .qis-rd__stage-text b { font-size: 28px; }
  .qis-rd__fact { flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 14px 2px; }
  .qis-rd__fact .qis-rd__icon { width: 32px; height: 32px; }
  .qis-rd__mid { font-size: 32px; }
  .qis-rd__name { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .qis-rd.is-grown .qis-rd__fill, .qis-rd.is-grown .qis-rd__bar > span { transition: none; }
}
