/*
 * /use-cases (Figma 5845:4936 "10 Use Cases").
 * Centered hero, a sticky row of anchor chips that follows the case in view
 * (/pages/use-cases.js), then four alternating cases, each beside a panel
 * holding only the visitor's question. Everything else comes from /v3.css.
 */

/* Skip link (site.css used to style it; not yet in v3.css). */
.skip {
  position: absolute;
  top: 8px;
  left: -9999px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 100px;
  background: var(--k-ink);
  color: #fff;
  font: 600 15px/1.2 var(--k-font-text);
  text-decoration: none;
}

.skip:focus {
  left: 12px;
}

/* v3.css's `.v3 a { color: inherit }` outranks .v3-btn / .v3-link colours;
   restore them until the shared sheet is fixed. */
.v3 .v3-btn {
  color: #fff;
}

.v3 .v3-btn.is-secondary {
  color: var(--k-ink);
}

.v3 .v3-link {
  color: var(--k-green);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ---------- hero ---------- */
.uc-hero {
  /* Room under the button for the chip row (24 gap + 56 pill) and the
     band's own 112px bottom padding; the row is pulled up into it. */
  padding-bottom: 192px;
}

.uc-hero .v3-stack {
  gap: 28px;
}

.uc-hero .v3-h1 {
  max-width: 900px;
  font-size: clamp(38px, 4.4vw, 54px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.uc-hero .v3-lead {
  max-width: 620px;
}

/* ---------- anchor chips ---------- */
/* Zero-height sticky rail, as on /guide: no layout shift, the pill hangs from it. */
.uc-anchors {
  position: sticky;
  top: 88px;
  z-index: 40;
  display: flex;
  justify-content: center;
  height: 0;
  margin-top: -168px;
  margin-bottom: 168px;
  padding: 0 var(--k-pad);
  pointer-events: none;
}

.uc-anchor-list {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 56px;
  margin: 0;
  padding: 8px;
  border: 1px solid rgb(255 255 255 / 90%);
  border-radius: 100px;
  background: var(--k-glass);
  box-shadow: 0 0 16px rgb(0 0 0 / 4%);
  list-style: none;
  pointer-events: auto;
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
}

.uc-anchor {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 100px;
  background: #fff;
  color: var(--k-ink-2);
  font: 500 15px/1 var(--k-font-text);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--k-dur-ui) var(--k-ease),
    color var(--k-dur-ui) var(--k-ease),
    transform var(--k-dur-press) var(--k-ease);
}

.uc-anchor[aria-current="true"] {
  background: var(--k-button);
  color: #fff;
}

.uc-anchor:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .uc-anchor:not([aria-current="true"]):hover {
    background: var(--k-chip);
    color: var(--k-ink);
  }
}

/* ---------- cases ---------- */
.uc-case {
  padding-top: 112px;
  padding-bottom: 112px;
  /* When jumped to, the case lands just below the chip row. */
  scroll-margin-top: 56px;
}

.uc-case .v3-split {
  grid-template-columns: minmax(0, 500px) minmax(0, 1fr);
}

.uc-case .v3-split.is-flipped {
  grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
}

.uc-copy {
  display: grid;
  justify-items: start;
  gap: 20px;
}

.uc-copy .v3-body {
  max-width: 480px;
}

/* The visitor's question, alone on a soft panel in the opposite band colour. */
.uc-panel {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  min-height: 440px;
  margin: 0;
  padding: 40px;
  border-radius: 28px;
  background: var(--k-bg-2);
}

.is-grey .uc-panel {
  background: var(--k-bg);
}

.uc-panel-label {
  color: var(--k-ink-3);
  font: 500 14px/1.2 var(--k-font-text);
}

.uc-bubble {
  max-width: 340px;
  margin: 0;
  padding: 16px 20px;
  border-radius: 20px 20px 20px 6px;
  background: #fff;
  box-shadow: var(--k-shadow-soft);
}

.is-grey .uc-bubble {
  background: var(--k-bg-2);
}

.uc-bubble p {
  margin: 0;
  color: var(--k-ink);
  font: 500 22px/1.3 var(--k-font-display);
  text-wrap: pretty;
}

/* The bubble pops in from its tail corner rather than rising. */
.v3-motion .uc-bubble[data-reveal] {
  transform: translateY(8px) scale(0.96);
  transform-origin: 0 100%;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .uc-anchor {
    transition: none;
  }

  .v3-motion .uc-bubble[data-reveal] {
    transform: none;
  }
}

/* ---------- responsive ---------- */
/* Tablets: share the row evenly so the visual is not squeezed. */
@media (min-width: 961px) and (max-width: 1200px) {
  .uc-case .v3-split,
  .uc-case .v3-split.is-flipped {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 56px;
  }

  .uc-panel {
    min-height: 360px;
  }
}

@media (max-width: 960px) {
  .uc-hero {
    padding-bottom: 168px;
  }

  .uc-anchors {
    margin-top: -144px;
    margin-bottom: 144px;
  }

  .uc-case {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .uc-case .v3-split,
  .uc-case .v3-split.is-flipped {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .uc-panel {
    min-height: 280px;
    padding: 32px 20px;
  }
}

@media (max-width: 560px) {
  .uc-anchors {
    top: 84px;
  }

  .uc-anchor-list {
    gap: 2px;
    height: 48px;
    padding: 5px;
  }

  .uc-anchor {
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
  }

  .uc-bubble p {
    font-size: 20px;
  }
}
