:root {
    --story-dashboard: #4d4565;
    --story-dormant: #cfc4b5;
    --story-paper: #fbf8f2;
    --story-ink: #2a2740;
}

.story-skip {
    position: fixed;
    z-index: 100;
    top: 8px;
    left: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--brand-dark);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform .2s ease;
}

.story-skip:focus { transform: translateY(0); }
.story-page { position: relative; overflow-x: clip; overflow-y: visible; isolation: isolate; }
.story-backdrop {
    position: absolute;
    z-index: -1;
    inset: 0 0 auto;
    height: 76%;
    background:
        radial-gradient(circle at 20% 4%, rgba(95, 141, 247, .1), transparent 26rem),
        radial-gradient(circle at 82% 24%, rgba(242, 99, 59, .1), transparent 30rem),
        linear-gradient(180deg, #fffdf9, var(--story-paper));
    pointer-events: none;
}

.story-layout {
    display: grid;
    grid-template-columns: minmax(340px, .88fr) minmax(420px, 1.12fr);
    width: min(1260px, calc(100% - 48px));
    margin: 0 auto;
}

.story-figure-column { position: relative; min-width: 0; }
.story-figure-sticky {
    position: sticky;
    top: 72px;
    display: flex;
    height: calc(100svh - 72px);
    align-items: center;
    justify-content: center;
}

.story-figure {
    position: relative;
    width: min(78%, 390px);
    aspect-ratio: 360 / 760;
    filter: drop-shadow(0 26px 60px rgba(58, 42, 27, .1));
    animation: story-float 7s ease-in-out infinite;
}

.story-figure svg { display: block; width: 100%; height: 100%; overflow: visible; }
.story-part,
.story-heart,
.story-archive {
    opacity: .34;
    transition: opacity .7s ease, filter .7s ease, stroke .7s ease, fill .7s ease;
}

.story-part { stroke: var(--story-dormant); }
.story-calendar.is-lit { stroke: var(--calendar); filter: drop-shadow(0 0 7px rgba(95, 141, 247, .68)); opacity: 1; }
.story-notes.is-lit { stroke: var(--notes); filter: drop-shadow(0 0 7px rgba(60, 167, 124, .66)); opacity: 1; }
.story-tasks.is-lit { stroke: var(--tasks); filter: drop-shadow(0 0 7px rgba(242, 99, 59, .68)); opacity: 1; }
.story-dashboard.is-lit { stroke: var(--story-dashboard); filter: drop-shadow(0 0 7px rgba(77, 69, 101, .44)); opacity: 1; }
.story-eye { fill: var(--calendar); stroke: none; }
.story-eye-shine { fill: #fff; stroke: none; }

.story-heart {
    fill: transparent;
    stroke: var(--story-dormant);
    stroke-width: 3.4;
    transform-origin: 180px 250px;
}

.story-heart.is-lit {
    fill: rgba(239, 111, 123, .15);
    stroke: var(--habits);
    opacity: 1;
    filter: drop-shadow(0 0 9px rgba(239, 111, 123, .7));
    animation: story-heartbeat 1.6s ease-in-out infinite;
}

.story-archive { fill: var(--story-dormant); stroke: var(--story-dormant); transform-origin: 180px 84px; }
.story-archive.is-lit {
    fill: var(--archive);
    stroke: var(--archive);
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(155, 121, 239, .62));
}
.story-archive.is-lit .story-orbit { transform-origin: 180px 84px; animation: story-orbit 20s linear infinite; }
.story-tasks.is-lit .story-leg-left { transform-origin: 174px 372px; animation: story-step-left .9s ease-in-out infinite; }
.story-tasks.is-lit .story-leg-right { transform-origin: 186px 372px; animation: story-step-right .9s ease-in-out infinite; }

.story-flash {
    position: absolute;
    z-index: 3;
    inset: -12%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.92), rgba(255,225,194,.5) 38%, transparent 70%);
    opacity: 0;
    pointer-events: none;
}

.story-figure.is-complete .story-flash { animation: story-flash 1.25s ease forwards; }
.story-figure-caption {
    position: absolute;
    left: 50%;
    bottom: -7%;
    width: max-content;
    max-width: 92vw;
    text-align: center;
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity .8s ease .35s, transform .8s ease .35s;
}

