/* Raaya landing story (/, /de/): before/after hero, Raaya's diary, what she
   does, lifeline. Shares tokens with landing.css. Copy lives in the HTML;
   story.js only toggles classes. */

/* ---------- Hero: many helpers → one diary ---------- */
.s-hero { position: relative; padding: 56px 0 40px; background: var(--glow); overflow: hidden; }
.s-hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .s-hero-grid { grid-template-columns: 1.02fr 1fr; gap: 56px; } }
@media (max-width: 600px) { .s-hero { padding-top: 28px; } }
.s-hero h1 { margin-bottom: .35em; }
.s-hero .lede { font-size: 1.14rem; color: var(--muted); max-width: 34em; }
.s-hero .lede b { color: var(--text); font-weight: 600; }

.juggle { margin: 0; position: relative; }
.jg-stage {
  position: relative; width: 100%; max-width: 500px; margin: 0 auto; aspect-ratio: 1 / 1;
  border-radius: 28px; background: var(--card); border: 1px solid var(--outline); box-shadow: var(--shadow);
  overflow: hidden; isolation: isolate;
}
@media (max-width: 560px) { .jg-stage { aspect-ratio: 5 / 6; } .jg-diary { width: 88%; } }
.jg-stage::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--pink) 10%, transparent) 0, transparent 60%);
  transition: opacity .8s var(--ease);
}
.jg-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.jg-lines path {
  fill: none; stroke: color-mix(in srgb, var(--muted) 55%, transparent); stroke-width: 1.6;
  stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 5 6;
  animation: jg-flow 1.6s linear infinite; transition: opacity .6s var(--ease);
}
.jg-lines path.x { stroke: color-mix(in srgb, var(--amber) 55%, transparent); animation-duration: 2.3s; }
@keyframes jg-flow { to { stroke-dashoffset: -22; } }

.jg-you, .jg-h, .jg-diary { position: absolute; transform: translate(-50%, -50%); }
.jg-you {
  left: 50%; top: 50%; z-index: 2; width: 74px; height: 74px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: var(--high); border: 1px solid var(--outline); font: 600 13px/1.2 var(--sans);
  animation: jg-wobble 2.6s ease-in-out infinite; transition: opacity .5s var(--ease), transform .6s var(--ease);
}
.jg-you small { display: block; font-weight: 500; font-size: 10.5px; color: var(--amber); margin-top: 2px; }
@keyframes jg-wobble { 0%, 100% { transform: translate(-50%, -50%) rotate(0); } 25% { transform: translate(-50%, -50%) rotate(-3deg); } 75% { transform: translate(-50%, -50%) rotate(3deg); } }

.jg-h {
  left: var(--x); top: var(--y); z-index: 3; width: 30%; max-width: 132px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 8px 6px; border-radius: 14px; background: var(--raised); border: 1px solid var(--outline);
  font: 600 11.5px/1.25 var(--sans); color: var(--text);
  transition: left .9s var(--ease), top .9s var(--ease), opacity .7s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0s);
  animation: jg-bob 3.4s ease-in-out infinite; animation-delay: var(--d, 0s);
}
.jg-h svg { width: 20px; height: 20px; color: var(--c, var(--purple)); }
.jg-h .badge {
  position: absolute; top: -7px; right: -4px; min-width: 18px; padding: 0 5px; border-radius: 999px;
  background: #E11D48; color: #fff; font: 700 10px/18px var(--sans);
}
@keyframes jg-bob { 0%, 100% { margin-top: 0; } 50% { margin-top: -4px; } }

.jg-diary {
  left: 50%; top: 50%; z-index: 4; width: 78%; max-width: 360px;
  opacity: 0; transform: translate(-50%, -50%) scale(.6); pointer-events: none;
  transition: opacity .7s var(--ease) .55s, transform .8s var(--ease) .55s;
  background: var(--raised); border: 1px solid color-mix(in srgb, var(--purple) 45%, var(--outline));
  border-radius: 22px; padding: 16px 16px 12px; box-shadow: 0 24px 60px -24px rgba(139, 92, 246, .55);
}
.jg-diary-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.jg-diary-head img { border-radius: 9px; }
.jg-diary-head b { font: 500 1.08rem/1.2 var(--serif); }
.jg-diary-head span { display: block; font-size: 11.5px; color: var(--faint); }
.jg-diary ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.jg-diary li {
  display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.35;
  padding: 7px 9px; border-radius: 11px; background: var(--high);
  opacity: 0; transform: translateY(6px); transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.jg-diary li i { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--c, var(--purple)); }
