/* Features page (features.html). Uses the tokens from landing.css; everything here is prefixed fx2- so it cannot touch other pages.
   Motion: sections reveal as they scroll into view (features.js adds .in); with prefers-reduced-motion, or no JS, everything simply shows. */

html:has(.fx2) { scroll-padding-top: 78px; }
.fx2-page { max-width: 1120px; }
.fx2 { width: 100%; margin: 0 auto; padding-bottom: 20px; }

/* ---------- scroll progress ---------- */
.fx2-bar { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 50; pointer-events: none; }
.fx2-bar i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }

/* ---------- reveal on scroll ---------- */
.fx-js .fx2-r { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.fx-js .fx2-r.in { opacity: 1; transform: none; }

/* ---------- shared bits ---------- */
.fx2-kicker { margin: 0 0 10px; font: 500 12.5px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.fx2-kicker .badge-beta { margin-left: 6px; vertical-align: 1px; }
.fx2-lead { margin: 18px 0 0; max-width: 34em; color: var(--muted); font-size: 18px; line-height: 1.6; }
.fx2-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 28px; }
.fx2-cta.center { justify-content: center; }
.fx2-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
.fx2-ico svg { width: 20px; height: 20px; }
.fx2-small { margin: 14px 0 0; color: var(--muted); font-size: 14px; text-align: center; }
.fx2-note { margin: 22px 0 0; text-align: center; }

/* ---------- page title ---------- */
.fx2-hero { padding: clamp(28px, 6vh, 64px) 0 clamp(26px, 4vh, 44px); }
.fx2-crumb { display: flex; gap: 8px; align-items: center; margin: 0 0 18px; font: 500 13px var(--font-mono); letter-spacing: .06em; color: var(--muted); }
.fx2-crumb a:hover { color: var(--text); }
.fx2-crumb span { opacity: .5; }
.fx2-hero h1 { margin: 0; font-family: var(--font-display); font-size: clamp(52px, 9vw, 104px); line-height: .98; letter-spacing: -.045em; font-weight: 800; }
.fx2-hero h1::after { content: ""; display: block; width: 72px; height: 7px; margin-top: clamp(16px, 2.6vw, 26px); border-radius: 4px; background: var(--accent); }
.fx2-hero .fx2-lead { margin-top: clamp(16px, 2.6vw, 24px); font-size: clamp(17px, 2vw, 21px); max-width: 30em; }

.fx2-demo { position: relative; background: var(--surface); border: 1.5px solid var(--text); border-radius: 16px; padding: 0 0 4px; box-shadow: 6px 6px 0 var(--border); }
.fx2-demo-head { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1.5px solid var(--border); font: 500 12px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fx2-demo-head i { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.fx2-demo-head span { margin-left: auto; transition: color .4s; }
.fx2-demo-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.fx2-demo-row .fx2-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 16px; transition: color .4s; }
.fx2-demo-row .fx2-size { font: 400 13px var(--font-mono); color: var(--muted); }
.fx2-demo-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px 10px; color: var(--muted); font-size: 13.5px; }
.fx2-demo-foot svg { width: 16px; height: 16px; flex: none; color: var(--accent-text); }
.fx2-demo.enc .fx2-name { font-family: var(--font-mono); font-weight: 500; color: var(--enc); letter-spacing: .02em; }
.fx2-demo.enc .fx2-demo-head span { color: var(--enc); }
.fx2-demo.enc .fx2-demo-foot svg { color: var(--enc); }

/* ---------- facts strip ---------- */
.fx2-facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.fx2-facts li { padding: 18px 20px; display: flex; flex-direction: column; gap: 3px; border-left: 1.5px solid var(--border); }
.fx2-facts li:first-child { border-left: 0; }
.fx2-facts b { font: 800 22px/1.1 var(--font-display); letter-spacing: -.02em; }
.fx2-facts span { color: var(--muted); font-size: 13.5px; line-height: 1.4; }

/* ---------- chapter navigation ---------- */
.fx2-nav { position: sticky; top: 8px; z-index: 30; display: flex; gap: 4px; margin: 26px 0 0; padding: 5px; border: 1.5px solid var(--border); border-radius: 13px; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); overflow-x: auto; scrollbar-width: none; }
.fx2-nav::-webkit-scrollbar { display: none; }
.fx2-nav a { flex: none; padding: 7px 13px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background .2s, color .2s; }
.fx2-nav a:hover { color: var(--text); background: var(--surface); }
.fx2-nav a[aria-current="true"] { background: var(--text); color: var(--bg); }

