/* Inside Aethera: the end-to-end process page */

.px-page { --hh: 104px; --max: 1480px; background: var(--midnight); }
@media (max-width: 999px) { .px-page { --hh: 92px; } }
.px-page main { padding-top: var(--hh); }
html:has(.px-page) { scroll-padding-top: calc(var(--hh) + 8px); }

/* ---------- Header ---------- */
.px-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; color: var(--paper);
  background: rgba(0, 11, 38, .9);
  -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(185, 188, 214, .12);
}
.px-bar { display: flex; align-items: center; gap: 18px; height: 60px; }
.px-title { font-family: var(--serif); font-size: 1.125rem; color: #C9CBE3; padding-left: 18px; border-left: 1px solid rgba(185, 188, 214, .25); white-space: nowrap; }
.mode { margin-left: auto; display: inline-flex; padding: 3px; gap: 3px; border: 1px solid rgba(185, 188, 214, .3); border-radius: 4px; }
.mode button { border: 0; background: none; color: #9A9ECB; font-weight: 600; font-size: .8125rem; padding: 6px 11px; border-radius: 2px; cursor: pointer; transition: background-color .2s, color .2s; }
.mode button[aria-pressed="true"] { background: var(--paper); color: var(--navy); }
.px-back { font-size: .875rem; color: #C9CBE3; text-decoration: none; white-space: nowrap; }
.px-back:hover { color: var(--paper); }
.px-title a.crumb { color: inherit; text-decoration: none; }
.px-title a.crumb:hover { color: var(--paper); }
.px-title span.crumb { color: rgba(185, 188, 214, .45); }
.px-progress { display: flex; align-items: center; gap: 24px; height: 44px; }
.px-segs { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex: 1 1 auto; min-width: 0; }
.px-segs li { flex: 1 1 0; min-width: 0; }
.px-segs a { position: relative; display: block; height: 28px; text-decoration: none; color: transparent; font-size: 0; }
.px-segs a::before { content: ""; position: absolute; left: 0; right: 0; top: 13px; height: 2px; background: rgba(185, 188, 214, .22); border-radius: 1px; transition: background-color .3s; }
.px-segs a.done::before { background: rgba(185, 188, 214, .55); }
.px-segs a.on::before { background: var(--paper); height: 3px; top: 12.5px; }
.px-segs a::after {
  content: attr(data-label); position: absolute; left: 0; top: 30px; white-space: nowrap;
  font-size: .75rem; color: var(--paper); background: var(--panel); padding: 4px 8px; border-radius: 2px;
  opacity: 0; pointer-events: none; transform: translateY(-3px); transition: opacity .2s, transform .2s;
}
.px-segs a:hover::after, .px-segs a:focus-visible::after { opacity: 1; transform: none; }
.px-tracker { flex: 0 1 auto; display: flex; align-items: center; gap: 10px; margin: 0; font-size: .8125rem; white-space: nowrap; min-width: 0; }
.px-tracker svg { width: 28px; height: 16px; flex: none; }
.px-tracker .lbl { color: #9A9ECB; }
.px-tracker .val { color: var(--paper); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 999px) {
  .px-bar { height: 52px; gap: 12px; }
  .px-bar .brand-word, .px-back { display: none; }
  .px-title { font-size: 1rem; padding-left: 12px; }
  .px-title .crumb { display: none; }
  .px-progress { height: 40px; gap: 12px; flex-wrap: nowrap; }
  .px-segs { gap: 3px; flex: 0 0 38%; }
  .px-tracker .lbl { display: none; }
}

/* ---------- Chapters ---------- */
.chapter { position: relative; padding: 0 0 8vh; border-top: 1px solid rgba(185, 188, 214, .1); }
.chapter-overview { border-top: 0; }
.ch-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); grid-template-areas: "text visual"; gap: 56px; }
.ch-visual { grid-area: visual; }
.ch-text { grid-area: text; }
.ch-sticky { position: sticky; top: var(--hh); height: calc(100vh - var(--hh)); display: flex; align-items: center; }
.ch-fig { position: relative; width: 100%; border: 1px solid rgba(185, 188, 214, .16); border-radius: 4px; background: radial-gradient(ellipse 85% 75% at 50% 45%, #0B1640 0%, #050D2B 75%); overflow: hidden; }
.ch-fig svg.px { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; max-height: calc(100vh - var(--hh) - 92px); }
.ch-fig-iso { background: radial-gradient(ellipse 80% 70% at 55% 45%, #0B1640 0%, var(--midnight) 72%); }
.minimap { position: absolute; left: 10px; bottom: 4px; width: 92px; height: 50px; opacity: .95; pointer-events: none; }
.fig-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 58px; padding: 8px 14px; border-top: 1px solid rgba(185, 188, 214, .12); font-size: .75rem; color: #9A9ECB; }
.ch-fig:has(.minimap) .fig-foot { padding-left: 116px; }

.ch-head { min-height: calc(100vh - var(--hh)); display: flex; flex-direction: column; justify-content: center; padding: 6vh 0; }
.ch-kicker { display: flex; align-items: center; gap: 0; margin: 0 0 18px; font-size: .875rem; color: #9A9ECB; }
.ch-kicker span + span::before { content: ""; display: inline-block; width: 1px; height: 12px; background: rgba(185, 188, 214, .35); margin: 0 12px; vertical-align: -1px; }
.ch-kicker .ch-num { font-family: var(--serif); font-size: 1.125rem; color: var(--paper); font-feature-settings: "lnum" 1; }
.ch-title { font-family: var(--serif); font-weight: 380; font-size: clamp(2.5rem, 1.6rem + 3vw, 4rem); line-height: 1.02; letter-spacing: -.02em; }
.ch-title.display { font-size: min(var(--step-5), 7.4vh); }
.ch-lede { margin-top: 22px; font-size: var(--step-1); line-height: 1.5; color: #C9CBE3; max-width: 30em; }
.scroll-cue { margin-top: 44px; display: flex; align-items: center; gap: 12px; font-size: .875rem; color: #9A9ECB; }
.scroll-cue span { width: 1px; height: 36px; background: linear-gradient(var(--paper), transparent); animation: cue 2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

.ch-steps { padding-bottom: 18vh; }
.step { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; transition: opacity .45s var(--ease); max-width: 30rem; }
.js .step:not(.is-active) { opacity: .3; }
.step-n { font-size: .8125rem; color: #9A9ECB; font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.step h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.75rem, 1.3rem + 1.2vw, 2.25rem); line-height: 1.12; letter-spacing: -.012em; }
.step p { margin: 14px 0 0; color: #C9CBE3; font-size: 1.0625rem; line-height: 1.6; }
.step .tech { display: none; font-size: .9375rem; color: #B9BCD6; border-left: 2px solid rgba(82, 136, 175, .7); padding-left: 14px; }
.tech-badge { display: block; font-size: .6875rem; font-weight: 700; letter-spacing: .04em; color: #7FA6C6; margin-bottom: 4px; }
.mode-tech .step .tech { display: block; }
.step.sheet h3 { font-size: 1.5rem; }
.step.sheet dl { margin: 16px 0 0; border-top: 1px solid rgba(185, 188, 214, .3); }
.step.sheet dl > div { display: grid; grid-template-columns: 9.5em 1fr; gap: 16px; padding: 11px 0; border-bottom: 1px solid rgba(185, 188, 214, .12); font-size: .9375rem; }
.step.sheet dt { color: #9A9ECB; }
.step.sheet dd { margin: 0; color: var(--paper); }
.step.sheet .tech-row { display: none !important; }
.mode-tech .step.sheet .tech-row { display: grid !important; }

/* ---------- Drawing styles (shared) ---------- */
.px text { font-family: var(--sans); }
.px .lbl { fill: #E1E3F1; font-size: 15px; font-weight: 600; }
.px .lbl-sub { fill: #9A9ECB; font-size: 12.5px; }
.px .lbl-t { fill: #7FA6C6; font-size: 12px; font-weight: 600; opacity: 0; transition: opacity .4s; }
.mode-tech .px .lbl-t { opacity: 1; }
.px .lead { stroke: rgba(201, 203, 227, .55); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.px .lead-dot { fill: #C9CBE3; }
.px .shell { fill: rgba(28, 33, 67, .55); stroke: #7A7FAE; stroke-width: 1.4; }
.px .shell-rib { stroke: rgba(122, 127, 174, .16); stroke-width: 1; }
.px .duct { fill: none; stroke: rgba(122, 127, 174, .5); stroke-width: 1.2; }
.px .chan { fill: rgba(90, 97, 166, .1); }
.px .eq { fill: #1C2350; stroke: #9A9ECB; stroke-width: 1.3; }
.px .eq-l { fill: none; stroke: #9A9ECB; stroke-width: 1.2; }
.px .eq-hot { fill: rgba(158, 128, 84, .22); stroke: #B89A6C; }
.px .eq-cool { fill: rgba(82, 136, 175, .18); stroke: #7FA6C6; }
.px .pipe { fill: none; stroke: #7A7FAE; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.px .pipe-thin { fill: none; stroke: #7A7FAE; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.px .hotline { fill: none; stroke: #B89A6C; stroke-width: 3; stroke-dasharray: 6 6; stroke-linecap: round; animation: flow 1.6s linear infinite; }
.px .coolline { fill: none; stroke: #7FA6C6; stroke-width: 3; stroke-dasharray: 6 6; stroke-linecap: round; animation: flow 1.6s linear infinite; }
.px .dataline { fill: none; stroke: #5288AF; stroke-width: 1.4; stroke-dasharray: 3 5; animation: flow 2s linear infinite; }
.px .ctlline { fill: none; stroke: #C9CBE3; stroke-width: 1.4; stroke-dasharray: 3 5; animation: flow 2s linear infinite reverse; }
.px .dim { stroke: #7A7FAE; stroke-width: 1; fill: none; }
.px .dim-t { fill: #9A9ECB; font-size: 12px; }
.px .tblock rect { fill: none; stroke: rgba(185, 188, 214, .35); }
.px .tblock text { fill: #9A9ECB; font-size: 11px; }
.px .part { transition: opacity .45s var(--ease); }
.px.has-focus .part { opacity: .32; }
.px.has-focus .part.on { opacity: 1; }
.px .part.opt:not(.on) { opacity: 0; }
.px .on .eq, .px .on .shell { stroke: var(--paper); }
.px .detail-panel { fill: rgba(7, 16, 47, .96); stroke: rgba(185, 188, 214, .35); }
.px .chart-axis { stroke: rgba(185, 188, 214, .4); stroke-width: 1; fill: none; }
.px .chart-line { stroke: #5288AF; stroke-width: 2.2; fill: none; }
.px .chart-band { fill: rgba(158, 128, 84, .16); }
.px .gauge-ring { fill: #0B1640; stroke: #9A9ECB; stroke-width: 1.5; }
.px .needle { stroke: var(--paper); stroke-width: 2.4; stroke-linecap: round; }
.px .bar-bg { fill: rgba(185, 188, 214, .12); }
.px .bar-fg { fill: #5288AF; }
.px .led { fill: #2B3163; }
.px .led.on { fill: #7FA6C6; }
@media (prefers-reduced-motion: reduce) { .px .hotline, .px .coolline, .px .dataline, .px .ctlline, .scroll-cue span { animation: none; } }

/* minimap */
.minimap .unit polygon { fill-opacity: .5; }
.minimap .unit.is-on .f-top { fill: var(--paper); }
.minimap .unit.is-on .f-left { fill: #C9CBE3; }
.minimap .unit.is-on .f-right { fill: #9A9ECB; }
.minimap .unit.is-on polygon { fill-opacity: 1; }
.minimap .mind-group { opacity: .5; }
.minimap .mind-group.is-on { opacity: 1; }
.minimap .pipe-flow { display: none; }

/* AetheraMind twin */
.px .twin polygon { fill: rgba(122, 127, 174, .06) !important; stroke: rgba(185, 188, 214, .55); stroke-width: .8; vector-effect: non-scaling-stroke; }
.px .twin .detail, .px .twin .shadow { display: none; }
.px .twin .pipe-outer, .px .twin .pipe-inner { stroke: rgba(185, 188, 214, .35) !important; }
.px .node-ring { fill: none; stroke: rgba(185, 188, 214, .45); stroke-width: 1; }
.px .node { fill: #1C2350; stroke: #C9CBE3; stroke-width: 1.4; }
.px .node.live { fill: #5288AF; stroke: #F7F7F6; }
.px .arc { fill: none; stroke: rgba(127, 166, 198, .45); stroke-width: 1.2; stroke-dasharray: 2 5; animation: flow 3s linear infinite; }

/* ---------- Mobile layout: drawing pinned on top, text scrolls below ---------- */
@media (max-width: 999px) {
  .ch-grid { display: block; }
  .ch-visual { position: sticky; top: var(--hh); z-index: 5; background: var(--midnight); padding: 10px 0 8px; margin: 0 calc(var(--gutter) * -1); padding-inline: var(--gutter); box-shadow: 0 12px 18px -10px rgba(0, 11, 38, .9); }
  .ch-sticky { position: static; height: auto; display: block; }
  .ch-fig svg.px { aspect-ratio: auto; height: 38vh; max-height: none; }
  .minimap { width: 64px; height: 36px; bottom: 3px; }
  .fig-foot { min-height: 42px; padding: 6px 10px; font-size: .6875rem; }
  .ch-fig:has(.minimap) .fig-foot { padding-left: 84px; }
  .ch-head { min-height: auto; padding: 32px 0 12px; }
  .chapter-overview .ch-head { padding-top: 24px; }
  .ch-title { font-size: clamp(2.125rem, 1.5rem + 3vw, 2.75rem); }
  .ch-title.display { font-size: clamp(2.25rem, 1.6rem + 3.4vw, 3rem); }
  .ch-lede { font-size: 1.0625rem; margin-top: 14px; }
  .scroll-cue { display: none; }
  .step { min-height: 46vh; max-width: none; padding: 14px 0 8px; justify-content: flex-start; }
  .step h3 { font-size: 1.625rem; }
  .ch-steps { padding-bottom: 26vh; }
}

/* ---------- Products finale ---------- */
.chapter-products { padding: 12vh 0 var(--section); border-top: 1px solid rgba(185, 188, 214, .1); }
.prod-head { min-height: auto; padding: 0 0 48px; max-width: 46rem; }
.prod-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
.pgroup + .pgroup { margin-top: 22px; }
.pgroup h3 { font-size: .8125rem; font-weight: 600; color: #9A9ECB; margin-bottom: 8px; }
.pbtn {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  background: none; border: 0; border-top: 1px solid rgba(185, 188, 214, .14); padding: 10px 4px;
  color: #C9CBE3; font-size: 1rem; font-weight: 500; transition: color .2s, background-color .2s;
}
.pgroup .pbtn:last-child { border-bottom: 1px solid rgba(185, 188, 214, .14); }
.pbtn svg { width: 30px; height: 30px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.pbtn:hover { color: var(--paper); }
.pbtn[aria-pressed="true"] { color: var(--paper); background: rgba(185, 188, 214, .07); }
.prod-detail { position: sticky; top: calc(var(--hh) + 24px); border: 1px solid rgba(185, 188, 214, .2); border-radius: 4px; background: #07102F; padding: clamp(22px, 3vw, 36px); }
.pd-top { display: flex; align-items: center; gap: 18px; }
.pd-icon { width: 64px; height: 64px; flex: none; fill: none; stroke: var(--paper); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.pd-group { margin: 0; font-size: .8125rem; color: #9A9ECB; }
.pd-name { font-family: var(--serif); font-weight: 400; font-size: clamp(1.75rem, 1.3rem + 1.5vw, 2.5rem); line-height: 1.1; letter-spacing: -.012em; }
.pd-use { margin: 18px 0 0; color: #C9CBE3; font-size: 1.0625rem; }
.pd-route { display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin: 26px 0 6px; }
.pd-route span { position: relative; font-size: .8125rem; font-weight: 600; padding: 7px 10px; border: 1px solid rgba(185, 188, 214, .22); color: #7A7FAE; border-radius: 2px; margin-right: 14px; transition: all .3s var(--ease); }
.pd-route span::after { content: ""; position: absolute; right: -15px; top: 50%; width: 14px; height: 1px; background: rgba(185, 188, 214, .25); }
.pd-route span:last-child::after { display: none; }
.pd-route span.lit { color: var(--navy); background: var(--paper); border-color: var(--paper); }
.pd-route span.lit::after { background: var(--paper); }
.pd-route span.out { color: var(--paper); border-style: dashed; }
.pd-facts { margin: 22px 0 0; border-top: 1px solid rgba(185, 188, 214, .25); }
.pd-facts > div { display: grid; grid-template-columns: 11em 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid rgba(185, 188, 214, .12); }
.pd-facts dt { color: #9A9ECB; font-size: .9375rem; }
.pd-facts dd { margin: 0; color: var(--paper); }
.pd-scale { display: flex; flex-wrap: wrap; gap: 4px; }
.pd-scale i { font-style: normal; font-size: .75rem; padding: 4px 8px; border-radius: 2px; color: #7A7FAE; border: 1px solid rgba(185, 188, 214, .18); }
.pd-scale i.on { color: var(--navy); background: #C9CBE3; border-color: #C9CBE3; }
.balance { margin-top: clamp(64px, 8vw, 112px); }
.balance h3 { font-family: var(--serif); font-weight: 400; font-size: var(--step-3); letter-spacing: -.01em; }
.bal-bar { display: flex; height: 54px; margin-top: 24px; border: 1px solid rgba(185, 188, 214, .3); border-radius: 3px; overflow: hidden; }
.bal-bar .cap { background: var(--paper); color: var(--navy); display: flex; align-items: center; padding-left: 16px; font-size: .9375rem; }
.bal-bar .cap b { font-weight: 600; }
.bal-bar .rest { flex: 1; background: repeating-linear-gradient(135deg, rgba(185, 188, 214, .18) 0 4px, transparent 4px 9px); }
.bal-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 24px; }
.bal-split div { border-top: 1px solid rgba(185, 188, 214, .3); padding-top: 14px; }
.bal-split strong { display: block; font-weight: 600; margin-bottom: 4px; }
.bal-split span { color: #C9CBE3; font-size: .9375rem; }
.balance .note { margin-top: 20px; }
.px-end { margin-top: clamp(80px, 10vw, 140px); padding-top: 48px; border-top: 1px solid rgba(185, 188, 214, .2); }
.px-end .lede { margin-top: 18px; }
@media (max-width: 999px) {
  .prod-grid { grid-template-columns: 1fr; gap: 28px; }
  .prod-detail { position: static; }
  .pd-facts > div { grid-template-columns: 1fr; gap: 4px; }
  .bal-split { grid-template-columns: 1fr; gap: 16px; }
  .prod-list { display: grid; grid-template-columns: 1fr; }
}

/* overview highlight */
.px .fx { transition: opacity .5s var(--ease); }
.px .fx.fade { opacity: .2; }