.jg-diary li em { font-style: normal; color: var(--muted); display: block; font-size: 11.5px; }

/* After: helpers fold into the diary. */
.juggle.after .jg-h { left: 50%; top: 50%; opacity: 0; transform: translate(-50%, -50%) scale(.35); animation: none; }
.juggle.after .jg-lines path { opacity: 0; }
.juggle.after .jg-you { opacity: 0; transform: translate(-50%, -50%) scale(.4); animation: none; }
.juggle.after .jg-stage::before { opacity: 0; }
.juggle.after .jg-stage { background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--purple) 16%, var(--card)) 0, var(--card) 70%); }
.juggle.after .jg-diary { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.juggle.after .jg-diary li { opacity: 1; transform: none; }
.juggle.after .jg-diary li:nth-child(1) { transition-delay: 1.05s; }
.juggle.after .jg-diary li:nth-child(2) { transition-delay: 1.3s; }
.juggle.after .jg-diary li:nth-child(3) { transition-delay: 1.55s; }
.juggle.after .jg-diary li:nth-child(4) { transition-delay: 1.8s; }

.jg-bar { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.jg-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--outline); }
.jg-seg button {
  font: 600 13px/1 var(--sans); color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 9px 16px; border-radius: 999px; min-height: 36px;
}
.jg-seg button[aria-pressed="true"] { background: var(--brand-btn); color: #fff; }
.jg-cap { text-align: center; color: var(--muted); font-size: .95rem; margin: 10px auto 0; max-width: 30em; min-height: 3em; }
.jg-cap b { color: var(--text); }
html:not(.sjs) .jg-bar { display: none; }

/* ---------- Analogy band: like a real assistant ---------- */
.s-diary { padding: 72px 0; }
.helpers-row { list-style: none; padding: 0; margin: 0 0 32px; display: flex; flex-wrap: wrap; gap: 8px; }
.helpers-row li {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--outline); font-size: 13.5px; color: var(--muted);
}
.helpers-row li b { color: var(--text); font-weight: 600; }
.helpers-row li.arrow { border: 0; background: none; color: var(--purple); font-weight: 600; padding-inline: 2px; }
.helpers-row li.one { border-color: color-mix(in srgb, var(--purple) 55%, var(--outline)); color: var(--text); font-weight: 600; }