/* ---------- chapters ---------- */
.fx2-chapter { padding-top: clamp(56px, 9vw, 104px); }
.fx2-head { max-width: 44em; margin-bottom: clamp(24px, 4vw, 40px); }
.fx2-head.split { max-width: none; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); align-items: center; }
.fx2-head-text { max-width: 44em; }
.fx2-head h2 { margin: 0 0 12px; font-family: var(--font-display); font-size: clamp(28px, 4.2vw, 44px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; }
.fx2-head p:not(.fx2-kicker) { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.6; }

/* ---------- encryption steps ---------- */
.fx2-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.fx2-step { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1.05fr); gap: 8px 26px; align-items: center; padding: 22px 22px 22px 0; }
.fx2-step::before { content: ""; position: absolute; left: 21px; top: 0; bottom: -22px; width: 2px; background: var(--border); }
.fx2-step:last-child::before { bottom: 50%; }
.fx2-num { position: relative; z-index: 1; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-fg); font: 800 18px var(--font-display); box-shadow: 0 0 0 6px var(--bg); }
.fx2-step-text h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 21px; letter-spacing: -.02em; line-height: 1.2; }
.fx2-step-text p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.fx2-step-text strong, .fx2-tiles b { color: var(--text); font-weight: 700; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: .92em; }

