/*
 * The guided story of the demo: the four step pages (/demo/, /demo/problem/, /demo/ask/, /demo/arrive/). Loaded after demo.css; uses its colors and fonts. story.js makes the top bar and the
 * bottom nav; the rest is the pages' own markup with these classes.
 */
:root {
  --st-body: #3F4643;           /* the longer lines: a little softer than the ink */
  --st-frame: #ECEEED;          /* the address strip of a browser window */
  --st-dot: #B9BFBC;
}

body[data-story-step] { background: var(--soft); min-height: 100vh; display: flex; flex-direction: column; }
body[data-story-step] > main { flex: 1 1 auto; }

/* The top bar (story.js): Garrison, then the steps. The current one is black. */
.st-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 28px; background: var(--paper); border-bottom: 1px solid var(--line); }
.st-steps { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.st-step { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 12px; border-radius: 17px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.st-step:hover { color: var(--ink); background: var(--chip); }
.st-step[aria-current="step"] { background: var(--ink); color: #FFFFFF; font-weight: 600; }
.st-step-n { font-variant-numeric: tabular-nums; }
.st-talk { min-height: 34px; padding: 0 14px; border: 1px solid var(--muted); border-radius: 17px; background: var(--paper); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.st-talk:hover { background: var(--chip); }
@media (max-width: 720px) {
  .st-bar { padding: 10px 16px; }
  .st-step { padding: 0 11px; }
  /* Only the current step keeps its name on screen; the others keep it for screen readers. */
  .st-step:not([aria-current="step"]) .st-step-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 480px) {
  /* Garrison and "Talk to us" on the first row, the steps under it: the same on every step, whichever name is long. */
  .st-steps { order: 3; flex-basis: 100%; }
}

/* The bottom nav (story.js): Back on the left, Next on the right. */
.st-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 8px; }
.st-nav .btn, .st-nav .btn-line { height: 48px; padding: 0 22px; }
.st-nav-next { margin-left: auto; }
.st-solo > .st-nav { margin-top: 0; }
/* Story.ready(true): the step is done and Next is the button to press. A ring and a slow pulse. */
.st-nav-next.st-nav-ready { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); animation: st-ready 1.8s ease-in-out infinite; }
@keyframes st-ready {
  0%, 100% { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); }
  50% { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink), 0 0 0 14px rgba(17, 20, 19, 0.12); }
}

