/* /newhome "How Orderlink works" walkthrough: business-type tabs, scenario
   intro, five-stage story and Orderlink screen illustrations.
   Markup: templates/website/partials/newhome-story*.html */

.newhome .nh-story {
  --story-ink: #09254a;
  --story-muted: #4f6e89;
  --story-royal: #0879e8;
  --story-cyan: #12b5df;
  --story-pale: #d8f0fc;
  --story-wash: #eef8ff;
  --story-line: #e3f3fc;
  --story-low: #c25400;
  --story-low-bg: #fff1e5;
  --story-done: #12804a;
  --story-done-bg: #e5f7ed;
  padding: 96px 0 104px;
  background: linear-gradient(180deg, #e8f8ff 0%, #fff 220px);
  color: var(--story-ink);
}
.newhome .nh-story em { color: var(--story-royal); font-style: normal; }

/* ---------- Section heading ---------- */
.newhome .nh-story__head { max-width: 760px; margin-bottom: 44px; }
.newhome .nh-story__head .nh-eyebrow { margin-bottom: 18px; color: var(--story-royal); }
.newhome .nh-story__head h2 {
  margin: 0 0 16px;
  color: var(--story-ink);
  font: 700 clamp(36px, 4.2vw, 58px)/1.03 'Space Grotesk', Arial, sans-serif;
  letter-spacing: -.06em;
}
.newhome .nh-story__head > p:last-child { max-width: 560px; margin: 0; color: var(--story-muted); font: 400 18px/1.5 Inter, Arial, sans-serif; }

/* ---------- Business type tabs: attached to the walkthrough panel ---------- */
.newhome .nh-story__tabs { display: flex; align-items: flex-end; gap: 20px; padding-left: 28px; }
.newhome .nh-story__tabs-label { flex: none; margin: 0 0 17px; color: #7890a6; font: 700 11px/1.2 'Space Grotesk', Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.newhome .nh-story__types { display: flex; gap: 6px; }
.newhome .nh-story__type { position: relative; display: block; cursor: pointer; }
.newhome .nh-story__type input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.newhome .nh-story__type-tab {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: -1px;
  padding: 13px 20px 14px 14px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  color: var(--story-muted);
  transition: background-color .2s ease, color .2s ease;
}
.newhome .nh-story__type-tab svg {
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 9px;
  background: var(--story-wash);
  color: var(--story-royal);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: background-color .2s ease, color .2s ease;
}
.newhome .nh-story__type-tab strong { font: 700 16px/1.2 'Space Grotesk', Arial, sans-serif; letter-spacing: -.02em; }
.newhome .nh-story__type:hover .nh-story__type-tab { background: #f2f9ff; color: var(--story-ink); }
.newhome .nh-story__type input:checked + .nh-story__type-tab {
  border-color: #cfe7f6;
  background: #fff;
  box-shadow: inset 0 3px 0 var(--story-royal);
  color: var(--story-ink);
}
.newhome .nh-story__type input:checked + .nh-story__type-tab svg {
  background: linear-gradient(135deg, var(--story-royal), var(--story-cyan));
  color: #fff;
}
.newhome .nh-story__type input:focus-visible + .nh-story__type-tab { outline: 3px solid var(--story-cyan); outline-offset: -3px; }

.newhome .nh-story__panel {
  position: relative;
  padding: 48px 52px 40px;
  border: 1px solid #cfe7f6;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 40px 80px -60px #0b4f9e59;
}

/* ---------- Scenario intro ---------- */
.newhome .nh-story__scenario.is-entering { animation: nh-story-fade .35s ease both; }
.newhome .nh-story__intro { max-width: 900px; }
.newhome .nh-story__example { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--story-royal); font: 700 12px/1.2 'Space Grotesk', Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.newhome .nh-story__example svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.newhome .nh-story__intro h3 {
  margin: 0 0 16px;
  color: var(--story-ink);
  font: 700 clamp(40px, 4.6vw, 64px)/1 'Space Grotesk', Arial, sans-serif;
  letter-spacing: -.065em;
}
.newhome .nh-story__guide { margin: 0 0 22px; color: var(--story-muted); font: 500 clamp(17px, 1.5vw, 21px)/1.4 Inter, Arial, sans-serif; }
.newhome .nh-story__guide span { margin-left: 4px; color: var(--story-royal); }
.newhome .nh-story__facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.newhome .nh-story__facts li { padding: 7px 14px; border: 1px solid #d6edfa; border-radius: 999px; background: #f5fbff; color: var(--story-ink); font: 500 15px/1.3 Inter, Arial, sans-serif; }
.newhome .nh-story__lead { max-width: 720px; margin: 20px 0 0; color: var(--story-muted); font: 400 18px/1.55 Inter, Arial, sans-serif; }
.newhome .nh-story__lead strong { color: var(--story-ink); }

/* ---------- Five-step progress ---------- */
.newhome .nh-story__progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 48px 0 0; padding: 0; list-style: none; }
.newhome .nh-story__progress button { display: block; width: 100%; padding: 0 0 4px; border: 0; background: none; color: #7890a6; text-align: left; cursor: pointer; }
.newhome .nh-story__bar { position: relative; display: block; height: 4px; overflow: hidden; border-radius: 4px; background: #dcEFF9; }
.newhome .nh-story__bar::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--story-royal), var(--story-cyan));
  content: '';
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s ease;
}
.newhome .nh-story__progress .is-done .nh-story__bar::after,
.newhome .nh-story__progress [aria-current] .nh-story__bar::after { transform: scaleX(1); }
.newhome .nh-story__step { display: block; margin-top: 10px; font: 600 13px/1.25 'Space Grotesk', Arial, sans-serif; transition: color .2s ease; }
.newhome .nh-story__step b { margin-right: 4px; color: var(--story-royal); font-weight: 700; }
.newhome .nh-story__progress button:hover .nh-story__step,
.newhome .nh-story__progress [aria-current] .nh-story__step { color: var(--story-ink); }
.newhome .nh-story__progress button:focus-visible { outline: 3px solid var(--story-cyan); outline-offset: 4px; border-radius: 4px; }

/* ---------- Stage ---------- */
.newhome .nh-story__stage {
  display: grid;
  grid-template-columns: minmax(250px, .8fr) minmax(0, 1.2fr);
  gap: 56px;
  align-items: center;
  min-height: 460px;
  padding: 44px 0;
}
.newhome .nh-story__stage[hidden] { display: none; }
.newhome .nh-story__stage.is-entering .nh-story__copy { animation: nh-story-rise .4s ease both; }
.newhome .nh-story__stage.is-entering .nh-ui { animation: nh-story-rise .45s .06s ease both; }
.newhome .nh-story__context { margin: 0 0 16px; color: var(--story-royal); font: 700 13px/1.2 'Space Grotesk', Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.newhome .nh-story__copy h4 { max-width: 420px; margin: 0 0 18px; color: var(--story-ink); font: 700 clamp(34px, 3.6vw, 52px)/1.03 'Space Grotesk', Arial, sans-serif; letter-spacing: -.06em; }
.newhome .nh-story__copy p:last-child { max-width: 400px; margin: 0; color: var(--story-muted); font: 400 17px/1.55 Inter, Arial, sans-serif; }

/* ---------- Controls ---------- */
.newhome .nh-story__controls { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 24px; border-top: 1px solid var(--story-pale); }
.newhome .nh-story__controls p { margin: 0; color: #7890a6; font: 600 14px/1 'Space Grotesk', Arial, sans-serif; }
.newhome .nh-story__controls p strong { color: var(--story-royal); font-size: 17px; }
.newhome .nh-story__now { margin-left: 10px; color: var(--story-ink); }
.newhome .nh-story__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid #cfe5f3;
  border-radius: 999px;
  background: #fff;
  color: var(--story-ink);
  font: 700 15px/1 'DM Sans', Arial, sans-serif;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.newhome .nh-story__nav:not(:disabled):hover { transform: translateY(-1px); }
.newhome .nh-story__nav--back:not(:disabled):hover { border-color: var(--story-royal); color: var(--story-royal); }
.newhome .nh-story__nav--next { border-color: var(--story-royal); background: var(--story-royal); color: #fff; }
.newhome .nh-story__nav--next:hover { border-color: #0b52bb; background: #0b52bb; }
.newhome .nh-story__nav:disabled { opacity: .45; cursor: default; }
.newhome .nh-story__nav:focus-visible { outline: 3px solid var(--story-cyan); outline-offset: 3px; }
.newhome .nh-story__announce { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Without the script only the first stage can show, so hide the controls. */
.newhome .nh-story:not(.is-ready) .nh-story__progress,
.newhome .nh-story:not(.is-ready) .nh-story__controls { display: none; }

/* ---------- Orderlink screen illustrations ---------- */
.newhome .nh-ui {
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  overflow: hidden;
  border: 1px solid #cdeafa;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 56px -30px #0b4f9e66, 0 1px 2px #0b4f9e14;
  color: var(--story-ink);
  font: 400 13px/1.4 Inter, Arial, sans-serif;
}
.newhome .nh-ui__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--story-line); background: #f7fcff; color: var(--story-muted); font-size: 12px; }
.newhome .nh-ui__brand { color: var(--story-royal); font: 700 14px/1 'Space Grotesk', Arial, sans-serif; letter-spacing: -.03em; }
.newhome .nh-ui__brand::before { margin-right: 6px; color: var(--story-cyan); content: '◼'; font-size: 9px; }
.newhome .nh-ui__body { padding: 24px; }
.newhome .nh-ui__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.newhome .nh-ui__eyebrow { margin: 0 0 7px; color: #6a7d8b; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.newhome .nh-ui__title { margin: 0; color: var(--story-ink); font: 700 24px/1.1 'Space Grotesk', Arial, sans-serif; letter-spacing: -.04em; }

.newhome .nh-ui__status { display: inline-flex; flex: none; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: #e5f5ff; color: var(--story-royal); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.newhome .nh-ui__status::before { width: 6px; height: 6px; border-radius: 50%; background: var(--story-cyan); content: ''; }
.newhome .nh-ui__status.is-low { background: var(--story-low-bg); color: var(--story-low); }
.newhome .nh-ui__status.is-low::before { background: #ff7900; }
.newhome .nh-ui__status.is-done { background: var(--story-done-bg); color: var(--story-done); }
.newhome .nh-ui__status.is-done::before { background: #22b566; }

.newhome .nh-ui__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--story-line); }
.newhome .nh-ui__fields dt { color: var(--story-muted); font-size: 12px; }
.newhome .nh-ui__fields dd { margin: 4px 0 0; color: var(--story-ink); font: 600 17px/1.2 'Space Grotesk', Arial, sans-serif; letter-spacing: -.02em; }

.newhome .nh-ui__table { width: 100%; margin-top: 20px; border-collapse: collapse; }
.newhome .nh-ui__fields + .nh-ui__table { margin-top: 28px; }
.newhome .nh-ui__table th { padding: 0 0 8px; border-bottom: 1px solid var(--story-line); color: #6a7d8b; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.newhome .nh-ui__table td { padding: 10px 0; border-bottom: 1px solid #eef7fc; font-size: 13.5px; }
.newhome .nh-ui__table tr:last-child td { border-bottom: 0; padding-bottom: 0; }
.newhome .nh-ui__table :is(th, td):not(:first-child) { padding-left: 16px; text-align: right; }
.newhome .nh-ui__table td:not(:first-child) { font: 600 14px/1.2 'Space Grotesk', Arial, sans-serif; font-variant-numeric: tabular-nums; }

.newhome .nh-ui__rows { margin: 0; padding: 0; list-style: none; }
.newhome .nh-ui__head + .nh-ui__rows { margin-top: 14px; }
.newhome .nh-ui__rows li { display: grid; grid-template-columns: 1.15fr 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--story-line); }
.newhome .nh-ui__rows li:first-child { padding-top: 4px; }
.newhome .nh-ui__head + .nh-ui__rows li:first-child { padding-top: 14px; border-top: 1px solid var(--story-line); }
.newhome .nh-ui__rows li:last-child { padding-bottom: 0; border-bottom: 0; }
.newhome .nh-ui__rows b,
.newhome .nh-ui__levels b { display: block; color: var(--story-ink); font: 600 14px/1.2 'Space Grotesk', Arial, sans-serif; }
.newhome .nh-ui__rows small,
.newhome .nh-ui__levels small { display: block; margin-top: 4px; color: #60768a; font-size: 12px; }
.newhome .nh-ui__detail { color: var(--story-muted); font-size: 12.5px; }
.newhome .nh-ui__rows .nh-ui__status { justify-self: end; }

.newhome .nh-ui__origin { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--story-line); }
.newhome .nh-ui__origin b { font: 600 17px/1.2 'Space Grotesk', Arial, sans-serif; }
.newhome .nh-ui__origin span { color: var(--story-muted); font-size: 12px; }
.newhome .nh-ui__branch { --nh-gap: 12px; position: relative; display: grid; grid-template-columns: repeat(var(--nh-branches, 3), minmax(0, 1fr)); gap: var(--nh-gap); margin-top: 38px; }
.newhome .nh-ui__branch::before {
  --nh-centre: calc((100% - (var(--nh-branches, 3) - 1) * var(--nh-gap)) / (2 * var(--nh-branches, 3)));
  position: absolute;
  top: -20px;
  right: var(--nh-centre);
  left: var(--nh-centre);
  height: 20px;
  border: 1px solid var(--story-royal);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  content: '';
}
.newhome .nh-ui__branch::after { position: absolute; top: -38px; left: 50%; height: 18px; border-left: 1px solid var(--story-royal); content: ''; }
.newhome .nh-ui__card { position: relative; padding: 14px; border: 1px solid #cdeafa; border-radius: 10px; background: #fff; }
.newhome .nh-ui__card b { display: block; font: 700 14px/1.2 'Space Grotesk', Arial, sans-serif; }
.newhome .nh-ui__card strong { display: block; margin: 16px 0 3px; color: var(--story-royal); font: 700 24px/1 'Space Grotesk', Arial, sans-serif; letter-spacing: -.05em; }
.newhome .nh-ui__card small { display: block; color: #60768a; font-size: 11.5px; line-height: 1.45; }

.newhome .nh-ui__summary { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.newhome .nh-ui__summary strong { font: 700 30px/1 'Space Grotesk', Arial, sans-serif; letter-spacing: -.05em; }
.newhome .nh-ui__summary span { color: var(--story-muted); font-size: 12px; text-align: right; }
.newhome .nh-ui__cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid #cdeafa; border-radius: 10px; }
.newhome .nh-ui__cells > div { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-height: 132px; padding: 16px; border-right: 1px solid #cdeafa; }
.newhome .nh-ui__cells > div:last-child { border-right: 0; }
.newhome .nh-ui__cells p { margin: 0; }
.newhome .nh-ui__cells b { display: block; font: 600 14px/1.1 'Space Grotesk', Arial, sans-serif; }
.newhome .nh-ui__cells small { display: block; margin-top: 5px; color: #60768a; font-size: 11.5px; }
.newhome .nh-ui__cells strong { color: var(--story-royal); font: 700 24px/1 'Space Grotesk', Arial, sans-serif; letter-spacing: -.05em; }

.newhome .nh-ui__levels { margin: 16px 0 0; padding: 0; list-style: none; }
.newhome .nh-ui__levels li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; padding: 13px 0; border-top: 1px solid var(--story-line); }
.newhome .nh-ui__levels li:last-child { padding-bottom: 0; }
.newhome .nh-ui__meter { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 6px; background: #e6f4fc; }
.newhome .nh-ui__meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--story-royal), var(--story-cyan)); }
.newhome .nh-ui__levels .is-low .nh-ui__meter i { background: #ff9a3c; }
.newhome .nh-ui__levels .is-done .nh-ui__meter i { background: linear-gradient(90deg, #22b566, #4fd08b); }

.newhome .nh-ui__link { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.newhome .nh-ui__link span { padding: 7px 13px; border: 1px solid #cdeafa; border-radius: 999px; color: var(--story-ink); font: 700 12.5px/1 'Space Grotesk', Arial, sans-serif; }
.newhome .nh-ui__link span:first-child { border-color: transparent; background: var(--story-wash); color: var(--story-royal); }
.newhome .nh-ui__link i { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--story-royal) 0 8px, transparent 8px 14px); background-size: 28px 2px; }

@keyframes nh-story-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nh-story-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes nh-story-flow { to { background-position: 28px 0; } }
@media (prefers-reduced-motion: no-preference) {
  .newhome .nh-story__stage:not([hidden]) .nh-ui__link i { animation: nh-story-flow 1s linear infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .newhome .nh-story *,
  .newhome .nh-story *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .newhome .nh-story__tabs { padding-left: 16px; }
  .newhome .nh-story__tabs-label { display: none; }
}
@media (max-width: 960px) {
  .newhome .nh-story__panel { padding: 40px 32px 32px; }
  .newhome .nh-story__stage { gap: 36px; }
}
@media (max-width: 760px) {
  .newhome .nh-story { padding: 72px 0 76px; }
  .newhome .nh-story__head { margin-bottom: 30px; }
  .newhome .nh-story__head > p:last-child { font-size: 16px; }
  .newhome .nh-story__tabs { display: block; padding: 0; }
  .newhome .nh-story__tabs-label { display: block; margin-bottom: 10px; }
  .newhome .nh-story__types { display: grid; grid-template-columns: repeat(4, auto); justify-content: stretch; gap: 2px; }
  .newhome .nh-story__type-tab { flex-direction: column; gap: 6px; padding: 10px 6px 11px; border-radius: 12px 12px 0 0; text-align: center; }
  .newhome .nh-story__type-tab svg { width: 32px; height: 32px; padding: 7px; }
  .newhome .nh-story__type-tab strong { font-size: 11.5px; letter-spacing: -.01em; white-space: nowrap; }
  .newhome .nh-story__panel { padding: 30px 18px 22px; border-radius: 16px; }
  .newhome .nh-story__intro h3 { font-size: clamp(36px, 10vw, 50px); }
  .newhome .nh-story__progress { margin-top: 36px; gap: 6px; }
  .newhome .nh-story__step { display: none; }
  .newhome .nh-story__progress button { padding: 10px 0; }
  .newhome .nh-story__stage { display: block; min-height: 0; padding: 32px 0 40px; }
  .newhome .nh-story__copy { margin-bottom: 28px; }
  .newhome .nh-story__copy h4 { font-size: clamp(32px, 9vw, 44px); }
  .newhome .nh-story__copy p:last-child { max-width: none; font-size: 16px; }
  .newhome .nh-ui { max-width: none; }
  .newhome .nh-ui__body { padding: 18px; }
  .newhome .nh-ui__top { padding: 12px 16px; }
  .newhome .nh-ui__title { font-size: 21px; }
  .newhome .nh-ui__rows li { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .newhome .nh-ui__detail { display: none; }
  .newhome .nh-ui__cells { grid-template-columns: 1fr; }
  .newhome .nh-ui__cells > div { flex-direction: row; align-items: flex-end; min-height: 0; padding: 14px; border-right: 0; border-bottom: 1px solid #cdeafa; }
  .newhome .nh-ui__cells > div:last-child { border-bottom: 0; }
  .newhome .nh-story__controls { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 20px; }
  .newhome .nh-story__controls p { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .newhome .nh-story__nav { width: 100%; padding: 0 14px; white-space: nowrap; }
}
@media (max-width: 360px) {
  .newhome .nh-story__type-tab { padding-right: 3px; padding-left: 3px; }
  .newhome .nh-story__type-tab strong { font-size: 11px; }
}
@media (max-width: 520px) {
  .newhome .nh-story__facts { gap: 6px; }
  .newhome .nh-story__facts li { padding: 6px 11px; font-size: 13.5px; }
  .newhome .nh-story__lead { font-size: 16px; }
  .newhome .nh-ui__head { flex-direction: column; gap: 10px; }
  .newhome .nh-ui__fields { grid-template-columns: 1fr; gap: 12px; }
  .newhome .nh-ui__branch { grid-template-columns: 1fr; gap: 8px; margin-top: 18px; }
  .newhome .nh-ui__branch::before,
  .newhome .nh-ui__branch::after { display: none; }
  .newhome .nh-ui__card { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; }
  .newhome .nh-ui__card strong { grid-row: span 2; grid-column: 2; margin: 0; }
  .newhome .nh-ui__table td { font-size: 12.5px; }
}
