/* ============================================================================
   Rules only the demo hub needs. Tokens, shell, header, hero, cards, caps,
   footer and motion all come from `site.css` (the apex layout, light palette).
   ========================================================================= */

/* ------------------------------------------------------- demo facts (hero) */

/* The three things a visitor must know before clicking anything. They are
   pills rather than a paragraph so a visitor sees them even when skimming. */
.flags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: clamp(22px, 3.5vh, 30px) 0 0;
  padding: 0;
  list-style: none;
}

.flags li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--body);
}

.flags svg {
  flex-shrink: 0;
  color: var(--red);
}

/* ------------------------------------------------------------------- cards */

/* Each section's cards sit in one row, never two-plus-one (the same reasoning
   as `academy.html`): three family demos, then three staff demos. */
.hub__cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 940px) {
  .hub__cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* How to get past the sign-in screen. It sits at the bottom so the three tips
   line up across the row however long the descriptions above them run. */
.card__tip {
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--page);
  font-size: 13px;
  line-height: 1.55;
  color: var(--body);
}

.card__tip + .card__host {
  margin-top: 0;
}

.card__tip-label {
  display: block;
  margin-bottom: 3px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--red);
}

.card__tip strong {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The arrow and the spinner share one fixed box, so swapping them never moves
   anything. */
.card__go-slot {
  position: relative;
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.card__go-slot .spinner {
  position: absolute;
  inset: 0;
}

/* ------------------------------------------------------ pending feedback */

.spinner {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(24, 24, 27, 0.12);
  border-top-color: currentColor;
  opacity: 0;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.is-pending {
  cursor: progress;
}

.is-pending .spinner {
  opacity: 1;
}

.card.is-pending .card__go,
.btn.is-pending .btn__icon,
.head__real.is-pending .head__real-icon {
  opacity: 0;
}

/* A pending card keeps its hover look after the pointer leaves, so the user
   can still see which card is loading. */
.card.is-pending {
  border-color: var(--red-soft);
  box-shadow: var(--shadow-lg);
}

.card.is-pending .card__icon {
  background: var(--red);
  color: #fff;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.3);
}

.card.is-pending .card__go-slot {
  color: var(--red);
}

/* On the red button the spinner is white on a translucent track. */
.btn--primary .spinner {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

/* The global bar for every navigation. It creeps towards 92% and never
   finishes: the next page replaces it. */
.nav-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-progress::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--red-deep), var(--red-bright));
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.45);
}

.nav-progress.is-on {
  opacity: 1;
}

.nav-progress.is-on::before {
  animation: trickle 9s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
}

@keyframes trickle {
  0% {
    transform: scaleX(0);
  }
  8% {
    transform: scaleX(0.35);
  }
  100% {
    transform: scaleX(0.92);
  }
}

/* --------------------------------------------------- masthead real link */

.head__real {
  position: relative;
}

.head__real-slot {
  position: relative;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.head__real-slot > * {
  position: absolute;
  inset: 0;
  width: 15px;
  height: 15px;
}

.head__real-slot .spinner {
  border-width: 1.5px;
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.3s var(--ease),
    background 0.3s var(--ease),
    border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--red-bright) 0%, var(--red) 100%);
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.28);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(220, 38, 38, 0.38);
}

.btn--ghost {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--red-soft);
  color: var(--red-deep);
}

.btn__slot {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn__slot > * {
  position: absolute;
  inset: 0;
}

.btn:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 3px;
}

/* ------------------------------------------------- the real academy panel */

.real {
  position: relative;
  overflow: hidden;
  margin-top: clamp(52px, 9vh, 96px);
  padding: clamp(28px, 4.5vw, 56px);
  border-radius: 24px;
  border: 1px solid var(--red-soft);
  background:
    radial-gradient(
      ellipse 90% 130% at 0% 0%,
      rgba(220, 38, 38, 0.09) 0%,
      transparent 60%
    ),
    var(--surface);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(26px, 4vw, 60px);
  align-items: center;
}

/* The mark as a watermark, purely decorative and inert. */
.real__mark {
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 280px;
  height: auto;
  opacity: 0.06;
  pointer-events: none;
}

.real > :not(.real__mark) {
  position: relative;
  z-index: 1;
}

.real .eyebrow {
  margin-bottom: 14px;
}

.real__title {
  margin: 0 0 14px;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.real__text {
  margin: 0;
  max-width: 58ch;
  color: var(--body);
}

.real__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 270px;
}

.real__host {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--faint);
}

@media (max-width: 860px) {
  .real {
    grid-template-columns: minmax(0, 1fr);
  }

  .real__actions {
    min-width: 0;
  }
}

/* ------------------------------------------------------------------ footer */

.foot__note {
  color: var(--faint);
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 720px) {
  .head__real-text--long {
    display: none;
  }
}

@media (min-width: 721px) {
  .head__real-text--short {
    display: none;
  }
}
