/* ============================================================
   GTR project page — custom layer on top of the Clarity template
   ============================================================ */

/* ---------- Hero ---------- */
/* .container sets flex:1 (basis 0); overflow:hidden would let the flex item
   collapse to zero height, so force flex:none here (selector must out-rank
   the template's div.container.blog#first-content rule). */
div.container.blog#first-content.gtr-hero {
  flex: none;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 560px at 88% 12%, rgba(27, 175, 122, 0.16), transparent 62%),
    radial-gradient(900px 520px at 4% 92%, rgba(42, 120, 214, 0.14), transparent 60%),
    linear-gradient(180deg, #0b1015 0%, #0d1319 55%, #0b1116 100%);
}

/* animated speed streaks */
div.container.blog#first-content.gtr-hero::before {
  content: "";
  position: absolute;
  inset: -60% -30%;
  background: repeating-linear-gradient(
    115deg,
    transparent 0px,
    transparent 180px,
    rgba(255, 255, 255, 0.028) 180px,
    rgba(255, 255, 255, 0.028) 184px,
    transparent 184px,
    transparent 320px,
    rgba(27, 175, 122, 0.05) 320px,
    rgba(27, 175, 122, 0.05) 323px
  );
  animation: gtr-streak 26s linear infinite;
  pointer-events: none;
}

/* faint blueprint grid, faded at edges */
div.container.blog#first-content.gtr-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(75% 75% at 50% 40%, black 30%, transparent 100%);
  mask-image: radial-gradient(75% 75% at 50% 40%, black 30%, transparent 100%);
  pointer-events: none;
}

@keyframes gtr-streak {
  from { transform: translateX(0); }
  to   { transform: translateX(-640px); }
}

div.container.blog#first-content.gtr-hero .blog-title {
  position: relative;
  z-index: 2;
}

/* gradient wordmark inside the title (survives .white * color rule) */
.gtr-grad {
  background: linear-gradient(92deg, #35d99e 0%, #1baf7a 45%, #4fc3f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* same idea on white background: one backbone (GTR green) flowing into many tasks (blue) */
.gtr-grad-ink {
  background: linear-gradient(92deg, #0d6a49 0%, #159d6e 42%, #2a78d6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

div.container.blog#first-content.gtr-hero h1.title {
  line-height: 1.18;
}

div.container.blog#first-content.gtr-hero p.author {
  opacity: 0.92;
}
div.container.blog#first-content.gtr-hero p.author .aff {
  font-style: normal;
  font-size: 0.85em;
  opacity: 0.65;
}
div.container.blog#first-content.gtr-hero p.author a {
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.45);
  text-underline-offset: 3px;
}
div.container.blog#first-content.gtr-hero p.author sup {
  font-size: 0.7em;
  line-height: 0;
}

