/* ==========================================================================
   03 Features — bento grid of hairline cells with live mini-visuals
   ========================================================================== */
#features .fe-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(340px, auto);
}
#features .fe-a { grid-column: 1 / 3; grid-row: 1 / 3; }
#features .fe-b { grid-column: 3; grid-row: 1; }
#features .fe-c { grid-column: 4; grid-row: 1; }
#features .fe-d { grid-column: 3 / 5; grid-row: 2; }
#features .fe-e { grid-column: 1; grid-row: 3; }
#features .fe-f { grid-column: 2; grid-row: 3; }
#features .fe-g { grid-column: 3 / 5; grid-row: 3; }

#features .fe-cell {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 24px; padding: var(--pad);
}
#features .fe-vis { position: relative; flex: 1; display: grid; place-items: center; min-height: 150px; z-index: 1; }
#features .fe-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
#features .fe-copy h3 + p { margin-top: 8px; }
#features .fe-copy p { max-width: 400px; }
#features .fe-ic { display: inline-flex; }
#features .fe-ok { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; flex: none; }
#features .fe-stat { display: grid; gap: 2px; margin-top: auto; }
#features .fe-stat .mono { color: var(--text-2); }
#features .fe-stat b { font-size: clamp(30px, 3vw, 40px); font-weight: 400; letter-spacing: -0.05em; line-height: 1.1; color: var(--text); }
#features .fe-gl {
  width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm);
  font-size: 10px; font-weight: 600; color: var(--text);
  background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line-2);
}

/* cursor spotlight */
#features .fe-spot {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease-out);
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.045), transparent 65%);
}
#features .fe-spot::after {
  content: ""; position: absolute; inset: 0; padding: 1px; border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.28), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
#features .fe-cell:hover .fe-spot { opacity: 1; }

/* ---------- A · autonomous agents ---------- */
#features .fe-a { justify-content: flex-end; min-height: 600px; }
/* exploded stack of agent plates (inline SVG, see features.html). Neutral line work with gradient edges; the running
   step is the one red plate. --ex is the plate spacing in SVG units: features.js scrubs it open on scroll. */
