/* ============================================================
   FRAME V2 — enhancements.css
   Design-polish layer (July 2026):
     · chapter rail (right-edge section index)
     · settlement ticker (simulated corridors strip)
     · leadership quotes re-typeset (humanist, not display caps)
     · light-section schematic plus-marks
     · comparison table: Frame column emphasis
     · integration pipe step indicator
     · interop terminal trace + preset press states
     · precision cursor for the interactive demos
   Pairs with js/enhancements.js. All colour/type from the bound
   FRAME design-system tokens.
   ============================================================ */

/* ---------------- chapter rail ---------------- */
.crail {
  position: fixed; right: clamp(14px, 1.6vw, 26px); top: 50%; transform: translateY(-50%);
  z-index: 290; display: flex; flex-direction: column; gap: 14px; /* below .nav (300) so mega panels cover it */
  mix-blend-mode: difference; /* one colour, readable on light + dark */
}
.crail__item {
  display: flex; align-items: center; justify-content: flex-end; gap: 9px;
  cursor: pointer; color: #fff; opacity: .38;
  transition: opacity .25s;
}
.crail__item:hover, .crail__item.is-active { opacity: 1; }
.crail__label {
  font-family: var(--font-condensed); font-weight: 600; font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase; white-space: nowrap;
  opacity: 0; transform: translateX(6px); transition: opacity .25s, transform .25s;
}
.crail__item:hover .crail__label, .crail__item.is-active .crail__label { opacity: .85; transform: none; }
.crail__num {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}
.crail__tick { width: 14px; height: 1px; background: currentColor; transition: width .25s; }
.crail__item.is-active .crail__tick { width: 26px; }
@media (max-width: 1280px), (max-height: 620px) { .crail { display: none; } }

/* ---------------- settlement ticker (simulated) ---------------- */
.ticker {
  position: relative; display: flex; align-items: stretch; overflow: clip;
  background: var(--ink-900); border-top: 1px solid var(--line-1);
}
.ticker__tag {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 13px var(--gutter) 13px var(--gutter);
  font-family: var(--font-condensed); font-weight: 700; font-size: 12px;
  letter-spacing: .2em; text-transform: uppercase; color: var(--frame-conduit);
  background: var(--ink-900); border-right: 1px solid var(--line-1);
  position: relative; z-index: 2; white-space: nowrap;
}
.ticker__sim {
  font-family: var(--font-mono); font-weight: 500; font-size: 10px;
  letter-spacing: .14em; color: var(--frame-foundry);
  border: 1px solid var(--line-2); padding: 2px 7px;
}
.ticker__belt { flex: 1; overflow: hidden; display: flex; align-items: center; }
.ticker__track {
  display: flex; gap: 0; white-space: nowrap; will-change: transform;
  animation: tickerRoll 90s linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
html.no-motion .ticker__track { animation: none; }
.ticker__item {
  display: inline-flex; align-items: baseline; gap: 9px;
  padding: 13px 26px; border-right: 1px solid var(--line-1);
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .02em;
  color: var(--frame-galvanized); font-variant-numeric: tabular-nums;
}
.ticker__item .c { color: var(--frame-clearspan); font-weight: 500; }
.ticker__item .t { color: var(--frame-conduit); }
.ticker__item .ok { color: var(--status-live, #2E7C6C); }
@keyframes tickerRoll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (max-width: 760px) { .ticker__tag { padding-inline: 16px; } }

/* ---------------- leadership quotes — humanist register ---------------- */
/* the one place on the page that speaks as a person, not a spec sheet */
.leader__quote {
  font-family: var(--font-body); font-weight: 400; text-transform: none;
  font-size: clamp(1.3rem, 1.9vw, 1.75rem); line-height: 1.5; letter-spacing: 0;
  max-width: 38ch;
}
.leader__quote .accent { font-weight: 600; }
.section--light .leader__quote { color: var(--frame-forge); }
.section--light .leader__quote .accent { color: var(--frame-deepwater); }

/* ---------------- light sections — schematic plus-marks ---------------- */
.section--light .gridlines::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cpath d='M64 57v14M57 64h14' stroke='%230F4C81' stroke-opacity='.14' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}

/* ---------------- comparison table — the Frame column is the point ---------------- */
.compare__row .frame-v { box-shadow: inset 3px 0 0 var(--frame-conduit); transition: background .25s; }
.section--light .compare__row .frame-v { box-shadow: inset 3px 0 0 var(--frame-deepwater); }
.compare__row:hover .frame-v { background: rgba(15,76,129,.16); }
.section--light .compare__row:hover .frame-v { background: rgba(15,76,129,.11); }

/* ---------------- integration pipe — step indicator ---------------- */
.pipe__steps { display: flex; gap: 8px; margin-top: 6px; }
.pipe__steps i {
  width: 26px; height: 3px; background: var(--line-2);
  transition: background .35s;
}
.pipe__steps i.is-on { background: var(--frame-conduit); }

/* ---------------- interop — terminal readout + trace ---------------- */
.if-readout__amt { font-family: var(--font-mono); font-weight: 500; letter-spacing: -.01em; }
.if-trace {
  flex-basis: 100%; display: grid; gap: 3px; margin-top: 10px; min-height: 0;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55;
  letter-spacing: .01em; color: var(--frame-foundry); font-variant-numeric: tabular-nums;
}
.if-trace:empty { margin-top: 0; }
.if-trace__ln { display: flex; gap: 12px; align-items: baseline; animation: traceIn .3s ease both; }
.if-trace__ln .ms { color: var(--frame-conduit); flex: none; width: 5.4em; }
.if-trace__ln .ok { margin-left: auto; color: var(--status-live, #2E7C6C); }
@keyframes traceIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
html.no-motion .if-trace__ln { animation: none; }

/* preset chips — tactile press */
.if-preset { transition: border-color .25s, background .25s, color .25s, transform .15s; }
.if-preset:hover { transform: translateY(-1px); }
.if-preset:active { transform: translateY(1px) scale(.985); }

/* ---------------- precision cursor (interactive demos) ---------------- */
@media (pointer: fine) {
  [data-precision], [data-precision] * { cursor: none !important; }
  .pcursor {
    position: fixed; left: 0; top: 0; z-index: 420; pointer-events: none;
    width: 30px; height: 30px; margin: -15px 0 0 -15px; opacity: 0;
    transition: opacity .2s, width .15s, height .15s, margin .15s;
  }
  .pcursor.is-on { opacity: 1; }
  .pcursor::before {
    content: ""; position: absolute; inset: 0; border: 1.2px solid var(--frame-conduit);
    border-radius: 50%; opacity: .9;
  }
  .pcursor::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px;
    margin: -2px 0 0 -2px; background: var(--frame-deepwater); border-radius: 50%;
  }
  .pcursor.is-down { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
}
.pcursor { display: none; }
@media (pointer: fine) { .pcursor { display: block; } }

/* ---------------- magnetic CTAs ---------------- */
.btn[data-magnet] { transition: transform .28s cubic-bezier(.22,.61,.36,1); will-change: transform; }