.duties { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
@media (min-width: 640px) { .duties { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .duties { grid-template-columns: repeat(3, 1fr); } }
.duties li { background: var(--card); border: 1px solid var(--outline); border-radius: 18px; padding: 18px 18px 16px; }
.duties h3 { font-size: 1.08rem; margin-bottom: .3em; display: flex; align-items: center; gap: 10px; }
.duties h3 svg { width: 22px; height: 22px; flex: none; color: var(--purple); }
.duties p { margin: 0; color: var(--muted); font-size: .96rem; }
.duties .like { display: block; font-size: 12px; letter-spacing: .04em; color: var(--faint); margin-bottom: 6px; text-transform: uppercase; font-weight: 600; }

/* ---------- Diary entries: what Raaya does ---------- */
.s-does { padding: 80px 0; }
.entries { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
@media (min-width: 860px) { .entries { grid-template-columns: 1fr 1fr; } .entries .wide { grid-column: 1 / -1; } }
.entry {
  position: relative; background: var(--card); border: 1px solid var(--outline); border-radius: 22px;
  padding: 20px; box-shadow: var(--shadow); min-width: 0;
}
.entry-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.entry h3 { margin: 0; font-size: 1.22rem; }
.instead {
  display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px/1.4 var(--sans); color: var(--muted);
  padding: 3px 10px; border-radius: 999px; border: 1px dashed var(--outline);
}
.instead s { text-decoration-color: color-mix(in srgb, var(--pink) 75%, transparent); text-decoration-thickness: 1.5px; color: var(--text); }
.entry .says { display: grid; gap: 8px; margin: 0 0 12px; }
.bub { margin: 0; padding: 10px 13px; border-radius: 16px; font-size: .96rem; line-height: 1.45; max-width: 92%; }
.bub.you { justify-self: end; background: var(--brand-btn); color: #fff; border-bottom-right-radius: 5px; }
.bub.you .ph { display: inline-flex; align-items: center; gap: 6px; }
.bub.you svg { width: 16px; height: 16px; }
.bub.raaya { justify-self: start; background: var(--high); border-bottom-left-radius: 5px; }
.bub.raaya b { display: block; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--purple); margin-bottom: 2px; }
.dots { display: none; gap: 4px; padding: 4px 0; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.dfiled { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dfiled li {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 10px;
  font-size: 12.5px; background: var(--surface); border: 1px solid var(--outline); color: var(--text);
}
.dfiled li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--purple)); flex: none; }
.dfiled .link { color: var(--muted); }
.dfiled .link::before { width: 12px; height: 2px; border-radius: 1px; background: var(--muted); }
.entry .note { margin: 12px 0 0; font-size: .9rem; color: var(--faint); }

/* Reveal: Raaya "writes" her line once the card scrolls in (story.js adds .done). */
.sjs .entry:not(.done) .bub.raaya .txt { display: none; }
.sjs .entry:not(.done) .dots { display: inline-flex; }
.sjs .entry:not(.done) .dfiled, .sjs .entry:not(.done) .reveal { opacity: 0; transform: translateY(6px); }
.sjs .entry .dfiled, .sjs .entry .reveal { transition: opacity .5s var(--ease) .15s, transform .5s var(--ease) .15s; }
.sjs .entry.done .bub.raaya .txt { animation: fade-up .45s var(--ease) both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Plan entry */
.plan-tabs { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--outline); margin-bottom: 12px; }
.plan-tabs button { font: 600 13px/1 var(--sans); color: var(--muted); background: none; border: 0; cursor: pointer; padding: 9px 14px; border-radius: 999px; min-height: 36px; }
.plan-tabs button[aria-selected="true"] { background: var(--high); color: var(--text); box-shadow: inset 0 0 0 1px var(--outline); }
.plan-grid { display: grid; gap: 14px; }
@media (min-width: 860px) { .plan-grid { grid-template-columns: .9fr 1.1fr; align-items: start; } }
.psteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: ps; }
.psteps li {
  counter-increment: ps; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start;
  padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--outline); font-size: .95rem;
}
.psteps li::before {
  content: counter(ps); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font: 600 12px/1 var(--sans); background: var(--high); color: var(--purple);
}
.psteps .docs { grid-column: 2; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.psteps .docs span { font-size: 11.5px; padding: 2px 8px; border-radius: 8px; border: 1px solid var(--outline); color: var(--muted); }
.psteps .docs span::before { content: '📎 '; }
.facts { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--high); font-size: .92rem; }
.facts b { display: block; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--purple); margin-bottom: 4px; }
.facts ul { margin: 0; padding-left: 18px; color: var(--muted); }
.sjs .plan-grid .psteps li { animation: step-in .45s var(--ease) both; }
.sjs .plan-grid .psteps li:nth-child(2) { animation-delay: .08s; } .sjs .plan-grid .psteps li:nth-child(3) { animation-delay: .16s; }
.sjs .plan-grid .psteps li:nth-child(4) { animation-delay: .24s; } .sjs .plan-grid .psteps li:nth-child(5) { animation-delay: .32s; }
.sjs .plan-grid .psteps li:nth-child(6) { animation-delay: .4s; }
@keyframes step-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* Online tasks entry: a small browser */
.mini-browser { border-radius: 14px; border: 1px solid var(--outline); background: var(--surface); overflow: hidden; }
.mb-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--outline); font-size: 11.5px; color: var(--faint); }
.mb-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--outline); }
.mb-bar span { margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: var(--high); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-body { padding: 12px; display: grid; gap: 8px; }
.mb-field { display: grid; gap: 3px; font-size: 11.5px; color: var(--faint); }
.mb-field span {
  display: block; min-height: 30px; padding: 6px 10px; border-radius: 9px; background: var(--card);
  border: 1px solid var(--outline); color: var(--text); font-size: 13px; position: relative; overflow: hidden; white-space: nowrap;
}
.mb-field em { font-style: normal; display: inline-block; }
.mb-field span::after {
  content: '✦'; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--purple); font-size: 11px;
}
.mb-submit { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.mb-submit .btn { pointer-events: none; padding: 8px 14px; font-size: 13px; min-height: 0; }
.mb-submit .stop { display: inline-flex; align-items: center; gap: 6px; color: var(--amber); font-weight: 600; }
.sjs .entry:not(.done) .mb-field em { clip-path: inset(0 100% 0 0); }
.sjs .entry.done .mb-field em { animation: type-in .9s steps(12, end) both; }
.sjs .entry.done .mb-field:nth-child(2) em { animation-delay: .45s; }
.sjs .entry.done .mb-field:nth-child(3) em { animation-delay: .9s; }
@keyframes type-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Lifeline entry */
.lifeline { list-style: none; margin: 8px 0 0; padding: 26px 0 0; position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(132px, 1fr); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.lifeline::before { content: ''; position: absolute; left: 6px; right: 6px; top: 11px; height: 3px; border-radius: 2px; background: var(--brand); transform-origin: left; }
.sjs .entry:not(.done) .lifeline::before { transform: scaleX(0); }
.sjs .entry .lifeline::before { transition: transform 1.4s var(--ease); }
.lifeline li { position: relative; scroll-snap-align: start; padding: 10px 11px; border-radius: 14px; background: var(--surface); border: 1px solid var(--outline); font-size: 12.5px; line-height: 1.35; }
.lifeline li::before { content: ''; position: absolute; top: -21px; left: 14px; width: 11px; height: 11px; border-radius: 50%; background: var(--c, var(--purple)); box-shadow: 0 0 0 3px var(--card); }
.lifeline time { display: block; font-weight: 600; color: var(--faint); font-size: 11px; letter-spacing: .03em; text-transform: uppercase; margin-bottom: 2px; }
.lifeline b { display: block; font-weight: 600; }
.lifeline em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.lifeline .now { border-color: color-mix(in srgb, var(--purple) 55%, var(--outline)); }

/* ---------- CTA band ---------- */
.s-cta { padding: 64px 0 72px; }
.s-cta-card {
  border-radius: 28px; padding: 36px 24px; text-align: center; border: 1px solid var(--outline);
  background: radial-gradient(ellipse 80% 90% at 50% 0%, rgba(139, 92, 246, .20), transparent 70%), var(--card);
}
.s-cta-card h2 { margin-bottom: .3em; }
.s-cta-card p { color: var(--muted); max-width: 36em; margin-inline: auto; }
.s-cta-card .cta-row { justify-content: center; }
.s-cta-card .ticks { justify-content: center; }

/* Colours per kind */
.k-papers { --c: var(--blue); } .k-money { --c: var(--green); } .k-people { --c: var(--pink); }
.k-plan { --c: var(--purple); } .k-place { --c: var(--amber); }

/* ---------- Reduced motion: no flow, no bob, no typing; everything shown ---------- */
@media (prefers-reduced-motion: reduce) {
  .jg-lines path, .jg-h, .jg-you, .dots i { animation: none !important; }
  .jg-h, .jg-you, .jg-diary, .jg-diary li, .jg-lines path, .jg-stage::before { transition: none !important; }
  .sjs .entry .bub.raaya .txt { display: inline !important; animation: none !important; }
  .sjs .entry .dfiled, .sjs .entry .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .sjs .entry .dots { display: none !important; }
  .sjs .entry .mb-field em { clip-path: none !important; animation: none !important; }
  .sjs .entry .lifeline::before { transform: none !important; transition: none !important; }
  .sjs .plan-grid .psteps li { animation: none !important; }
}