#features .fe-a-vis {
  position: absolute; left: 0; right: 0; top: 0; height: 74%; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent);
}
#features .fe-st { --ex: 48; display: block; width: 100%; height: 100%; overflow: visible; }
#features .fe-st * { transform-box: view-box; }
#features .fe-st-move { transform: translateY(calc(var(--i) * var(--ex) * 1px)); }
#features .fe-st-lift { transition: transform .9s var(--ease-out); }
#features .fe-st-p.is-on .fe-st-lift { transform: translate(10px, -6px); }
#features .fe-st-float { animation: fe-st-float 7s var(--ease-in-out) infinite alternate; animation-delay: calc(var(--i) * -1.3s); }
@keyframes fe-st-float { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
#features .fe-st-under { fill: #060607; stroke: #fff; stroke-opacity: .1; }
#features .fe-st-wall { stroke: #fff; stroke-opacity: .2; }
#features .fe-st-face { fill: url(#fa-face); fill-opacity: .94; stroke: url(#fa-edge); }
#features .fe-st-heat { fill: url(#fa-face-r); stroke: url(#fa-edge-r); stroke-width: 1.2; opacity: 0; transition: opacity .7s var(--ease-out); }
#features .fe-st-inset { fill: none; stroke: #fff; stroke-opacity: .09; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
#features .fe-st-tone { opacity: 0; transition: opacity .7s var(--ease-out); }
#features .fe-st-leds rect { fill: #fff; fill-opacity: .12; transition: fill .5s, fill-opacity .5s; }
#features .fe-st-led { fill: #fff; fill-opacity: .28; transition: fill .5s, fill-opacity .5s; }
/* the logo's dot goes neutral here: the running plate is the stack's one red mark */
#features .fe-st-logo { color: #ededed; opacity: .92; --logo-dot: #ededed; }
#features .fe-st-now { font-variant-numeric: tabular-nums; }
#features .fe-st-p.is-on .fe-st-heat { opacity: 1; }
#features .fe-st-p.is-on .fe-st-tone { opacity: .7; }
#features .fe-st-p.is-on .fe-st-leds rect { fill: #ff8a76; fill-opacity: .5; }
#features .fe-st-p.is-on .fe-st-led { fill: var(--accent); fill-opacity: 1; }
#features .fe-st-gl, #features .fe-st-gf { fill: none; stroke: url(#fa-guide); stroke-dasharray: 2 4; }
/* gradient strokes scale with the SVG (no non-scaling-stroke): Chrome paints a gradient on a non-scaling stroke for
   the scroll position it was painted at, so static (reduced-motion) frames showed the edges lit from the wrong side */
#features .fe-st-face, #features .fe-st-heat, #features .fe-st-gl, #features .fe-st-gf, #features .fe-st-lbl path { vector-effect: none; }
#features .fe-st-guides path { transform-origin: 50% 0; transform-box: fill-box; transform: scaleY(calc(var(--ex) / 48)); }
#features .fe-st-gf { stroke-dasharray: none; stroke-opacity: .5; }
/* leader labels */
#features .fe-st-lbl path { fill: none; }
#features .fe-st-lbl circle { fill: #fff; fill-opacity: .3; transition: fill-opacity .5s; }
#features .fe-st-lbl text {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; white-space: pre;
  fill: #ededed; fill-opacity: .42; transition: fill-opacity .5s;
}
#features .fe-st-lbl.is-on text { fill-opacity: 1; }
#features .fe-st-lbl.is-on circle { fill-opacity: .9; }
/* soft neutral light behind the stack */
#features .fe-a::before {
  content: ""; position: absolute; z-index: 0; left: 50%; top: 4%; width: min(70%, 480px); aspect-ratio: 1; translate: -38% 0; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.035), transparent 64%); filter: blur(20px);
}
#features .fe-a-chips { position: absolute; z-index: 2; top: var(--pad); right: var(--pad); display: grid; justify-items: end; gap: 8px; }
#features .fe-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: var(--r-pill);
  font-size: 12.5px; color: var(--text); background: rgba(10,10,10,.6); box-shadow: inset 0 0 0 1px var(--line-2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#features .fe-a .fe-copy { gap: 22px; }
#features .fe-a .h3 { font-size: clamp(28px, 2.6vw, 38px); }
#features .fe-a .fe-copy p { max-width: 440px; }

/* ---------- B · multi-model ---------- */
#features .fe-models { align-content: center; gap: 18px; }
#features .fe-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 280px; }
#features .fe-model {
  height: 30px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: var(--r-pill);
  font-size: 12.5px; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); background: rgba(255,255,255,.015);
  transition: color .5s, background .5s, box-shadow .5s;
}
#features .fe-model.is-on {
  color: #0a0a0a; background: #ededed; box-shadow: inset 0 0 0 1px #ededed;
}
#features .fe-route { display: inline-flex; align-items: center; gap: 8px; }
#features .fe-route::before { content: ""; width: 18px; height: 1px; background: var(--line-3); }
#features .fe-route .faint { color: var(--text-2); }
#features .fe-route b { font-weight: 400; color: var(--text); }

