/* ==========================================================================
   Home page: components

   Chips, cards, panes, record panels, lists, badges and buttons. Diagrams
   that draw a structure or a sequence live in diagrams.css.
   ========================================================================== */

/* Chips -------------------------------------------------------------------- */

.xh .xh-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.xh .xh-chips--center { justify-content: center; }

.xh .xh-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.46rem 0.74rem;
  border: 1px solid var(--xh-line);
  border-radius: 999px;
  background: var(--xh-bg-card);
  font-family: var(--md-code-font);
  font-size: 0.66rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--xh-fg-2);
}

.xh .xh-chip--teal {
  border-color: color-mix(in srgb, var(--xh-teal) 50%, var(--xh-line));
  background: color-mix(in srgb, var(--xh-teal) 9%, transparent);
  color: var(--xh-teal-text);
}

.xh .xh-chip--warn {
  border-color: color-mix(in srgb, var(--xh-warn) 45%, var(--xh-line));
  background: color-mix(in srgb, var(--xh-warn) 9%, transparent);
  color: var(--xh-warn);
}

.xh .xh-chip--x {
  background: transparent;
  border-style: dashed;
  color: var(--xh-fg-2);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--xh-warn) 85%, transparent);
}

/* Cards -------------------------------------------------------------------- */

.xh .xh-card {
  --xh-sec-bg: var(--xh-bg-card);
  position: relative;
  padding: 1.3rem 1.35rem 1.4rem;
  border: 1px solid var(--xh-line);
  border-radius: 14px;
  background: var(--xh-bg-card);
}

.xh .xh-card--accent {
  border-color: color-mix(in srgb, var(--xh-teal) 55%, var(--xh-line));
  background: linear-gradient(180deg,
              color-mix(in srgb, var(--xh-teal) 10%, var(--xh-bg-card)) 0,
              var(--xh-bg-card) 70%);
  box-shadow: 0 22px 60px -30px color-mix(in srgb, var(--xh-teal) 70%, transparent);
}

.xh .xh-card--pad-l { padding: 1.8rem 1.9rem 1.9rem; }

/* A card whose top edge fills with teal when it comes into view. */
.xh .xh-card--line::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 14px;
  right: 14px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--xr-teal), var(--xr-teal-bright));
  transform: scaleX(1);
  transform-origin: 0 50%;
}

.xh-js .xh .xh-card--line::before {
  transform: scaleX(0);
  transition: transform 1.1s cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: calc(0.25s + var(--i, 0) * 90ms);
}

.xh-js .xh .xh-card--line.is-in::before,
.xh-js .xh .is-in .xh-card--line::before {
  transform: scaleX(1);
}

.xh .xh-card__n {
  display: block;
  margin-bottom: 0.85rem;
  font-family: var(--md-code-font);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  color: var(--xh-teal-text);
}

.xh .xh-card__k {
  display: block;
  margin-bottom: 0.7rem;
  font-family: var(--md-code-font);
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--xh-fg-3);
}

.xh .xh-card--accent .xh-card__k { color: var(--xh-teal-text); }

.xh .xh-card__t {
  font-size: 0.98rem;
  font-weight: 640;
  line-height: 1.3;
  letter-spacing: -0.016em;
  color: var(--xh-fg);
}

.xh .xh-card__t--l { font-size: 1.22rem; letter-spacing: -0.024em; }

.xh .xh-card__d {
  margin-top: 0.5rem;
  font-size: 0.76rem;
  line-height: 1.6;
  color: var(--xh-fg-2);
}

.xh .xh-card__d strong { color: var(--xh-fg); font-weight: 620; }

/* Panes: the two sides of a comparison ------------------------------------- */

.xh .xh-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.xh .xh-pane {
  --xh-sec-bg: var(--xh-bg-card);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.55rem 1.6rem;
  border: 1px solid var(--xh-line);
  border-radius: 16px;
  background: var(--xh-bg-card);
}

.xh .xh-pane--bad {
  --xh-sec-bg: transparent;
  background: transparent;
  border-style: dashed;
}