/* hero buttons */
.gtr-hero .info .gtr-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.gtr-hero .info .button.icon {
  background-color: rgba(255, 255, 255, 0.10) !important;
  border: 1px solid rgba(255, 255, 255, 0.22);
  margin-bottom: 0;
  transition: background-color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.gtr-hero .info .button.icon:hover {
  background-color: rgba(27, 175, 122, 0.28) !important;
  border-color: rgba(27, 175, 122, 0.65);
  transform: translateY(-2px);
}

/* sticker */
.gtr-hero .blog-cover img.foreground {
  animation: gtr-float 5.5s ease-in-out infinite;
  filter: drop-shadow(0 24px 42px rgba(0, 0, 0, 0.55));
}
.gtr-hero .blog-cover img.background {
  opacity: 0.55;
  filter: blur(34px) saturate(1.35);
}
@keyframes gtr-float {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50% { transform: translateY(-14px) rotate(0.8deg); }
}

/* ---------- Stat band (inside hero) ---------- */
.gtr-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 26px 0 40px 0;
}
.gtr-stat {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(6px);
  padding: 18px 20px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.gtr-stat:hover {
  border-color: rgba(27, 175, 122, 0.55);
  transform: translateY(-3px);
}
.gtr-stat .value {
  font-family: "Poppins", sans-serif;
  font-size: 2.05em;
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
  white-space: nowrap;
}
.gtr-stat .value .unit {
  font-size: 0.52em;
  font-weight: 600;
  opacity: 0.75;
  margin-left: 2px;
}
.gtr-stat .label {
  font-family: "Poppins", sans-serif;
  font-size: 0.82em;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 6px;
  line-height: 1.4;
}

/* Baked-in formulas: the SVG carries its own glyphs, inherits colour through
   currentColor and sizes itself in ex units. The template sets a global
   `svg { width: 100% }`, which would stretch each formula across the column. */
.gtr-math { display: inline-block; }
.gtr-math svg { display: inline-block; width: auto; max-width: 100%; height: auto; margin: 0; }

/* hardware the measurements were taken on, called out in the copy */
.gtr-hw { color: #c0392b; font-weight: 600; }
.gtr-hero .gtr-hw { color: #ff8079; }

/* schematic figures read fine below full column width */
div.container.blog img.gtr-shrink { width: 75%; }


/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  div.container.blog#first-content.gtr-hero::before,
  .gtr-hero .blog-cover img.foreground { animation: none; }
}

/* ---------- Chart card ---------- */
.gtr-chart-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 22px 24px 14px 24px;
  position: relative;
}
.gtr-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.gtr-chart-title {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 1.02em;
  color: #1a1a19;
}
.gtr-chart-sub {
  font-family: "Poppins", sans-serif;
  font-size: 0.8em;
  color: #898781;
}
.gtr-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px 0;
}
.gtr-chip-row .chip-label {
  font-family: "Poppins", sans-serif;
  font-size: 0.78em;
  color: #898781;
  margin-right: 2px;
}
.gtr-chip {
  font-family: "Poppins", sans-serif;
  font-size: 0.8em;
  font-weight: 500;
  color: #52514e;
  background: #f4f4f2;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}
.gtr-chip:hover { background: #ebebe8; }
.gtr-chip.active {
  background: #10382a;
  color: #ffffff;
  border-color: #10382a;
}
.gtr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 2px 2px 2px;
  font-family: "Poppins", sans-serif;
  font-size: 0.8em;
  color: #52514e;
}
.gtr-legend .item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.gtr-chart-wrap {
  position: relative;
  width: 100%;
}
.gtr-chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}
.gtr-chart-wrap svg text {
  font-family: "Poppins", sans-serif;
}
.gtr-pt { transition: opacity 0.35s ease; cursor: pointer; }
.gtr-pt.dim { opacity: 0.10; pointer-events: none; }
.gtr-pt-hit { fill: transparent; }
.gtr-pt-hit:focus { outline: none; }
.gtr-pt-hit:focus + .gtr-pt-mark,
.gtr-pt:hover .gtr-pt-mark {
  transform: scale(1.28);
}
.gtr-pt-mark {
  transition: transform 0.18s ease;
  transform-origin: center;
  transform-box: fill-box;
}
.gtr-lbl { transition: opacity 0.35s ease; }
.gtr-lbl.dim { opacity: 0.08; }
.gtr-frontier { transition: opacity 0.35s ease; }
.gtr-frontier.dim { opacity: 0.12; }

.gtr-tip {
  position: absolute;
  pointer-events: none;
  background: #101418;
  color: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  font-family: "Poppins", sans-serif;
  font-size: 12.5px;
  line-height: 1.45;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 30;
  max-width: 240px;
  white-space: nowrap;
}
.gtr-tip.show { opacity: 1; transform: translateY(0); }
.gtr-tip .tip-val { font-weight: 700; font-size: 13.5px; }
.gtr-tip .tip-name { color: rgba(255, 255, 255, 0.78); font-size: 11.5px; display: flex; align-items: center; gap: 6px; }
.gtr-tip .tip-key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }

