/* Frontier pages: /frontier, /frontier/<slug>, /frontier/archive.
   Built on the tokens in style.css. One extra token, --fx, is the accent of the vision being shown. */

/* ---- Accent per vision. Must match the accent in app/frontier/content (tests/site/test_frontier.py checks). ---- */
.fx-page { --fx: var(--accent); }
.fx-core { --fx: #f0b44c; }
.fx-livekeys { --fx: #61c9a8; }
.fx-outcome-keys { --fx: #f2b65b; }
.fx-warp { --fx: #78a9f2; }
.fx-recall { --fx: #e58a76; }
.fx-echo { --fx: #6fbfb1; }
.fx-deadends { --fx: #d3a15e; }
.fx-fork { --fx: #b99be8; }
.fx-lens { --fx: #7ccad0; }
.fx-mesh { --fx: #66cad8; }
.fx-consensus { --fx: #83c98b; }
.fx-demand-board { --fx: #baa4e1; }
.fx-treaty { --fx: #a5a5e8; }
.fx-exchange { --fx: #e4b85d; }
.fx-compute { --fx: #84abe6; }
.fx-passport { --fx: #8ba8de; }
.fx-receipts { --fx: #dcc188; }
.fx-sentinel { --fx: #e28e76; }
.fx-forge { --fx: #e9a260; }
.fx-commons { --fx: #96c595; }
.fx-temporary-apis { --fx: #91b3da; }
.fx-live-dashboards { --fx: #6bc794; }
.fx-federation { --fx: #a0cac7; }
.fx-standards { --fx: #bfc5d1; }
.fx-labs { --fx: #ce91c9; }
.fx-horizon { --fx: #9ea9ee; }

/* ---- Page frame. Sections are numbered like the plates of an atlas. ---- */
.fx-page { position: relative; counter-reset: fx-plate; }
.fx-section { margin: 6rem 0; scroll-margin-top: calc(var(--nav-h) + 16px); counter-increment: fx-plate; }
.fx-section > .sec-title { display: flex; align-items: center; gap: 0.9rem; font-size: clamp(1.9rem, 3.6vw, 2.9rem); margin: 0 0 1.4rem; }
.fx-section > .sec-title::before { content: counter(fx-plate, decimal-leading-zero); align-self: flex-start; margin: 0.55em 0 0; font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500; font-stretch: 100%; letter-spacing: 0.08em; line-height: 1; color: var(--accent); }
.fx-section > .sec-title::after { content: ''; flex: 1 1 2rem; min-width: 1.5rem; height: 9px; transform-origin: left center;
  background: linear-gradient(var(--text-faint), var(--text-faint)) right center / 1px 9px no-repeat,
              linear-gradient(var(--border-strong), var(--border-strong)) left center / 100% 1px no-repeat; }
.fx-lead { font-size: 1.05rem; color: var(--text-dim); max-width: 68ch; }
.fx-lead strong { color: var(--text); font-weight: 650; }
.fx-notice { max-width: 78ch; }
.fx-notice p { margin: 0; }
.fx-fig-cap, .fx-hero-cap { font-family: var(--font-mono); font-size: 0.7rem; line-height: 1.5; letter-spacing: 0.02em; color: var(--text-faint); margin: 1rem 0 0; }
.fx-fig-cap span, .fx-hero-cap span { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; margin-right: 0.6em; }

/* Sections arrive once as they are scrolled to. frontier.js adds fx-pre, and only when motion is welcome. */
.fx-js .fx-section { transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.fx-js .fx-section > .sec-title::after { transition: transform 1s var(--ease) 0.15s; }
.fx-section.fx-pre { opacity: 0; transform: translateY(18px); }
.fx-section.fx-pre:focus-within { opacity: 1; transform: none; }
.fx-section.fx-pre > .sec-title::after { transform: scaleX(0); }

/* ---- Signatures: the ring pattern computed for each vision (app/frontier/signature.py) ---- */
.fx-sig { display: block; width: 100%; height: 100%; overflow: hidden; background: color-mix(in srgb, var(--fx) 7%, var(--code-bg)); }
.fx-sig circle { fill: none; stroke: var(--fx); stroke-width: 1.15px; vector-effect: non-scaling-stroke; }
.fx-sig-b circle { stroke-opacity: 0.5; }
.fx-sig-c circle { stroke: var(--text); stroke-opacity: 0.32; }
.fx-sig .fx-sig-dot { fill: var(--fx); stroke: none; }
.fx-sig-c .fx-sig-dot { fill: var(--text); }
.fx-sig g { transition: transform 0.5s var(--ease); }
/* A vision's picture (app/frontier/art.py), or its signature where no picture exists. Pictures are cut out of
   their dark stage, so they need no tile behind them. */
.fx-glyph { flex: none; width: 56px; height: 56px; display: block; }
svg.fx-glyph { border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--fx) 38%, var(--border)); }
img.fx-glyph { object-fit: contain; background: none; transition: transform 0.5s var(--ease), filter 0.5s var(--ease); }
.card-h .fx-glyph { width: 40px; height: 40px; }
.fx-card:hover img.fx-glyph, .fx-chip a:hover img.fx-glyph, .fx-pager a:hover img.fx-glyph { transform: scale(1.12); filter: brightness(1.15); }
.fx-feature:hover img.fx-glyph { transform: scale(1.04); filter: brightness(1.1); }
.fx-card:hover .fx-sig-b, .fx-chip a:hover .fx-sig-b, .fx-feature:hover .fx-sig-b, .fx-pager a:hover .fx-sig-b { transform: translate(1.6px, -1.1px); }
.fx-card:hover .fx-sig-c, .fx-chip a:hover .fx-sig-c, .fx-feature:hover .fx-sig-c, .fx-pager a:hover .fx-sig-c { transform: translate(-1.2px, 1.4px); }

/* ---- Hero: the headline over a field of five sources ---- */
.fx-hero { position: relative; isolation: isolate; container-type: inline-size; display: grid; grid-template-columns: minmax(0, 1fr); align-content: end; min-height: clamp(560px, 84vh, 800px); padding: 4rem 0 2.4rem; border-bottom: 2px solid var(--text); }
.fx-hero::after { content: ''; position: absolute; left: 0; bottom: -4px; width: 132px; height: 4px; background: var(--strip); }
.fx-field { position: absolute; z-index: -1; top: -2rem; bottom: 0; left: calc(50% - 50vw); width: 100vw; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.03) calc(50% - 8cqw), #000 calc(50% + 22cqw)), linear-gradient(to bottom, #000 62%, rgba(0, 0, 0, 0.25) 100%);
  mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.03) calc(50% - 8cqw), #000 calc(50% + 22cqw)), linear-gradient(to bottom, #000 62%, rgba(0, 0, 0, 0.25) 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
.fx-field-still { position: absolute; top: 0; right: calc((100vw - 100cqw) / 2); height: 100%; aspect-ratio: 1; overflow: visible; transition: opacity 1.4s var(--ease); }
.fx-field canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s var(--ease); }
.fx-field.is-live canvas { opacity: 1; }
.fx-field.is-live .fx-field-still { opacity: 0; }
.fx-field-src { --c: var(--text); }
.fx-field-knowledge { --c: var(--get); }
.fx-field-work { --c: var(--post); }
.fx-field-trust { --c: var(--put); }
.fx-field-ecosystem { --c: var(--accent); }
.fx-field-src circle { fill: none; stroke: color-mix(in srgb, var(--c) 75%, var(--text)); stroke-opacity: 0.7; stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.fx-field-src .fx-field-halo { fill: var(--accent); fill-opacity: 0.22; stroke: none; }
.fx-field-src .fx-field-dot { fill: var(--accent); stroke: none; }

.fx-hero-copy { max-width: min(44rem, 58cqw); }
.fx-hero-title { font-family: var(--font-display); font-stretch: 70%; font-weight: 850; text-transform: uppercase; line-height: 0.92; letter-spacing: -0.008em; font-size: clamp(2.5rem, 5.3vw, 4.7rem); margin: 0 0 1.6rem; overflow-wrap: anywhere; }
.fx-hero-title span { color: var(--accent); display: block; }
.fx-hero-lead { font-size: 1.12rem; color: var(--text-dim); max-width: 54ch; margin: 0 0 0.8rem; }
.fx-hero-second { color: var(--text); font-weight: 600; }

/* The five areas. A plain row of links until frontier-field.js places each beside its source. */
.fx-field-areas { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }
.fx-area { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.32rem 0.55rem; font-family: var(--font-mono); font-size: 0.7rem; line-height: 1; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); text-decoration: none; white-space: nowrap; border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--bg) 82%, transparent); transition: color 0.15s var(--ease), border-color 0.15s var(--ease); }
.fx-area-count { color: var(--accent); }
.fx-area:hover, .fx-area:focus-visible { color: var(--text); border-color: var(--accent); }
.fx-hero.is-placed .fx-field-areas { position: absolute; inset: -2rem 0 0; margin: 0; display: block; pointer-events: none; }
.fx-hero.is-placed .fx-area { position: absolute; left: 0; top: 0; pointer-events: auto; }
.fx-hero.is-placed .fx-area::before { content: ''; position: absolute; right: 100%; top: 50%; width: 8px; height: 1px; background: var(--accent); }
.fx-hero.is-placed .fx-area.is-left::before { right: auto; left: 100%; }
.fx-hero-cap { margin-top: 1.6rem; }
@media (min-width: 992px) {
  .fx-hero-cap { position: absolute; right: 0; bottom: 0.9rem; margin: 0; padding: 0.3rem 0 0.3rem 0.6rem; max-width: 36ch; text-align: right; background: color-mix(in srgb, var(--bg) 80%, transparent); }
}

/* ---- The strip of counts under the hero. Every number is read from the registry. ---- */
.fx-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 3rem; border-bottom: 1px solid var(--border); }
.fx-strip > div { padding: 1.1rem 1rem 1.2rem; border-left: 1px solid var(--border); min-width: 0; }
.fx-strip > div:first-child { border-left: 0; padding-left: 0; }
.main-content .fx-strip dt { margin: 0; font-family: var(--font-mono); font-size: 0.68rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); }
.main-content .fx-strip dd { margin: 0.5rem 0 0; font-family: var(--font-display); font-stretch: 72%; font-weight: 800; font-size: clamp(1.5rem, 2.9vw, 2.3rem); line-height: 1; color: var(--text); white-space: nowrap; }
.fx-strip small { margin-left: 0.5em; font-family: var(--font-mono); font-stretch: 100%; font-size: 0.7rem; font-weight: 400; color: var(--text-faint); }

/* ---- Status and phase labels ---- */
.fx-status, .fx-phase { display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; line-height: 1; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.3rem 0.5rem; border-radius: 3px; border: 1px solid var(--border-strong); color: var(--text-dim); white-space: nowrap; }
.fx-status::before { content: ''; display: inline-block; width: 0.5em; height: 0.5em; border-radius: 50%; margin-right: 0.45em; border: 1px solid currentColor; vertical-align: 0.05em; }
.fx-status-research, .fx-status-proposed { color: var(--get); border-color: color-mix(in srgb, var(--get) 45%, transparent); }
.fx-status-planned, .fx-status-building { color: var(--put); border-color: color-mix(in srgb, var(--put) 45%, transparent); }
.fx-status-building::before, .fx-status-experimental::before, .fx-status-live::before { background: currentColor; }
.fx-status-experimental { color: var(--accent); border-color: var(--accent-line); }
.fx-status-live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.fx-status-superseded, .fx-status-retired { color: var(--text-faint); text-decoration: line-through; }
.fx-phase { border-style: dashed; color: var(--text-faint); }

/* ---- Featured three: one large panel, two beside it ---- */
.fx-featured { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.25rem; }
.fx-feature { position: relative; display: grid; grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr); min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: border-color 0.2s var(--ease); }
.fx-feature:first-child { grid-row: span 2; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(250px, 1fr) auto; }
.fx-feature:hover, .fx-feature:focus-within { border-color: var(--fx); }
.fx-feature-fig { position: relative; min-height: 190px; overflow: hidden; background: var(--code-bg); border-right: 1px solid var(--border); }
.fx-feature-fig::before { content: ''; position: absolute; inset: 0; background: radial-gradient(closest-side at 50% 58%, color-mix(in srgb, var(--fx) 20%, transparent), transparent); }
.fx-feature:first-child .fx-feature-fig { border-right: 0; border-bottom: 1px solid var(--border); }
.fx-feature-fig .fx-glyph { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; }
.fx-feature-fig img.fx-glyph { padding: 5%; }
.fx-feature-body { display: flex; flex-direction: column; padding: 1.4rem; min-width: 0; }
.fx-feature-head { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem; }
.fx-feature-name { font-family: var(--font-display); font-stretch: 72%; font-weight: 850; text-transform: uppercase; font-size: clamp(1.8rem, 2.6vw, 2.3rem); line-height: 0.95; margin: 0 0 0.6rem; }
.fx-feature:first-child .fx-feature-name { font-size: clamp(2.2rem, 4.4vw, 3.5rem); }
.fx-feature-name a { color: var(--text); text-decoration: none; }
.fx-feature-name a::after { content: ''; position: absolute; inset: 0; }
.fx-feature-tag { color: var(--fx); font-weight: 600; margin: 0 0 0.7rem; }
.fx-feature-text { color: var(--text-dim); font-size: 0.95rem; margin: 0 0 1.1rem; }
.fx-feature .tile-more { position: relative; }

/* ---- The stack: eight layers against a gauge, bottom layer first ---- */
.fx-stack { list-style: none; padding: 0; margin: 2rem 0 0; counter-reset: fx-layer 9; border-top: 1px solid var(--border-strong); border-left: 1px solid var(--border-strong); }
.fx-layer { counter-increment: fx-layer -1; position: relative; display: grid; grid-template-columns: 3.2rem minmax(0, 18rem) minmax(0, 1fr); align-items: baseline; gap: 0.2rem 1.5rem; padding: 1.05rem 0.5rem 1.05rem 1.4rem; border-bottom: 1px solid var(--border); transition: background-color 0.2s var(--ease); }
.fx-layer::before { content: 'L' counter(fx-layer); font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); }
.fx-layer::after { content: ''; position: absolute; left: 0; top: 50%; width: 9px; height: 1px; background: var(--border-strong); }
.fx-layer-name { font-family: var(--font-display); font-stretch: 74%; font-weight: 800; text-transform: uppercase; font-size: 1.5rem; line-height: 1; color: var(--text); }
.fx-layer-text { color: var(--text-dim); font-size: 0.95rem; }
.fx-layer:hover { background-color: var(--surface); }
.fx-layer:last-child::before, .fx-layer:last-child .fx-layer-name { color: var(--accent); }
.fx-layer:last-child::after { background: var(--accent); width: 14px; }

/* ---- The route: every vision in the phase that would deliver it ---- */
.fx-route { list-style: none; padding: 0; margin: 2rem 0 0; border-bottom: 1px solid var(--border); }
.fx-leg { display: grid; grid-template-columns: 3.6rem minmax(0, 19rem) minmax(0, 1fr); align-items: start; gap: 0.5rem 1.5rem; padding: 1.15rem 0; border-top: 1px solid var(--border); }
.fx-leg-n { font-family: var(--font-display); font-stretch: 70%; font-weight: 850; font-size: 2.1rem; line-height: 0.85; color: var(--text-faint); }
.fx-leg:first-child .fx-leg-n { color: var(--accent); }
.fx-leg-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.fx-leg-text { color: var(--text-faint); font-size: 0.88rem; line-height: 1.5; margin: 0.25rem 0 0; }
.fx-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.fx-chip a { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.28rem 0.75rem 0.28rem 0.28rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 0.9rem; font-weight: 600; line-height: 1.2; text-decoration: none; transition: border-color 0.15s var(--ease), color 0.15s var(--ease); }
.fx-chip .fx-glyph { width: 34px; height: 34px; flex: none; border: 0; border-radius: 4px; }
.fx-chip .fx-sig circle { stroke-width: 1.3px; }
.fx-chip a:hover, .fx-chip a:focus-visible { border-color: var(--fx); color: var(--fx); }

/* ---- Filters ---- */
.fx-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; margin: 1.5rem 0 0.5rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.fx-filters[hidden] { display: none; }
.fx-filter { display: flex; flex-direction: column; gap: 0.3rem; flex: 1 1 170px; min-width: 0; }
.fx-filter label { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); }
.fx-filter-status { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); min-height: 1.3em; margin: 0.4rem 0 0; }
.fx-none { color: var(--text-dim); padding: 2rem 0; }

/* ---- All visions: cards on narrow screens, an aligned index on wide ones ---- */
.fx-group { margin-top: 3.2rem; scroll-margin-top: calc(var(--nav-h) + 16px); }
.fx-group[hidden] { display: none; }
.fx-group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.2rem 2rem; border-bottom: 1px solid var(--text-faint); padding-bottom: 0.7rem; margin-bottom: 1rem; }
.fx-group-title { font-family: var(--font-display); font-stretch: 76%; font-weight: 800; text-transform: uppercase; font-size: 1.45rem; line-height: 1; margin: 0; }
.fx-group-blurb { color: var(--text-faint); font-size: 0.92rem; margin: 0; }
.fx-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 0.8rem; }
.fx-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease); min-width: 0; }
.fx-card[hidden] { display: none; }
.fx-card:hover, .fx-card:focus-within { border-color: var(--fx); }
.fx-card-link { display: flex; gap: 0.9rem; align-items: flex-start; color: inherit; text-decoration: none; }
.fx-card-link::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.fx-card-link:focus-visible { outline: none; }
.fx-card:focus-within { outline: 2px solid var(--fx); outline-offset: 2px; }
.fx-card-body { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.fx-card-name { font-weight: 700; font-size: 1.08rem; color: var(--text); transition: color 0.15s var(--ease); }
.fx-card-tag { color: var(--text-dim); font-size: 0.92rem; line-height: 1.4; }
.fx-card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.9rem 0 0; position: relative; }
@media (min-width: 992px) {
  .fx-group-head { margin-bottom: 0; }
  .fx-cards { display: block; }
  .fx-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; padding: 0.7rem 0.7rem 0.7rem 0; background: none; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
  .fx-card:hover, .fx-card:focus-within { background: linear-gradient(90deg, color-mix(in srgb, var(--fx) 10%, transparent), transparent 70%); box-shadow: inset 2px 0 0 var(--fx); }
  .fx-card:hover .fx-card-name, .fx-card:focus-within .fx-card-name { color: var(--fx); }
  .fx-card-link { display: grid; grid-template-columns: 56px minmax(0, 15rem) minmax(0, 1fr); align-items: center; gap: 1.1rem; padding-left: 0.5rem; }
  .fx-card-link::after { border-radius: 0; }
  .fx-card-link .fx-glyph { width: 56px; height: 56px; }
  .fx-card-body { display: contents; }
  .fx-card-name { font-family: var(--font-display); font-stretch: 76%; font-weight: 800; text-transform: uppercase; font-size: 1.3rem; line-height: 1; }
  .fx-card-meta { margin: 0; flex-wrap: nowrap; }
}

.fx-legend { margin-top: 2rem; max-width: 760px; }
.fx-legend summary, .fx-ledger summary { cursor: pointer; color: var(--text); font-weight: 600; }
.fx-legend-list { margin: 1rem 0 0; display: grid; gap: 0.6rem; }
.fx-legend-list > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 0.8rem; align-items: baseline; }
.fx-legend-list dt, .fx-legend-list dd { margin: 0; }
.fx-legend-list dd { color: var(--text-dim); font-size: 0.93rem; }
.fx-ledger { margin-top: 1.2rem; }
.fx-ledger .table-responsive { margin-top: 1rem; }

/* Two pieces these pages use from tools.css, which they do not load. */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); margin-bottom: 14px; }
.crumbs a { color: var(--text-dim); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.fx-page .tool-table { font-size: 0.92rem; }
.fx-page .tool-table th { color: var(--text); font-weight: 600; }
.fx-page .tool-table thead th { color: var(--text-faint); }

/* ---- One-liners ---- */
.fx-quotes { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3rem; }
.fx-quotes li { padding: 1.3rem 0 2rem; border-top: 1px solid var(--border-strong); }
.fx-quotes blockquote { margin: 0; max-width: 24ch; font-family: var(--font-display); font-stretch: 84%; font-weight: 700; font-size: clamp(1.5rem, 2.5vw, 2.1rem); line-height: 1.1; letter-spacing: -0.01em; color: var(--text); text-wrap: balance; }

/* ---- Scenarios. A dashed rule marks what is hypothetical. ---- */
.fx-scenarios { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 0 2.2rem; counter-reset: fx-scene; }
.fx-scenario { counter-increment: fx-scene; padding: 1.1rem 0 1.8rem; border-top: 1px dashed var(--text-faint); }
.fx-scenario::before { content: 'Illustration ' counter(fx-scene, decimal-leading-zero); display: block; font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); margin-bottom: 0.7rem; }
.fx-scenario-title { font-size: 1.15rem; font-weight: 700; line-height: 1.25; margin: 0 0 0.5rem; }
.fx-scenario p { color: var(--text-dim); font-size: 0.95rem; margin: 0 0 0.8rem; }
.fx-scenario .fx-scenario-uses { font-size: 0.85rem; margin: 0; }
.fx-scenario-uses span { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-right: 0.3rem; }

.fx-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.fx-pair .detail-card { border-top: 3px solid var(--fx); margin: 0; }
.fx-pair p { color: var(--text-dim); }

/* ---- Closing, with a quiet echo of the hero field ---- */
.fx-closing { position: relative; isolation: isolate; counter-increment: none; border-top: 2px solid var(--text); padding: 4.5rem 0 1rem; }
.fx-closing-field { position: absolute; z-index: -1; top: 0; right: 0; width: min(62%, 640px); height: 100%; opacity: 0.55; pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 70%); mask-image: linear-gradient(to right, transparent, #000 70%); }
.fx-closing-title { font-family: var(--font-display); font-stretch: 70%; font-weight: 850; text-transform: uppercase; line-height: 0.92; font-size: clamp(2.4rem, 6vw, 4.8rem); margin: 0 0 1.4rem; }
.fx-closing-title span { color: var(--accent); display: block; }
.fx-foot { margin-top: 2.2rem; color: var(--text-faint); font-size: 0.9rem; max-width: 78ch; }

/* ---- Detail page ---- */
.fx-detail-head { isolation: isolate; min-height: 27rem; display: flex; flex-direction: column; justify-content: flex-end; }
.fx-detail-head::after { background: var(--fx); }
.fx-detail-fig { position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; width: min(46%, 500px); pointer-events: none; }
.fx-detail-fig::before { content: ''; position: absolute; inset: -8% -12%; background: radial-gradient(closest-side at 50% 55%, color-mix(in srgb, var(--fx) 24%, transparent), color-mix(in srgb, var(--fx) 7%, transparent) 55%, transparent); }
.fx-detail-fig .fx-glyph { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; }
.fx-detail-fig img.fx-glyph { object-position: center bottom; padding-bottom: 1.2rem; }
/* The signature, where a vision has no picture: rings fading in from the left, without the glow. */
.fx-detail-fig:has(svg)::before { content: none; }
.fx-detail-fig svg.fx-glyph { background: none; -webkit-mask-image: linear-gradient(to right, transparent, #000 60%); mask-image: linear-gradient(to right, transparent, #000 60%); }
.fx-detail .page-title { font-size: clamp(3rem, 9vw, 6.5rem) !important; line-height: 0.9; margin-bottom: 0 !important; }
.fx-detail .page-eyebrow { color: var(--fx); }
.fx-tagline { font-family: var(--font-display); font-stretch: 85%; font-weight: 650; font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.15; color: var(--fx); max-width: 30ch; margin: 1.6rem 0 1rem; text-wrap: balance; }
.fx-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1.3rem 0 0; }
.fx-dates { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint); }
.fx-share { margin-top: 1.1rem; }
.fx-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 3.5rem; margin-top: 3rem; align-items: start; }
.fx-detail-main { counter-reset: fx-block; }
.fx-block { counter-increment: fx-block; margin-bottom: 3rem; padding-top: 1.1rem; border-top: 1px solid var(--border-strong); }
.fx-block p { color: var(--text-dim); max-width: var(--measure); font-size: 1.03rem; }
.fx-h { display: flex; align-items: baseline; gap: 0.8rem; font-family: var(--font-display); font-stretch: 74%; font-weight: 850; text-transform: uppercase; font-size: 1.75rem; line-height: 1; margin: 0 0 1rem; }
.fx-h::before { content: counter(fx-block, decimal-leading-zero); font-family: var(--font-mono); font-stretch: 100%; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; color: var(--fx); }
.fx-detail .prose-list li::marker { color: var(--fx); }
.fx-unsolved li::marker { content: '? '; }
.fx-example { border-left: 1px dashed var(--border-strong); padding-left: 1rem; }
.fx-detail-side { display: grid; gap: 1rem; position: sticky; top: calc(var(--nav-h) + 16px); }
.fx-side-card { margin: 0; padding: 1.1rem; }
.fx-side-card .card-h { font-size: 0.95rem; margin-bottom: 0.6rem; }
.fx-side-card p { color: var(--text-dim); font-size: 0.92rem; }
.fx-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; font-size: 0.95rem; }
.fx-links .fx-status { font-size: 0.6rem; padding: 0.2rem 0.35rem; margin-left: 0.3rem; }
.fx-say { border-top: 3px solid var(--fx); }
.fx-pager { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.fx-pager a { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 0.2rem 0.9rem; padding: 0.8rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); text-decoration: none; font-weight: 600; min-width: 0; overflow-wrap: anywhere; transition: border-color 0.15s var(--ease), color 0.15s var(--ease); }
.fx-pager a:hover, .fx-pager a:focus-visible { border-color: var(--fx); color: var(--fx); }
.fx-pager .fx-glyph { width: 52px; height: 52px; grid-row: span 2; }
.fx-pager a[rel="prev"] { grid-template-columns: 52px minmax(0, 1fr); }
.fx-pager a[rel="next"] { grid-template-columns: minmax(0, 1fr) 52px; text-align: right; }
.fx-pager a[rel="next"] .fx-glyph { grid-column: 2; grid-row: 1 / span 2; }
.fx-pager a[rel="next"] span { grid-column: 1; grid-row: 1; }
.fx-pager a:nth-child(2) { text-align: center; }
.fx-pager span { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); }

.fx-print-qr { display: none; }

/* ---- Narrow screens ---- */
@media (max-width: 991px) {
  .fx-section { margin: 4.5rem 0; }
  .fx-hero { min-height: 0; padding-top: 3rem; }
  .fx-hero-copy { max-width: none; }
  .fx-field { opacity: 0.3; }
  .fx-featured { grid-template-columns: minmax(0, 1fr); }
  .fx-feature:first-child { grid-row: auto; }
  .fx-leg { grid-template-columns: 3rem minmax(0, 1fr); }
  .fx-chips { grid-column: 2; }
  .fx-detail-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .fx-detail-side { position: static; }
  .fx-detail-fig { opacity: 0.4; width: 70%; }
  .fx-detail-fig:has(img) { position: relative; opacity: 1; width: min(62vw, 300px); aspect-ratio: 1; margin: 0.5rem 0 0.2rem -0.6rem; }
  .fx-detail-fig img.fx-glyph { object-position: center; padding-bottom: 0; }
}
@media (max-width: 640px) {
  .fx-section { margin: 3.4rem 0; }
  .fx-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-strip > div { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); }
  .fx-strip > div:nth-child(-n+2) { border-top: 0; }
  .fx-strip > div:last-child { grid-column: 1 / -1; }
  .fx-feature, .fx-feature:first-child { grid-template-columns: minmax(0, 1fr); grid-template-rows: 150px auto; }
  .fx-feature-fig { min-height: 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .fx-layer { grid-template-columns: 2.2rem minmax(0, 1fr); padding-left: 1.1rem; }
  .fx-layer-text { grid-column: 2; }
  .fx-quotes { grid-template-columns: minmax(0, 1fr); }
  .fx-pair { grid-template-columns: minmax(0, 1fr); }
  .fx-legend-list > div { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
  .fx-detail-head { min-height: 0; }
  .fx-pager { grid-template-columns: minmax(0, 1fr); }
  .fx-pager a:nth-child(2) { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-card, .fx-feature, .fx-layer, .fx-sig g, img.fx-glyph, .fx-field-still, .fx-field canvas, .fx-js .fx-section, .fx-js .fx-section > .sec-title::after { transition: none; }
  .fx-card:hover .fx-sig g, .fx-chip a:hover .fx-sig g, .fx-feature:hover .fx-sig g, .fx-pager a:hover .fx-sig g { transform: none; }
}

/* ---- Print: a clean summary on white, with the address as a QR code ---- */
@media print {
  .navbar-custom, .footer-custom, .skip-link, .fx-filters, .fx-filter-status, .fx-share, .page-actions, .fx-pager,
  .fx-field, .fx-field-areas, .fx-hero-cap, .fx-closing-field, .fx-detail-fig, .fx-feature-fig, .fx-say, .fx-legend, .palette, .copy-btn { display: none !important; }
  html, body, .main-content { background: #fff !important; color: #111 !important; }
  .fx-page { --fx: #111; color: #111; }
  .fx-page *, .fx-page *::before { color: #111 !important; background: transparent !important; border-color: #999 !important; box-shadow: none !important; animation: none !important; }
  .fx-page a { text-decoration: underline; background-image: none !important; }
  .fx-hero { display: block; min-height: 0; padding: 0 0 1rem; }
  .fx-detail-head { min-height: 0; }
  .fx-hero-title, .page-title { font-size: 26pt !important; }
  .fx-section { margin: 1.5rem 0; opacity: 1 !important; transform: none !important; }
  .fx-card, .fx-feature, .fx-scenario, .fx-block, .fx-layer, .fx-leg, .detail-card { break-inside: avoid; }
  .fx-cards, .fx-featured, .fx-scenarios { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-feature, .fx-feature:first-child { display: block; grid-row: auto; }
  .fx-detail-layout { display: block; }
  .fx-detail-side { position: static; margin-top: 1rem; }
  details.fx-ledger > *:not(summary) { display: none; }
  .fx-print-qr { display: flex; align-items: center; gap: 1rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #999; font-family: var(--font-mono); font-size: 10pt; break-inside: avoid; }
  .fx-print-qr svg { width: 28mm; height: 28mm; }
}

/* Cards, chips and feature titles are whole-block links: no text-link underline or hover fill from the site's prose rule. */
.main-content .fx-page .fx-card-link, .main-content .fx-page .fx-card-link:hover,
.main-content .fx-page .fx-chip a, .main-content .fx-page .fx-chip a:hover,
.main-content .fx-page .fx-feature .tile-more, .main-content .fx-page .fx-feature .tile-more:hover,
.main-content .fx-page .fx-feature-name a, .main-content .fx-page .fx-feature-name a:hover { background-image: none; padding-bottom: 0; }
.main-content .fx-page .fx-card-link, .main-content .fx-page .fx-card-link:hover { color: inherit; }
.main-content .fx-page .fx-chip a { color: var(--text); padding: 0.28rem 0.75rem 0.28rem 0.28rem; }
.main-content .fx-page .fx-chip a:hover, .main-content .fx-page .fx-chip a:focus-visible { color: var(--fx); }
.main-content .fx-page .fx-feature-name a { color: var(--text); }
.main-content .fx-page .fx-feature:hover .fx-feature-name a, .main-content .fx-page .fx-feature-name a:focus-visible { color: var(--fx); }
.main-content .fx-page .fx-feature .tile-more { color: var(--text); align-self: flex-start; }
.main-content .fx-page .fx-feature:hover .tile-more { color: var(--fx); }