.xh .xh-pane--good {
  border-color: color-mix(in srgb, var(--xh-teal) 55%, var(--xh-line));
  background: linear-gradient(180deg,
              color-mix(in srgb, var(--xh-teal) 9%, var(--xh-bg-card)) 0,
              var(--xh-bg-card) 60%);
  box-shadow: 0 26px 70px -34px color-mix(in srgb, var(--xh-teal) 75%, transparent);
}

.xh .xh-pane__k {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
  font-family: var(--md-code-font);
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--xh-fg-3);
}

.xh .xh-pane--good .xh-pane__k { color: var(--xh-teal-text); }
.xh .xh-pane--bad .xh-pane__k { color: var(--xh-warn); }

.xh .xh-pane__t {
  font-size: 1.16rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.022em;
  color: var(--xh-fg);
}

.xh .xh-pane__t em {
  font-style: normal;
  color: var(--xh-teal-text);
}

.xh .xh-pane__d {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--xh-fg-2);
}

.xh .xh-pane__foot {
  margin-top: auto;
  padding-top: 1.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--xh-fg);
}

/* Record panels: what the kernel holds or emits, set in mono ---------------- */

.xh .xh-term {
  overflow: hidden;
  border: 1px solid var(--xh-line);
  border-radius: 12px;
  background: var(--md-code-bg-color);
  font-family: var(--md-code-font);
  font-size: 0.7rem;
  letter-spacing: 0;
  box-shadow: 0 20px 50px -34px var(--xh-shadow);
}

.xh .xh-term--accent {
  border-color: color-mix(in srgb, var(--xh-teal) 45%, var(--xh-line));
}

.xh .xh-term--warn {
  border-color: color-mix(in srgb, var(--xh-warn) 45%, var(--xh-line));
}

.xh .xh-term__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 2.15rem;
  padding: 0.5rem 0.95rem;
  border-bottom: 1px solid var(--xh-line);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--xh-fg-3);
}

.xh .xh-term__body {
  display: grid;
  gap: 0.42rem;
  padding: 0.9rem 0.95rem 1rem;
  line-height: 1.5;
  color: var(--md-code-fg-color);
}

.xh .xh-kv {
  display: grid;
  grid-template-columns: minmax(6.5rem, 40%) minmax(0, 1fr);
  gap: 0.9rem;
}

.xh .xh-kv > :first-child { color: var(--xh-fg-3); }

.xh .xh-ln { display: block; }
.xh .xh-ln--teal { color: var(--xh-teal-text); }
.xh .xh-ln--warn { color: var(--xh-warn); }

.xh .xh-ln--x {
  color: var(--xh-fg-3);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--xh-warn) 85%, transparent);
}

.xh .xh-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--xh-line);
  border-radius: 5px;
  font-family: var(--md-code-font);
  font-size: 0.56rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--xh-fg-2);
}

.xh .xh-badge--deny {
  border-color: color-mix(in srgb, var(--xh-warn) 50%, transparent);
  background: color-mix(in srgb, var(--xh-warn) 14%, transparent);
  color: var(--xh-warn);
}

.xh .xh-badge--ok {
  border-color: color-mix(in srgb, var(--xh-teal) 55%, transparent);
  background: color-mix(in srgb, var(--xh-teal) 14%, transparent);
  color: var(--xh-teal-text);
}

/* Lists: built from role="list" blocks, so the documentation list styles
   never apply ---------------------------------------------------------------- */

.xh .xh-list {
  display: grid;
  gap: 0.6rem;
}

.xh .xh-list > div {
  position: relative;
  padding-left: 1.45rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--xh-fg);
}

.xh .xh-list > div::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0.1rem;
  width: 0.6rem;
  height: 1.5px;
  border-radius: 2px;
  background: var(--xh-teal);
}

.xh .xh-list--dim > div { color: var(--xh-fg-2); }
.xh .xh-list--s > div { font-size: 0.76rem; }

/* Refused or absent: struck through, marked in the warning colour. */
.xh .xh-list--x > div {
  color: var(--xh-fg-3);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--xh-warn) 80%, transparent);
}

