/* ==========================================================================
   Relay — interactive demonstrations
   1. Shared demo chrome   2. Hero story   3. Sample website (Fernwood)
   4. Workflow simulator   5. Dashboard   6. Demos page
   All businesses, people and data shown are fictional.
   ========================================================================== */

/* 1. Shared demo chrome ---------------------------------------------------- */
.win-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; min-width: 0; }
.win-bar > i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); flex: none; }
.win-bar > i:nth-child(1) { background: #f0a7a0; } .win-bar > i:nth-child(2) { background: #f2cf86; } .win-bar > i:nth-child(3) { background: #9fd3a8; }
.win-url { flex: 1; min-width: 0; margin: 0 8px; padding: 3px 10px; border-radius: 6px; background: var(--bg-2); color: var(--ink-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.demo-toolbar { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; justify-content: space-between; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: .4rem .75rem; min-height: 34px; border-radius: 7px; font-size: .8438rem; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: .4rem; transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease), box-shadow var(--dur-2); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.demo-btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 36px; padding: .45rem .85rem; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); font-size: .8438rem; font-weight: 620; color: var(--ink); transition: border-color var(--dur-1), background var(--dur-1), box-shadow var(--dur-1); }
.demo-btn:hover { border-color: var(--ink-3); }
.demo-btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }
.demo-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.demo-btn[disabled] { opacity: .5; cursor: not-allowed; }
.demo-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.demo-caption { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .9rem 0 0; font-size: .8125rem; color: var(--ink-3); }

/* 2. Hero story ------------------------------------------------------------
   One fictional request: website form → automation → team dashboard.
   Every visual state is an attribute (data-s="…") so the GSAP timeline in
   hero.js can play, pause, reverse or jump to any moment and always land on
   a correct, readable state. The markup ships the finished state, which is
   what visitors without JavaScript (or with reduced motion) see. */
.hero-visual {
  position: relative; min-width: 0; padding: 14px 16px 16px;
  border-radius: calc(var(--r-xl) + 6px); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  box-shadow: var(--shadow-lg), 0 1px 0 rgba(255,255,255,.04) inset;
}
.hero-visual > * { position: relative; z-index: 1; }
.story-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.story-top .sample-tag { white-space: nowrap; }
.story-label { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); letter-spacing: -.005em; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.hero-visual.is-playing .live-dot { animation: live 1.6s var(--ease) infinite; }
@keyframes live { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); } }

.story-stage { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
.story-site { grid-column: 1 / 11; grid-row: 1; }
.story-flow { grid-column: 1 / 7; grid-row: 2; margin-top: 46px; }
.story-dash { grid-column: 7 / 13; grid-row: 2; margin: 76px 0 0 18px; }
.story-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 3; }
.wire-base { fill: none; stroke: var(--line-2); stroke-width: 1.6; stroke-dasharray: 3 5; stroke-linecap: round; }
.wire-lit { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.wire-end { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.6; transition: fill var(--dur-2), stroke var(--dur-2); }
.wire-end.is-lit { fill: var(--accent); stroke: var(--accent); }
.story-packet {
  position: absolute; left: 0; top: 0; z-index: 4; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow-md), 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 11.5px; font-weight: 650; white-space: nowrap; color: var(--ink); opacity: 0; pointer-events: none; will-change: transform;
}
.story-packet .avatar { width: 20px; height: 20px; border-radius: 50%; font-size: 8.5px; }

.story-card {
  position: relative; z-index: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease), border-color var(--dur-3) var(--ease), filter var(--dur-3) var(--ease);
}
.story-card.is-active { z-index: 2; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--shadow-lg), 0 0 0 4px color-mix(in srgb, var(--accent) 11%, transparent); }
.hero-visual.is-playing .story-card:not(.is-active) { opacity: .72; transform: scale(.985); filter: saturate(.6); }

