/* Home hero — "Live router": your tools → freemodel.in/v1 → every model. SVG wires + light pulses (route.js).
   Only transform / opacity / stroke-dashoffset animate; nothing runs while the hero is off-screen. */
.hx { padding-bottom: 28px; }
.rt { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px) minmax(0, 1fr);
  align-items: center; max-width: 1160px; min-height: 440px; margin: 64px auto 0; padding: 8px 0 24px; }
.rt::before { content: ""; position: absolute; left: 50%; top: 50%; width: 760px; height: 520px; transform: translate(-50%, -50%); z-index: -2; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 22%, transparent), color-mix(in srgb, var(--cyan, #38cfff) 8%, transparent) 55%, transparent); filter: blur(10px); }
.rt-wires { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; overflow: visible; pointer-events: none; }
.rt-wire { fill: none; stroke: color-mix(in srgb, var(--brand) 28%, var(--border-strong)); stroke-width: 1.3; opacity: .9; }
[data-theme="dark"] .rt-wire { stroke: rgba(160, 145, 255, .2); }
.rt-port { fill: var(--surface); stroke: color-mix(in srgb, var(--brand) 55%, transparent); stroke-width: 1.5; }
.rt-wire.dash { stroke-dasharray: 2 6; opacity: .7; }
.rt-pulse { fill: none; stroke: url(#rt-grad); stroke-width: 3; stroke-linecap: round; }
.rt-pulse.glow { stroke-width: 11; opacity: .3; }

/* side columns */
.rt-col { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rt-in { align-items: flex-end; padding-right: 64px; }
.rt-out { align-items: flex-start; padding-left: 64px; }
.rt-node { position: relative; display: inline-flex; align-items: center; gap: 11px; height: 46px; padding: 0 16px 0 7px; border-radius: 15px; max-width: 100%;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  font-size: 14px; font-weight: 600; letter-spacing: -.01em; color: var(--text); white-space: nowrap;
  transition: border-color .35s var(--ease), box-shadow .45s var(--ease), transform .45s var(--ease); }
/* logo tile: tinted initial until the image has loaded, then a white tile with the logo (never an empty box) */
.rt .lg { position: relative; flex-shrink: 0; display: grid; place-items: center; overflow: hidden; border-radius: 10px;
  background: color-mix(in srgb, var(--brand) 13%, var(--bg-2)); border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--border)); transition: background-color .3s, border-color .3s, box-shadow .4s var(--ease); }
.rt .lg .ini { font-size: 13px; font-weight: 700; line-height: 1; color: color-mix(in srgb, var(--brand) 75%, var(--text)); transition: opacity .25s; }
.rt .lg img { position: absolute; inset: 0; margin: auto; width: 60%; height: 60%; object-fit: contain; opacity: 0; transition: opacity .3s; }
.rt .lg.ok { background: #fff; border-color: rgba(0, 0, 0, .07); }
.rt .lg.ok img { opacity: 1; }
.rt .lg.ok .ini { opacity: 0; }
.rt .lg.fm { background: none; border: 0; }
.rt .lg.fm img { width: 100%; height: 100%; }
.rt-node .lg { width: 32px; height: 32px; }
.rt-node .nm { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rt-node .pr { margin-left: 4px; font: 500 11.5px var(--font-mono); color: var(--text-3); }
.rt-node.hit { border-color: color-mix(in srgb, var(--brand) 70%, transparent); transform: translateY(-1px);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent), 0 10px 30px -10px color-mix(in srgb, var(--brand) 55%, transparent); }
.rt-out .rt-node.hit { border-color: color-mix(in srgb, var(--mint, #35e0b0) 70%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mint, #35e0b0) 14%, transparent), 0 10px 30px -10px color-mix(in srgb, var(--mint, #35e0b0) 50%, transparent); }
.rt-badge { position: absolute; right: -6px; top: -11px; padding: 3px 8px; border-radius: 999px; font: 600 10.5px var(--font-mono); color: #04281d; background: var(--mint, #35e0b0);
  box-shadow: 0 4px 12px -4px rgba(53, 224, 176, .6); opacity: 0; transform: translateY(4px) scale(.9); transition: opacity .3s, transform .35s var(--ease); pointer-events: none; }
.rt-node.hit .rt-badge { opacity: 1; transform: none; }

/* the core */
.rt-core { position: relative; border-radius: 24px; padding: 1.5px; overflow: hidden; isolation: isolate;
  box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--brand) 60%, transparent), 0 0 0 1px var(--border); transition: box-shadow .5s var(--ease); }
.rt-core::before { content: ""; position: absolute; left: 50%; top: 50%; width: 180%; aspect-ratio: 1; z-index: -1; transform: translate(-50%, -50%) rotate(0deg);
  background: conic-gradient(from 0deg, transparent 0 55%, color-mix(in srgb, var(--brand) 90%, transparent) 70%, var(--cyan, #38cfff) 80%, transparent 92%);
  animation: rtSpin 6s linear infinite; will-change: transform; }
@keyframes rtSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.rt-core.hit { box-shadow: 0 30px 90px -24px color-mix(in srgb, var(--brand) 85%, transparent), 0 0 0 1px color-mix(in srgb, var(--brand) 50%, transparent); }
.rt-core-in { position: relative; border-radius: 22.5px; padding: 18px 20px 16px; background: var(--surface); }
.rt-head { display: flex; align-items: center; gap: 12px; }
.rt-logo { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; flex-shrink: 0; box-shadow: 0 6px 18px -6px rgba(91, 61, 245, .55); }
.rt-logo img { width: 100%; height: 100%; display: block; }
.rt-head b { display: block; font-size: 15.5px; letter-spacing: -.02em; }
.rt-url { display: block; margin-top: 2px; font: 500 12.5px var(--font-mono); color: var(--text-3); }
.rt-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  color: #0a9f78; background: color-mix(in srgb, var(--mint, #35e0b0) 14%, transparent); }
[data-theme="dark"] .rt-pill { color: var(--mint, #35e0b0); }
.rt-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: rtPing 1.8s ease-in-out infinite; }
@keyframes rtPing { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.rt-log { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--code-bg); color: var(--code-text); font: 12.5px/1.75 var(--font-mono); min-height: 104px; }
.rt-log .k { color: #7d8597; display: inline-block; width: 52px; }
.rt-log .m { color: #b79bff; font-weight: 600; }
.rt-log .v { color: #e9e7ff; }
.rt-log .ok { color: #35e0b0; font-weight: 600; }
.rt-log .typ::after { content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: #b79bff; animation: rtCaret 1s steps(2) infinite; }
@keyframes rtCaret { 50% { opacity: 0; } }
.rt-res { opacity: 0; transform: translateY(3px); transition: opacity .3s, transform .3s var(--ease); }
.rt-res.on { opacity: 1; transform: none; }
.rt-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.rt-foot span { padding: 4px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 550; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--border); }

/* tablet */
@media (max-width: 1100px) {
  .rt { grid-template-columns: minmax(0, 1fr) minmax(280px, 330px) minmax(0, 1fr); }
  .rt-in { padding-right: 40px; } .rt-out { padding-left: 40px; }
  .rt-node .pr { display: none; }
}
@media (max-width: 900px) {
  .rt { grid-template-columns: minmax(0, 1fr) minmax(244px, 270px) minmax(0, 1fr); }
  .rt-node { padding-right: 11px; font-size: 12.5px; gap: 9px; }
  .rt-node .lg { width: 28px; height: 28px; }
  .rt-in { padding-right: 22px; } .rt-out { padding-left: 22px; }
  .rt-core-in { padding: 16px 16px 14px; } .rt-log { font-size: 11.5px; padding: 10px 12px; } .rt-log .k { width: 44px; }
}
/* phones: one compact card with a route strip  [tool] ──● [FreeModel] ──● [model]  (route.js) */
.rt-route { display: none; }
@media (max-width: 760px) {
  .rt { display: block; min-height: 0; max-width: 420px; margin-top: 40px; padding: 0 0 18px; }
  .rt::before { width: 130%; height: 80%; top: 46%; }
  .rt-in, .rt-out, .rt-wires { display: none; }
  .rt-core { width: 100%; border-radius: 22px; box-shadow: 0 18px 40px -24px color-mix(in srgb, var(--brand) 65%, transparent), 0 0 0 1px var(--border); }
  .rt-core-in { border-radius: 20.5px; padding: 16px 16px 14px; }
  .rt-logo { width: 36px; height: 36px; border-radius: 11px; }
  .rt-head b { font-size: 15px; }
  .rt-url { font-size: 12px; }

  .rt-route { display: flex; align-items: flex-start; margin-top: 14px; padding: 16px 10px 12px; border-radius: 16px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 6%, var(--bg-2)), var(--bg-2)); border: 1px solid var(--border); }
  .rt-ep { flex: 0 0 84px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: opacity .18s, transform .18s var(--ease); }
  .rt-ep.swap { opacity: 0; transform: translateY(4px) scale(.94); }
  .rt-ep .lg { width: 44px; height: 44px; margin-top: 4px; border-radius: 13px; box-shadow: 0 6px 16px -8px rgba(11, 11, 18, .35); }
  .rt-ep .lg .ini { font-size: 16px; }
  .rt-ep small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; letter-spacing: -.01em; color: var(--text-2); }
  .rt-ep.hub { flex-basis: 64px; }
  .rt-ep.hub .lg { width: 52px; height: 52px; margin: 0; border-radius: 15px;
    box-shadow: 0 10px 24px -8px rgba(91, 61, 245, .7), 0 0 0 5px color-mix(in srgb, var(--brand) 14%, transparent); }
  .rt-ep.hub small { font: 600 11px var(--font-mono); color: var(--text-3); }
  .rt-ep.hit .lg { border-color: color-mix(in srgb, var(--mint, #35e0b0) 80%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--mint, #35e0b0) 18%, transparent), 0 8px 22px -8px color-mix(in srgb, var(--mint, #35e0b0) 70%, transparent); }
  .rt-core.hit .rt-ep.hub .lg { box-shadow: 0 10px 28px -6px rgba(91, 61, 245, .9), 0 0 0 7px color-mix(in srgb, var(--brand) 22%, transparent); }
  .rt-tr { position: relative; flex: 1 1 auto; min-width: 14px; height: 2px; margin: 25px 2px 0; border-radius: 2px;
    background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--brand) 45%, transparent) 0 4px, transparent 4px 8px); }
  .rt-tr i { position: absolute; left: 0; top: -2px; width: 22px; height: 6px; border-radius: 6px; opacity: 0;
    background: linear-gradient(90deg, transparent, #8b74ff 45%, #38cfff); box-shadow: 0 0 12px 1px rgba(91, 140, 255, .8); }

  .rt-log { margin-top: 12px; font-size: 11.5px; line-height: 1.7; min-height: 0; padding: 10px 12px; }
  .rt-log .k { width: 44px; }
  .rt-log .v { word-break: break-all; }
  .rt-foot { margin-top: 10px; }
  .rt-foot span { font-size: 11px; padding: 4px 8px; }
}
@media (max-width: 360px) { .rt-ep { flex-basis: 70px; } .rt-ep .lg { width: 40px; height: 40px; margin-top: 4px; } .rt-ep.hub .lg { width: 48px; height: 48px; } .rt-tr { margin-top: 23px; } }

@media (prefers-reduced-motion: reduce) { .rt-core::before, .rt-pill i, .rt-log .typ::after { animation: none; } }
.rt.rt-off .rt-core::before, .rt.rt-off .rt-pill i { animation-play-state: paused; }