/* ---------- C · security ---------- */
#features .fe-shield { min-height: 170px; }
#features .fe-ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: inset 0 0 0 1px var(--line); }
#features .fe-ring.r1 { width: 104px; height: 104px; box-shadow: inset 0 0 0 1px var(--line-2); }
#features .fe-ring.r2 { width: 160px; height: 160px; box-shadow: none; border: 1px dashed var(--line-2); animation: fe-spin 40s linear infinite; }
#features .fe-ring.r3 { width: 220px; height: 220px; animation: fe-spin 18s linear infinite reverse; }
#features .fe-ring.r3::after { content: ""; position: absolute; left: 50%; top: -2.5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 6px var(--accent-glow); }
@keyframes fe-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
#features .fe-shield-tile {
  position: relative; width: 64px; height: 64px; display: grid; place-items: center; border-radius: var(--r-lg); color: var(--text);
  background: linear-gradient(180deg, var(--bg-4), var(--bg-3));
  box-shadow: inset 0 0 0 1px var(--line-3), inset 0 1px 0 rgba(255,255,255,.08), 0 16px 40px -12px rgba(0,0,0,.9);
}
#features .fe-shield-tile svg { width: 30px; height: 30px; }
#features .fe-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- D · real-time sync ---------- */
#features .fe-d { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 28px; }
#features .fe-d .fe-copy, #features .fe-g .fe-copy { height: 100%; }
#features .fe-sync { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; place-items: initial; align-items: center; align-content: center; }
#features .fe-sync-src, #features .fe-sync-lines { display: grid; grid-template-rows: repeat(4, 34px); gap: 12px; }
#features .fe-node {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 7px; border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--text); background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line-2); white-space: nowrap;
}
#features .fe-sync-lines { position: relative; }
#features .fe-sync-lines::after { content: ""; position: absolute; right: 0; top: 17px; bottom: 17px; width: 1px; background: var(--line-2); }
#features .fe-line { position: relative; overflow: hidden; }
#features .fe-line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line-2); }
#features .fe-line i { position: absolute; inset: 0; animation: fe-pulse 2.8s var(--ease-in-out) infinite; animation-delay: var(--d); }
#features .fe-line i::after {
  content: ""; position: absolute; left: -48px; top: 50%; width: 48px; height: 2px; margin-top: -1px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(237,237,237,.7) 70%, #fff); box-shadow: 0 0 10px rgba(255,255,255,.35);
}
@keyframes fe-pulse { from { transform: translateX(0); } to { transform: translateX(calc(100% + 48px)); } }
#features .fe-sync-core { position: relative; display: grid; justify-items: center; gap: 8px; padding-left: 22px; color: var(--text-2); }
#features .fe-sync-core::before { content: ""; position: absolute; left: 0; top: 26px; width: 22px; height: 1px; background: var(--line-2); }
#features .fe-core {
  width: 52px; height: 52px; border-radius: var(--r); display: grid; place-items: center; color: var(--text);
  background: linear-gradient(180deg, var(--bg-4), var(--bg-3));
  box-shadow: inset 0 0 0 1px var(--line-3), inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 6px rgba(255,255,255,.025), 0 16px 40px -12px rgba(0,0,0,.9);
}
/* real Redloop mark (its own red dot is the tile's one red signal) */
#features .fe-core .logo-mark { width: 26px; height: auto; }

/* ---------- E · human in the loop ---------- */
#features .fe-card {
  width: 100%; max-width: 250px; display: grid; gap: 12px; padding: 14px; border-radius: var(--r); font-size: 12px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2)); box-shadow: inset 0 0 0 1px var(--line-2), 0 24px 50px -24px rgba(0,0,0,.9);
}
#features .fe-card-h { display: flex; align-items: center; gap: 10px; }
#features .fe-card-h > span:nth-child(2) { display: grid; line-height: 1.3; flex: 1; min-width: 0; }
#features .fe-card-h b { color: var(--text); font-weight: 500; font-size: 13px; }
#features .fe-card-h .mono { font-size: 10px; color: var(--text-2); }
#features .fe-av { width: 26px; height: 26px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; }
#features .fe-card-b { display: grid; gap: 2px; padding: 10px 0; border-block: 1px solid var(--line); }
#features .fe-card-b b { font-size: 22px; font-weight: 400; letter-spacing: -0.04em; color: var(--text); }
/* buttons and the "approved" pill share one slot; each state fully leaves before the other arrives */
#features .fe-card-a, #features .fe-card-done { grid-area: 4 / 1; transition: opacity .32s var(--ease-out) .26s, transform .32s var(--ease-out) .26s; }
#features .fe-card-done { transition-duration: .22s; transition-delay: 0s; }
#features .fe-card-a { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#features .fe-btn { height: 30px; display: grid; place-items: center; border-radius: 6px; background: #ededed; color: #0a0a0a; font-weight: 500; font-size: 12px; transition: transform .3s var(--ease-out), background .15s, box-shadow .3s; }
#features .fe-btn.ghost { background: #0a0a0a; color: #ededed; box-shadow: 0 0 0 1px #2e2e2e; }
#features .fe-btn.is-press { transform: scale(.96); background: #cccccc; box-shadow: 0 0 0 4px rgba(237,237,237,.12); }
#features .fe-card-done { display: flex; align-items: center; justify-content: center; gap: 8px; height: 30px; border-radius: var(--r-sm); color: #7cf0b5; background: rgba(62,224,143,.08); box-shadow: inset 0 0 0 1px rgba(62,224,143,.22); opacity: 0; transform: translateY(6px); font-size: 10px; }
#features .fe-card.is-done .fe-card-a { opacity: 0; transform: translateY(-6px); transition-duration: .22s; transition-delay: 0s; }
#features .fe-card.is-done .fe-card-done { opacity: 1; transform: none; transition-duration: .32s; transition-delay: .26s; }