.story-figure.is-complete .story-figure-caption { opacity: 1; transform: translate(-50%, 0); }
.story-figure-caption strong {
    display: block;
    background: linear-gradient(90deg, var(--calendar), var(--habits), var(--archive), var(--notes), var(--tasks));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-size: clamp(24px, 3.4vw, 42px);
    font-weight: 900;
    letter-spacing: .22em;
}
.story-figure-caption span { color: var(--muted); font-size: 12px; font-weight: 750; }

.story-copy { min-width: 0; padding: 0 4vw 0 2vw; }
.story-step {
    --step-colour: var(--brand);
    display: flex;
    min-height: calc(100svh - 72px);
    flex-direction: column;
    justify-content: center;
    gap: 17px;
    padding: 70px 0;
}

.story-enhanced .story-step {
    opacity: .34;
    transform: translateY(12px);
    transition: opacity .55s ease, transform .55s ease;
}
.story-enhanced .story-step.is-active { opacity: 1; transform: translateY(0); }
.story-kicker,
.story-label p {
    margin: 0;
    color: var(--step-colour);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.story-intro h1 {
    max-width: 760px;
    margin: 0;
    color: var(--story-ink);
    font-size: clamp(48px, 5.5vw, 76px);
    line-height: 1;
    letter-spacing: -.055em;
}
.story-intro h1 span { color: var(--brand); font-size: .72em; }
.story-lede,
.story-step > p:not(.story-kicker),
.story-step li {
    max-width: 40rem;
    color: var(--muted);
    font-size: clamp(17px, 1.45vw, 20px);
    line-height: 1.68;
}
.story-lede { margin: 0; }
.story-intro .actions { margin-top: 8px; }
.story-intro button.button { cursor: pointer; font: inherit; font-weight: 800; }
.story-scroll-cue { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: 13px !important; font-weight: 750; }
.story-scroll-cue > span { position: relative; width: 21px; height: 34px; border: 2px solid var(--line); border-radius: 12px; }
.story-scroll-cue > span::after { content: ""; position: absolute; top: 6px; left: 50%; width: 3px; height: 7px; border-radius: 3px; background: var(--brand); transform: translateX(-50%); animation: story-cue 1.7s ease-in-out infinite; }

.story-label { display: flex; align-items: center; gap: 14px; }
.story-label > span {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--step-colour) 28%, transparent);
    border-radius: 17px;
    background: color-mix(in srgb, var(--step-colour) 11%, white);
    color: var(--step-colour);
    font-size: 25px;
    font-weight: 900;
    box-shadow: 0 14px 30px color-mix(in srgb, var(--step-colour) 12%, transparent);
    transition: color .5s ease, background .5s ease, box-shadow .5s ease;
}
.story-step.is-active .story-label > span { background: var(--step-colour); color: #fff; box-shadow: 0 16px 36px color-mix(in srgb, var(--step-colour) 30%, transparent); }
.story-step h2 { max-width: 680px; margin: 0; color: var(--story-ink); font-size: clamp(36px, 4.2vw, 58px); line-height: 1.04; letter-spacing: -.045em; }
.story-step > p { margin: 0; }
.story-step ul { display: grid; max-width: 39rem; gap: 10px; margin: 3px 0 0; padding: 0; list-style: none; }
.story-step li { position: relative; padding-left: 22px; color: var(--ink); font-size: 15px; font-weight: 600; }
.story-step li::before { content: ""; position: absolute; top: .7em; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--step-colour); box-shadow: 0 0 0 4px color-mix(in srgb, var(--step-colour) 13%, transparent); }

