/* Story & Roadmap (/story, story1, Mortimer, 19-10-2026): the chapters in one centred column (each chapter keeps its
   old size: 860 px wide, same padding), joined by a timeline that lights up as you scroll. The chapter nearest the middle
   of the screen, or under the mouse, comes forward with a glow and the others step back a little. Chapters marked
   "Roadmap" in /admin/site/story are drawn dashed and violet, after a "We are here" marker. story.js sets the classes
   and the line's measures (--sr-top, --sr-len, --sr-done, --sr-fill); without it the page reads the same, only still. */
@property --sr-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

.sr { --sr-x: 34px; max-width: 860px; margin: 0 auto; }

/* Counters above the column */
.sr-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 28px; }
.sr-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
    letter-spacing: 0.04em; color: #dbe2ee; background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.sr-chip i { width: 9px; height: 9px; border-radius: 50%; }
.sr-chip--done i { background: var(--cyan); box-shadow: 0 0 10px rgba(0,221,235,0.8); }
.sr-chip--road i { border: 2px dashed #b9a3f0; }

/* The timeline: a soft track for the chapters already lived, a dashed one for the roadmap, and a bright fill (with a
   glowing head) that follows the scroll up to "We are here". Behind the cards, through their dots. */
.sr-track { position: relative; }
.sr-line { position: absolute; z-index: 0; left: calc(var(--sr-x) - 1px); width: 2px; top: var(--sr-top, 40px); height: var(--sr-len, calc(100% - 80px)); pointer-events: none; }
.sr-line::before, .sr-line::after { content: ''; position: absolute; left: 0; right: 0; border-radius: 2px; }
.sr-line::before { top: 0; height: var(--sr-done, 100%); background: linear-gradient(180deg, var(--orange), var(--cyan) 55%, var(--violet)); opacity: 0.28; }
.sr-line::after { top: var(--sr-done, 100%); bottom: 0; background: repeating-linear-gradient(180deg, rgba(185,163,240,0.75) 0 7px, transparent 7px 14px); opacity: 0.7; }
.sr-line-fill { position: absolute; z-index: 1; top: 0; left: -1px; width: 4px; height: var(--sr-fill, 0px); border-radius: 4px;
    background: linear-gradient(180deg, var(--orange), var(--cyan) 55%, var(--violet)) 0 0 / 100% var(--sr-done, 100%) no-repeat;
    box-shadow: 0 0 14px rgba(0,221,235,0.55), 0 0 30px rgba(147,112,219,0.35); transition: height 0.18s linear; }
.sr-line-fill::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
    background: #fff; box-shadow: 0 0 0 4px rgba(0,221,235,0.35), 0 0 22px 6px rgba(0,221,235,0.8), 0 0 46px 12px rgba(147,112,219,0.45);
    opacity: var(--sr-head, 0); transition: opacity 0.3s; }

.sr-list { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }

/* One chapter: the same card as before (padding 26/28/26/64, the dot at 26 px), now with the focus effect */
.sr-ch article { position: relative; padding: 26px 28px 26px 64px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
    transform-origin: var(--sr-x) 50%;   /* it grows out of the timeline: the dot stays on the line */
    transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.45s, background-color 0.45s, border-color 0.45s, box-shadow 0.55s; }
.sr-ch article::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
    background: conic-gradient(from var(--sr-a), var(--orange), var(--cyan), var(--violet), #ff4fd8, var(--orange));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
    opacity: 0; transition: opacity 0.5s; animation: sr-spin 7s linear infinite; animation-play-state: paused; }
@keyframes sr-spin { to { --sr-a: 360deg; } }
.sr-node { position: absolute; z-index: 2; left: calc(var(--sr-x) - 8px); top: 32px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-1);
    border: 3px solid var(--cyan); box-shadow: 0 0 14px rgba(0,221,235,0.6); transition: background 0.35s, box-shadow 0.35s, transform 0.35s; }
.sr-ch.is-lit .sr-node { background: var(--cyan); box-shadow: 0 0 0 4px rgba(0,221,235,0.18), 0 0 20px rgba(0,221,235,0.9); }
.sr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sr-meta time { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange); }
.sr-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 800;
    letter-spacing: 0.12em; text-transform: uppercase; }
