/*
  My Story page only, loaded after v2.css and dark.css and built from their
  tokens. A calm opening, then five chapters that alternate sides along one
  thin path, a small side navigator, and a few layers that drift with scroll.
*/

/* Opening */
.story-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--g); align-items: end; padding: clamp(120px, 14vw, 170px) var(--g) clamp(60px, 7vw, 100px); overflow: hidden; }
.story-hero__text { position: relative; z-index: 1; padding-bottom: clamp(10px, 4vw, 60px); }
.story-hero__title { font: 400 clamp(2.8rem, 1.6rem + 3.6vw, 5.2rem)/0.98 var(--serif); letter-spacing: -0.02em; color: var(--ink); margin-bottom: clamp(20px, 2.6vw, 32px); }
.story-hero__field { position: absolute; right: -6%; top: 22%; width: min(60vw, 780px); height: auto; pointer-events: none; }
.story-hero__arch { justify-self: center; width: min(100%, 420px); }

/* An arch frame: the photo is cut off at the bottom by the frame; the head may rise above it. */
.arch { position: relative; aspect-ratio: 4 / 5; }
.arch::before { content: ''; position: absolute; inset: 14% 0 0; border-radius: 999px 999px 10px 10px; background: linear-gradient(180deg, var(--night-2), var(--card) 80%); border: 1px solid var(--line); }
.arch picture, .arch__me { position: absolute; inset: 0; clip-path: inset(-40% 0 0 0 round 0 0 10px 10px); }
.arch img { position: absolute; left: 50%; bottom: 0; width: 104%; height: auto; max-width: none; translate: -50% 0; }
.arch--small { width: min(100%, 360px); margin: 0 auto; }
.arch--small .art__back { position: absolute; inset: -6% -14%; width: 128%; height: auto; }

