/* ═════════════════════════════════════════════════════════════════
   SeaFly Index 4.0 — on top of index3.css (body.x3-ui.x4-ui · prefix x4-). Same warm dashboard palette,
   only what Index 4 adds: forwarder hero, trust row, network hub, transport chain, advantages, dashboard rows.
═════════════════════════════════════════════════════════════════ */

/* ── <b> replaced by spans (SEO: no repeated / long bold tags) — same look as index3.css ── */
.x4 .x4-b { font-weight: 700; }
.x4 .x3-starter .x4-b { display: block; font-weight: 600; font-size: .92rem; }
.x4 .x3-offers .x4-b { display: block; font-size: .95rem; }
.x4 .x3-steps .x4-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--x3-side); border: 1px solid var(--border); font-size: .82rem; font-weight: 700; color: var(--text-1); flex-shrink: 0; }
.x4 p.x4-em { color: var(--text-1); font-weight: 700; }

/* ── hero ── */
body.x4-ui .hero { padding-top: 88px; }
body.x4-ui .hero-content { max-width: 860px; }
.x4-badge { font-size: .78rem; }
h1.x4-title { font-size: clamp(2.2rem, 5.6vw, 3.9rem); letter-spacing: -.045em; line-height: 1.04; margin-bottom: 18px; }
h1.x4-title span { color: var(--text-3); }
h1.x4-title .x4-nb { white-space: nowrap; }
.x4-lead { max-width: 640px; margin-bottom: 14px; }
.x4-anchor { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 0 0 26px; font-size: .9rem; font-weight: 600; color: var(--text-1); }
.x4-anchor span { position: relative; }
.x4-anchor span + span::before { content: ''; position: absolute; left: -9px; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: var(--accent); }
.x4-chatlabel { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: .8rem; font-weight: 600; letter-spacing: .02em; color: var(--accent); }
body.x4-ui #chatInterface:not(.chat-popped) { box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 18px 56px rgba(47,95,224,.12); }

/* ── examples + trust ── */
.x4-start { padding-bottom: 64px; }
.x4-starters .x3-starter { min-height: 64px; }
.x4-starters .x3-starter small { font-style: normal; }
.x4-trust { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
.x4-trust li { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--text-2); }
.x4-trust svg { color: #16a34a; flex-shrink: 0; }

/* ── steps a bit roomier (longer forwarder texts) ── */
.x4-steps li { align-items: flex-start; line-height: 1.5; }
.x4-steps .x4-n { margin-top: 1px; }

/* ── network hub ── */
.x4-net { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.x4-net > * { min-width: 0; }
.x4-hub { position: relative; margin: 0; aspect-ratio: 1; width: 100%; max-width: 480px; justify-self: center; }
.x4-hub-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.x4-hub-lines .ring { fill: none; stroke: var(--border); stroke-width: 1; }
.x4-hub-lines .ring2 { stroke-dasharray: 2 6; }
.x4-hub-lines line { stroke: var(--accent); stroke-opacity: .35; stroke-width: 1.4; stroke-dasharray: 4 7; animation: x4-flow 2.8s linear infinite; }
@keyframes x4-flow { to { stroke-dashoffset: -22; } }
.x4-hub-core { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 32%; aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    background: var(--bg-card); border: 1px solid var(--border-lit); box-shadow: 0 18px 50px rgba(47,95,224,.16), 0 0 0 8px rgba(47,95,224,.05); }
.x4-hub-core img { border-radius: 10px; }
.x4-hub-core .x4-b { font-size: .98rem; letter-spacing: -.02em; }
.x4-hub-core small { font-size: .72rem; color: var(--text-3); }
.x4-node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; width: 30%; text-align: center; font-size: .82rem; font-weight: 600; color: var(--text-1); line-height: 1.25; }
.x4-node span { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--bg-card); border: 1px solid var(--border-lit); box-shadow: 0 6px 18px rgba(28,27,25,.07); color: var(--text-1); transition: transform .3s; }
.x4-node:hover span { transform: translateY(-2px); }
.x4-node.n0 { left: 50%; top: 12.5%; } .x4-node.n1 { left: 82.5%; top: 31.25%; } .x4-node.n2 { left: 82.5%; top: 68.75%; }
.x4-node.n3 { left: 50%; top: 87.5%; } .x4-node.n4 { left: 17.5%; top: 68.75%; } .x4-node.n5 { left: 17.5%; top: 31.25%; }

/* ── transport chain (timeline) ── */
.x4-chain { margin: 8px 0 0; padding: 26px; border-radius: 24px; border: 1px solid var(--border); background: var(--bg-card); box-shadow: 0 18px 50px rgba(28,27,25,.06); }
.x4-chain-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 26px; font-size: .92rem; }
.x4-chain-head span { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.x4-chain-head .x4-route { color: var(--text-2); font-weight: 500; }
.x4-chain-head em { margin-left: auto; font-style: normal; font-size: .74rem; font-weight: 600; color: var(--text-3); border: 1px solid var(--border); padding: 3px 10px; border-radius: 999px; }
.x4-chain-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; position: relative; }
.x4-chain-steps::before { content: ''; position: absolute; left: 7%; right: 7%; top: 23px; height: 2px; background: linear-gradient(90deg, var(--accent), rgba(47,95,224,.25)); border-radius: 2px;
    transform-origin: left; transform: scaleX(1); transition: transform 1.4s cubic-bezier(.2,.7,.2,1); }
.x4-chain-steps li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.x4-chain-steps .ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-card); border: 2px solid var(--accent); color: var(--accent); margin-bottom: 6px; position: relative; z-index: 1;
    transition: opacity .5s, transform .5s; transition-delay: calc(var(--d) * 120ms); }