.fx2-vis { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 20px 16px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; min-height: 124px; }
.fx2-vis .chip { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg); font: 500 12.5px/1.3 var(--font-mono); text-align: center; }
.fx2-vis .chip em { font-style: normal; color: var(--muted); font-size: 11px; }
.fx2-vis .chip svg { width: 14px; height: 14px; margin-bottom: 2px; }
.fx2-vis .chip.hot { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.fx2-vis .chip.enc { background: var(--enc-bg); border-color: color-mix(in srgb, var(--enc) 45%, transparent); color: var(--enc); }
.fx2-vis .chip.enc em { color: inherit; opacity: .8; }
.fx2-vis .chip.big { padding: 12px 18px; font-size: 14px; }
.fx2-vis .arrow { position: relative; width: 26px; height: 2px; background: var(--muted); transform-origin: left; flex: none; }
.fx2-vis .arrow::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--muted); border-right: 0; }
.fx2-vis .fork { display: flex; flex-direction: column; gap: 8px; }
.fx2-vis .fork.up { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.fx2-vis-master { flex-direction: column; }
.fx2-vis-tree { flex-direction: column; }
.fx2-vis-tree .branches { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; position: relative; padding-top: 14px; }
.fx2-vis-tree .branches::before { content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 14px; background: var(--muted); }
.fx2-vis-chunks { gap: 8px; }
.fx2-vis-chunks .blk { position: relative; display: grid; place-items: center; width: 66px; height: 66px; border-radius: 10px; background: var(--enc-bg); border: 1.5px solid color-mix(in srgb, var(--enc) 45%, transparent); color: var(--enc); font: 500 11.5px var(--font-mono); padding-top: 14px; }
.fx2-vis-chunks .blk b { position: absolute; top: 6px; left: 0; right: 0; text-align: center; font: 800 14px var(--font-display); }
.fx2-vis-chunks .blk.end { border-style: dashed; }
.fx2-vis-chunks .cap { flex-basis: 100%; text-align: center; color: var(--muted); font-size: 12.5px; }
.fx2-vis-url { flex-direction: column; gap: 14px; }
.fx2-vis-url .url { background: none; padding: 0; font: 500 clamp(11.5px, 1.6vw, 14px) var(--font-mono); white-space: nowrap; max-width: 100%; overflow: hidden; }
.fx2-vis-url .u-host { color: var(--muted); }
.fx2-vis-url .u-id { color: var(--text); }
.fx2-vis-url .u-hash { color: var(--accent-fg); background: var(--accent); border-radius: 5px; padding: 2px 5px; }
.fx2-vis-url .url-notes { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font: 400 12.5px var(--font-body); }
.fx2-vis-url .url-notes i { font-style: normal; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.fx2-vis-url .url-notes i::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.fx2-vis-url .url-notes .n-kept { color: var(--accent-text); font-weight: 600; }
.fx2-vis-url .url-notes .n-kept::before { background: var(--accent); }

/* diagram parts appear one after another once their step is visible */
.fx-js .fx2-step .fx2-vis > * { opacity: 0; transform: translateY(8px) scale(.96); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
.fx-js .fx2-step.in .fx2-vis > * { opacity: 1; transform: none; }
.fx-js .fx2-step.in .fx2-vis > :nth-child(1) { transition-delay: .25s; }
.fx-js .fx2-step.in .fx2-vis > :nth-child(2) { transition-delay: .4s; }
.fx-js .fx2-step.in .fx2-vis > :nth-child(3) { transition-delay: .55s; }
.fx-js .fx2-step.in .fx2-vis > :nth-child(4) { transition-delay: .7s; }
.fx-js .fx2-step.in .fx2-vis > :nth-child(5) { transition-delay: .85s; }
.fx-js .fx2-step .fx2-vis .arrow { transform: scaleX(0); }
.fx-js .fx2-step.in .fx2-vis .arrow { transform: scaleX(1); }

/* ---------- what we can / cannot see ---------- */
.fx2-see { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: clamp(30px, 5vw, 56px); }
.fx2-see > div { padding: 24px; border: 1.5px solid var(--border); border-radius: 16px; background: var(--surface); }
.fx2-see h3 { margin: 0 0 12px; font-family: var(--font-display); font-size: 19px; letter-spacing: -.02em; }
.fx2-see ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.fx2-see li { position: relative; padding-left: 26px; color: var(--muted); font-size: 15px; }
.fx2-see li::before { content: ""; position: absolute; left: 3px; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .6; }
.see-cannot { border-color: color-mix(in srgb, var(--enc) 50%, var(--border)) !important; background: color-mix(in srgb, var(--enc-bg) 70%, var(--surface)) !important; }
.see-cannot h3 { color: var(--enc); }
.see-cannot li { color: var(--text); }
.see-cannot li::before { width: 14px; height: 14px; top: .3em; left: 0; border-radius: 4px; background: var(--enc); opacity: 1; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.fx-js .fx2-see li { opacity: 0; transform: translateX(-8px); transition: opacity .45s ease, transform .45s ease; }
.fx-js .fx2-see.in li { opacity: 1; transform: none; }
.fx-js .fx2-see.in li:nth-child(1) { transition-delay: .2s; }
.fx-js .fx2-see.in li:nth-child(2) { transition-delay: .3s; }
.fx-js .fx2-see.in li:nth-child(3) { transition-delay: .4s; }
.fx-js .fx2-see.in li:nth-child(4) { transition-delay: .5s; }
.fx-js .fx2-see.in li:nth-child(5) { transition-delay: .6s; }

.fx2-why { margin-top: 16px; padding: 26px 28px; border: 1.5px solid var(--border); border-left: 5px solid var(--accent); border-radius: 16px; background: var(--surface); }
.fx2-why h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 21px; letter-spacing: -.02em; }
.fx2-why p { margin: 0 0 14px; color: var(--muted); max-width: 46em; }
.fx2-why ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); }
.fx2-why li strong { color: var(--text); }

/* ---------- tile grids ---------- */
.fx2-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.fx2-tiles.three { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.fx2-tiles article { padding: 22px; border: 1.5px solid var(--border); border-radius: 16px; background: var(--surface); transition: transform .2s, border-color .2s, box-shadow .2s; }
.fx2-tiles article:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 5px 0 color-mix(in srgb, var(--accent) 35%, transparent); }
.fx2-tiles svg { width: 24px; height: 24px; color: var(--accent-text); margin-bottom: 12px; }
.fx2-tiles h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 17.5px; letter-spacing: -.015em; }
.fx2-tiles p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.fx2-tiles.honest article { border-style: dashed; }