/* Fernwood's site: a different brand (cream, serif, gold) from Relay's own UI. */
.ss-body { --fw-green: #1d3a2c; background: linear-gradient(170deg, #fbf8f1 0%, #f3ecdc 100%); color: var(--fw-green); border-radius: 0 0 var(--r-lg) var(--r-lg); overflow: hidden; position: relative; }
.ss-body::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 220px; height: 120px; border-radius: 50%; background: radial-gradient(closest-side, rgba(79,138,99,.28), transparent); pointer-events: none; }
.ss-nav { display: flex; align-items: center; gap: 14px; padding: 11px 16px; font-size: 11.5px; color: #5c6660; border-bottom: 1px solid #ebe3d2; }
.ss-nav b { display: inline-flex; align-items: center; gap: 7px; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 14.5px; color: var(--fw-green); margin-right: auto; }
.ss-nav em { font-style: normal; font-weight: 400; color: #5c6660; }
.ss-logo { width: 16px; height: 16px; border-radius: 50% 50% 50% 4px; background: #2c5541; box-shadow: inset -4px -4px 0 #4f8a63; }
.ss-nav-cta { background: #e9c46a; color: var(--fw-green); padding: 4px 9px; border-radius: 5px; font-weight: 700; }
.ss-hero { position: relative; z-index: 1; display: grid; gap: 12px; padding: 14px 16px 16px; }
.ss-kicker { margin: 0 0 3px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #8a6a1c; font-weight: 700; }
.ss-title { margin: 0; max-width: 16em; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-weight: 700; font-size: clamp(18px, 1.9vw, 22px); line-height: 1.12; letter-spacing: -.01em; }
.ss-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; padding: 8px; border-radius: 10px; background: #fff; border: 1px solid #ebe3d2; box-shadow: 0 6px 18px rgba(29,58,44,.08); }
.ss-field { display: grid; align-content: center; min-height: 38px; padding: 4px 9px; border-radius: 6px; border: 1px solid #e2dacb; background: #fff; font-size: 12.5px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; transition: border-color var(--dur-2), box-shadow var(--dur-2); }
.ss-field small { font-size: 9.5px; font-weight: 600; color: #6f685a; line-height: 1.2; }
.ss-type { display: block; min-height: 1.25em; line-height: 1.25; }
.ss-field[data-s="focus"] { border-color: #2c5541; box-shadow: 0 0 0 3px rgba(44,85,65,.16); }
.ss-field[data-s="focus"] .ss-type::after { content: ""; display: inline-block; width: 1.5px; height: 1em; margin-left: 1px; vertical-align: -2px; background: var(--fw-green); animation: caret 900ms steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.ss-submit { display: grid; place-items: center; padding: 0 14px; border-radius: 6px; background: #2c5541; color: #fbf8f1; font-size: 12px; font-weight: 700; white-space: nowrap; transition: transform var(--dur-1) var(--ease), background var(--dur-2); }
.ss-submit > span { display: inline-flex; align-items: center; gap: 4px; }
.ss-submit svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ss-submit[data-s="pressed"] { transform: scale(.94); background: #1d3a2c; }
.ss-submit[data-s="sent"] { background: #23774c; }
.ss-submit:not([data-s="sent"]) [data-when="sent"], .ss-submit[data-s="sent"] [data-when="idle"] { display: none; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px 10px; border-bottom: 1px solid var(--line); }
.card-title { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; letter-spacing: -.005em; white-space: nowrap; }
.card-sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; transition: background var(--dur-2); }
.story-flow.is-active .pulse { background: var(--ok); }
.hero-visual.is-playing .story-flow.is-active .pulse { animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

.flow-list { list-style: none; display: grid; gap: 3px; padding: 7px; }
.flow-list button { width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 6px 7px; border: 1px solid transparent; border-radius: 8px; background: none; font-size: 12.5px; font-weight: 600; color: var(--ink-3); text-align: left; transition: background var(--dur-3) var(--ease), color var(--dur-3) var(--ease), border-color var(--dur-2); }
.flow-list button:hover { border-color: var(--line); }
.flow-list button[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-softer); }
.flow-list .fl-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-3); transition: background var(--dur-3), color var(--dur-3), transform var(--dur-3) var(--ease); }
.fl-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fl-state { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 4px; background: var(--neutral-soft); color: var(--neutral); white-space: nowrap; transition: background var(--dur-2), color var(--dur-2); }
.fl-state > span { display: none; }
.flow-list li[data-s="wait"] [data-when="wait"], .flow-list li[data-s="run"] [data-when="run"], .flow-list li[data-s="done"] [data-when="done"] { display: inline; }
.flow-list li[data-s="run"] button { background: var(--accent-softer); color: var(--ink); }
.flow-list li[data-s="run"] .fl-icon { background: var(--accent-soft); color: var(--accent-text); transform: scale(1.06); }
.flow-list li[data-s="run"] .fl-state { background: var(--accent-soft); color: var(--accent-text); }
.flow-list li[data-s="done"] button { color: var(--ink); }
.flow-list li[data-s="done"] .fl-icon { background: var(--ok-soft); color: var(--ok); }
.flow-list li[data-s="done"] .fl-state { background: var(--ok-soft); color: var(--ok); }
/* "Scheduled" is a plan, not a completed action: it gets the info colour and a dashed icon. */
.flow-list li.is-later[data-s="done"] .fl-icon { background: var(--info-soft); color: var(--info); outline: 1px dashed color-mix(in srgb, var(--info) 55%, transparent); outline-offset: -1px; }
.flow-list li.is-later[data-s="done"] .fl-state { background: var(--info-soft); color: var(--info); }

.count-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.count-roll { display: inline-grid; height: 1.25em; line-height: 1.25em; overflow: hidden; }
.count-roll > span { grid-area: 1 / 1; transition: transform var(--dur-3) var(--ease), opacity var(--dur-3); }
.count-roll[data-s="before"] > span:last-child, .count-roll[data-s="after"] > span:first-child { opacity: 0; }
.count-roll[data-s="before"] > span:last-child { transform: translateY(100%); }
.count-roll[data-s="after"] > span:first-child { transform: translateY(-100%); }

.dash-toast {
  position: absolute; right: 12px; top: -17px; z-index: 3; display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 9px;
  background: var(--deep-2); color: var(--on-deep); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); font-size: 11.5px; font-weight: 600; box-shadow: var(--shadow-lg); white-space: nowrap;
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
}
.dash-toast svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dash-toast[data-s="hidden"] { opacity: 0; transform: translateY(-8px) scale(.97); }
.dash-rows { list-style: none; display: grid; gap: 2px; padding: 6px 8px 0; }
.dash-slot { display: grid; }
.dash-slot > * { grid-area: 1 / 1; }
.dash-empty { display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line-2); border-radius: 8px; font-size: 11px; color: var(--ink-3); transition: opacity var(--dur-3); }
.dash-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 7px 6px; border-radius: 8px; font-size: 12px; }
.dash-row b { display: block; font-size: 12.5px; line-height: 1.2; }
.dash-row small { display: block; color: var(--ink-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row > span:nth-child(2) { min-width: 0; }
.dash-row .badge { font-size: 10.5px; }
.dash-row.is-new { background: var(--accent-softer); box-shadow: inset 2px 0 0 var(--accent); transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease); }
[data-newrow][data-s="hidden"], [data-task][data-s="hidden"] { opacity: 0; transform: translateY(-6px); }
.dash-slot:has([data-s="shown"]) .dash-empty { opacity: 0; }
.avatar { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff; flex: none; }
.a1 { background: #6d5bc4; } .a2 { background: #b8653d; } .a3 { background: #2f7a62; } .a4 { background: #46689f; } .a5 { background: #a94f73; } .a6 { background: #66706b; }
.dash-task-slot { margin: 6px 8px 8px; }
.dash-task { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--info-soft); transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease); }
.dash-task > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-task svg { width: 14px; height: 14px; fill: none; stroke: var(--info); stroke-width: 1.7; stroke-linecap: round; }
.dash-task .badge { font-size: 10px; background: var(--surface); }

.story-caption { margin: 14px 2px 0; min-height: 2.9em; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.story-caption b { color: var(--ink); }
.story-controls { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.story-stages { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; list-style: none; }
.story-stages button { position: relative; width: 100%; display: flex; align-items: center; gap: 7px; padding: 9px 10px 11px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--surface) 80%, transparent); font-size: 12.5px; font-weight: 600; line-height: 1.2; color: var(--ink-3); text-align: left; overflow: hidden; transition: color var(--dur-2), border-color var(--dur-2), background var(--dur-2), transform var(--dur-1) var(--ease); }
.story-stages button:active { transform: scale(.98); }
.story-stages .t { min-width: 0; }
.story-stages button > .n { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--bg-2); font-size: 11px; font-weight: 750; flex: none; transition: background var(--dur-2), color var(--dur-2); }
.story-stages button::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--accent); }
.story-stages button:hover { color: var(--ink); border-color: var(--line-2); }
.story-stages button.is-active, .story-stages button.is-done { color: var(--ink); background: var(--surface); }
.story-stages button.is-active { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.story-stages button.is-active > .n, .story-stages button.is-done > .n { background: var(--accent-strong); color: var(--accent-ink); }
.story-stages button.is-done::after { opacity: .35; }
.story-hint { display: none; }
.story-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; color: var(--ink); box-shadow: var(--shadow-xs); transition: border-color var(--dur-1), transform var(--dur-1) var(--ease); }
.story-btn:hover { border-color: var(--ink-3); }
.story-btn:active { transform: scale(.94); }
.story-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.story-toggle { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }
.story-toggle:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.story-toggle .i-play { display: none; fill: currentColor; stroke-width: 1; }
.hero-visual:not(.is-playing) .story-toggle .i-play { display: block; }
.hero-visual:not(.is-playing) .story-toggle .i-pause { display: none; }
/* Without the motion script the controls have nothing to drive, so they stay hidden. */
html:not(.js) .story-controls, .hero-visual.is-static .story-controls, .hero-visual:not(.is-ready) .story-wires, .hero-visual:not(.is-ready) .story-packet { display: none; }

/* Entrance: the three cards assemble just after the headline. */
@media (prefers-reduced-motion: no-preference) {
  .story-top, .story-card, .story-caption, .story-controls { animation: assemble 800ms var(--ease-out) backwards; }
  .story-top { animation-delay: 320ms; }
  .story-site { animation-delay: 380ms; }
  .story-flow { animation-delay: 480ms; }
  .story-dash { animation-delay: 580ms; }
  .story-caption, .story-controls { animation-delay: 660ms; }
  .hero-visual { animation: frame-in 900ms var(--ease-out) 200ms backwards; }
}
@keyframes assemble { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes frame-in { from { opacity: 0; transform: translateY(20px); } }

@media (max-width: 1100px) { .hero-visual { max-width: 680px; } }
/* Phones: one card at a time, in the same grid cell so the stage never changes
   height. The stage buttons double as a progress indicator. */
@media (max-width: 640px) {
  .hero-visual { padding: 12px 12px 14px; border-radius: var(--r-xl); margin-inline: -4px; }
  .story-stage { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .story-stage > .story-card { grid-column: 1; grid-row: auto; margin: 0; }
  .story-wires, .story-packet { display: none !important; }
  html.js .hero-visual:not(.is-static) .story-stage > .story-card { grid-area: 1 / 1; align-self: stretch; }
  html.js .hero-visual:not(.is-static) .story-card { transition: opacity 380ms var(--ease), transform 480ms var(--ease-out), visibility 0s linear 480ms; }
  html.js .hero-visual:not(.is-static) .story-card:not(.is-active) { opacity: 0; visibility: hidden; transform: translateX(-24px) scale(.98); filter: none; }
  html.js .hero-visual:not(.is-static) .story-card.is-active ~ .story-card:not(.is-active) { transform: translateX(24px) scale(.98); }
  html.js .hero-visual:not(.is-static) .story-card.is-active { transition-delay: 0s; visibility: visible; }
  .story-card { display: flex; flex-direction: column; }
  .ss-body { flex: 1; }
  .ss-nav span:not(.ss-nav-cta) { display: none; }
  .ss-form { grid-template-columns: 1fr 1fr; }
  .ss-submit { grid-column: 1 / -1; min-height: 34px; }
  .story-caption { font-size: 13px; min-height: 3.9em; margin-top: 12px; }
  .story-controls { gap: 6px; }
  .story-stages button { font-size: 11.5px; padding: 8px 7px 10px; gap: 5px; }
  .story-btn { width: 40px; height: 40px; }
  .story-top { margin-bottom: 10px; }
}
@media (max-width: 520px) {
  .story-stages .t-more { display: none; }
  .story-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
  .story-stages { grid-column: 1 / -1; }
  .story-stages button { justify-content: center; }
  .story-hint { display: block; font-size: 12px; color: var(--ink-3); }
  .story-label { font-size: 12px; }
  .story-top .t-more { display: none; }
}

/* 3. Sample website (fictional Fernwood Outdoor Co.) ------------------------ */
.site-demo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; min-width: 0; }
.sd-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sd-stage { display: flex; justify-content: center; padding: clamp(12px, 2.5vw, 24px); background: var(--bg-2); min-height: 200px; }
.sd-frame { position: relative; max-width: 100%; border-radius: var(--r-lg); overflow: hidden; background: #fbf8f1; border: 1px solid var(--line-2); box-shadow: var(--shadow-md);
  transition: width var(--dur-4) var(--ease-in-out), border-radius var(--dur-3) var(--ease), border-width var(--dur-3) var(--ease); }
.sd-frame .win-bar { border-radius: 0; }
.sd-frame.is-switching .sd-scroll { opacity: 0; }
.sd-scroll { height: 540px; overflow: auto; overscroll-behavior: contain; transition: opacity 160ms var(--ease); scrollbar-width: thin; }
.is-compact .sd-scroll { height: 430px; }
.sd-phone-bar { display: none; }
.sd-frame.is-mobile { border: 9px solid var(--bezel); border-radius: 38px; background: #fbf8f1; }
.sd-frame.is-mobile .sd-bar { display: none; }
.sd-frame.is-mobile .sd-phone-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 20px 4px; font-size: 11px; font-weight: 700; color: #1f2a24; background: #fbf8f1; }
.sd-island { width: 74px; height: 20px; border-radius: 12px; background: #1d1b22; }
.sd-frame.is-mobile .sd-scroll { height: 600px; }
.is-compact .sd-frame.is-mobile .sd-scroll { height: 470px; }

.fw { --fw-green: #1d3a2c; --fw-green-2: #2c5541; --fw-cream: #fbf8f1; --fw-sand: #efe8d8; --fw-gold: #e9c46a; --fw-ink: #1f2a24; --fw-muted: #5c6660;
  --fw-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  container: fw / inline-size; position: relative; background: var(--fw-cream); color: var(--fw-ink); font-family: var(--font-sans); font-size: 16px; line-height: 1.55; }
:where(.fw) button { font: inherit; }
.fw-h1, .fw-h2, .fw-logo, .fw h4, .fw-band b, .fw-card b, .fw-footer b { font-family: var(--fw-serif); }
.fw-nav { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 40px; background: color-mix(in srgb, var(--fw-cream) 94%, transparent); border-bottom: 1px solid var(--fw-sand); }
.fw-logo { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; font-size: 21px; font-weight: 700; color: var(--fw-green); letter-spacing: -.01em; }
.fw-logo em { font-style: normal; font-weight: 400; color: var(--fw-muted); }
.fw-logo-mark { width: 26px; height: 26px; border-radius: 50% 50% 50% 6px; background: var(--fw-green-2); box-shadow: inset -6px -6px 0 #4f8a63; }
.fw-links { display: flex; align-items: center; gap: 6px; }
.fw-links > button:not(.fw-btn) { border: 0; background: none; padding: 8px 12px; border-radius: 6px; color: var(--fw-ink); font-size: 15px; font-weight: 550; }
.fw-links > button:not(.fw-btn):hover { background: var(--fw-sand); }
.fw-links > button[aria-current="page"] { color: var(--fw-green-2); box-shadow: inset 0 -2px 0 var(--fw-green-2); border-radius: 0; }
.fw-burger { display: none; width: 42px; height: 42px; border: 1px solid var(--fw-sand); border-radius: 8px; background: #fff; place-items: center; }
.fw-burger span, .fw-burger span::before, .fw-burger span::after { display: block; width: 18px; height: 2px; background: var(--fw-ink); border-radius: 2px; content: ""; position: relative; }
.fw-burger span::before { position: absolute; top: -6px; } .fw-burger span::after { position: absolute; top: 6px; }
.fw-mobile-menu { display: grid; padding: 8px 20px 14px; background: var(--fw-cream); border-bottom: 1px solid var(--fw-sand); }
.fw-mobile-menu button { text-align: left; border: 0; border-bottom: 1px solid var(--fw-sand); background: none; padding: 14px 4px; font-size: 17px; font-weight: 600; color: var(--fw-ink); }
.fw-mobile-menu button[aria-current="page"] { color: var(--fw-green-2); }
.fw-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 20px; border-radius: 8px; border: 1px solid transparent; font-weight: 700; font-size: 15px; text-decoration: none; transition: filter var(--dur-1), transform var(--dur-1); }
.fw-btn:hover { filter: brightness(1.05); }
.fw-btn:active { transform: translateY(1px); }
.fw-btn-sm { min-height: 38px; padding: 7px 14px; font-size: 14px; }
.fw-btn-gold { background: var(--fw-gold); color: var(--fw-green); }
.fw-btn-gold:hover { color: var(--fw-green); }
.fw-btn-green { background: var(--fw-green-2); color: var(--fw-cream); }
.fw-btn-green:hover { color: var(--fw-cream); }
.fw-btn-line { background: transparent; border-color: rgba(251,248,241,.5); color: var(--fw-cream); }
.fw-btn-line-dark { background: transparent; border-color: #d8cfbd; color: var(--fw-ink); }
.fw-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 56px 40px; background: linear-gradient(140deg, #1d3a2c, #2c5541 70%, #36654c); color: var(--fw-cream); }
.fw-kicker { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--fw-gold); }
.fw-page-head .fw-kicker { color: #8a6a1c; }
.fw-h1 { margin: 0 0 14px; font-size: 48px; line-height: 1.04; letter-spacing: -.02em; font-weight: 700; color: inherit; outline: none; }
.fw-lead { font-size: 18px; margin: 0 0 24px; opacity: .88; max-width: 30em; }
.fw-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fw-hero-art { border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; box-shadow: 0 20px 40px rgba(0,0,0,.25); }
.fw-art { width: 100%; height: 100%; }
.fw-section { padding: 48px 40px; }
.fw-eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--fw-green-2); }
.fw-h2 { margin: 0 0 22px; font-size: 32px; letter-spacing: -.006em; color: var(--fw-green); font-weight: 700; }
.fw-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.fw-card { text-align: left; display: grid; gap: 8px; align-content: start; padding: 20px; border-radius: 12px; background: #fff; border: 1px solid var(--fw-sand); color: var(--fw-ink); transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2); }
.fw-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(29,58,44,.12); border-color: #cdbf9f; }
.fw-card b { font-size: 19px; color: var(--fw-green); }
.fw-card > span:last-child { font-size: 14.5px; color: var(--fw-muted); line-height: 1.45; }
.fw-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: #e6efe2; color: var(--fw-green-2); }
.fw-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fw-steps-wrap { background: var(--fw-sand); }
.fw-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0; margin: 0; counter-reset: fw; }
.fw-steps li { counter-increment: fw; padding: 18px 20px; border-radius: 12px; background: var(--fw-cream); display: grid; gap: 2px; }
.fw-steps li::before { content: counter(fw); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--fw-green-2); color: var(--fw-cream); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.fw-steps b { font-size: 17px; color: var(--fw-green); }
.fw-steps span { font-size: 14.5px; color: var(--fw-muted); }
.fw-band { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 40px; padding: 28px 32px; border-radius: 14px; background: var(--fw-green); color: var(--fw-cream); }
.fw-band b { font-size: 26px; }
.fw-page-head { padding: 48px 40px 8px; }
.fw-page-head .fw-h1 { color: var(--fw-green); font-size: 42px; }
.fw-page-head .fw-lead { color: var(--fw-muted); opacity: 1; }
.fw-list { display: grid; gap: 12px; }
.fw-service { display: grid; grid-template-columns: 42px 1fr auto; gap: 18px; align-items: center; padding: 20px 22px; border-radius: 12px; background: #fff; border: 1px solid var(--fw-sand); transition: box-shadow 1s var(--ease), border-color 1s; }
.fw-service h4 { margin: 0 0 2px; font-size: 20px; color: var(--fw-green); }
.fw-service p { margin: 0; color: var(--fw-muted); font-size: 15px; }
.fw-service.is-highlight { border-color: var(--fw-gold); box-shadow: 0 0 0 3px rgba(233,196,106,.45); }
.fw-about { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fw-about > div { padding: 22px; border-radius: 12px; background: #fff; border: 1px solid var(--fw-sand); }
.fw-about h4 { margin: 0 0 6px; font-size: 19px; color: var(--fw-green); }
.fw-about p { margin: 0; color: var(--fw-muted); font-size: 15px; }
.fw-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 720px; padding: 26px; border-radius: 14px; background: #fff; border: 1px solid var(--fw-sand); }
.fw-full { grid-column: 1 / -1; }
.fw-field { display: grid; gap: 6px; }
.fw-field label { font-weight: 650; font-size: 14.5px; color: var(--fw-ink); }
.fw-field label span { font-weight: 400; color: var(--fw-muted); }
.fw-field input, .fw-field select, .fw-field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 8px; border: 1px solid #d8cfbd; background: #fff; color: var(--fw-ink); font: inherit; font-size: 16px; }
.fw-field input:focus, .fw-field select:focus, .fw-field textarea:focus { outline: none; border-color: var(--fw-green-2); box-shadow: 0 0 0 3px rgba(44,85,65,.18); }
.fw-field [aria-invalid="true"] { border-color: #b4352e; }
.fw-error { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fbe5e3; color: #9c2b25; font-weight: 600; font-size: 14.5px; }
.fw-done { max-width: 620px; padding: 28px; border-radius: 14px; background: #fff; border: 1px solid var(--fw-sand); outline: none; }
.fw-done-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #23774c; color: #fff; font-weight: 800; font-size: 20px; margin-bottom: 12px; }
.fw-done h4 { margin: 0 0 6px; font-size: 24px; color: var(--fw-green); }
.fw-done p { color: var(--fw-muted); }
.fw-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 40px; background: var(--fw-green); color: rgba(251,248,241,.75); font-size: 14px; }
.fw-footer b { color: var(--fw-cream); }
.fw-hotspot { position: absolute; z-index: 4; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-strong); color: #fff; font: 700 12px/1 var(--font-sans); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent), 0 4px 10px rgba(0,0,0,.2); pointer-events: none; }
.fw-hotspot.is-ping { animation: ping 900ms var(--ease) 2; }
@keyframes ping { 50% { transform: scale(1.35); } }
.sd-notes { list-style: none; display: grid; gap: 6px; padding: 14px 16px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.sd-notes button { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; width: 100%; text-align: left; border: 0; background: none; padding: 8px; border-radius: 8px; font-size: .9063rem; color: var(--ink-2); }
.sd-notes button:hover { background: var(--accent-softer); color: var(--ink); }
.sd-notes button span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-strong); color: #fff; font-weight: 700; font-size: 12px; }

@container fw (max-width: 640px) {
  .fw-nav { padding: 12px 18px; }
  .fw-logo { font-size: 18px; }
  .fw-logo em { display: none; }
  .fw-links { display: none; }
  .fw-burger { display: grid; }
  .fw-hero { grid-template-columns: 1fr; padding: 32px 20px; gap: 24px; }
  .fw-h1 { font-size: 34px; }
  .fw-page-head .fw-h1 { font-size: 31px; }
  .fw-lead { font-size: 16.5px; }
  .fw-actions .fw-btn { flex: 1 1 100%; }
  .fw-section { padding: 32px 20px; }
  .fw-page-head { padding: 32px 20px 0; }
  .fw-h2 { font-size: 26px; }
  .fw-cards, .fw-steps, .fw-about { grid-template-columns: 1fr; }
  .fw-card { grid-template-columns: 42px 1fr; column-gap: 14px; }
  .fw-card .fw-icon { grid-row: span 2; }
  .fw-band { margin: 20px; padding: 22px; }
  .fw-band b { font-size: 22px; }
  .fw-band .fw-btn { width: 100%; }
  .fw-service { grid-template-columns: 42px 1fr; }
  .fw-service .fw-btn { grid-column: 1 / -1; }
  .fw-form { grid-template-columns: 1fr; padding: 18px; }
  .fw-footer { padding: 20px; }
}

/* 4. Workflow simulator ------------------------------------------------------ */
.wf { container: wf / inline-size; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; overflow: clip; min-width: 0; }
.wf-title { font-weight: 650; font-size: .9063rem; }
.wf-body { display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; }
.wf-body > * { padding: 1.25rem; min-width: 0; }
.wf-trigger { background: var(--surface-2); border-right: 1px solid var(--line); display: grid; gap: .9rem; align-content: start; }
.wf-inspector { border-left: 1px solid var(--line); background: var(--surface); }
.wf-label { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem .75rem; margin: 0 0 .7rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.wf-hint { font-weight: 500; letter-spacing: 0; text-transform: none; font-size: .75rem; }
.wf-trigger .wf-label { margin-bottom: -.35rem; }
.wf-event { padding: .9rem 1rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.wf-event > b { display: block; font-size: .9063rem; margin-bottom: .6rem; line-height: 1.3; }
.wf-event dl { margin: 0; display: grid; gap: .45rem; }
.wf-event dl div { display: grid; gap: 1px; }
.wf-event dt { font-size: .6875rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.wf-event dd { margin: 0; font-size: .8438rem; color: var(--ink); overflow-wrap: anywhere; }
.wf-controls { display: flex; flex-wrap: wrap; gap: .5rem; }
.wf-controls .demo-btn.primary { flex: 1; justify-content: center; }
.wf-clock { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .8125rem; color: var(--ink-3); }
.wf-clock svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.wf-clock b { color: var(--ink); font-variant-numeric: tabular-nums; }
.wf-lead-card { padding: .85rem 1rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.wf-lead-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; font-size: .875rem; }
.wf-lead-card ol { list-style: none; display: grid; gap: .3rem; font-size: .8125rem; color: var(--ink-2); }
.wf-lead-card li span { display: inline-block; min-width: 0; margin-right: .4rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.wf-steps { list-style: none; display: grid; gap: .5rem; position: relative; }
.wf-steps::before { content: ""; position: absolute; left: 27px; top: 20px; bottom: 20px; width: 2px; background: var(--line); }
.wf-step-item { position: relative; transition: opacity var(--dur-3) var(--ease); }
.wf-step-item.is-pending { opacity: .5; }
.wf-step { position: relative; width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: .8rem; padding: .6rem .75rem .6rem .5rem; text-align: left; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-2); }
.wf-step:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.wf-step[aria-pressed="true"] { border-color: var(--accent-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.is-running > .wf-step { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-softer); }
.wf-step-main { display: grid; min-width: 0; }
.wf-step-main b { font-size: .9063rem; font-weight: 620; line-height: 1.3; }
.wf-step-main small { font-size: .7813rem; color: var(--ink-3); min-height: 1.1em; overflow-wrap: anywhere; }
.wf-step-kind { font-size: .6563rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.wf-kind { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; position: relative; z-index: 1; }
.wf-kind svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.k-event .wf-kind, .wf-kind.k-event { background: var(--info-soft); color: var(--info); }
.k-action .wf-kind, .wf-kind.k-action { background: var(--accent-soft); color: var(--accent-text); }
.k-notify .wf-kind, .wf-kind.k-notify { background: var(--warn-soft); color: var(--warn); }
.k-task .wf-kind, .wf-kind.k-task { background: color-mix(in srgb, var(--accent-3) 14%, var(--surface)); color: var(--accent-3); }
.k-record .wf-kind, .wf-kind.k-record { background: var(--ok-soft); color: var(--ok); }
.is-pending .wf-kind { filter: grayscale(1); }
.is-changed > .wf-step { animation: changed 1.6s var(--ease); }
.is-added > .wf-step { animation: added 600ms var(--ease) both, changed 1.6s var(--ease); }
@keyframes changed { 0%, 40% { background: var(--accent-softer); border-color: var(--accent); } }
@keyframes added { from { opacity: 0; transform: translateY(-8px); } }

.st-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem; border-radius: 5px; font-size: .7188rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap; border: 1px solid transparent; }
.st-waiting { background: var(--neutral-soft); color: var(--neutral); }
.st-running { background: var(--accent-soft); color: var(--accent-text); }
.st-received { background: var(--neutral-soft); color: var(--ink-2); }
.st-done { background: var(--ok-soft); color: var(--ok); }
.st-sent { background: var(--info-soft); color: var(--info); }
.st-scheduled { background: transparent; color: var(--info); border: 1px dashed currentColor; }
.st-open { background: var(--accent-softer); color: var(--accent-text); border-color: var(--accent-soft); }
.st-completed { background: var(--ok-solid); color: #fff; }
.st-responded { background: var(--accent-strong); color: var(--accent-ink); }
.st-cancelled { background: var(--neutral-soft); color: var(--neutral); text-decoration: line-through; }
.st-overdue { background: var(--warn-soft); color: var(--warn); }
.st-escalated { background: var(--danger-soft); color: var(--danger); }
.st-spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.st-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; padding: 0; vertical-align: -1px; }
.st-dot.st-scheduled { border-width: 1.5px; }

.wf-next { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px dashed var(--line-2); animation: panel-in var(--dur-3) var(--ease); }
.wf-outcomes { display: grid; gap: .5rem; }
.wf-outcome { display: flex; justify-content: space-between; align-items: center; gap: .75rem; width: 100%; padding: .7rem .9rem; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); text-align: left; font-weight: 600; font-size: .875rem; color: var(--ink); transition: border-color var(--dur-1), background var(--dur-1), opacity var(--dur-2); }
.wf-outcome small { font-weight: 550; color: var(--ink-3); font-size: .75rem; white-space: nowrap; }
.wf-outcome:hover:not([disabled]) { border-color: var(--accent-strong); background: var(--accent-softer); }
.wf-outcome[disabled] { opacity: .45; cursor: default; }
.wf-outcome.is-chosen { opacity: 1; border-color: var(--accent-strong); background: var(--accent-softer); box-shadow: 0 0 0 1px var(--accent-strong) inset; }
.wf-outcome-note { margin: .9rem 0 0; padding: .8rem .95rem; border-radius: var(--r); background: var(--info-soft); color: var(--ink); font-size: .875rem; border-left: 3px solid var(--info); animation: panel-in var(--dur-3) var(--ease); }

.wf-empty { padding: 1.5rem 1rem; border: 1px dashed var(--line-2); border-radius: var(--r); text-align: center; color: var(--ink-3); font-size: .875rem; }
.wf-empty p { margin: 0; }
.wf-detail { animation: panel-in var(--dur-2) var(--ease); }
.wf-detail-head { display: flex; gap: .75rem; align-items: center; margin-bottom: .75rem; }
.wf-detail-head h3 { margin: 0; font-size: 1.0625rem; line-height: 1.25; }
.wf-detail-status { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1rem; font-size: .8438rem; color: var(--ink-2); }
.wf-detail dl { margin: 0; display: grid; gap: .25rem; }
.wf-detail dt { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-top: .65rem; }
.wf-detail dt:first-child { margin-top: 0; }
.wf-detail dd { margin: 0; font-size: .9063rem; color: var(--ink-2); line-height: 1.5; }
.wf-detail dt:nth-of-type(3) { color: var(--warn); }
.wf-detail dd:last-child { padding: .6rem .75rem; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--ink); }

.wf-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding: .85rem 1.25rem; border-top: 1px solid var(--line); background: var(--surface-2); font-size: .7813rem; color: var(--ink-3); }
.wf-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.wf-legend b { color: var(--ink); font-weight: 650; }
.wf-log { border-top: 1px solid var(--line); }
.wf-log summary { cursor: pointer; padding: .8rem 1.25rem; font-size: .8438rem; font-weight: 650; color: var(--ink-2); }
.wf-log summary:hover { color: var(--ink); }
.wf-log ol { list-style: none; display: grid; gap: .35rem; padding: 0 1.25rem 1rem; max-height: 220px; overflow: auto; font-size: .8125rem; color: var(--ink-2); }
.wf-log time { display: inline-block; min-width: 4.8rem; font-family: var(--font-mono); font-size: .75rem; color: var(--ink-3); }

.wf.is-compact .wf-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.wf.is-compact .wf-trigger { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: end; column-gap: 1.25rem; }
.wf.is-compact .wf-trigger .wf-label { grid-column: 1 / -1; }
.wf.is-compact .wf-event { grid-row: span 2; }
.wf.is-compact .wf-event dl { grid-template-columns: 1fr 1fr; }
.wf.is-compact .wf-event dl div:last-child { grid-column: 1 / -1; }

@container wf (max-width: 1000px) {
  .wf-body { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .wf-trigger { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); column-gap: 1.5rem; align-items: start; }
  .wf-trigger .wf-label { grid-column: 1 / -1; }
  .wf-event { grid-row: span 3; }
  .wf-event dl { grid-template-columns: 1fr 1fr; }
  .wf-event dl div:last-child { grid-column: 1 / -1; }
  .wf-inspector { border-left: 1px solid var(--line); }
}
@container wf (max-width: 720px) {
  .wf-body, .wf.is-compact .wf-body { grid-template-columns: 1fr; }
  .wf-trigger { border-right: 0; border-bottom: 1px solid var(--line); }
  .wf-trigger, .wf.is-compact .wf-trigger { grid-template-columns: 1fr; }
  .wf-event { grid-row: auto; }
  .wf-inspector { border-left: 0; border-top: 1px solid var(--line); }
  .wf.is-compact .wf-event { grid-row: auto; }
  .wf.is-compact .wf-inspector { border-left: 0; border-top: 1px solid var(--line); }
  .wf-body > * { padding: 1rem; }
}
@container wf (max-width: 420px) {
  .wf-step { grid-template-columns: 32px minmax(0, 1fr); }
  .wf-step [data-pill] { grid-column: 2; justify-self: start; }
  .wf-kind { width: 32px; height: 32px; }
  .wf-steps::before { left: 24px; }
  .wf.is-compact .wf-event dl { grid-template-columns: 1fr; }
}

/* 5. Dashboard (fictional Fernwood Ops portal) -------------------------------- */
.db { container: db / inline-size; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; min-width: 0; }
.db-app { position: relative; display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: 600px; }
.db.is-compact .db-app { grid-template-columns: minmax(0, 1fr); min-height: 0; }
.db-side { display: flex; flex-direction: column; gap: 1.25rem; padding: 1rem .75rem; background: var(--deep); color: var(--on-deep); }
.db-brand { display: flex; align-items: center; gap: .55rem; padding: .25rem .5rem; font-weight: 600; font-size: .9375rem; }
.db-brand b { font-weight: 800; }
.db-mark { width: 24px; height: 24px; border-radius: 50% 50% 50% 5px; background: #3d7a57; box-shadow: inset -5px -5px 0 #7fb98f; }
.db-nav { display: grid; gap: 2px; }
.db-nav button { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .6rem .65rem; border: 0; border-radius: 8px; background: none; color: var(--on-deep-2); font-size: .875rem; font-weight: 560; text-align: left; transition: background var(--dur-1), color var(--dur-1); }
.db-nav button:hover { background: rgba(255,255,255,.07); color: var(--on-deep); }
.db-nav button[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.db-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.db-nav em { margin-left: auto; font-style: normal; font-size: .6875rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent-strong); color: #fff; }
.db-user { margin-top: auto; display: flex; align-items: center; gap: .6rem; padding: .65rem .5rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .8125rem; }
.db-user b { display: block; color: var(--on-deep); font-weight: 650; }
.db-user small { color: var(--on-deep-2); font-size: .7188rem; }
.db-main { min-width: 0; display: flex; flex-direction: column; background: var(--surface-2); }
.db-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem .9rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.db-title { margin: 0; font-size: 1.15rem; letter-spacing: -.02em; outline: none; }
.db-sub { margin: .15rem 0 0; font-size: .8125rem; color: var(--ink-3); }
.db-top-tools { display: flex; gap: .5rem; align-items: center; }
.db-icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); }
.db-icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.db-icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.db-dot { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger-solid); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); }
.db-bell-wrap { position: relative; }
.db-notes { position: absolute; right: 0; top: calc(100% + 8px); z-index: 6; width: min(300px, 80vw); border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-lg); animation: panel-in var(--dur-2) var(--ease); }
.db-notes-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid var(--line); font-size: .875rem; }
.db-notes ul { list-style: none; display: grid; max-height: 260px; overflow: auto; }
.db-notes li { padding: .65rem .9rem; font-size: .8125rem; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.db-notes li:last-child { border-bottom: 0; }
.db-notes li.is-unread { color: var(--ink); background: var(--accent-softer); font-weight: 550; }
.db-link { border: 0; background: none; padding: .2rem .1rem; color: var(--accent-text); font-weight: 650; font-size: .8125rem; }
.db-link:hover { text-decoration: underline; }
.db-view { padding: 1.25rem; display: grid; gap: 1rem; align-content: start; animation: panel-in var(--dur-2) var(--ease); }
.db.is-compact .db-view { max-height: 520px; overflow: auto; }

.db-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.db-kpi { padding: .85rem 1rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); display: grid; gap: .1rem; }
.db-kpi span { font-size: .75rem; font-weight: 650; color: var(--ink-3); }
.db-kpi b { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.db-kpi small { font-size: .7188rem; color: var(--ink-3); }
.db-kpi.is-warn { border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.db-kpi.is-warn small { color: var(--warn); font-weight: 650; }
.db-kpi.is-ok small { color: var(--ok); font-weight: 600; }
.db-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; }
.db-span { grid-column: 1 / -1; }
.db-panel { padding: 1rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.db-panel h4 { margin: 0 0 .75rem; font-family: var(--font-sans); font-size: .8438rem; font-weight: 700; }
.db-panel-head { display: flex; justify-content: space-between; align-items: baseline; }

.db-filters { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; }
.db-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.db-chips button { display: inline-flex; align-items: center; gap: .35rem; min-height: 34px; padding: .35rem .7rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.db-chips button:hover { color: var(--ink); border-color: var(--ink-3); }
.db-chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.db-chips em { font-style: normal; opacity: .7; font-size: .75rem; }
.db-inline { display: inline-flex; align-items: center; gap: .45rem; font-size: .8125rem; font-weight: 600; color: var(--ink-3); }
.db-select { min-height: 34px; padding: .3rem 1.9rem .3rem .6rem; border-radius: 7px; border: 1px solid var(--line-2); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%238D94A1' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right .55rem center / 10px; appearance: none; font-size: .8125rem; font-weight: 600; color: var(--ink); }
.db-select:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 1px; }
.db-status.st-todo { background-color: var(--neutral-soft); border-color: transparent; }
.db-status.st-doing { background-color: var(--info-soft); color: var(--info); border-color: transparent; }
.db-status.st-done { background-color: var(--ok-soft); color: var(--ok); border-color: transparent; }
.db-search { position: relative; flex: 1 1 220px; max-width: 340px; display: flex; }
.db-search svg { position: absolute; left: .65rem; top: 50%; translate: 0 -50%; width: 16px; height: 16px; fill: none; stroke: var(--ink-3); stroke-width: 1.7; stroke-linecap: round; }
.db-search input { width: 100%; min-height: 38px; padding: .4rem .75rem .4rem 2.1rem; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); font-size: .875rem; }
.db-search input:focus { outline: none; border-color: var(--accent-strong); box-shadow: var(--ring); }

.db-tasks { list-style: none; display: grid; gap: .45rem; }
.db-task { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .6rem .75rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: background var(--dur-2), border-color var(--dur-2); }
.db-panel .db-task { background: var(--surface-2); }
.db-task.is-overdue { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.db-task-main { min-width: 0; }
.db-task-main b { display: block; font-size: .875rem; font-weight: 600; line-height: 1.35; }
.db-task-main small { font-size: .75rem; color: var(--ink-3); }
.db-overdue { color: var(--warn); font-weight: 700; }
.db-task.s-done .db-task-main b { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.db-check { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; color: transparent; transition: background var(--dur-2), border-color var(--dur-2), color var(--dur-2), transform var(--dur-1); }
.db-check:hover { border-color: var(--ok); }
.db-check:active { transform: scale(.9); }
.db-check svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.db-check[aria-pressed="true"] { background: var(--ok-solid); border-color: var(--ok-solid); color: #fff; animation: bump 400ms var(--ease); }
.db-empty { color: var(--ink-3); font-size: .875rem; padding: .75rem; }

.db-bars { list-style: none; display: grid; gap: .6rem; }
.db-bars li { display: grid; grid-template-columns: 64px minmax(0, 1fr) 24px; gap: .6rem; align-items: center; font-size: .8125rem; color: var(--ink-2); }
.db-bars b { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.db-bar { height: 10px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.db-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--accent); transition: width var(--dur-4) var(--ease); }
.db-mini-sched { list-style: none; display: grid; gap: .5rem; font-size: .875rem; }
.db-mini-sched time, .db-activity time, .db-history time { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: .75rem; }
.db-mini-sched time { display: inline-block; width: 3.2rem; font-weight: 700; }
.db-activity { list-style: none; display: grid; gap: .55rem; }
.db-activity li { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: .5rem; font-size: .8125rem; color: var(--ink-2); }
.db-activity b { color: var(--ink); font-weight: 650; }

.db-table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.db-table { width: 100%; border-collapse: collapse; font-size: .8438rem; }
.db-table th { text-align: left; padding: .6rem .85rem; font-size: .7188rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.db-table td { padding: .7rem .85rem; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
.db-table tr:last-child td { border-bottom: 0; }
.db-table tbody tr:hover { background: var(--accent-softer); }
.db-table td b { display: block; color: var(--ink); font-weight: 620; }
.db-table td small { font-size: .7188rem; color: var(--ink-3); }

.db-week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; }
.db-day { padding: .7rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); display: grid; gap: .45rem; align-content: start; min-height: 180px; }
.db-day h4 { margin: 0 0 .2rem; font-family: var(--font-sans); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.db-visit { padding: .5rem .6rem; border-radius: 7px; border-left: 3px solid var(--accent); background: var(--accent-softer); display: grid; font-size: .75rem; animation: panel-in var(--dur-2) var(--ease); }
.db-visit time { font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.db-visit b { color: var(--ink); font-weight: 620; font-size: .8125rem; line-height: 1.3; }
.db-visit small { color: var(--ink-3); }
.db-visit.p-priya { border-left-color: #E07AA3; background: color-mix(in srgb, #E07AA3 12%, var(--surface)); }
.db-visit.p-marcus { border-left-color: #E9965F; background: color-mix(in srgb, #E9965F 12%, var(--surface)); }
.db-visit.p-elena { border-left-color: #4FC1A0; background: color-mix(in srgb, #4FC1A0 12%, var(--surface)); }
.db-visit.p-jordan { border-left-color: #9C86F0; background: color-mix(in srgb, #9C86F0 12%, var(--surface)); }
.db-day .db-empty { padding: 0; font-size: .75rem; margin: 0; }

.db-drawer { position: absolute; top: 0; right: 0; bottom: 0; z-index: 8; width: min(360px, 100%); padding: 1.1rem 1.25rem; overflow: auto; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -18px 0 40px rgba(0, 0, 0, .5); animation: drawer-in var(--dur-3) var(--ease); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } }
.db-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.db-drawer-head h4 { margin: .1rem 0 0; font-size: 1.2rem; letter-spacing: -.02em; }
.db-facts { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 0 0 1rem; padding: .85rem; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.db-facts dt { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.db-facts dd { margin: 0; font-size: .875rem; font-weight: 550; }
.db-drawer-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.db-drawer h5 { margin: 0 0 .6rem; font-size: .8125rem; font-weight: 700; }
.db-history { list-style: none; display: grid; gap: .65rem; border-left: 2px solid var(--line); padding-left: .9rem; font-size: .8125rem; color: var(--ink-2); }
.db-history li { position: relative; display: grid; }
.db-history li::before { content: ""; position: absolute; left: calc(-.9rem - 6px); top: .35em; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.db-compact-activity { margin-top: .25rem; }

@container db (max-width: 820px) {
  .db-app { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .db-side { min-width: 0; }
  .db-side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem .75rem; }
  .db-nav { display: flex; overflow-x: auto; flex: 1 1 100%; order: 3; scrollbar-width: none; }
  .db-nav button { width: auto; white-space: nowrap; }
  .db-nav button[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
  .db-user { margin: 0 0 0 auto; border: 0; padding: 0; }
  .db-user small { display: none; }
  .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-grid { grid-template-columns: 1fr; }
  .db-week { grid-template-columns: 1fr; }
  .db-day { min-height: 0; }
}
@container db (max-width: 520px) {
  .db-view { padding: .9rem; }
  .db-top { padding: .9rem; }
  .db-task { grid-template-columns: 28px minmax(0, 1fr); }
  .db-task .db-status { grid-column: 2; justify-self: start; }
  .db-user span:last-child { display: none; }
  .db-table thead { display: none; }
  .db-table, .db-table tbody, .db-table tr, .db-table td { display: block; }
  .db-table tr { padding: .6rem .85rem; border-bottom: 1px solid var(--line); }
  .db-table td { padding: .1rem 0; border: 0; }
  .db-table:not(.tt-table) td:nth-child(3)::before { content: "Owner: "; color: var(--ink-3); }
  .tt-table td:nth-child(2)::before { content: "Rate: "; color: var(--ink-3); }
  .tt-table td:nth-child(3)::before { content: "Recorded: "; color: var(--ink-3); }
  .tt-table td:nth-child(5)::before { content: "Estimated gross: "; color: var(--ink-3); }
  .db-facts { grid-template-columns: 1fr; }
}

/* Refinements */
.demo-btn { white-space: nowrap; }
.demo-btn svg.fill { fill: currentColor; stroke: none; }
.st-dot.st-sent { background: var(--info); }
.st-dot.st-scheduled { border-color: var(--info); }
.db-view { grid-template-columns: minmax(0, 1fr); }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { white-space: nowrap; flex: none; }
@media (max-width: 480px) { .hero .actions { gap: .6rem; } .hero .actions .btn { flex: 1 1 0; padding-inline: .9rem; } }
@media (max-width: 349px) { .hero .actions .btn { flex-basis: 100%; } }

.wf-insp { position: sticky; top: calc(var(--header-h) + 16px); }

/* 7. Connected systems (homepage scroll story) ------------------------------
   Default (phones, no JS, reduced data): three steps, each with its own small
   illustration. On wide screens connected.js adds .is-enhanced: the steps
   scroll on the left while one sticky canvas on the right changes from a
   website, to the workflow behind it, to the team's dashboard. */
.cs-steps { list-style: none; display: grid; gap: clamp(3rem, 7vw, 4.5rem); }
.cs-step { max-width: 40rem; }
.cs-step h3 { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.12; letter-spacing: -.022em; margin-bottom: .6rem; }
.cs-step > p:not(.cs-kicker) { color: var(--ink-2); font-size: 1.0625rem; }
.cs-kicker { display: inline-flex; align-items: center; gap: .6rem; font-size: .8125rem; font-weight: 650; letter-spacing: .02em; color: var(--ink-3); margin-bottom: .9rem; }
.cs-kicker .num { display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 6px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-text); font-size: .75rem; font-weight: 750; font-variant-numeric: tabular-nums; transition: background var(--dur-3), color var(--dur-3); }
.cs-points { list-style: none; display: grid; gap: .45rem; margin: 1.1rem 0 1.4rem; }
.cs-points li { position: relative; padding-left: 1.6rem; color: var(--ink-2); font-size: .975rem; }
.cs-points li::before { content: ""; position: absolute; left: 0; top: .45em; width: 14px; height: 9px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); border-radius: 0 0 0 2px; transform: rotate(-45deg) scale(.8); transform-origin: 30% 60%; }
.cs-fig { margin-top: 1.6rem; max-width: 34rem; }
.cs-fig .mini-browser, .cs-fig .mini-dash { transform: none; border-bottom: 1px solid var(--line); border-radius: var(--r-lg); }
.cs-fig .mini-flow { padding-bottom: 0; }
.cs-fig .mini-step .badge { margin-left: auto; }
.cs-fig .mini-step.is-later { border-style: dashed; }
.cs-fig .mini-step:nth-child(2) { margin-left: 12px; } .cs-fig .mini-step:nth-child(3) { margin-left: 24px; } .cs-fig .mini-step:nth-child(4) { margin-left: 36px; }
/* Phones: each illustration assembles when its step scrolls in. */
@media (prefers-reduced-motion: no-preference) {
  html.js .cs-step .mini-step, html.js .cs-step .mini-site > *, html.js .cs-step .mini-dash .main > * { opacity: 0; transform: translateY(10px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
  html.js .cs-step.is-in .mini-step, html.js .cs-step.is-in .mini-site > *, html.js .cs-step.is-in .mini-dash .main > * { opacity: 1; transform: none; }
  html.js .cs-step .mini-step:nth-child(2), html.js .cs-step .mini-site > :nth-child(2), html.js .cs-step .mini-dash .main > :nth-child(2) { transition-delay: 160ms; }
  html.js .cs-step .mini-step:nth-child(3), html.js .cs-step .mini-dash .main > :nth-child(3) { transition-delay: 320ms; }
  html.js .cs-step .mini-step:nth-child(4), html.js .cs-step .mini-dash .main > :nth-child(n+4) { transition-delay: 480ms; }
}
.cs-visual { display: none; }
@media (min-width: 1000px) {
  .cs-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
  .cs-step h3 { font-size: clamp(1.35rem, 2vw, 1.6rem); }
}

/* Enhanced desktop layout */
.cs.is-enhanced {
  --cs-h: clamp(470px, calc(100vh - var(--header-h) - 110px), 600px);
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); gap: clamp(2.5rem, 5vw, 5rem); align-items: start;
}
.cs.is-enhanced .cs-steps { grid-template-columns: 1fr; gap: 0; }
html.js .cs.is-enhanced .cs-step { transform: none; min-height: max(62vh, calc(var(--cs-h) * .9)); display: flex; flex-direction: column; justify-content: center; padding-block: 2rem; }
/* Steps that are not current recede through colour, not opacity, so their text keeps AA contrast. */
.cs.is-enhanced .cs-step h3, .cs.is-enhanced .cs-step > p, .cs.is-enhanced .cs-points li { transition: color 500ms var(--ease); }
.cs.is-enhanced .cs-step:not(.is-current) h3, .cs.is-enhanced .cs-step:not(.is-current) > p:not(.cs-kicker), .cs.is-enhanced .cs-step:not(.is-current) .cs-points li { color: var(--ink-3); }
.cs.is-enhanced .cs-points li::before { transition: border-color 500ms var(--ease); }
.cs.is-enhanced .cs-step:not(.is-current) .cs-points li::before { border-color: var(--line-2); }
.cs.is-enhanced .cs-step:first-child { min-height: var(--cs-h); }
.cs.is-enhanced .cs-step.is-current .num { background: var(--accent-strong); color: var(--accent-ink); }
.cs.is-enhanced .cs-step h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.cs.is-enhanced .cs-fig { display: none; }
.cs.is-enhanced .cs-visual { display: block; position: sticky; top: calc(var(--header-h) + (100vh - var(--header-h) - var(--cs-h)) / 2); }

.cs-canvas {
  position: relative; height: var(--cs-h); border-radius: 24px; border: 1px solid var(--line); overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  box-shadow: var(--shadow-lg);
}
.cs-rail { position: absolute; top: 18px; left: 24px; right: 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 12px; font-weight: 650; color: var(--ink-3); padding-bottom: 10px; z-index: 5; }
.cs-rail::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--line); }
.cs-rail span { display: inline-flex; align-items: center; gap: 6px; transition: color var(--dur-3); }
.cs-rail span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; transition: background var(--dur-3); }
.cs-rail span.is-on { color: var(--ink); }
.cs-rail span.is-on::before { background: var(--accent); border-color: var(--accent); }
.cs-rail-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-3)); transform-origin: left; transform: scaleX(0); z-index: 1; }
.cs-layer { position: absolute; inset: 70px 28px 28px; }

/* Layer 1: website */
.cs-site { right: 108px; bottom: 40px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-lg); transform-origin: 0% 50%; }
.cs-site-body { flex: 1; min-height: 0; display: flex; flex-direction: column; background: linear-gradient(170deg, #fbf8f1, #f3ecdc); color: #1d3a2c; border-radius: 0 0 var(--r-lg) var(--r-lg); overflow: hidden; }
.cs-site-nav { display: flex; align-items: center; gap: 12px; padding: 10px 16px; font-size: 11px; color: #5c6660; border-bottom: 1px solid #ebe3d2; }
.cs-site-nav b { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 14px; color: #1d3a2c; }
.cs-site-cta { padding: 3px 8px; border-radius: 5px; background: #e9c46a; color: #1d3a2c; font-weight: 700; }
.cs-site-hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; padding: 18px 16px 14px; align-items: start; }
.cs-site-kicker { margin: 0 0 4px; font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #8a6a1c; }
.cs-site-title { margin: 0 0 10px; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: clamp(17px, 1.7vw, 22px); font-weight: 700; line-height: 1.1; }
.cs-site-lines i { display: block; height: 6px; border-radius: 3px; background: #e2d9c6; margin-bottom: 6px; }
.cs-site-lines i + i { width: 70%; }
.cs-site-photo { height: 92px; margin-top: 12px; border-radius: 10px; background: radial-gradient(60% 80% at 75% 110%, #6f9a68, transparent 70%), radial-gradient(70% 90% at 15% 120%, #8db487, transparent 70%), linear-gradient(180deg, #e7efe0, #d3e2c9); position: relative; overflow: hidden; }
.cs-site-photo::after { content: ""; position: absolute; right: 18%; top: 18%; width: 22px; height: 22px; border-radius: 50%; background: #f2d58a; }
.cs-site-form { display: grid; gap: 6px; padding: 10px; border-radius: 10px; background: #fff; border: 1px solid #ebe3d2; box-shadow: 0 8px 20px rgba(29,58,44,.08); font-size: 10px; }
.cs-site-form b { font-size: 11px; }
.cs-site-form .f { padding: 5px 7px; border-radius: 5px; border: 1px solid #e2dacb; color: #6f685a; }
.cs-site-form .btn-f { padding: 6px; border-radius: 5px; background: #2c5541; color: #fbf8f1; text-align: center; font-weight: 700; }
.cs-site-cards { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 16px; }
.cs-site-cards span { display: grid; gap: 6px; padding: 7px; border-radius: 8px; background: #fff; border: 1px solid #ebe3d2; font-size: 10px; font-weight: 650; }
.cs-site-cards i { height: 34px; border-radius: 5px; background: linear-gradient(135deg, #cfe0c9, #9fbf98); }
.cs-site-cards span:nth-child(2) i { background: linear-gradient(135deg, #f1dfae, #d9b768); }
.cs-site-cards span:nth-child(3) i { background: linear-gradient(135deg, #d8e3d5, #7fa287); }
.cs-phone { position: absolute; right: -88px; bottom: -28px; width: 132px; height: 248px; display: flex; flex-direction: column; gap: 7px; padding: 26px 10px 10px; border-radius: 26px; border: 6px solid var(--bezel); background: #fbf8f1; color: #1d3a2c; box-shadow: var(--shadow-lg); font-size: 9px; }
.cs-phone-island { position: absolute; top: 6px; left: 50%; width: 40px; height: 10px; margin-left: -20px; border-radius: 6px; background: #1d2420; }
.cs-phone b { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 11px; }
.cs-phone-title { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 13px; font-weight: 700; line-height: 1.1; }
.cs-phone-btn { padding: 5px; border-radius: 5px; background: #e9c46a; text-align: center; font-weight: 700; }
.cs-phone-card { flex: 1; border-radius: 6px; background: #efe7d6; }
.cs-callout { position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 999px; background: var(--ink); color: var(--surface); font-size: 11.5px; font-weight: 650; white-space: nowrap; box-shadow: var(--shadow-md); }
.cs-callout::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-3) 30%, transparent); }
.cs-callout[data-callout="services"] { top: 76px; left: 42%; }
.cs-callout[data-callout="contact"] { top: 32%; right: -22px; }
.cs-callout[data-callout="design"] { bottom: 74px; left: -12px; }
.cs-callout[data-callout="mobile"] { bottom: -40px; right: -24px; }
.hl-target { transition: box-shadow var(--dur-3); }
.cs-canvas[data-stage="0"] .hl-target { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 8px; }
.cs-canvas[data-stage="0"] .cs-phone.hl-target { box-shadow: var(--shadow-lg), 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 26px; }

/* Layer 2: workflow graph. Node boxes and link paths share one 100×100 grid. */
.cs-links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* User-space widths: the 100×100 viewBox stretches to the canvas (about 5×4 px per unit). */
.cs-link { fill: none; stroke: var(--line-2); stroke-width: .38; }
.cs-link-lit { fill: none; stroke: var(--accent); stroke-width: .45; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.cs-link-flow { fill: none; stroke: var(--surface); stroke-width: .5; stroke-dasharray: .5 2.5; opacity: 0; transition: opacity var(--dur-3); }
.cs-link-lit.is-later { stroke: var(--info); }
@media (prefers-reduced-motion: no-preference) {
  .cs-canvas[data-stage="1"] .cs-link-flow { opacity: .9; animation: link-flow 900ms linear infinite; }
}
@keyframes link-flow { to { stroke-dashoffset: -3; } }
.cs-node { position: absolute; width: 28%; height: 19%; display: grid; grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-content: center; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md); font-size: 11px; color: var(--ink-3); }
.cs-node b { display: block; color: var(--ink); font-size: 12px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-node small { display: block; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-node > span:nth-child(2) { min-width: 0; }
.cs-node em { grid-column: 2; justify-self: start; margin-top: 5px; font-style: normal; font-size: 10px; }
.cs-node-icon { grid-row: 1 / span 2; align-self: center; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.cs-node-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cs-node.is-source { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cs-node.is-source .cs-node-icon { background: var(--accent-soft); color: var(--accent-text); }
.cs-node.is-later { border-style: dashed; border-color: color-mix(in srgb, var(--info) 45%, var(--line)); }
.cs-node.is-later .cs-node-icon { background: var(--info-soft); color: var(--info); }
.cs-node[data-node="source"] { left: 0; top: 40.5%; }
.cs-node[data-node="capture"] { left: 36%; top: 12%; }
.cs-node[data-node="route"] { left: 36%; top: 59%; }
.cs-node[data-node="task"] { left: 72%; top: 3%; }
.cs-node[data-node="notify"] { left: 72%; top: 40.5%; }
.cs-node[data-node="follow"] { left: 72%; top: 78%; }
.cs-flow { pointer-events: none; }

/* Layer 3: team dashboard */
.cs-app { position: absolute; inset: 0; display: grid; grid-template-columns: 52px minmax(0, 1fr); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.cs-app-side { display: grid; align-content: start; justify-items: center; gap: 12px; padding: 14px 0; background: var(--deep); }
.cs-app-side .ss-logo { width: 22px; height: 22px; margin-bottom: 6px; background: var(--accent); box-shadow: inset -5px -5px 0 color-mix(in srgb, var(--accent) 60%, #fff); }
.cs-app-side i { width: 22px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); }
.cs-app-side i.on { background: var(--accent-3); }
.cs-app-main { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; min-width: 0; }
.cs-app-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cs-app-head b { font-family: var(--font-display); font-size: 15px; letter-spacing: -.01em; }
.cs-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cs-kpis span { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.cs-kpis small { display: block; font-size: 10.5px; color: var(--ink-3); font-weight: 600; }
.cs-kpis b { font-family: var(--font-display); font-size: 22px; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cs-app-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; }
.cs-rows { list-style: none; display: grid; align-content: start; gap: 4px; }
.cs-rows li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 7px; border-radius: 8px; font-size: 11px; color: var(--ink-3); }
.cs-rows li.is-new { background: var(--accent-softer); box-shadow: inset 2px 0 0 var(--accent); }
.cs-rows .avatar { width: 26px; height: 26px; font-size: 9.5px; border-radius: 7px; }
.cs-rows b { display: block; color: var(--ink); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-rows small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-rows > li > span:nth-child(2) { min-width: 0; }
.cs-rows em { font-style: normal; font-size: 9.5px; }
.cs-activity { list-style: none; display: grid; align-content: start; gap: 9px; padding: 10px 10px 10px 18px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 10.5px; color: var(--ink-2); position: relative; }
.cs-activity::before { content: "Activity"; display: block; margin: 0 0 2px -8px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.cs-activity li { position: relative; }
.cs-activity li::before { content: ""; position: absolute; left: -11px; top: .45em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cs-activity time { display: block; font-size: 9.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* 8. Workflow motion refinements ------------------------------------------
   Progress meter, a spine that fills as steps finish, a pulse on the running
   step, a small "pop" when a step resolves, and an intake ring on the event. */
.wf-progress { display: flex; align-items: center; gap: .75rem; margin: -.2rem 0 .8rem; font-size: .75rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.wf-progress span { flex: none; min-width: 8.5em; }
.wf-progress i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.wf-progress b { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-3)); transform-origin: left; transform: scaleX(0); transition: transform 500ms var(--ease-out); }
.wf-steps::after { content: ""; position: absolute; left: 27px; top: 20px; width: 2px; height: calc((100% - 40px) * var(--spine, 0)); background: var(--accent); border-radius: 2px; transition: height 600ms var(--ease-out); }
@media (max-width: 560px) { .wf-steps::after { left: 24px; } }
@keyframes step-pop { 0% { transform: scale(.82); } 60% { transform: scale(1.08); } 100% { transform: none; } }
@keyframes step-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes intake { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); } 100% { box-shadow: 0 0 0 14px transparent; } }
@keyframes tick { 0% { opacity: .2; transform: translateY(-4px); } 100% { opacity: 1; transform: none; } }
@keyframes insp-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: no-preference) {
  .wf-step-item.is-running .wf-kind { animation: step-pulse 1.1s var(--ease) infinite; }
  .wf-step-item.is-shown .wf-kind { animation: step-pop 420ms var(--ease-out); }
  .wf-step-item.is-shown .st-pill { animation: tick 360ms var(--ease-out); }
  .wf-event.is-sending { animation: intake 900ms var(--ease-out); }
  .wf-clock b.is-tick { display: inline-block; animation: tick 320ms var(--ease-out); }
  .wf-detail { animation: insp-in 320ms var(--ease-out); }
}

/* 9. Dashboard motion refinements -----------------------------------------
   Only what changed moves: the updated task row, the KPI that changed and the
   view you switched to. Rows no longer re-animate on every update. */
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes row-flash { 0% { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); } }
@keyframes check-draw { from { stroke-dashoffset: 14; } to { stroke-dashoffset: 0; } }
@keyframes kpi-flash { 0% { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); } }
@keyframes drawer-out { to { transform: translateX(28px); opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .db-view.is-switch { animation: view-in 340ms var(--ease-out); }
  .db-task.is-updated { animation: row-flash 1.3s var(--ease); }
  .db-task.is-updated.s-done .db-check path { stroke-dasharray: 14; animation: check-draw 380ms var(--ease-out); }
  .db-kpi.is-changed { animation: kpi-flash 1.1s var(--ease); }
  .db-drawer.is-closing { animation: drawer-out 200ms var(--ease) forwards; }
  .db-kpi, .db-task, .db-lead, .db-nav button { transition: background var(--dur-2), border-color var(--dur-2), box-shadow var(--dur-2), transform var(--dur-2) var(--ease); }
  .db-kpi:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
}

/* 10. Sample website motion ---------------------------------------------- */
@keyframes fw-page-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: no-preference) {
  .fw-main.is-entering > * { animation: fw-page-in 480ms var(--ease-out) backwards; }
  .fw-main.is-entering > :nth-child(2) { animation-delay: 70ms; }
  .fw-main.is-entering > :nth-child(3) { animation-delay: 140ms; }
  .fw-main.is-entering > :nth-child(n+4) { animation-delay: 210ms; }
  .fw-card .fw-icon { transition: transform var(--dur-3) var(--ease-out); }
  .fw-card:hover .fw-icon { transform: translateY(-2px) rotate(-4deg) scale(1.06); }
  .fw-btn { transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-2); }
  .fw-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(29,58,44,.18); }
  .fw-btn:active { transform: translateY(0) scale(.98); }
}

/* 11. Service-page hero visuals ---------------------------------------------
   Small interactive previews beside the headline on the three service pages.
   page-visuals.js drives them; without it they show a sensible static state. */
.page-hero.has-visual .ph-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .92fr); gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; }
.page-hero.has-visual h1 { max-width: 14ch; }
@media (max-width: 1000px) { .page-hero.has-visual .ph-grid { grid-template-columns: 1fr; } .ph-visual { max-width: 620px; } }
.hv { position: relative; padding: 14px; border-radius: calc(var(--r-xl) + 4px); border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), var(--bg-2)); box-shadow: var(--shadow-lg); }
.hv-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.hv-note { margin: 12px 4px 0; min-height: 2.9em; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.hv-note b { color: var(--ink); }

/* Responsive preview */
.hv-stage { display: grid; place-items: start center; height: 330px; padding: 14px; border-radius: var(--r-lg); background: var(--bg-2); overflow: hidden; }
.hv-device { width: 100%; height: 100%; overflow: hidden; border-radius: 12px; border: 1px solid var(--line-2); background: #fbf8f1; box-shadow: var(--shadow-md); transition: width 700ms var(--ease-in-out), border-radius 500ms var(--ease), border-width 500ms var(--ease); }
.hv-device[data-size="tablet"] { width: 62%; border-radius: 18px; border: 7px solid var(--bezel); }
.hv-device[data-size="phone"] { width: 38%; border-radius: 26px; border: 7px solid var(--bezel); }
.hv-bar { display: flex; align-items: center; gap: 5px; padding: 7px 10px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 9.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.hv-bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; }
.hv-bar span { margin-left: 6px; padding: 2px 8px; border-radius: 5px; background: var(--bg-2); overflow: hidden; text-overflow: ellipsis; }
.hv-device:not([data-size="desktop"]) .hv-bar { display: none; }
.hv-page { color: #1d3a2c; font-size: 10px; }
.hv-nav { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #ebe3d2; }
.hv-nav b { display: inline-flex; align-items: center; gap: 5px; margin-right: auto; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 12px; }
.hv-nav .ss-logo { width: 12px; height: 12px; }
.hv-links { display: flex; gap: 10px; color: #5c6660; }
.hv-links i { font-style: normal; }
.hv-cta { padding: 3px 7px; border-radius: 4px; background: #e9c46a; font-weight: 700; white-space: nowrap; }
.hv-burger { display: none; width: 22px; height: 22px; border: 1px solid #e2dacb; border-radius: 5px; place-items: center; }
.hv-burger i, .hv-burger i::before, .hv-burger i::after { display: block; width: 10px; height: 1.5px; background: #1d3a2c; position: relative; content: ""; }
.hv-burger i::before { position: absolute; top: -3.5px; } .hv-burger i::after { position: absolute; top: 3.5px; }
.hv-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; padding: 14px 12px; align-items: center; }
.hv-kicker { margin: 0 0 3px; font-size: 7.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #8a6a1c; }
.hv-title { margin: 0 0 8px; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 17px; font-weight: 700; line-height: 1.1; }
.hv-copy .ln { display: block; height: 5px; border-radius: 3px; background: #e2d9c6; margin-bottom: 5px; }
.hv-copy .ln.s { width: 65%; }
.hv-btn { display: inline-block; margin-top: 6px; padding: 5px 9px; border-radius: 5px; background: #2c5541; color: #fbf8f1; font-weight: 700; }
.hv-img { aspect-ratio: 4 / 3; border-radius: 9px; background: radial-gradient(60% 80% at 75% 110%, #6f9a68, transparent 70%), radial-gradient(70% 90% at 15% 120%, #8db487, transparent 70%), linear-gradient(180deg, #e7efe0, #d3e2c9); }
.hv-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 12px 12px; }
.hv-cards span { display: grid; gap: 5px; padding: 6px; border-radius: 7px; background: #fff; border: 1px solid #ebe3d2; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-cards i { height: 26px; border-radius: 4px; background: linear-gradient(135deg, #cfe0c9, #9fbf98); }
.hv-cards span:nth-child(2) i { background: linear-gradient(135deg, #f1dfae, #d9b768); }
/* Layout follows data-layout, which page-visuals.js sets part-way through the
   width change so the page visibly reflows as the device narrows. */
.hv-device:not([data-layout="desktop"]) .hv-links { display: none; }
.hv-device:not([data-layout="desktop"]) .hv-hero { grid-template-columns: 1fr; }
.hv-device:not([data-layout="desktop"]) .hv-img { aspect-ratio: 16 / 9; order: -1; }
.hv-device[data-layout="tablet"] .hv-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hv-device[data-layout="phone"] .hv-cta { display: none; }
.hv-device[data-layout="phone"] .hv-burger { display: grid; }
.hv-device[data-layout="phone"] .hv-cards { grid-template-columns: 1fr; }
.hv-device[data-layout="phone"] .hv-title { font-size: 15px; }
@media (max-width: 520px) { .hv-device[data-layout="desktop"] .hv-page { font-size: 8.5px; } .hv-device[data-layout="desktop"] .hv-title { font-size: 13px; } .hv-device[data-layout="desktop"] .hv-cards span { font-size: 8px; } }

/* Automation pipeline */
.hv-trigger { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; }
.hv-pipe .pulse { background: var(--ok); }
.hv-pipe.is-running .pulse { animation: pulse 1.4s var(--ease) infinite; }
.hv-request { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs); font-size: 12px; }
.hv-request b { display: block; font-size: 13px; }
.hv-request small { color: var(--ink-3); }
.hv-request .sample-tag { margin-left: auto; }
.hv-pipe.is-running .hv-request { animation: intake 900ms var(--ease-out); }
.hv-steps { list-style: none; display: grid; gap: 8px; position: relative; }
.hv-steps::before { content: ""; position: absolute; left: 25px; top: 18px; bottom: 18px; width: 2px; background: var(--line); }
.hv-steps li { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 12px 9px 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-size: 12px; color: var(--ink-3); transition: background var(--dur-3), border-color var(--dur-3), opacity var(--dur-3); }
.hv-steps b { display: block; font-size: 13px; color: var(--ink); }
.hv-steps > li > span:nth-child(2) { min-width: 0; }
.hv-steps small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-ico { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-3); transition: background var(--dur-3), color var(--dur-3); }
.hv-ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hv-state { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--neutral-soft); color: var(--neutral); white-space: nowrap; }
.hv-state > span { display: none; }
.hv-steps li[data-s="wait"] [data-when="wait"], .hv-steps li[data-s="run"] [data-when="run"], .hv-steps li[data-s="done"] [data-when="done"] { display: inline; }
.hv-steps li[data-s="wait"] { opacity: .55; }
.hv-steps li[data-s="run"] { background: var(--accent-softer); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.hv-steps li[data-s="run"] .hv-ico { background: var(--accent-soft); color: var(--accent-text); }
.hv-steps li[data-s="run"] .hv-state { background: var(--accent-soft); color: var(--accent-text); }
.hv-steps li[data-s="done"] .hv-ico, .hv-steps li[data-s="done"] .hv-state { background: var(--ok-soft); color: var(--ok); }
.hv-steps li.is-later { border-style: dashed; }
.hv-steps li.is-later[data-s="done"] .hv-ico, .hv-steps li.is-later[data-s="done"] .hv-state { background: var(--info-soft); color: var(--info); }
@media (prefers-reduced-motion: no-preference) {
  .hv-steps li[data-s="run"] .hv-ico { animation: step-pulse 1.1s var(--ease) infinite; }
  .hv-steps li[data-s="done"] .hv-ico { animation: step-pop 420ms var(--ease-out); }
}

/* Role preview */
.hv-app { display: grid; grid-template-columns: 44px minmax(0, 1fr); min-height: 300px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-md); }
.hv-side { display: grid; align-content: start; justify-items: center; gap: 11px; padding: 12px 0; background: var(--deep); }
.hv-side .ss-logo { width: 18px; height: 18px; margin-bottom: 4px; background: var(--accent); box-shadow: inset -4px -4px 0 color-mix(in srgb, var(--accent) 60%, #fff); }
.hv-side i { width: 18px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.18); }
.hv-side i.on { background: var(--accent-3); }
.hv-panels { display: grid; padding: 14px 16px; }
.hv-panel { grid-area: 1 / 1; display: grid; align-content: start; gap: 12px; }
.hv-panel[hidden] { display: none; }
.hv-greet { margin: 0; display: grid; }
.hv-greet b { font-family: var(--font-display); font-size: 16px; letter-spacing: -.01em; }
.hv-greet small { font-size: 11.5px; color: var(--ink-3); }
.hv-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hv-kpis span { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); }
.hv-kpis small { display: block; font-size: 10.5px; color: var(--ink-3); font-weight: 600; }
.hv-kpis b { font-family: var(--font-display); font-size: 20px; }
.hv-bars { list-style: none; display: grid; gap: 9px; font-size: 12px; }
.hv-bars li { display: grid; grid-template-columns: 56px minmax(0, 1fr) 16px; align-items: center; gap: 10px; color: var(--ink-2); }
.hv-bars i { height: 8px; border-radius: 6px; background: var(--bg-2); overflow: hidden; }
.hv-bars i b { display: block; height: 100%; border-radius: 6px; background: var(--accent); transform-origin: left; }
.hv-bars .w-40 { width: 40%; } .hv-bars .w-60 { width: 60%; } .hv-bars .w-80 { width: 80%; }
.hv-bars em { font-style: normal; font-weight: 700; color: var(--ink); text-align: right; }
.hv-tasks { list-style: none; display: grid; gap: 7px; }
.hv-tasks li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); font-size: 11.5px; color: var(--ink-3); }
.hv-tasks b { display: block; font-size: 12.5px; color: var(--ink); }
.hv-tasks em { font-style: normal; font-size: 10px; }
.hv-tasks li.is-done b { text-decoration: line-through; color: var(--ink-3); }
.hv-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-2); display: grid; place-items: center; }
.hv-tasks li.is-done .hv-check { background: var(--accent-strong); border-color: var(--accent-strong); }
.hv-tasks li.is-done .hv-check::after { content: ""; width: 8px; height: 4px; margin-top: -2px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.hv-private { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--info-soft); color: var(--ink-2); font-size: 11.5px; }
@keyframes hv-panel-in { from { opacity: 0; transform: translateX(14px); } }
@keyframes bar-grow { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: no-preference) {
  .hv-panel.is-entering > * { animation: hv-panel-in 420ms var(--ease-out) backwards; }
  .hv-panel.is-entering > :nth-child(2) { animation-delay: 70ms; }
  .hv-panel.is-entering > :nth-child(3) { animation-delay: 140ms; }
  .hv-panel.is-entering .hv-bars b { animation: bar-grow 800ms var(--ease-out) 200ms backwards; }
}
@media (max-width: 520px) {
  .hv { padding: 10px; }
  .hv-stage { height: 280px; padding: 10px; }
  .hv-device[data-size="tablet"] { width: 78%; }
  .hv-device[data-size="phone"] { width: 54%; }
  .hv .seg button { padding-inline: .55rem; }
  .hv-top .sample-tag { display: none; }
}

/* Service-page hero entrance */
.page-hero .ph-copy > * { animation: rise var(--dur-4) var(--ease-out) backwards; }
.page-hero .ph-copy > :nth-child(2) { animation-delay: 70ms; }
.page-hero .ph-copy > :nth-child(3) { animation-delay: 140ms; }
.page-hero .ph-copy > :nth-child(4) { animation-delay: 210ms; }
.page-hero .ph-copy > :nth-child(5) { animation-delay: 280ms; }
.page-hero .ph-grid > .ph-visual { animation: frame-in 900ms var(--ease-out) 220ms backwards; }
.page-hero.has-visual .ph-grid > .ph-copy { animation: none; }

/* Connected-systems story on tablets: text and illustration side by side. */
@media (min-width: 700px) and (max-width: 999px) {
  .cs-step { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); column-gap: 2.5rem; align-items: start; }
  .cs-step > :not(.cs-fig) { grid-column: 1; }
  .cs-step > .cs-fig { grid-column: 2; grid-row: 1 / span 6; align-self: center; margin-top: 0; }
}

/* 12. Time & Earnings (dashboard demo) ---------------------------------------
   Hours by day, approval status and a clearly labelled gross-pay estimate. */
.tt-private { display: flex; gap: .6rem; align-items: flex-start; margin: 0; padding: .7rem .9rem; border-radius: var(--r); background: var(--accent-softer); border: 1px solid var(--accent-soft); font-size: .8125rem; color: var(--ink-2); }
.tt-private svg, .tt-state svg { width: 16px; height: 16px; flex: none; margin-top: 1px; fill: none; stroke: var(--accent-text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tt-days { list-style: none; display: grid; gap: .4rem; margin: 0 0 1rem; }
.tt-days li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) 3.6rem; gap: .75rem; align-items: center; font-size: .8438rem; color: var(--ink-2); }
.tt-days.is-editable li { grid-template-columns: 2.6rem minmax(0, 1fr) 3.6rem auto; }
.tt-days b { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.tt-day { font-weight: 650; color: var(--ink-3); }
.tt-days .db-bar i { transition: width 500ms var(--ease-out); }
.tt-step { display: inline-flex; gap: .3rem; }
.tt-step .db-icon-btn { width: 32px; height: 32px; font-size: 1.05rem; font-weight: 700; line-height: 1; }
.tt-step .db-icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.tt-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 0; padding: .85rem 1rem; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.tt-sum dt { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.tt-sum dd { margin: .15rem 0 0; font-size: .875rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.tt-sum div:last-child dd { font-family: var(--font-display); font-size: 1.1rem; color: var(--accent-text); }
.tt-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.tt-hint { font-size: .78rem; color: var(--ink-3); }
.tt-state { display: flex; gap: .5rem; align-items: center; margin: 1rem 0 0; font-size: .8438rem; color: var(--ink-2); }
.tt-note { margin: 0; font-size: .78rem; line-height: 1.5; color: var(--ink-3); }
.tt-note b { color: var(--ink-2); }
.tt-mini { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; font-size: .875rem; color: var(--ink-2); }
.tt-mini b { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.tt-table tr.is-focus td { background: var(--accent-softer); }
.tt-table .db-link[aria-pressed="true"] { color: var(--ink); text-decoration: underline; }
.tt-sheet h4:focus { outline: none; }
.tt-sheet h4:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .tt-sheet.is-updated { animation: row-flash 1.3s var(--ease); }
}
@container db (max-width: 520px) {
  .tt-sum { grid-template-columns: 1fr; }
  .tt-table tr.is-focus { background: var(--accent-softer); }
  .tt-table tr.is-focus td { background: none; }
  .tt-days.is-editable li { grid-template-columns: 2.4rem minmax(0, 1fr) 3.2rem auto; gap: .5rem; }
}