.sr-badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sr-badge--done { color: #5eead4; background: rgba(45,212,191,0.1); border: 1px solid rgba(45,212,191,0.3); }
.sr-badge--road { color: #c9b8ff; background: rgba(147,112,219,0.14); border: 1px dashed rgba(185,163,240,0.55); }
.sr-ch h2 { margin: 6px 0 10px; font-size: 1.5rem; line-height: 1.25; }

/* The full text: the BASC News BBCode (news_render) */
.sr-body { color: #cdd5e3; line-height: 1.65; overflow-wrap: anywhere; }
.sr-body strong { color: #fff; }
.sr-body a { color: var(--cyan); text-decoration: underline; text-decoration-color: rgba(0,221,235,0.4); text-underline-offset: 3px; }
.sr-body a:hover { color: #7ff3fb; }
.sr-body .nb-h { margin: 14px 0 4px; color: #fff; line-height: 1.3; }
.sr-body h3.nb-h { font-size: 1.22rem; } .sr-body h4.nb-h { font-size: 1.1rem; } .sr-body h5.nb-h { font-size: 1rem; }
.sr-body .nb-center { text-align: center; } .sr-body .nb-right { text-align: right; } .sr-body .nb-left { text-align: left; }
.sr-body .nb-list { margin: 8px 0; padding-left: 4px; list-style: none; }
.sr-body .nb-list li { position: relative; padding-left: 22px; }
.sr-body .nb-list li::before { content: ''; position: absolute; left: 4px; top: 0.72em; width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg);
    background: var(--cyan); box-shadow: 0 0 10px rgba(0,221,235,0.7); }
.sr-body .nb-c-primary, .sr-body .nb-c-bright { color: var(--cyan); }
.sr-body .nb-c-soft { color: #a5f3fc; }
.sr-body .nb-c-dark, .sr-body .nb-c-deep { color: var(--orange); }
.sr-body .nb-c-muted { color: var(--muted); }

/* Up to 4 images, GIFs or MP4s under the text; a click opens them big */
.sr-media { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.sr-media--1 { grid-template-columns: 1fr; }
.sr-media--3 { grid-template-rows: 1fr 1fr; }
.sr-shot { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
    background: #0b0618; cursor: zoom-in; aspect-ratio: 4 / 3; transition: border-color 0.3s, box-shadow 0.3s; }
.sr-shot img, .sr-shot video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sr-shot:hover { border-color: rgba(0,221,235,0.45); box-shadow: 0 10px 30px -10px rgba(0,221,235,0.45); }
.sr-shot:hover img, .sr-shot:hover video { transform: scale(1.045); }
.sr-media--1 .sr-shot { aspect-ratio: auto; }
.sr-media--1 .sr-shot img, .sr-media--1 .sr-shot video { height: auto; max-height: 480px; object-fit: contain; }
.sr-media--3 .sr-shot:first-child { grid-row: span 2; aspect-ratio: auto; }
.sr-play { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; display: grid; place-items: center; border-radius: 50%;
    background: rgba(7,2,15,0.6); border: 1px solid rgba(255,255,255,0.35); backdrop-filter: blur(6px); transition: opacity 0.3s, transform 0.3s; }
.sr-play svg { width: 22px; height: 22px; margin-left: 3px; fill: #fff; }
.sr-shot.is-playing .sr-play { opacity: 0; transform: scale(0.8); }
.sr-shot:hover .sr-play { opacity: 1; transform: none; }

/* Roadmap chapters: not achieved yet */
.sr-ch.is-road article { border-style: dashed; border-color: rgba(185,163,240,0.32);
    background: linear-gradient(135deg, rgba(147,112,219,0.09), rgba(255,255,255,0.02) 60%); }
.sr-ch.is-road .sr-node { border: 2px solid #b9a3f0; background: radial-gradient(circle, #d8ccff 0 2.5px, var(--bg-1) 3.5px); box-shadow: 0 0 0 3px rgba(147,112,219,0.18), 0 0 14px rgba(147,112,219,0.55); }
.sr-ch.is-road .sr-meta time { color: #c9b8ff; }
.sr-ch.is-road .sr-body .nb-list li::before { background: #b9a3f0; box-shadow: 0 0 10px rgba(147,112,219,0.7); }

/* "We are here": where the lived story ends and the roadmap begins */
.sr-now { position: relative; display: flex; align-items: center; min-height: 48px; padding: 2px 0 2px 64px; }
.sr-now-dot { position: absolute; left: calc(var(--sr-x) - 11px); top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff, var(--orange) 45%, #c2410c); box-shadow: 0 0 18px rgba(249,115,22,0.85); }
.sr-now-dot::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(249,115,22,0.7); animation: sr-ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes sr-ping { 0% { transform: scale(0.7); opacity: 1; } 80%, 100% { transform: scale(1.8); opacity: 0; } }
.sr-now-text { display: grid; gap: 1px; }
.sr-now-text b { font-size: 0.78rem; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--orange); }
.sr-now-text span { font-size: 0.95rem; color: #dbe2ee; }

/* Focus: the chapter being read comes forward with a glow; the rest step back */
.sr-ch { min-width: 0; }   /* never positioned: story.js reads the articles' offsets from the list */
.sr-ch.is-focus article { z-index: 2; transform: scale(1.035); background-color: rgba(22,10,48,0.55); border-color: transparent;
    box-shadow: 0 24px 70px -18px rgba(0,221,235,0.42), 0 0 90px -20px rgba(147,112,219,0.6), 0 0 0 1px rgba(255,255,255,0.04); }
.sr-ch.is-focus article::after { opacity: 1; animation-play-state: running; }
.sr-ch.is-focus .sr-node { transform: scale(1.25); }
/* story1b (Mortimer, 19-10-2026: "su nodo debe estar animado … tipo el de We are here pero un poco más sutil"): the dot of the
   chapter in focus fills up and sends a soft ring out, like "We are here" but thinner, fainter and slower. */
.sr-node::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid rgba(0,221,235,0.7); opacity: 0; pointer-events: none; }
.sr-ch.is-focus .sr-node { background: var(--cyan); box-shadow: 0 0 0 4px rgba(0,221,235,0.16), 0 0 18px rgba(0,221,235,0.85);
    animation: sr-fill 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sr-ch.is-focus .sr-node::after { animation: sr-pulse 2.6s cubic-bezier(0, 0, 0.2, 1) 0.3s infinite; }
.sr-ch.is-road.is-focus .sr-node { background: radial-gradient(circle, #fff 0 2.5px, #b9a3f0 3.5px); box-shadow: 0 0 0 4px rgba(147,112,219,0.2), 0 0 18px rgba(147,112,219,0.85); }
.sr-ch.is-road .sr-node::after { border-color: rgba(185,163,240,0.6); }
@keyframes sr-fill { from { box-shadow: 0 0 0 0 rgba(0,221,235,0.6), 0 0 0 rgba(0,221,235,0); } }
@keyframes sr-pulse { 0% { transform: scale(0.8); opacity: 0.9; } 75%, 100% { transform: scale(1.75); opacity: 0; } }
.sr-ch.is-road.is-focus article { box-shadow: 0 24px 70px -18px rgba(147,112,219,0.55), 0 0 90px -20px rgba(255,79,216,0.35), 0 0 0 1px rgba(255,255,255,0.04); }
.sr.has-focus .sr-ch:not(.is-focus) article { opacity: 0.66; }
.sr.has-focus .sr-ch:not(.is-focus) article:hover { opacity: 1; }

/* The big view of the media */
.sr-box { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; overflow: hidden; }
.sr-box[open] { display: grid; place-items: center; }
.sr-box::backdrop { background: rgba(4,1,10,0.88); backdrop-filter: blur(8px); }
.sr-box-stage { margin: 0; display: grid; place-items: center; max-width: 92vw; max-height: 86vh; }
.sr-box-stage img, .sr-box-stage video { display: block; max-width: 92vw; max-height: 86vh; width: auto; height: auto; border-radius: 14px;
    box-shadow: 0 30px 90px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.08); animation: sr-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes sr-in { from { opacity: 0; transform: scale(0.96); } }
.sr-box-stage figcaption { margin-top: 10px; font-size: 0.85rem; color: var(--muted); text-align: center; }
.sr-box-x, .sr-box-nav { position: fixed; z-index: 2; display: grid; place-items: center; border-radius: 50%; color: #fff; cursor: pointer;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); backdrop-filter: blur(6px); transition: background 0.2s, border-color 0.2s; }
.sr-box-x:hover, .sr-box-nav:hover { background: rgba(0,221,235,0.16); border-color: rgba(0,221,235,0.5); }
.sr-box-x { top: 18px; right: 18px; width: 44px; height: 44px; font-size: 1.6rem; line-height: 1; }
.sr-box-nav { top: 50%; width: 52px; height: 52px; margin-top: -26px; font-size: 2rem; line-height: 1; }
.sr-box-prev { left: 18px; } .sr-box-next { right: 18px; }
.sr-box-nav[hidden] { display: none; }

@media (max-width: 600px) {
    .sr { --sr-x: 26px; }
    .sr-legend { justify-content: flex-start; margin-bottom: 22px; }
    .sr-list { gap: 18px; }
    .sr-ch article { padding: 22px 18px 22px 52px; }
    .sr-node { top: 28px; }
    .sr-ch h2 { font-size: 1.3rem; }
    .sr-ch.is-focus article { transform: scale(1.015); }
    .sr-now { padding-left: 52px; }
    .sr-media { gap: 8px; }
    .sr-box-nav { top: auto; bottom: 18px; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .sr-ch article, .sr-node, .sr-line-fill, .sr-shot img, .sr-shot video { transition: none; }
    .sr-ch.is-focus article { transform: none; }
    .sr-ch article::after, .sr-now-dot::after, .sr-ch.is-focus .sr-node, .sr-ch.is-focus .sr-node::after { animation: none; }
    .sr-shot:hover img, .sr-shot:hover video { transform: none; }
}