/* ---------- Loss cards ---------- */
.gtr-loss-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 1vh 0;
}
.gtr-loss {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 4px solid #1baf7a;
  border-radius: 12px;
  background: #fbfbfa;
  padding: 18px 20px;
}
.gtr-loss:nth-child(2) { border-left-color: #2a78d6; }
.gtr-loss:nth-child(3) { border-left-color: #eb6834; }
.gtr-loss h4 {
  font-family: "Poppins", sans-serif;
  font-size: 0.92em;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: #1a1a19;
}
.gtr-loss .math-line {
  font-size: 0.82em;
  padding: 6px 0;
  overflow-x: auto;
}

/* ---------- Tabs ---------- */
.gtr-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 10px 0;
}

/* the task tabs end one container and their panels open the next — drop the
   doubled padding at that seam so the tab row sits close to what it controls */
#results { padding-bottom: 0; }
#results + div.container.blog.extra-large { padding-top: 0; }
/* the chart card and the task tabs live in the wide container so their control
   strips fit on one row; drop the doubled padding at each seam */
#frontier { padding-bottom: 0; }
#frontier + div.container.blog.extra-large { padding-top: 0; }
.gtr-panel .gtr-chip-row { margin-top: 8px; }
.gtr-tab {
  font-family: "Poppins", sans-serif;
  font-size: 0.86em;
  font-weight: 500;
  color: #52514e;
  background: #f1f1ee;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 16px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}
.gtr-tab:hover { background: #e7e7e3; }
.gtr-tab.active {
  background: #10382a;
  color: #fff;
}
.gtr-panel { display: none; }
.gtr-panel.active { display: block; animation: gtr-fadein 0.45s ease; }
@keyframes gtr-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* metric chips inside qualitative panels */
.gtr-metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0 14px 0;
}
.gtr-metric {
  font-family: "Poppins", sans-serif;
  font-size: 0.8em;
  color: #333;
  background: #f4f4f2;
  border-radius: 8px;
  padding: 7px 12px;
}
.gtr-metric b { font-weight: 600; }

/* ---------- Results table ---------- */
/* the six task tables: plain white rows (no zebra striping), GTR rows in bold black */
.gtr-panel table tbody tr,
.gtr-panel table tbody tr:nth-child(2n+1) { background-color: #fff; }
table tr.gtr-ours td {
  color: #000;
  font-weight: 700;
}
table tr.gtr-group-row td {
  background: #fff !important;
  text-align: left !important;
  font-size: 78%;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #52514e;
}
table td.best { font-weight: 700; }
table td.best::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1baf7a;
  margin-left: 5px;
  vertical-align: middle;
}

/* ---------- Ablation delta table ---------- */
.gtr-delta {
  font-family: "Poppins", sans-serif;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.gtr-delta .row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.6fr) minmax(0, 0.6fr);
  gap: 8px;
  align-items: center;
  padding: 12px 18px;
  font-size: 0.9em;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.gtr-delta .row:first-child { border-top: none; }
.gtr-delta .row.head {
  background: #f7f7f5;
  font-size: 0.78em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #898781;
}
.gtr-delta .row:nth-child(odd):not(.head) { background: #fbfbfa; }
.gtr-delta .row.full {
  background: rgba(27, 175, 122, 0.10);
  font-weight: 600;
}
.gtr-delta .ap { font-weight: 600; color: #1a1a19; }
.gtr-delta .delta-up { color: #006300; font-weight: 600; }
.gtr-delta .delta-down { color: #a63a2b; font-weight: 600; }
.gtr-delta .delta-zero { color: #898781; }

/* ---------- Magnifier lens (AnyUp-style) ---------- */
img.gtr-zoom {
  touch-action: none;
  cursor: crosshair;
}
#gtr-lens {
  position: fixed;
  top: 0;
  left: 0;
  width: 210px;
  height: 210px;
  margin: -105px; /* center the lens on the cursor */
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #ffffff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32), 0 0 0 3px rgba(27, 175, 122, 0.55);
  pointer-events: none;
  background: #ffffff;
  opacity: 0;
  transition: opacity 0.15s ease-out;
  will-change: transform;
  backface-visibility: hidden;
  contain: paint;
  z-index: 9999;
}
#gtr-lens.show { opacity: 1; }
#gtr-lens > img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  max-width: none;
  transform-origin: 0 0;
  will-change: transform;
  pointer-events: none;
  user-select: none;
}
@media (prefers-reduced-motion: reduce) {
  #gtr-lens { transition: none; }
}
/* no hover on coarse pointers — hide the lens affordance */
@media (hover: none) {
  img.gtr-zoom { cursor: default; }
}

/* ---------- BibTeX ---------- */
.gtr-bib-wrap { position: relative; }
/* styled here rather than by an external highlighter; the block is plain text */
.gtr-bib-wrap pre {
  display: block;
  overflow-x: auto;
  margin: 0;
  padding: 18px 96px 18px 20px; /* room on the right for the copy button */
  background: #f7f7f5;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}
.gtr-bib-wrap code {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.86em;
  line-height: 1.6;
  color: #1a1a19;
}
.gtr-copy {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  font-family: "Poppins", sans-serif;
  font-size: 0.78em;
  font-weight: 500;
  background: #ffffff;
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.gtr-copy:hover { background: #f0f0ed; }
.gtr-copy.copied {
  background: #0d6a49;
  border-color: #0d6a49;
  color: #fff;
}

/* ---------- Responsive ---------- */
@media screen and (max-width: 900px) {
  .gtr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gtr-loss-grid { grid-template-columns: 1fr; }
}
@media screen and (max-width: 560px) {
  .gtr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gtr-stat .value { font-size: 1.6em; }
  .gtr-delta .row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr) minmax(0, 0.7fr); padding: 10px 12px; }
  /* keep the chart readable on phones: scroll sideways instead of shrinking */
  .gtr-chart-wrap { overflow-x: auto; }
  .gtr-chart-wrap svg { min-width: 640px; }
}