/* ---------- F · observability ---------- */
#features .fe-obs { align-content: end; justify-items: stretch; place-items: initial; display: grid; gap: 14px; }
#features .fe-obs-h { display: flex; justify-content: space-between; align-items: baseline; }
#features .fe-obs-h b { font-size: 22px; font-weight: 400; letter-spacing: -0.04em; color: var(--text); }
#features .fe-obs-bars {
  height: 120px; display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--line-2);
  background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 25%;
}
#features .fe-obs-bars i {
  flex: 1; height: 100%; border-radius: 2px 2px 0 0; transform-origin: 50% 100%; transform: scaleY(var(--h));
  background: linear-gradient(180deg, rgba(237,237,237,.46), rgba(237,237,237,.08));
}
/* the chart's one red signal: the p95 spike */
#features .fe-obs-bars i.hot { background: linear-gradient(180deg, var(--accent), rgba(236,63,42,.25)); }

/* ---------- G · integrations orbit ---------- */
#features .fe-g { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 28px; }
#features .fe-orbit { --orb: 280px; min-height: 260px; }
/* hairline orbits (SVG) + node arms (HTML). The arms ride one slow spin; tiles counter-rotate to stay upright.
   One node syncs at a time: its beam lights to the core and its dithered icon turns red. */
#features .fe-orb { --S: calc(var(--orb) * 1.2); position: relative; width: var(--S); height: var(--S); flex: none; }
#features .fe-orb-rings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* view-box origin is the SVG (0,0), which is the orbit centre here */
#features .fe-orb-rings * { transform-box: view-box; transform-origin: 0 0; }
#features .fe-orb-r { fill: none; stroke: #fff; stroke-opacity: .12; vector-effect: non-scaling-stroke; }
#features .fe-orb-r.dash { stroke-dasharray: 2 4; stroke-opacity: .16; }
#features .fe-orb-dial path { stroke: #fff; stroke-opacity: .1; vector-effect: non-scaling-stroke; }
#features .fe-orb-dial path.mj { stroke-opacity: .3; }
#features .fe-orb-dial { animation: fe-spin-svg 240s linear infinite reverse; }
#features .fe-orb-cross { stroke: #fff; stroke-opacity: .16; vector-effect: non-scaling-stroke; }
#features .fe-orb-sweep { animation: fe-spin-svg 9s linear infinite; }
#features .fe-orb-sweep path { fill: none; stroke-width: 1.6; stroke-linecap: round; }
@keyframes fe-spin-svg { to { transform: rotate(360deg); } }
#features .fe-orb-spin { position: absolute; inset: 0; animation: fe-orb-spin 120s linear infinite; }
@keyframes fe-orb-spin { to { transform: rotate(360deg); } }
#features .fe-orb-arm {
  position: absolute; left: 50%; top: 50%; width: calc(var(--S) / 2 * var(--r)); height: 0;
  transform-origin: 0 0; transform: rotate(var(--a));
}
#features .fe-orb-node { position: absolute; left: 100%; top: 0; transform: translate(-50%, -50%) rotate(calc(var(--a) * -1)); }
#features .fe-orb-tile {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm);
  background: linear-gradient(180deg, var(--bg-4), var(--bg-3));
  box-shadow: inset 0 0 0 1px var(--line-2), inset 0 1px 0 rgba(255,255,255,.06), 0 10px 24px -10px #000;
  animation: fe-orb-spin 120s linear infinite reverse; transition: box-shadow .6s var(--ease-out);
}
#features .fe-orb-tile .dz { justify-self: center; }
/* nodes keep their neutral ink when the card is hovered; only the syncing node is red */
#features .fe-orb-node .dz { --dz-fill: #e4e4e4; --dz-line: #85858a; --dz-dot: #a4a4a8; --dz-ghost: #333338; }
#features .fe-orb-arm.is-on .dz { --dz-fill: var(--accent); --dz-line: #c2402d; --dz-dot: #e0503a; --dz-ghost: #4a1a13; }
#features .fe-orb-arm.is-on .fe-orb-tile { box-shadow: inset 0 0 0 1px rgba(236,63,42,.5), 0 0 0 4px rgba(236,63,42,.07), 0 10px 24px -10px #000; }
#features .fe-orb-beam {
  position: absolute; left: 32px; right: 22px; top: -.5px; height: 1px; overflow: hidden;
  background: linear-gradient(90deg, rgba(255,255,255,.0), rgba(255,255,255,.12)); transition: background .6s;
}
#features .fe-orb-arm.is-on .fe-orb-beam { background: linear-gradient(90deg, rgba(236,63,42,.05), rgba(236,63,42,.75)); }
#features .fe-orb-beam::after {
  content: ""; position: absolute; top: 0; left: 100%; width: 18px; height: 1px; opacity: 0;
  background: linear-gradient(90deg, #fff, transparent);
}
#features .fe-orb-arm.is-on .fe-orb-beam::after { opacity: 1; animation: fe-orb-pkt 1.1s var(--ease-in-out) infinite; }
@keyframes fe-orb-pkt { from { left: 100%; } to { left: -18px; } }
#features .fe-orb-core { position: absolute; left: 50%; top: 50%; translate: -50% -50%; }
/* neutral light behind the orbit */
#features .fe-orbit::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: calc(var(--orb) * 1.2); aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.03), transparent 62%); pointer-events: none;
}