/* Steps 1 and 2: one column in the middle, no right side. */
.st-solo { width: 100%; max-width: 1080px; margin: 0 auto; padding: 56px 28px; display: flex; flex-direction: column; justify-content: center; gap: 36px; }
.st-solo-narrow { max-width: 976px; }
.st-h1 { font-family: var(--display); font-size: 48px; line-height: 1.12; letter-spacing: -0.01em; font-weight: 700; }
.st-lead { font-size: 21px; line-height: 1.45; color: var(--st-body); max-width: 720px; }
.st-kicker { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.st-h1 + .st-lead { margin-top: -16px; }
.st-kicker + .st-h1 { margin-top: -26px; }
.st-h1-md { font-size: 40px; line-height: 1.15; }
@media (max-width: 640px) {
  .st-solo { padding: 32px 16px; gap: 28px; }
  .st-h1 { font-size: 32px; }
  .st-h1-md { font-size: 28px; }
  .st-lead { font-size: 18px; }
  .st-h1 + .st-lead { margin-top: -12px; }
  .st-kicker + .st-h1 { margin-top: -18px; }
}

/* Step 1: the Start button, the other screens and the reset, small. */
.st-go { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.st-go .btn { height: 52px; padding: 0 28px; font-size: 16px; }
.st-extra { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 28px; }
.st-more { font-size: 14px; }
.st-more > summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.st-more > summary:hover { color: var(--ink); }
.st-more ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.st-quiet { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; }
.st-quiet:hover { color: var(--ink); }

/* Step 2: the four steps of today, as cards in a row. */
.st-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.st-cards > li { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.st-cards { counter-reset: st-card; }
.st-cards > li { counter-increment: st-card; }
.st-cards b { font-family: var(--display); font-size: 20px; font-weight: 700; }
.st-cards b::before { content: counter(st-card) ". "; }
.st-cards span { color: var(--muted); line-height: 1.5; }

/* The switch: a label and two options, the chosen one black. Buttons carry data-value and aria-pressed
   (Story.bindSwitch). Alone it is a card; .st-switch-inline is the small one for a side panel. */
.st-switch { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.st-switch-label { font-weight: 600; }
.st-switch-opts { display: flex; gap: 8px; }
.st-switch-opts > button { flex: 1 1 0; min-width: 0; min-height: 46px; padding: 4px 10px; background: var(--paper); color: var(--ink); border: 1px solid var(--muted); border-radius: 8px; }
.st-switch-opts > button:hover { border-color: var(--ink); }
.st-switch-opts > button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #FFFFFF; font-weight: 600; }
.st-switch-inline { padding: 0; border: 0; background: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.st-switch-inline .st-switch-label { font-weight: 500; color: var(--muted); }
.st-switch-inline .st-switch-opts { gap: 0; }
.st-switch-inline .st-switch-opts > button { flex: none; min-height: 32px; padding: 0 12px; border-radius: 0; }
.st-switch-inline .st-switch-opts > button:first-child { border-radius: 6px 0 0 6px; border-right-width: 0; }
.st-switch-inline .st-switch-opts > button:last-child { border-radius: 0 6px 6px 0; }

/* Steps 3 and 4: the split screen. The product on the left, wide; what happens on the right, narrower.
   One column under 900px, the product first. */
.st { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 24px; align-items: stretch; padding: 24px 28px; }
.st-left { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.st-right { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 900px) {
  .st { grid-template-columns: minmax(0, 1fr); padding: 16px; }
}
.st-title { font-family: var(--display); font-size: 28px; line-height: 1.2; font-weight: 700; }
.st-lines { margin: 0; padding-left: 20px; color: var(--st-body); line-height: 1.6; display: flex; flex-direction: column; gap: 4px; }
.st-sub { font-weight: 600; font-size: 14px; }
.st-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.st-card .code { background: var(--chip); border: 0; font-size: 12.5px; line-height: 1.55; overflow-x: auto; }
.st-events { list-style: none; margin: 0; padding: 0; }
.st-events > li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--nav); font-size: 13px; }
.st-events > li > .mono { font-size: 13px; overflow-wrap: anywhere; }
.st-events-at { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-none { color: var(--muted); font-size: 13px; }

/* A browser window around a Northwind Health page: three dots and the address.
   <div class="st-frame"><div class="st-frame-url"><span>northwind.example/sign-up</span></div> the page </div> */
.st-frame { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.st-frame-url { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--st-frame); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.st-frame-url::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--st-dot); box-shadow: 16px 0 0 var(--st-dot), 32px 0 0 var(--st-dot); margin-right: 32px; }
.st-frame-url > * { flex: 1 1 auto; min-width: 0; max-width: 360px; margin: 0 auto; background: var(--paper); border-radius: 6px; padding: 5px 12px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A jump in time, as a black pill: "6 days later · August 8". */
.st-time { align-self: flex-start; display: inline-block; background: var(--ink); color: #FFFFFF; border-radius: 14px; padding: 5px 14px; font-size: 13px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .st-step, .st-switch-opts > button { transition: none !important; }
  .st-nav-next.st-nav-ready { animation: none; }
}

/* "Talk to us" dialog: one field, the work email. */
.st-dialog { width: min(400px, calc(100% - 32px)); box-sizing: border-box; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); }
.st-dialog::backdrop { background: rgba(17, 20, 19, 0.45); }
.st-dialog-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 18px; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.st-dialog-x:hover { background: var(--chip); color: var(--ink); }
.st-dialog-title { margin: 0 0 16px 0; font-size: 20px; line-height: 1.2; }
.st-dialog-form { display: flex; flex-direction: column; gap: 12px; }
.st-dialog-field { display: flex; flex-direction: column; gap: 6px; }
.st-dialog-label { font-size: 13px; font-weight: 600; }
.st-dialog-input { height: 44px; padding: 0 12px; border: 1px solid var(--muted); border-radius: 8px; font: inherit; color: var(--ink); background: var(--paper); }
.st-dialog-send { margin-top: 8px; cursor: pointer; }
.st-dialog-send:disabled { opacity: 0.6; cursor: default; }
.st-dialog-note { margin: 0; min-height: 0; color: #B42318; font-size: 13px; }
.st-dialog-note:empty { display: none; }
.st-dialog-sent { margin: 0; font-size: 15px; }
.st-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