/* Chapters */
.journey { position: relative; background: var(--night); border-block: 1px solid var(--line); display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: clamp(20px, 3vw, 48px); padding: clamp(10px, 2vw, 30px) var(--g); }
.journey__nav { position: relative; }
.journey__nav ol { position: sticky; top: 120px; display: grid; gap: 4px; padding-left: 14px; border-left: 1px solid var(--line); }
.journey__nav a { display: flex; gap: 10px; padding: 7px 0; text-decoration: none; font: 600 0.78rem/1.35 var(--sans); color: var(--muted); transition: color .3s; }
.journey__nav a b { font-weight: 700; font-size: 0.66rem; letter-spacing: 0.14em; padding-top: 2px; color: var(--muted); }
.journey__nav a:hover, .journey__nav a.is-on { color: var(--ink); }
.journey__nav a.is-on b { color: var(--violet); }
.journey__nav a.is-on { box-shadow: -15px 0 0 -14px var(--signal); }
.journey__now { display: none; }
.journey__main { position: relative; }
.journey__path { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.journey__path path { fill: none; stroke-width: 1.5; stroke-linecap: round; }
.journey__track { stroke: var(--line); }
.journey__fill { stroke: url(#pathInk); stroke-dasharray: 1; stroke-dashoffset: 1; }

.beat { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(80px, 9vw, 150px); align-items: center; padding: clamp(50px, 8vw, 110px) 0; scroll-margin-top: 80px; }
.beat__text { grid-column: 1; grid-row: 1; max-width: 30rem; justify-self: end; }
.beat__art { grid-column: 2; grid-row: 1; position: relative; width: min(100%, 400px); justify-self: start; }
.beat--flip .beat__text { grid-column: 2; justify-self: start; }
.beat--flip .beat__art { grid-column: 1; justify-self: end; }
.beat__node { position: absolute; left: 50%; top: 50%; z-index: 1; width: 15px; height: 15px; margin: -7px 0 0 -7px; border-radius: 50%; border: 1px solid var(--iris); background: var(--night); transition: background .5s, border-color .5s, box-shadow .5s; }
.beat.is-on .beat__node { background: var(--signal); border-color: var(--signal); box-shadow: 0 0 0 5px rgba(143, 120, 255, .16); }
.chapter__meta { display: flex; gap: 14px; align-items: center; font: 700 0.66rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.chapter__meta b { color: var(--violet); font-weight: 700; }
.chapter__title { font: 400 clamp(2rem, 1.3rem + 2vw, 3.2rem)/1.02 var(--serif); letter-spacing: -0.015em; color: var(--ink); margin-bottom: 16px; outline: none; }
.chapter__body { font-size: clamp(1rem, 0.95rem + 0.25vw, 1.15rem); color: var(--ink-body); opacity: 1; }
.chapter__evidence { margin-top: 22px; border-top: 1px solid var(--line); }
.chapter__evidence li { position: relative; padding: 9px 0 9px 18px; border-bottom: 1px solid var(--line); font: 600 0.84rem/1.4 var(--sans); color: var(--ink); }
.chapter__evidence li::before { content: ''; position: absolute; left: 2px; top: 1.05em; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
.chapter__evidence a { text-decoration: none; border-bottom: 1px solid rgba(169, 150, 255, .45); transition: color .3s, border-color .3s; }
.chapter__evidence a:hover { color: var(--violet); border-color: var(--violet); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Illustrations: soft translucent shapes behind, thin lines and nodes in front. */
.beat__art > svg { display: block; width: 100%; height: auto; }
.beat__art .art__back { position: absolute; inset: 0; }
.a-soft { fill: rgba(143, 120, 255, .10); }
.a-soft--2 { fill: rgba(213, 177, 168, .10); }
.a-line { fill: none; stroke: var(--iris); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.a-faint { opacity: .45; }
.a-layer { fill: rgba(143, 120, 255, .08); }
.a-layer--1 { fill: rgba(89, 119, 197, .12); }
.a-layer--2 { fill: rgba(213, 177, 168, .14); stroke: var(--rose); }
.a-bar { stroke: var(--line); stroke-width: 6; }
.a-dash { stroke-dasharray: 3 7; opacity: .8; }
.a-glyph { stroke: var(--signal); stroke-width: 2; }
.a-node { fill: var(--night); stroke: var(--iris); }
.a-node--on { fill: var(--signal); stroke: var(--signal); }
.a-ring { fill: none; stroke: rgba(169, 150, 255, .45); }
.a-orbit { fill: none; stroke: var(--line); stroke-width: 1.4; }
.arch .a-node { fill: var(--night); stroke: var(--iris); stroke-width: 1.4; }

/* Close */
.story-close { display: flex; flex-wrap: wrap; gap: clamp(24px, 4vw, 56px); align-items: center; justify-content: center; padding: clamp(60px, 8vw, 110px) var(--g) clamp(70px, 9vw, 130px); }
.story-close__photo { width: 200px; aspect-ratio: 1; }
.story-close__photo img { width: 100%; height: 100%; }

/* Motion: the opening fades in, chapters rise 12px once. Off with reduced motion. */
.story-hero__text > *, .story-hero__arch { animation: fadeUp 1s var(--ease) backwards; }
.story-hero__arch { animation-delay: .15s; }
.motion .beat__text, .motion .beat__art { opacity: 0; transform: translateY(12px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.motion .beat__art { transition-delay: .1s; }
.motion .beat.is-in .beat__text, .motion .beat.is-in .beat__art { opacity: 1; transform: none; }
[data-depth] { will-change: transform; }

@media (max-width: 1100px) {
  .journey { grid-template-columns: minmax(0, 1fr); }
  .journey__nav { display: none; }
  /* A small sticky label replaces the side navigator. */
  .journey__now { display: flex; position: sticky; top: 72px; z-index: 5; gap: 12px; align-items: center; margin: 0 calc(var(--g) * -1); padding: 12px var(--g); background: rgba(31, 22, 51, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); font: 600 0.78rem/1.2 var(--sans); color: var(--ink); }
  .journey__now b { white-space: nowrap; font-size: 0.66rem; letter-spacing: 0.14em; color: var(--violet); }
  .journey__now i { margin-left: auto; width: 64px; height: 2px; background: var(--line); }
  .journey__now s { display: block; height: 100%; background: var(--signal); transform-origin: left; transition: transform .4s var(--ease); }
}
@media (max-width: 760px) {
  .story-hero { grid-template-columns: minmax(0, 1fr); padding-top: 100px; }
  .story-hero__arch { width: min(78%, 320px); }
  .journey__path, .beat__node { display: none; }
  .beat, .beat--flip { grid-template-columns: minmax(0, 1fr); row-gap: 28px; padding: 48px 0; scroll-margin-top: 120px; }
  .beat__text, .beat--flip .beat__text { grid-column: 1; grid-row: 1; justify-self: start; }
  .beat__art, .beat--flip .beat__art { grid-column: 1; grid-row: 2; justify-self: center; width: min(78%, 300px); }
  .beat + .beat { border-top: 1px solid var(--line); }
  .story-close__photo { width: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  .story-hero__text > *, .story-hero__arch { animation: none; }
  [data-depth] { will-change: auto; }
}