/* ---------- responsive ---------- */
@media (max-width: 1199px) {
  #features .fe-orbit { --orb: 248px; }
}
@media (max-width: 1100px) {
  #features .fe-orbit { min-height: calc(var(--orb) * 1.18 + 40px); }
  #features .fe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  #features .fe-grid > * { grid-column: auto; grid-row: auto; min-height: 320px; }
  #features .fe-a, #features .fe-d, #features .fe-g { grid-column: 1 / -1; }
  #features .fe-a { min-height: 560px; }
  #features .fe-a-vis { height: 76%; }
}
@media (max-width: 767px) {
  #features .fe-grid { grid-template-columns: 1fr; }
  #features .fe-grid > * { min-height: 0; }
  #features .fe-a { min-height: 560px; }
  #features .fe-a-vis { top: 60px; height: auto; aspect-ratio: 640 / 500; }
  /* no leader labels on phones: centre the stack instead */
  #features .fe-st-lbls { display: none; }
  #features .fe-st { translate: -8% 0; }
  /* the stack renders at ~0.55x here: thicken its scaling gradient edges back to ~1px */
  #features .fe-st-face, #features .fe-st-gl, #features .fe-st-gf { stroke-width: 1.8; }
  #features .fe-st-heat { stroke-width: 2.2; }
  #features .fe-d, #features .fe-g { grid-template-columns: 1fr; }
  #features .fe-d .fe-vis { order: -1; }
  #features .fe-g .fe-vis { order: -1; }
  #features .fe-stat { margin-top: 4px; }
  #features .fe-vis { min-height: 170px; }
  #features .fe-orbit { --orb: 240px; min-height: calc(var(--orb) * 1.18 + 32px); }
  #features .fe-node { font-size: 12px; padding-right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  #features .fe-ring.r2, #features .fe-ring.r3, #features .fe-line i, #features .fe-st-float,
  #features .fe-orb-dial, #features .fe-orb-sweep, #features .fe-orb-spin, #features .fe-orb-tile, #features .fe-orb-beam::after { animation: none; }
  #features .fe-st-lift, #features .fe-st-heat, #features .fe-st-tone { transition: none; }
}
