/* The story (on the landing and on /story). The stage carries data attributes set by story.js —
   one per fact that is true in the current step — and every rule below that
   starts with [data-…] draws that fact. Colours are the landing's. */
.story{padding-top:34px;padding-bottom:90px}
.story-show{--green:#6f9a35;--shade:#e6ebdc;--track:var(--line);--hover:var(--soft)}
.story .eyebrow{margin-bottom:20px}

.story-stage{display:grid;grid-template-columns:1fr 1fr;gap:22px}
.story-panel{display:flex;flex-direction:column;padding:18px 22px 22px;background:#fff;border:1px solid #bfc5b5;border-radius:8px;box-shadow:8px 10px 0 var(--shade)}
.story-label{display:block;font:500 10px/1.5 var(--mono);letter-spacing:1.2px;color:var(--muted)}

/* the narration: lime bubbles under the chat, one at a time. They are the
   narrator's voice, so they look like nothing else on the stage; the tail
   points up at the chat or sideways at the app. */
.story-says{display:grid;align-items:center;min-height:104px;margin-top:14px}
.story-says p{grid-area:1/1;position:relative;justify-self:start;max-width:92%;margin:0;padding:12px 18px 13px;background:var(--lime);border:1.5px solid var(--ink);border-radius:18px;box-shadow:4px 5px 0 var(--ink);font:600 18px/1.3 'Space Grotesk',sans-serif;letter-spacing:-.3px;opacity:0;transform:scale(.9) rotate(-1deg);transform-origin:20% 0;transition:opacity .25s,transform .35s cubic-bezier(.3,1.5,.5,1)}
.story-says p.is-on{opacity:1;transform:rotate(-1deg);transition-delay:.2s}
.story-says p::after{content:'';position:absolute;width:14px;height:14px;background:var(--lime);border:solid var(--ink);transform:rotate(45deg)}
.story-says .story-tail-up::after{top:-8.5px;left:34px;border-width:1.5px 0 0 1.5px}
.story-says .story-tail-side{justify-self:end;margin-right:6px;transform-origin:100% 50%}
.story-says .story-tail-side::after{top:50%;right:-8.5px;margin-top:-7px;border-width:1.5px 1.5px 0 0}
.story-says mark{background:var(--ink);color:var(--lime);white-space:nowrap;padding:0 6px 2px;border-radius:3px;-webkit-box-decoration-break:clone;box-decoration-break:clone}

/* the chat: each message waits for its fact, and says who is speaking */
.story-thread{display:flex;flex-direction:column;gap:10px;flex:1;min-height:318px;margin-top:12px}
.story-msg{display:none;max-width:90%;animation:story-in .35s both}
.story-msg p{margin:0;padding:10px 14px;border-radius:12px;font-size:15px;line-height:1.4}
.story-who{display:block;margin:0 4px 3px;font:500 10px/1.5 var(--mono);letter-spacing:1.2px;color:var(--muted)}
.story-msg-you{align-self:flex-end;text-align:right}
.story-msg-you p{background:var(--ink);color:var(--paper);border-bottom-right-radius:3px;font-weight:500;text-align:left}
.story-msg-ai{align-self:flex-start}
.story-msg-ai p{background:var(--soft);border-bottom-left-radius:3px}
.story-working p{padding:14px}
.story-working i{display:inline-block;width:6px;height:6px;margin-right:4px;border-radius:50%;background:#6c7560;animation:story-dot 1s infinite}
.story-working i:nth-child(2){animation-delay:.15s}
.story-working i:nth-child(3){animation-delay:.3s;margin-right:0}
@keyframes story-in{from{opacity:0;transform:translateY(8px)}}
@keyframes story-dot{0%,60%,100%{opacity:.3}30%{opacity:1}}

/* UnitBob's message to the AI: a message like the others, carrying the facts */
.story-msg-bob{align-self:flex-end;text-align:right}
.story-msg-bob p{background:#fff;border:1.5px solid var(--ink);border-bottom-right-radius:3px;font-weight:500;text-align:left}
.story-msg-bob code{display:block;margin-top:7px;padding:6px 9px;border-radius:6px;background:var(--ink);color:var(--lime);font:500 12px/1.45 var(--mono)}

[data-ask] .story-msg-you{display:block}
[data-ask]:not([data-done]) .story-working:not(.story-working-fix){display:block;animation-delay:.8s}
[data-done] .story-done{display:block;animation-delay:var(--done-wait,0s)}
[data-tapped] .story-msg-bob{display:block;animation-delay:.5s}
[data-tapped]:not([data-fixed]) .story-working-fix{display:block;animation-delay:1.5s}
[data-fixed] .story-msg-bob{animation-delay:0s}
[data-fixed] .story-fixed{display:block}

/* the app: its parts, and a lamp on each once the sensors are on */
.story-parts{display:grid;gap:8px;margin-top:12px}
.story-part{position:relative;display:grid;gap:1px;padding:9px 46px 10px 16px;border:1px solid var(--line);border-radius:7px;transition:border-color .4s,background .4s}
.story-part b{font:600 16px/1.3 'Space Grotesk',sans-serif;letter-spacing:-.3px}
.story-part span{font-size:13px;line-height:1.4;color:var(--muted);opacity:0;transition:opacity .4s}
.story-lamp{position:absolute;top:50%;right:17px;width:12px;height:12px;margin-top:-6px;border-radius:50%;background:none;border:1.5px dashed #a4b390;transition:background .35s,border-color .35s,transform .45s cubic-bezier(.3,1.6,.5,1)}
[data-lamps] .story-lamp{background:var(--green);border:1.5px solid var(--green);transform:scale(1.15)}
[data-lamps] .story-part span{opacity:1}
[data-lamps]:not([data-ask]) .story-part:nth-child(1) :is(.story-lamp,span){transition-delay:.4s}
[data-lamps]:not([data-ask]) .story-part:nth-child(2) :is(.story-lamp,span){transition-delay:.65s}
[data-lamps]:not([data-ask]) .story-part:nth-child(3) :is(.story-lamp,span){transition-delay:.9s}
[data-lamps]:not([data-ask]) .story-part:nth-child(4) :is(.story-lamp,span){transition-delay:1.15s}
[data-red] .story-part-receipts{border-color:var(--orange);background:#fff9f5;transition-delay:var(--red-wait)}
[data-red] .story-part-receipts .story-lamp{background:var(--orange);border-color:var(--orange);transition-delay:var(--red-wait);animation:story-ring 1.3s var(--red-wait) infinite}
@keyframes story-ring{from{box-shadow:0 0 0 0 rgba(212,77,43,.55)}to{box-shadow:0 0 0 11px rgba(212,77,43,0)}}

/* one slot under the parts: the customer's mail, the alarm, or the all-clear */
.story-slot{display:grid;margin-top:10px;min-height:70px}
.story-note{grid-area:1/1;align-self:start;margin:0;padding:10px 14px 12px;border:1px solid var(--ink);border-radius:7px;font-weight:600;font-size:15px;line-height:1.4;opacity:0;transform:translateY(8px);transition:opacity .35s,transform .35s;pointer-events:none}
.story-note .story-label{margin-bottom:3px}
.story-note-mail{background:var(--ink);color:var(--paper)}
.story-note-mail .story-label{color:#c4cdb8}
.story-note-alert{border-color:var(--orange);background:#fff9f5}
.story-note-alert .story-label{color:#b0401f}
.story-note-fixed{border-color:var(--green);background:#f6fbef}
[data-mail] .story-note-mail,[data-fixed] .story-note-fixed{opacity:1;transform:none}
[data-red] .story-note-alert{opacity:1;transform:none;transition-delay:var(--note-wait)}

/* the button, and the pointer that comes and presses it */
.story-tap{position:relative;display:inline-block;margin-left:8px;padding:4px 13px;border:1px solid var(--ink);border-radius:5px;background:var(--lime);font-size:13px;transition:transform .12s,background .12s,color .12s}
.story-cursor{position:absolute;left:55%;top:45%;width:26px;height:26px;fill:var(--ink);stroke:#fff;stroke-width:1.6;stroke-linejoin:round;opacity:0;transform:translate(70px,46px);transition:opacity .25s,transform .9s cubic-bezier(.3,.1,.2,1);filter:drop-shadow(0 2px 2px rgba(0,0,0,.25))}
[data-aim] .story-cursor{opacity:1;transform:none}
[data-tapped] .story-cursor{transform:scale(.86);transition-duration:.12s}
[data-tapped] .story-tap{background:var(--ink);color:var(--paper);animation:story-press .5s}
@keyframes story-press{0%{transform:scale(1);box-shadow:0 0 0 0 rgba(25,29,24,.5)}30%{transform:scale(.9)}100%{transform:scale(1);box-shadow:0 0 0 16px rgba(25,29,24,0)}}

/* the second telling: the chat answers, then the lamp turns, then the alarm */
[data-lamps]{--done-wait:1s;--red-wait:1.9s;--note-wait:2.5s}
[data-aim]{--done-wait:0s;--red-wait:0s;--note-wait:0s}

/* play, and where you are */
.story-controls{display:flex;align-items:center;gap:8px;margin-top:30px}
.story-play{min-width:86px;padding:9px 14px;background:none;border:1px solid var(--ink);border-radius:5px;font-weight:600;font-size:14px}
.story-skip{width:40px;padding:9px 0;background:none;border:1px solid var(--ink);border-radius:5px;font-weight:600;font-size:14px}
.story-skip:disabled{opacity:.3}
:is(.story-play,.story-skip):hover:enabled{background:var(--hover)}
.story-steps{display:flex;gap:6px;flex:1;max-width:460px;margin-left:10px}
.story-steps button{flex:1;height:22px;padding:0;border:0;background:none;position:relative}
.story-steps button::after{content:'';position:absolute;left:0;right:0;top:9px;height:4px;border-radius:2px;background:var(--track);transition:background .3s}
.story-steps button.is-done::after{background:#a4b390}
.story-steps button.is-on::after{background:var(--ink)}
.story-actions{margin-top:38px}

.story-transcript{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

@media(max-width:820px){
  .story{padding-top:12px;padding-bottom:60px}
  .story .eyebrow{margin-bottom:10px}
  .story-stage{grid-template-columns:1fr;gap:12px}
  .story-panel{padding:11px 14px 14px;box-shadow:5px 6px 0 var(--shade)}
  .story-says{min-height:84px;margin-top:8px}
  .story-says p{font-size:15px;padding:9px 13px 10px;border-radius:14px;box-shadow:3px 4px 0 var(--ink)}
  .story-says .story-tail-side{justify-self:center;margin-right:0;transform-origin:50% 100%}
  .story-says .story-tail-side::after{top:auto;right:auto;bottom:-8.5px;left:50%;margin:0 0 0 -7px;border-width:0 1.5px 1.5px 0}
  .story-thread{min-height:244px;gap:6px;margin-top:8px}
  .story-parts{margin-top:8px}
  .story-msg p{padding:7px 11px;font-size:13px}
  .story-who{font-size:9px;margin-bottom:1px}
  .story-working p{padding:10px 11px}
  .story-msg-bob code{font-size:10.5px;padding:4px 7px;margin-top:5px}
  .story-parts{grid-template-columns:1fr 1fr;gap:6px}
  .story-part{padding:6px 28px 7px 10px}
  .story-part b{font-size:14px}
  .story-part span{font-size:11px;line-height:1.3}
  .story-lamp{right:10px;width:10px;height:10px;margin-top:-5px}
  .story-slot{min-height:62px;margin-top:8px}
  .story-note{padding:7px 10px 9px;font-size:13px}
  .story-tap{margin-left:6px;padding:2px 11px;font-size:12px}
  .story-controls{margin-top:20px}
}
@media(max-width:520px){
  .story-actions{flex-direction:column;align-items:flex-start;gap:18px}
}
@media(prefers-reduced-motion:reduce){
  .story-says p,.story-note,.story-lamp,.story-part,.story-part span,.story-cursor{transition-duration:.01s!important}
  .story-msg{animation-duration:.01s}
  .story-working i,[data-red] .story-part-receipts .story-lamp,[data-tapped] .story-tap{animation:none}
}

/* A wide but low window (a laptop with its browser bars): the stage gives up
   its air so the whole of it fits under the headline. The narration no longer
   keeps room for its tallest bubble — the two tall ones come while the chat
   above is nearly empty, and grow up into it. */
@media(min-width:821px) and (max-height:834px){
  .story-panel{padding-bottom:18px}
  .story-says{grid-template-rows:62px;align-items:end;min-height:0}
  .story-parts{gap:6px}
  .story-part{padding-top:5px;padding-bottom:6px}
  .story-slot{margin-top:8px}
}
@media(min-width:821px) and (max-height:750px){
  .story-panel{padding:14px 20px 16px}
  .story-thread{min-height:284px;gap:7px}
  .story-msg p{padding:8px 12px;font-size:14px}
  .story-working p{padding:11px 12px}
  .story-says{grid-template-rows:54px;margin-top:10px}
  .story-says p{font-size:16px;padding:10px 15px 11px}
  .story-part b{font-size:15px}
  .story-part span{font-size:12px}
  .story-note{padding:8px 12px 10px;font-size:14px}
  .story-slot{min-height:62px}
}

/* The cursor waits 70px to the right of its button before it glides in. On a
   phone the button sits near the screen's edge, so the waiting cursor stood
   past it and the whole page scrolled sideways (Reddit, 2026-12-01: 413px of
   page on a 390px screen). The page clips it at <main>: not at <body>, whose
   overflow passes to the window and leaves the page as wide; clip, unlike
   hidden, makes <main> no scroll box of its own. */
main{overflow-x:clip}
