/* Tungsten v5 use-case pages: one template, four pictures.
   Flow machine (what comes in → Tungsten → ready for review), a case that
   plays itself, the handoff, and the proof. */

/* ---------------- Hero ---------------- */

.uc-hero {
  padding-top: clamp(56px, 7vw, 96px);
}

.uc-subnav {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 40px;
  padding: 4px;
  border: 1px solid rgb(var(--ink-rgb) / 0.08);
  border-radius: 8px;
  background: rgb(var(--tint-rgb) / 0.03);
}

.uc-subnav a {
  padding: 9px 14px;
  border-radius: 5px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}

.uc-subnav a[aria-current="page"] {
  background: rgb(var(--tint-rgb) / 0.08);
  color: var(--ink-1);
  box-shadow: inset 0 -2px 0 var(--glow-orange);
}

.uc-hero__head {
  display: grid;
  gap: 20px;
  max-width: 900px;
}

.uc-hero h1 {
  margin: 0;
  color: var(--ink-1);
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 84px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
}

.uc-hero__lede {
  max-width: 620px;
  margin: 0;
  color: var(--ink-2);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.5;
}

.uc-hero__sectors {
  margin: 0;
  color: var(--ink-3);
  font-family: var(--font-machine);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------------- The flow machine ---------------- */

.flowm {
  margin-top: clamp(48px, 6vw, 72px);
  padding: clamp(18px, 2.5vw, 32px);
  background:
    radial-gradient(40% 70% at 50% 50%, rgb(255 92 0 / 0.1), transparent 70%),
    linear-gradient(rgb(var(--ink-rgb) / 0.03) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgb(var(--ink-rgb) / 0.03) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--card-bg);
}

.flowm__stage {
  position: relative;
  aspect-ratio: 3 / 1;
}

.flowm__wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.flowm__base {
  fill: none;
  stroke: rgb(var(--ink-rgb) / 0.1);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.flowm__lit {
  fill: none;
  stroke: url(#wire-grad);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 3px rgb(255 120 30 / 0.8));
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  transition: stroke-dashoffset 1.6s var(--ease-out-quart);
}

.is-lit .flowm__lit {
  stroke-dashoffset: 0;
}

.flowm__bead {
  fill: var(--bead);
  filter: drop-shadow(0 0 4px rgb(255 120 30 / 0.95));
  opacity: 0;
  transition: opacity 400ms 1.2s;
}

.is-lit .flowm__bead {
  opacity: 1;
}

.flowm__in {
  position: absolute;
  left: 3%;
  display: flex;
  width: 24%;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgb(var(--ink-rgb) / 0.12);
  border-radius: 8px;
  background: var(--chip-bg);
  color: var(--ink-1);
  font-size: 15px;
  font-weight: 500;
  transform: translateY(-50%);
}

.uc-icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--glow-hot);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flowm__core {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  justify-items: center;
  gap: 10px;
  transform: translate(-50%, -38%);
}

.flowm__core .glass-key {
  zoom: 1.8;
}

.flowm__core small,
.flowm__label {
  color: var(--ink-3);
  font-family: var(--font-machine);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.flowm__label {
  position: absolute;
  top: 0;
  transform: translateY(-60%);
}

.flowm__label--in {
  left: 3%;
}

.flowm__label--out {
  right: 3%;
}

.flowm__out {
  position: absolute;
  right: 3%;
  top: 50%;
  display: grid;
  width: 26%;
  gap: 6px;
  padding: 18px 18px 16px;
  border: 1px solid rgb(255 184 102 / 0.35);
  border-radius: 10px;
  background: var(--warm-panel);
  box-shadow: 0 0 36px -12px rgb(255 92 0 / 0.6), inset 0 1px 0 rgb(255 255 255 / 0.06);
  transform: translateY(-50%);
}

.flowm__out strong {
  color: var(--ink-1);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}

.flowm__out span {
  color: var(--ok-text);
  font-family: var(--font-machine);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.flowm__out i {
  display: block;
  height: 5px;
  margin-top: 6px;
  border-radius: 3px;
  background: rgb(var(--ink-rgb) / 0.12);
}

.flowm__out i:nth-of-type(1) { width: 90%; }
.flowm__out i:nth-of-type(2) { width: 70%; }
.flowm__out i:nth-of-type(3) { width: 80%; }

/* ---------------- Stats ---------------- */

.uc-stats {
  display: grid;
  margin-top: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid rgb(var(--ink-rgb) / 0.08);
  border-radius: 14px;
  background: rgb(var(--tint-rgb) / 0.02);
}

.uc-stats div {
  display: grid;
  gap: 6px;
  padding: 24px 26px;
}

.uc-stats div + div {
  border-left: 1px solid rgb(var(--ink-rgb) / 0.08);
}

.uc-stats strong {
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-shadow: var(--accent-glow);
}

.uc-stats span {
  color: var(--ink-2);
  font-size: 15px;
}

/* ---------------- What it does / Who it's for ---------------- */

.uc-tasks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.uc-task {
  padding: 28px 26px 30px;
}

.uc-task .uc-icon {
  width: 28px;
  height: 28px;
}

.uc-task h3,
.uc-aud h3,
.uc-proof h3 {
  margin: 18px 0 0;
  color: var(--ink-1);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.uc-task p {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 16px;
}

.uc-auds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.uc-aud {
  display: flex;
  flex-direction: column;
  padding: 30px 28px;
  color: inherit;
  transition: border-color 300ms var(--ease-out-quart), transform 300ms var(--ease-out-quart);
}

.uc-aud:hover,
.uc-proof:hover {
  border-color: rgb(255 184 102 / 0.3);
  transform: translateY(-3px);
}

.uc-aud__tag,
.uc__tag {
  color: var(--accent-ink);
  font-family: var(--font-machine);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.uc-aud ul {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.uc-aud li {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgb(var(--ink-rgb) / 0.08);
  color: var(--ink-2);
}

.uc-aud li::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--glow-orange);
  box-shadow: 0 0 6px rgb(255 92 0 / 0.7);
}

/* ---------------- Watch a case ---------------- */

.uc-demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.uc-state {
  justify-self: end;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-machine);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 300ms;
}

.run-step:is([data-state="done"], [data-state="review"]) .uc-state {
  opacity: 1;
}

.uc-state--ok { color: var(--ink-2); background: rgb(var(--tint-rgb) / 0.06); }
.uc-state--governs { color: var(--governs-ink); background: rgb(255 92 0 / 0.25); box-shadow: 0 0 12px -2px rgb(255 92 0 / 0.6); }
.uc-state--conflict { color: var(--warn-ink); background: rgb(255 170 40 / 0.14); }
.uc-state--missing { color: var(--bad-ink); background: rgb(230 90 90 / 0.16); }

/* Conflict and missing sources: the wire burns amber, or breaks. */
.run-step[data-final="conflict"][data-state="done"] .tube::before {
  background: #ffc15a;
  box-shadow: 0 0 6px rgb(255 190 80 / 0.8);
}

.run-step[data-final="missing"][data-state="done"] .tube::before {
  background: linear-gradient(180deg, rgb(230 90 90) 0 40%, transparent 40% 58%, rgb(230 90 90) 58%);
  box-shadow: none;
}

.uc-out {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 24px;
}

.uc-out__head {
  margin-bottom: 10px;
}

.uc-out__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  padding: 14px 0;
  border-top: 1px solid rgb(var(--ink-rgb) / 0.08);
  opacity: 0.25;
  transition: opacity 500ms var(--ease-out-quart);
}

.uc-out__row span {
  color: var(--ink-3);
  font-size: 13px;
}

.uc-out__row strong {
  grid-row: 2;
  color: var(--ink-1);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.uc-out__row em {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  padding: 5px 9px;
  border: 1px solid rgb(255 184 102 / 0.3);
  border-radius: 4px;
  color: var(--accent-ink);
  font-family: var(--font-machine);
  font-size: 11px;
  font-style: normal;
}

.uc-out__row.is-on {
  opacity: 1;
}

.uc-out__exception {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px dashed rgb(255 184 102 / 0.3);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 500ms, transform 500ms var(--ease-out-quart);
}

.uc-out__status {
  margin-top: auto;
  padding-top: 18px;
  opacity: 0;
  transition: opacity 500ms;
}

.uc-out[data-state="done"] :is(.uc-out__exception, .uc-out__status) {
  opacity: 1;
  transform: none;
}

/* ---------------- Who does what ---------------- */

.uc-hand {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.uc-hand__wire {
  position: absolute;
  left: 0;
  top: 44px;
  width: 100%;
  height: 20px;
  overflow: visible;
  pointer-events: none;
}

.uc-hand__wire path {
  fill: none;
  stroke: url(#wire-grad);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 3px rgb(255 120 30 / 0.8));
}

.uc-hand article {
  position: relative;
  z-index: 1;
  padding: 26px 26px 28px;
  background: var(--panel-bg);
}

.uc-hand article.is-core {
  border-color: rgb(255 184 102 / 0.35);
  box-shadow: 0 0 40px -14px rgb(255 92 0 / 0.55);
}

.uc-hand__who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  color: var(--ink-1);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.uc-hand__who .uc-icon {
  width: 26px;
  height: 26px;
}

.uc-hand__who .glass-key {
  zoom: 0.72;
}

.uc-hand p {
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.5;
}

/* ---------------- Proof ---------------- */

.uc-proofs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.uc-proof {
  display: flex;
  flex-direction: column;
  padding: 28px 26px;
  color: inherit;
  transition: border-color 300ms var(--ease-out-quart), transform 300ms var(--ease-out-quart);
}

.uc-proof strong {
  margin-top: 22px;
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: var(--accent-glow);
}

.uc-proof__unit {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 14px;
}

.uc-proof .uc__more {
  padding-top: 26px;
}

.uc-proof.is-main {
  border-color: rgb(255 184 102 / 0.25);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
  .uc-tasks,
  .uc-auds,
  .uc-demo,
  .uc-hand,
  .uc-proofs,
  .uc-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .uc-stats div + div {
    border-left: 0;
    border-top: 1px solid rgb(var(--ink-rgb) / 0.08);
  }

  .uc-hand__wire {
    display: none;
  }

  /* The flow machine turns vertical: inputs, the key, the result. */
  .flowm__stage {
    display: grid;
    aspect-ratio: auto;
    justify-items: center;
    gap: 14px;
  }

  .flowm__wires,
  .flowm__label {
    display: none;
  }

  .flowm__in,
  .flowm__out,
  .flowm__core {
    position: static;
    width: 100%;
    transform: none;
  }

  .flowm__core {
    width: auto;
    padding: 10px 0;
  }

  .flowm__core::before,
  .flowm__core::after {
    content: "";
    display: block;
    width: 2px;
    height: 22px;
    margin: 0 auto;
    background: linear-gradient(180deg, transparent, var(--glow-orange));
    box-shadow: 0 0 6px rgb(255 92 0 / 0.6);
  }

  .flowm__core::after {
    background: linear-gradient(180deg, var(--glow-orange), transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .flowm__lit {
    stroke-dashoffset: 0;
    transition: none;
  }

  .flowm__bead {
    display: none;
  }
}

/* The actual systems and owners behind each customer story. */
.workflow-path { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 0; margin: 32px 0 0; list-style: none; }
.workflow-path li { position: relative; border-top: 1px solid var(--line-soft); padding: 18px 20px 0 0; min-width: 0; }
.workflow-path li:not(:last-child)::after { content: '→'; position: absolute; right: 0; top: 18px; color: var(--accent-ink); }
.workflow-path strong, .workflow-path span { display: block; }
.workflow-path strong { color: var(--ink-1); font-size: 15px; font-weight: 500; }
.workflow-path span { color: var(--ink-2); font-size: 13px; margin-top: 6px; line-height: 1.5; }
@media (max-width: 680px) { .workflow-path { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; } .workflow-path li:nth-child(2)::after { content: none; } }
@media (max-width: 600px) {
  .uc-demo .run-card__bar > span:last-child:not(.run-card__status) { display: none; }
  .uc-demo .run-card__status { white-space: nowrap; }
}