.xh .xh-list--x > div::before,
.xh .xh-list--no > div::before {
  content: "\00d7";
  top: -0.08em;
  left: 0;
  width: auto;
  height: auto;
  background: none;
  font-size: 1.1em;
  font-weight: 600;
  color: var(--xh-warn);
}

.xh .xh-list--x > div::before { text-decoration: none; display: inline-block; }

.xh .xh-list--check > div::before {
  top: 0.38em;
  left: 0.16rem;
  width: 0.36rem;
  height: 0.62rem;
  border-right: 1.5px solid var(--xh-teal);
  border-bottom: 1.5px solid var(--xh-teal);
  border-radius: 1px;
  background: none;
  transform: rotate(42deg);
}

/* Questions on a line: a run of open questions, each a ring on one line, and
   the line runs on into the statement that answers them. As the line fills,
   each ring closes. ------------------------------------------------------------ */

.xh .xh-ask {
  --xh-ask-in: 1.45rem;
  position: relative;
  display: grid;
  gap: 0.68rem;
  padding: 0.1rem 0 1.9rem var(--xh-ask-in);
}

.xh .xh-ask::before,
.xh .xh-ask::after {
  content: "";
  position: absolute;
  top: 0.75rem;
  bottom: 0;
  left: 0;
  width: 2px;
}

.xh .xh-ask::before {
  background: var(--xh-line);
}

.xh .xh-ask::after {
  background: linear-gradient(180deg, var(--xr-teal-deep), var(--xr-teal));
  transform-origin: 50% 0;
}

.xh .xh-ask > div {
  position: relative;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--xh-fg);
}

.xh .xh-ask > div::before {
  content: "";
  position: absolute;
  top: calc(0.725em - 0.3rem);
  left: calc(1px - var(--xh-ask-in) - 0.3rem);
  z-index: 1;
  width: 0.6rem;
  height: 0.6rem;
  border: 2px solid var(--xh-teal);
  border-radius: 50%;
  background: var(--xh-teal);
  box-shadow: 0 0 0 3px var(--xh-sec-bg, var(--xh-bg));
}

/* The answer takes the line over: its rule starts where the questions' ends. */
.xh .xh-ask__answer {
  margin-top: 0;
  padding-left: calc(1.45rem - 2px);
}

.xh-js .xh .xh-ask::after {
  transform: scaleY(0);
  transition: transform 1.7s cubic-bezier(0.4, 0, 0.3, 1) 0.25s;
}

.xh-js .xh .is-in .xh-ask::after {
  transform: scaleY(1);
}

.xh-js .xh .xh-ask > div::before {
  border-color: var(--xh-fg-3);
  background: var(--xh-sec-bg, var(--xh-bg));
  transition: border-color 0.3s ease, background-color 0.3s ease;
  transition-delay: calc(0.3s + var(--k, 0) * 0.17s);
}

.xh-js .xh .is-in .xh-ask > div::before {
  border-color: var(--xh-teal);
  background: var(--xh-teal);
}

.xh-js .xh .xh-ask__answer {
  border-left-color: var(--xh-line);
  transition: border-color 0.5s ease 1.75s;
}

.xh-js .xh .is-in .xh-ask__answer {
  border-left-color: var(--xh-teal);
}

@media (prefers-reduced-motion: reduce) {
  .xh-js .xh .xh-ask::after {
    transform: none;
    transition: none;
  }

  .xh-js .xh .xh-ask > div::before {
    border-color: var(--xh-teal);
    background: var(--xh-teal);
    transition: none;
  }

  .xh-js .xh .xh-ask__answer {
    border-left-color: var(--xh-teal);
    transition: none;
  }
}

/* Buttons ------------------------------------------------------------------ */

.md-typeset .xh .xh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.25rem;
  border: 1px solid var(--xh-line);
  border-radius: 10px;
  background: var(--xh-bg-card);
  font-size: 0.8rem;
  font-weight: 620;
  line-height: 1;
  letter-spacing: -0.008em;
  color: var(--xh-fg);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease,
              transform 140ms ease, color 140ms ease;
}