.story-finale h2 { background: linear-gradient(100deg, var(--calendar), var(--habits), var(--archive), var(--notes), var(--tasks)); background-clip: text; -webkit-background-clip: text; color: transparent; }
.story-recap { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 4px; }
.story-recap span { padding: 7px 12px; border: 1px solid color-mix(in srgb, var(--step-colour) 22%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--step-colour) 9%, white); color: color-mix(in srgb, var(--step-colour) 78%, #2a2740); font-size: 13px; font-weight: 800; }

.story-rail {
    position: fixed;
    z-index: 18;
    top: 50%;
    right: 20px;
    display: grid;
    gap: 8px;
    transform: translateY(-50%);
}
.story-rail-line { position: absolute; z-index: -1; top: 14px; bottom: 14px; left: 14px; width: 2px; background: var(--line); }
.story-rail button { position: relative; display: grid; width: 30px; height: 30px; padding: 0; place-items: center; border: 0; background: transparent; cursor: pointer; }
.story-rail button > span { width: 10px; height: 10px; border: 2px solid var(--story-paper); border-radius: 50%; background: var(--line); box-shadow: 0 0 0 1px var(--line); transition: transform .25s ease, background .25s ease; }
.story-rail button.is-done > span { background: var(--step-colour); box-shadow: 0 0 0 1px var(--step-colour); }
.story-rail button[aria-current="step"] > span { transform: scale(1.55); }
.story-rail small { position: absolute; top: 50%; right: 36px; padding: 5px 8px; border-radius: 7px; background: var(--story-ink); color: #fff; font-size: 11px; font-weight: 750; opacity: 0; pointer-events: none; transform: translate(6px, -50%); transition: opacity .18s ease, transform .18s ease; }
.story-rail button:hover small,
.story-rail button:focus-visible small { opacity: 1; transform: translate(0, -50%); }

.story-proof { padding: 110px 0; }
.story-proof .feature-card { min-height: 260px; }
.story-proof .feature-icon { font-size: 21px; }
.story-proof-actions { justify-content: center; margin-top: 36px; }
.story-final-cta { margin-top: 18px; }

@keyframes story-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes story-orbit { to { transform: rotate(360deg); } }
@keyframes story-heartbeat { 0%, 100% { transform: scale(1); } 16% { transform: scale(1.13); } 32% { transform: scale(1); } 47% { transform: scale(1.08); } }
@keyframes story-step-left { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes story-step-right { 0%, 100% { transform: translateY(-7px); } 50% { transform: translateY(0); } }
@keyframes story-flash { 0% { opacity: 0; } 18% { opacity: .9; } 100% { opacity: 0; } }
@keyframes story-cue { 0% { opacity: 0; transform: translate(-50%, 0); } 35% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 1100px) {
    .story-rail { display: none; }
    .story-layout { grid-template-columns: minmax(280px, .76fr) minmax(380px, 1.24fr); width: min(100% - 32px, 1000px); }
    .story-copy { padding-right: 1vw; }
}

@media (max-width: 760px) {
    .story-layout { grid-template-columns: 1fr; width: 100%; }
    .story-figure-column,
    .story-copy { grid-area: 1 / 1; }
    .story-figure-column { z-index: 2; min-height: 100%; pointer-events: none; }
    .story-figure-sticky { top: 72px; height: 38svh; align-items: flex-start; padding-top: 12px; }
    .story-figure { width: auto; height: min(35svh, 290px); animation-duration: 8s; }
    .story-figure-caption { bottom: -10%; }
    .story-figure-caption strong { font-size: 22px; }
    .story-figure-caption span { font-size: 9px; }
    .story-copy { z-index: 1; padding: 42svh 20px 0; }
    .story-step { min-height: 88svh; justify-content: flex-start; padding: 35svh 0 12svh; }
    .story-intro { min-height: calc(100svh - 72px); padding-top: 12px; }
    .story-intro h1 { font-size: clamp(44px, 13.6vw, 68px); }
    .story-intro .actions { position: relative; z-index: 4; }
    .story-step h2 { font-size: clamp(34px, 10vw, 48px); }
    .story-step > p:not(.story-kicker) { font-size: 17px; }
    .story-step li { font-size: 14px; }
    .story-label > span { width: 48px; height: 48px; border-radius: 14px; font-size: 21px; }
    .story-scroll-cue { display: none; }
    .story-proof { padding: 88px 0; }
}

@media (max-width: 480px) {
    .story-copy { padding-right: 16px; padding-left: 16px; }
    .story-intro .actions { align-items: stretch; flex-direction: column; }
    .story-intro .button { width: 100%; }
    .story-finale { padding-bottom: 18svh; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .story-figure,
    .story-heart.is-lit,
    .story-archive.is-lit .story-orbit,
    .story-tasks.is-lit .story-leg-left,
    .story-tasks.is-lit .story-leg-right,
    .story-figure.is-complete .story-flash,
    .story-scroll-cue > span::after { animation: none !important; }
    .story-part,
    .story-heart,
    .story-archive,
    .story-step,
    .story-label > span,
    .story-figure-caption { transition: none !important; }
    .story-enhanced .story-step { transform: none; }
}