.x4-chain-steps .x4-b { font-size: .84rem; font-weight: 700; letter-spacing: -.01em; }
.x4-chain-steps small { font-size: .76rem; color: var(--text-3); line-height: 1.35; }
.x4-chain-bar { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 26px 0 0; padding: 12px 16px; border-radius: 14px; background: rgba(47,95,224,.07); color: var(--accent); font-size: .9rem; font-weight: 600; text-align: center; }
.x4-chain-bar .x3-av { width: 24px; height: 24px; }
.x4-chain figcaption { margin-top: 12px; font-size: .74rem; color: var(--text-3); }
/* animated when scrolled into view */
.x4-chain.x4-reveal:not(.x4-in) .x4-chain-steps::before { transform: scaleX(0); }
.x4-chain.x4-reveal:not(.x4-in) .x4-chain-steps .ic { opacity: 0; transform: scale(.7); }

/* ── advantages ── */
.x4-adv { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 16px; }
.x4-adv li { display: flex; gap: 14px; align-items: flex-start; }
.x4-adv li > span { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: var(--bg-card); border: 1px solid var(--border); color: var(--accent); }
.x4-adv p { margin: 2px 0 0; font-size: .93rem; }

/* ── dashboard demo ── */
.x4-tabs { display: flex; gap: 4px; overflow: hidden; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.x4-tabs span { font-size: .76rem; padding: 5px 10px; border-radius: 8px; color: var(--text-3); white-space: nowrap; }
.x4-tabs span.on { background: var(--x3-side); color: var(--text-1); font-weight: 600; }
.x4-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.x4-rows li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; font-size: .86rem; border-top: 1px solid var(--border); }
.x4-rows li:first-child { border-top: 0; }
.x4-rows svg { color: var(--text-3); flex-shrink: 0; }
.x4-rows span { flex: 1; min-width: 0; }
.x4-rows em { font-style: normal; font-size: .74rem; color: var(--text-3); white-space: nowrap; }
.x4-rows em.ok { color: #16a34a; }

/* ── calm reveal ── */
.x4-reveal { transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.x4-reveal:not(.x4-in) { opacity: 0; transform: translateY(18px); }

/* ── responsive ── */
@media (max-width: 960px) {
    .x4-net { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .x4-chain-steps { grid-template-columns: repeat(4, 1fr); row-gap: 22px; }
    .x4-chain-steps::before { display: none; }
}
@media (max-width: 640px) {
    body.x4-ui .hero { padding-top: 72px; }
    h1.x4-title { font-size: clamp(2rem, 9vw, 2.5rem); }
    .x4-anchor { font-size: .84rem; margin-bottom: 20px; }
    .x4-starters .x3-starter { min-height: 60px; padding: 14px; }
    .x4-trust { justify-content: flex-start; gap: 8px 14px; }
    /* hub → centre card + 2 columns, no lines */
    .x4-hub { aspect-ratio: auto; max-width: none; justify-self: stretch; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
    .x4-badge { font-size: .72rem; }
    .x4-hub-lines { display: none; }
    .x4-hub-core { position: static; transform: none; width: auto; aspect-ratio: auto; grid-column: 1 / -1; flex-direction: row; gap: 10px; padding: 14px; border-radius: 18px; }
    .x4-hub-core img { width: 32px; height: 32px; }
    .x4-node { position: static; transform: none; width: auto; min-width: 0; flex-direction: row; justify-content: flex-start; text-align: left; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); font-size: .8rem; }
    .x4-node span { width: 34px; height: 34px; border-radius: 10px; box-shadow: none; flex-shrink: 0; }
    /* chain → vertical */
    .x4-chain { padding: 20px 16px; }
    .x4-chain-head em { margin-left: 0; }
    .x4-chain-steps { grid-template-columns: 1fr; row-gap: 0; }
    .x4-chain-steps li { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 12px; text-align: left; align-items: center; padding: 6px 0; }
    .x4-chain-steps li::after { content: ''; position: absolute; left: 19px; top: 46px; bottom: -6px; width: 2px; background: rgba(47,95,224,.25); }
    .x4-chain-steps li:last-child::after { display: none; }
    .x4-chain-steps .ic { width: 40px; height: 40px; margin: 0; grid-row: 1 / 3; }
    .x4-chain-steps .x4-b { align-self: end; }
    .x4-chain-steps small { align-self: start; }
    .x4-chain-bar { font-size: .84rem; }
}
@media (prefers-reduced-motion: reduce) {
    .x4-hub-lines line { animation: none; }
    .x4-reveal, .x4-chain-steps .ic, .x4-chain-steps::before { transition: none; }
}

/* ── presentation video (partner section of the start page) ── */
.x4-video { margin: 22px 0 0; }
.x4-video video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 22px; border: 1px solid var(--border); background: #0b1020; box-shadow: 0 18px 50px rgba(28,27,25,.10); }
.x4-video figcaption { margin-top: 10px; font-size: .78rem; color: var(--text-3); text-align: center; }
.x4-film .x4-video { margin-top: 28px; }
.x4-video figcaption span + span { color: var(--text-3); }
.x4-transcript { margin-top: 10px; font-size: .86rem; color: var(--text-2); }
.x4-transcript summary { cursor: pointer; text-align: center; color: var(--text-3); font-size: .8rem; list-style: none; }
.x4-transcript summary::-webkit-details-marker { display: none; }
.x4-transcript summary:hover { color: var(--accent); }
.x4-transcript p { margin: 10px 0 0; line-height: 1.6; }