.md-typeset .xh .xh-btn:hover {
  border-color: var(--xh-teal);
  color: var(--xh-fg);
  transform: translateY(-1px);
}

.md-typeset .xh .xh-btn--primary {
  border-color: var(--xr-teal);
  background: var(--xr-teal);
  color: #04120f;
}

.md-typeset .xh .xh-btn--primary:hover {
  border-color: var(--xr-teal-bright);
  background: var(--xr-teal-bright);
  color: #04120f;
}

.xh .xh-btn__arrow {
  width: 0.4rem;
  height: 0.4rem;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

/* Documentation entry cards ------------------------------------------------ */

.md-typeset .xh .xh-doc {
  display: block;
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid var(--xh-line);
  border-radius: 12px;
  background: var(--xh-bg-card);
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease;
}

.md-typeset .xh .xh-doc:hover {
  border-color: var(--xh-teal);
  transform: translateY(-2px);
}

.xh .xh-doc__t {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  font-weight: 640;
  letter-spacing: -0.012em;
  color: var(--xh-fg);
}

.xh .xh-doc__t::after {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  border-top: 1.5px solid var(--xh-teal);
  border-right: 1.5px solid var(--xh-teal);
  transform: rotate(45deg);
}

.xh .xh-doc__d {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--xh-fg-2);
}

/* As seen on ---------------------------------------------------------------- */
/* Where Xratu has been seen, in one quiet row under the hero, and at its end,
   after a short divider, the NVIDIA Cloud Validated badge. Each mark is an
   alpha mask (docs/assets/seen-on) painted in the theme's grey, so no brand
   colour reaches the page; a mark lights to full on hover. Sizes are set in
   rem per mark (--w, --h), balanced by area rather than height. Where the row
   cannot hold all ten on one line, the badge takes a line of its own. */

.xh .xh-seen {
  --xh-seen-k: 0.96;
  padding: 2.6rem 0 0.4rem;
  text-align: center;
}

.xh .xh-seen__k {
  display: block;
  font-family: var(--md-code-font);
  font-size: 0.56rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--xh-fg-3);
}

.xh .xh-seen__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.1rem 1.5rem;
  margin-top: 1rem;
  color: var(--xh-fg-2);
}

.xh .xh-seen__lg {
  flex: none;
  width: calc(var(--w) * var(--xh-seen-k) * 1rem);
  height: calc(var(--h) * var(--xh-seen-k) * 1rem);
  background: currentColor;
  opacity: 0.62;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.xh .xh-seen__lg:hover {
  opacity: 1;
  color: var(--xh-fg);
}

/* The divider before the badge: short, fading at both ends. */
.xh .xh-seen__sep {
  flex: none;
  width: 1px;
  height: 2.3rem;
  background: linear-gradient(180deg, transparent, var(--xh-fg-3) 50%, transparent);
  opacity: 0.7;
}

/* Too narrow for all ten on one line: the badge takes the next line to itself,
   centred, and the divider goes. */
@media screen and (max-width: 72em) {
  .xh .xh-seen__sep { display: none; }
  .xh .xh-seen__lg:last-child { flex-basis: 100%; }
}

@media screen and (max-width: 38em) {
  .xh .xh-seen { --xh-seen-k: 0.82; padding-top: 2.1rem; }
  .xh .xh-seen__row { gap: 1rem 1.6rem; }
}

/* Narrow screens ----------------------------------------------------------- */

@media screen and (max-width: 60em) {
  .xh .xh-split { grid-template-columns: minmax(0, 1fr); }
}

@media screen and (max-width: 38em) {
  .xh .xh-chip { white-space: normal; line-height: 1.3; }
  .xh .xh-kv { grid-template-columns: minmax(5.2rem, 42%) minmax(0, 1fr); gap: 0.6rem; }
  .xh .xh-card--pad-l { padding: 1.4rem 1.3rem 1.5rem; }
}