/* ---------- feature rows ---------- */
.fx2-rows { display: grid; border-top: 1.5px solid var(--border); }
.fx2-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px 20px; align-items: center; padding: 22px 6px; border-bottom: 1.5px solid var(--border); transition: background .2s; }
.fx2-row:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.fx2-row h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 18.5px; letter-spacing: -.02em; }
.fx2-row p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 40em; }
.fx2-row code { align-self: start; white-space: nowrap; color: var(--accent-text); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---------- desktop sync diagram ---------- */
.fx2-sync { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 3vw, 30px); margin-bottom: 18px; padding: clamp(20px, 4vw, 34px); border: 1.5px solid var(--border); border-radius: 18px; background: var(--surface); }
.fx2-sync .side { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.fx2-sync .side .fx2-ico { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 4px; }
.fx2-sync .side .fx2-ico svg { width: 28px; height: 28px; }
.fx2-sync .side b { font-family: var(--font-display); font-size: 17px; }
.fx2-sync .side span:last-child { color: var(--muted); font-size: 13.5px; }
.fx2-sync .pipe { position: relative; flex: 1 1 140px; max-width: 280px; height: 44px; border-top: 2px dashed var(--border); border-bottom: 2px dashed var(--border); overflow: hidden; display: flex; align-items: center; }
.fx2-sync .pipe i { position: absolute; left: -14px; width: 12px; height: 12px; border-radius: 3px; background: var(--enc); animation: fx2-flow 3.2s linear infinite; }
.fx2-sync .pipe i:nth-child(2) { animation-delay: 1.05s; background: var(--accent); }
.fx2-sync .pipe i:nth-child(3) { animation-delay: 2.1s; }
.fx2-sync .pipe em { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 2px 9px; background: var(--surface); font: 500 11.5px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--enc); }
@keyframes fx2-flow { from { left: -14px; } to { left: 100%; } }

/* ---------- plans ---------- */
.fx2-plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.fx2-plans a { display: flex; flex-direction: column; gap: 2px; padding: 20px; border: 1.5px solid var(--border); border-radius: 16px; background: var(--surface); transition: transform .2s, border-color .2s, box-shadow .2s; }
.fx2-plans a:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 5px 0 color-mix(in srgb, var(--accent) 35%, transparent); }
.fx2-plans b { font: 800 30px/1.1 var(--font-display); letter-spacing: -.03em; white-space: nowrap; }
.fx2-plans span { font-weight: 600; color: var(--accent-text); }
.fx2-plans em { margin-top: 8px; font: 400 12.5px var(--font-mono); color: var(--muted); font-style: normal; }

/* ---------- finale ---------- */
.fx2-final { margin: clamp(60px, 9vw, 110px) 0 30px; padding: clamp(30px, 6vw, 60px) 24px; text-align: center; border: 1.5px solid var(--text); border-radius: 22px; background: var(--surface); box-shadow: 6px 6px 0 var(--border); }
.fx2-final h2 { margin: 0 0 8px; font-family: var(--font-display); font-size: clamp(28px, 4.4vw, 46px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; }
.fx2-final p { margin: 0; color: var(--muted); font-size: 17px; }

/* ---------- smaller screens ---------- */
@media (max-width: 880px) {
  .fx2-head.split { grid-template-columns: minmax(0, 1fr); }
  .fx2-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx2-facts li:nth-child(3) { border-left: 0; }
  .fx2-facts li:nth-child(n + 3) { border-top: 1.5px solid var(--border); }
  .fx2-step { grid-template-columns: 44px minmax(0, 1fr); column-gap: 16px; padding-right: 0; }
  .fx2-step .fx2-vis { grid-column: 2; }
  .fx2-see { grid-template-columns: minmax(0, 1fr); }
  .fx2-row { grid-template-columns: 40px minmax(0, 1fr); }
  .fx2-row code { grid-column: 2; justify-self: start; }
  .fx2-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .fx2-sync { flex-direction: column; }
  .fx2-sync .pipe { flex: none; width: 2px; height: 64px; max-width: none; border: 0; border-left: 2px dashed var(--border); overflow: visible; }
  .fx2-sync .pipe em { white-space: nowrap; }
  .fx2-sync .pipe i { display: none; }
  .fx2-vis .arrow { width: 2px; height: 20px; }
  .fx2-vis .arrow::after { right: -4px; top: auto; bottom: -1px; border: 5px solid transparent; border-top: 7px solid var(--muted); border-bottom: 0; border-left-color: transparent; }
  .fx2-step-text h3 { font-size: 19px; }
  .fx2-vis-keys { flex-direction: column; }
}

/* ---------- reduced motion: everything just shows ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-js .fx2-r, .fx-js .fx2-step .fx2-vis > *, .fx-js .fx2-see li { opacity: 1; transform: none; transition: none; }
  .fx-js .fx2-step .fx2-vis .arrow { transform: none; }
  .fx2-sync .pipe i { animation: none; left: 45%; }
  .fx2-sync .pipe i:nth-child(2), .fx2-sync .pipe i:nth-child(3) { display: none; }
  .fx2-tiles article, .fx2-plans a, .fx2-nav a { transition: none; }
}
