/* ========================================================================
   Findustrial OS — scoped styles.
   Every rule is prefixed with .fios-root so nothing in the surrounding
   WordPress/Elementor layout leaks in or out.
   ======================================================================== */

.fios-root {
	--fios-ink:        #e7ecff;
	--fios-ink-dim:    #8a93c7;
	--fios-accent:     #4a8ad6;
	--fios-accent-hot: #4a8ad6;
	--fios-accent-warm:#bc2e68;
	--fios-line:       rgba(120,150,255,0.18);

	position: relative;
	width: 100%;
	height: var(--fios-height, 100vh);
	min-height: var(--fios-min-height, 620px);
	overflow: hidden;
	isolation: isolate;
	/* Solid base for the whole section. On mobile this is what shows
	 * behind the carousel below the canvas — the more decorative gradient
	 * sits on `.fios-stage` so it scales to canvas height, not full-section
	 * height (which on mobile would include the carousel and stretch the
	 * gradient unevenly). */
	background: #00102a;
	color: var(--fios-ink);
	font-family: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
	contain: layout paint;
}

.fios-root *,
.fios-root *::before,
.fios-root *::after { box-sizing: border-box; }

.fios-root .fios-stage {
	position: absolute; inset: 0; z-index: 1;
	/* Findustrial brand "universe" gradient. Anchored to .fios-stage so it
	 * sizes to the 3D canvas (full section on desktop, 55vh block on mobile)
	 * and looks identical at both breakpoints. The transparent canvas, star
	 * field and polar grid sit on top, giving the depth that used to come
	 * from a heavy SVG asset. */
	background:
		radial-gradient(ellipse 80% 60% at 50% 25%, rgba(46, 104, 188, 0.4) 0%, transparent 60%),
		radial-gradient(ellipse 110% 80% at 50% 50%, #002766 0%, #001a3f 50%, #00102a 100%);
}
.fios-root .fios-stage canvas { display: block; width: 100% !important; height: 100% !important; }

/* ---------- Brand mark ---------- */
.fios-root .fios-brand {
	position: absolute; top: 28px; left: 32px;
	display: flex; align-items: center; gap: 12px;
	z-index: 20; pointer-events: none;
}
.fios-root .fios-brand-mark {
	width: 34px; height: 34px;
	display: grid; place-items: center;
	border-radius: 8px;
	background: linear-gradient(135deg, #003992, #2e68bc);
	color: #fff; font-weight: 800; font-size: 18px;
}
.fios-root .fios-brand-text { font-weight: 600; opacity: .9; line-height: 1.2; }
.fios-root .fios-brand-text small {
	display: block; color: var(--fios-ink-dim); font-weight: 400;
	font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
}

/* ---------- Hero title (H1) ----------
   Big light-blue gradient on the page H1, positioned over the canvas.
   `position: absolute` is anchored to `.fios-root` (the section) — NOT
   `fixed`, so the title scrolls with the section instead of floating
   above the whole page. */
.fios-root .fios-title {
	position: absolute; top: 48px; left: 0; right: 0;
	margin: 0; text-align: center; z-index: 15; pointer-events: none;
	font-weight: 700; font-size: clamp(20px, 2.4vw, 38px);
	letter-spacing: -.02em; line-height: 1.1;
	padding: 0 60px;
	background: linear-gradient(180deg, #ffffff 0%, #b8ccf0 100%);
	-webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- HUD pills ---------- */
.fios-root .fios-hud {
	position: absolute; left: 0; right: 0; bottom: 24px;
	display: flex; justify-content: center; gap: 10px; z-index: 20;
}
.fios-root .fios-pill {
	pointer-events: auto;
	background: rgba(10,13,36,0.6);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border: 1px solid var(--fios-line);
	border-radius: 999px; padding: 10px 16px;
	font: inherit; font-size: 12px; letter-spacing: .08em;
	color: var(--fios-ink-dim);
	display: inline-flex; align-items: center; gap: 10px;
	cursor: pointer; transition: color .2s, border-color .2s;
	user-select: none;
}
.fios-root .fios-pill:hover { color: var(--fios-ink); border-color: rgba(124,240,255,0.6); }
.fios-root .fios-pill.is-active {
	color: #05060f; background: var(--fios-accent-hot); border-color: var(--fios-accent-hot);
}
.fios-root .fios-dot {
	width: 8px; height: 8px; border-radius: 50%;
	background: var(--fios-accent-hot);
	box-shadow: 0 0 10px var(--fios-accent-hot);
}

.fios-root .fios-count-badge {
	position: absolute; left: 32px; bottom: 28px;
	font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
	color: var(--fios-ink-dim); z-index: 20; pointer-events: none;
}
.fios-root .fios-count-badge b {
	color: var(--fios-accent-hot); font-weight: 600; letter-spacing: .15em;
}

/* ---------- Leader SVG ---------- */
.fios-root .fios-leaders { position: absolute; inset: 0; pointer-events: none; z-index: 9; width: 100%; height: 100%; }

/* ---------- Module labels (floating HTML cards) ---------- */
.fios-root .fios-labels { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.fios-root .mod-label {
	position: absolute; left: 0; top: 0;
	display: flex; flex-direction: column; align-items: center; gap: 14px;
	background: linear-gradient(180deg, rgba(22,34,95,.88), rgba(10,16,55,.92));
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border: 1px solid rgba(124,240,255,0.28);
	border-radius: 18px;
	padding: 22px 26px 20px;
	width: 216px;
	box-shadow: 0 14px 44px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
	pointer-events: auto;
	cursor: pointer;
	transition: border-color .25s, box-shadow .25s, opacity .3s, filter .3s;
	will-change: transform, opacity;
}
.fios-root .mod-label:hover {
	border-color: var(--fios-accent-hot);
	box-shadow: 0 14px 44px rgba(0,0,0,.55), 0 0 48px rgba(124,240,255,.4), inset 0 1px 0 rgba(255,255,255,.1);
}
.fios-root .fios-labels.has-focus .mod-label:not(.is-focus):not(:hover) {
	opacity: .28;
	filter: blur(1.2px) saturate(.5);
}
.fios-root .mod-label.is-focus {
	border-color: var(--fios-accent-hot);
	background: linear-gradient(180deg, rgba(36,72,180,.95), rgba(14,28,92,.96));
	box-shadow: 0 18px 60px rgba(0,0,0,.6), 0 0 72px rgba(124,240,255,.55), inset 0 1px 0 rgba(255,255,255,.15);
	z-index: 2;
}

.fios-root .mod-label .ico {
	width: 76px; height: 76px; flex-shrink: 0;
	border-radius: 16px;
	background: radial-gradient(circle at 50% 35%, rgba(124,240,255,.18), rgba(124,240,255,.04) 70%);
	border: 1px solid rgba(124,240,255,.32);
	display: grid; place-items: center;
	color: var(--fios-accent-hot);
	transition: background .25s, border-color .25s, transform .25s;
}
.fios-root .mod-label.is-focus .ico {
	background: radial-gradient(circle at 50% 35%, rgba(124,240,255,.38), rgba(124,240,255,.08) 70%);
	border-color: var(--fios-accent-hot);
}
.fios-root .mod-label .ico img {
	width: 48px; height: 48px; display: block;
	filter: brightness(0) saturate(100%) invert(88%) sepia(54%) saturate(1042%) hue-rotate(160deg) brightness(102%) contrast(101%) drop-shadow(0 0 6px rgba(124,240,255,.4));
	transition: filter .25s;
	user-select: none; -webkit-user-drag: none;
}
.fios-root .mod-label.is-focus .ico img {
	filter: brightness(0) saturate(100%) invert(100%) drop-shadow(0 0 10px rgba(124,240,255,.85));
}

.fios-root .mod-label .txt { display: flex; flex-direction: column; align-items: center; line-height: 1.15; text-align: center; }
.fios-root .mod-label .mod-title { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: .01em; white-space: nowrap; text-shadow: 0 0 14px rgba(124,240,255,.35); }
.fios-root .mod-label .eyebrow { font-size: 9px; letter-spacing: .3em; text-transform: uppercase; color: var(--fios-accent-hot); font-weight: 600; margin-bottom: 6px; }
.fios-root .mod-label .kpi-line { font-size: 11px; color: var(--fios-ink-dim); margin-top: 6px; letter-spacing: .04em; }
.fios-root .mod-label .kpi-line b { color: #fff; font-weight: 600; }
.fios-root .mod-label .kpi-line .d { color: var(--fios-accent-hot); margin-left: 4px; }

/* ---------- Detail panel ---------- */
.fios-root .fios-panel {
	position: absolute; top: 50%; right: 32px;
	transform: translateY(-50%) translateX(calc(100% + 40px));
	width: 420px;
	max-height: calc(100% - 120px);
	overflow-y: auto;
	background: linear-gradient(180deg, rgba(15,22,64,.88), rgba(8,12,40,.88));
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	border: 1px solid var(--fios-line);
	border-radius: 18px;
	padding: 22px;
	z-index: 25;
	box-shadow: 0 24px 80px rgba(0,0,0,.5);
	transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .4s;
	opacity: 0;
	pointer-events: none;
}
.fios-root .fios-panel.is-open {
	transform: translateY(-50%) translateX(0);
	opacity: 1;
	pointer-events: auto;
}
.fios-root .fios-panel .fios-eyebrow { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--fios-accent-hot); margin-bottom: 8px; }
.fios-root .fios-panel h3 { margin: 0 0 14px; font-size: 24px; font-weight: 700; letter-spacing: -.01em; color: #fff; }
.fios-root .fios-panel p { color: var(--fios-ink-dim); font-size: 13px; line-height: 1.5; margin: 0 0 16px; }
.fios-root .fios-panel .fios-close {
	position: absolute; top: 14px; right: 14px;
	width: 28px; height: 28px; border-radius: 50%;
	background: rgba(255,255,255,.05);
	border: 1px solid var(--fios-line); color: var(--fios-ink);
	display: grid; place-items: center; cursor: pointer; font-size: 14px;
	padding: 0; line-height: 1;
}
.fios-root .fios-panel .fios-headline { font-size: 16px; font-weight: 700; line-height: 1.35; color: #fff; margin: 4px 0 16px; letter-spacing: -.005em; }
.fios-root .fios-panel .fios-benefits { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 14px; }
.fios-root .fios-panel .fios-benefits li {
	display: grid;
	grid-template-columns: 22px 1fr;
	gap: 12px;
	align-items: start;
	font-size: 12.5px;
	line-height: 1.5;
	color: rgba(220,230,250,.9);
}
.fios-root .fios-panel .fios-benefits li::before {
	content: '';
	width: 18px; height: 18px;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bc2e68' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
	background-repeat: no-repeat;
	background-position: center;
	margin-top: 1px;
}

.fios-root .fios-panel .fios-kpis-note {
	font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
	color: rgba(200,215,240,.4); margin: 0 0 8px;
	font-weight: 600;
}
.fios-root .fios-panel .fios-kpis {
	display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
	margin: 4px 0 16px;
}
.fios-root .fios-panel .kpi-cell {
	background: rgba(124,240,255,.04);
	border: 1px solid rgba(124,240,255,.12);
	border-radius: 10px;
	padding: 12px 14px;
	display: flex; flex-direction: column; gap: 4px;
}
.fios-root .fios-panel .kpi-cell .k { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: rgba(200,215,240,.6); font-weight: 600; }
.fios-root .fios-panel .kpi-cell .v { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -.01em; line-height: 1.1; }
.fios-root .fios-panel .kpi-cell .d { font-size: 10.5px; color: rgba(200,215,240,.55); margin-top: 2px; display: inline-flex; align-items: center; gap: 3px; }
.fios-root .fios-panel .kpi-cell .d.up   { color: #7cf0ab; }
.fios-root .fios-panel .kpi-cell .d.down { color: #bc2e68; }

.fios-root .fios-panel .fios-sub-desc { color: rgba(200,215,240,.6); font-size: 12px; line-height: 1.55; margin: 10px 0 0; font-style: italic; }

.fios-root .fios-noscript {
	position: absolute; inset: auto 5% 10% 5%;
	padding: 18px 22px; border-radius: 14px;
	background: rgba(10,13,36,.85); color: var(--fios-ink);
	border: 1px solid var(--fios-line);
	text-align: center; font-size: 14px;
}

/* ---------- Mobile card carousel (hidden on desktop, shown on < 900px) ---------- */
.fios-root .fios-mobile-cards { display: none; }
.fios-root .fios-panel-handle { display: none; }

/* Tablet tweaks (still desktop layout, just tighter) */
@media (max-width: 1100px) {
	.fios-root .fios-panel { width: min(380px, calc(100% - 24px)); right: 16px; }
}

/* ============================================================
   Mobile breakpoint — < 900px: 3D becomes a normal block,
   floating labels go away, carousel takes over module nav,
   panel becomes a section-anchored bottom sheet.

   Hard rules (per plugin spec):
     - All selectors stay under `.fios-root`.
     - NO `position: fixed` anywhere — the bottom sheet is `position:
       absolute` inside `.fios-root`, which becomes a scroll/positioning
       container on mobile.
     - NEVER `body { overflow: hidden }` — page scroll stays free, the
       sheet contains its own scroll via `overscroll-behavior: contain`.
   ============================================================ */
@media (max-width: 899px) {
	.fios-root {
		/* Full-section hero on mobile too — same look as desktop, just with
		   compact orbital labels (rules below) and a bottom-sheet panel.
		   No body-scroll touching, the section just lives in normal page
		   flow at its declared height. */
		overflow: hidden;
	}

	/* Canvas covers the full section on mobile, same as desktop. The labels
	   orbit inside, panel becomes a bottom sheet (rules below). */
	.fios-root .fios-stage { position: absolute; inset: 0; }
	/* Critical: tell the browser that vertical panning over the canvas is
	   page-scroll, not a gesture for the canvas. JS still gets touch events
	   for click / tap-to-focus detection. */
	.fios-root .fios-stage canvas { touch-action: pan-y; }

	/* Chrome that doesn't fit on a phone (just the count badge for now —
	   orbital labels stay visible via the compact rules below). */
	.fios-root .fios-count-badge { display: none !important; }

	/* Brand mark — still on the canvas overlay */
	.fios-root .fios-brand { top: 14px; left: 14px; gap: 8px; }
	.fios-root .fios-brand-mark { width: 28px; height: 28px; font-size: 14px; }
	.fios-root .fios-brand-text { font-size: 12px; }
	.fios-root .fios-brand-text small { font-size: 9px; }

	/* Title — condensed font + tighter top margin on small screens. */
	.fios-root .fios-title {
		top: 20px;
		padding: 0 20px;
		font-size: clamp(16px, 4.5vw, 24px);
	}

	/* HUD — anchored to bottom of canvas, compact. Sits *inside* the
	   stage block, not pinned to the viewport. */
	.fios-root .fios-hud {
		bottom: 12px;
		flex-wrap: wrap;
		padding: 0 12px;
		gap: 6px;
	}
	.fios-root .fios-pill { font-size: 10px; padding: 7px 11px; letter-spacing: .06em; }
	.fios-root .fios-dot { width: 6px; height: 6px; }

	/* Mobile uses the same orbital labels as desktop (compact). The SSR
	   `.fios-mobile-cards` block stays in the DOM as a fallback for SEO
	   crawlers and noscript users, but is visually hidden on every viewport. */
	.fios-root .fios-mobile-cards { display: none; }

	/* Leader lines (the dotted lines from each label to its 3D node) get
	   crowded on a small screen — hide them, the orbital position is enough. */
	.fios-root .fios-leaders { display: none !important; }

	/* Compact orbital labels for tablet / large phone (768-899px). */
	.fios-root .mod-label {
		width: 150px;
		padding: 12px 14px 10px;
		gap: 8px;
		border-radius: 12px;
	}
	.fios-root .mod-label .ico { width: 44px; height: 44px; border-radius: 10px; }
	.fios-root .mod-label .ico img,
	.fios-root .mod-label .ico svg { width: 28px; height: 28px; }
	.fios-root .mod-label .mod-title { font-size: 12px; }
	.fios-root .mod-label .eyebrow { font-size: 7.5px; margin-bottom: 3px; letter-spacing: 0.2em; }
	.fios-root .mod-label .kpi-line { font-size: 9px; margin-top: 3px; }
	/* Slightly less aggressive dim on small screens */
	.fios-root .fios-labels.has-focus .mod-label:not(.is-focus):not(:hover) {
		opacity: 0.2;
		filter: blur(1px) saturate(0.4);
	}
	/* ---------- Bottom sheet (section-anchored — NOT viewport-fixed) ----------
	   Anchored to .fios-root (position: relative on the section base rule).
	   This means the sheet covers the section's own area, not the whole
	   viewport — preserving page scroll and avoiding `position: fixed`. */
	.fios-root .fios-panel {
		position: absolute;
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-height: 100%;
		max-width: none;
		border-radius: 20px 20px 0 0;
		padding: 22px 20px 28px;
		/* Default off-screen state — translated below the section's bottom
		   edge. The section's `overflow: hidden` keeps it visually gone. */
		transform: translateY(100%);
		opacity: 1;
		overflow-y: auto;
		overscroll-behavior: contain;
		/* Local z-index — never leaks out of `.fios-root` because of the
		   isolation context. */
		z-index: 30;
	}
	.fios-root .fios-panel.is-open {
		transform: translateY(0);
	}
	.fios-root .fios-panel-handle {
		display: block;
		position: sticky;
		top: 0;
		margin: -8px auto 12px;
		width: 44px; height: 4px;
		border-radius: 999px;
		background: rgba(255,255,255,.18);
	}
	.fios-root .fios-panel .fios-close {
		top: 14px; right: 14px;
		width: 32px; height: 32px; font-size: 18px;
	}
	.fios-root .fios-panel h3 { font-size: 22px; }
	.fios-root .fios-panel .fios-headline { font-size: 15px; }
	.fios-root .fios-panel .fios-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
	.fios-root .fios-panel .kpi-cell { padding: 10px 12px; }
	.fios-root .fios-panel .kpi-cell .v { font-size: 16px; }
}

/* Very narrow phones — even more compact orbital labels (v3 breakpoint). */
@media (max-width: 480px) {
	.fios-root .mod-label {
		width: 130px;
		padding: 10px 10px 8px;
		gap: 6px;
	}
	.fios-root .mod-label .ico { width: 36px; height: 36px; border-radius: 8px; }
	.fios-root .mod-label .ico img,
	.fios-root .mod-label .ico svg { width: 22px; height: 22px; }
	.fios-root .mod-label .mod-title { font-size: 11px; }
	.fios-root .mod-label .eyebrow { font-size: 7px; }
	.fios-root .mod-label .kpi-line { font-size: 8px; }

	.fios-root .fios-panel { padding: 16px 16px 24px; }
	.fios-root .fios-panel h3 { font-size: 18px; }
	.fios-root .fios-panel .fios-kpis { gap: 6px; }
	.fios-root .fios-panel .kpi-cell { padding: 10px 10px; }
	.fios-root .fios-panel .kpi-cell .v { font-size: 14px; }
}

/* ---------- Reduced motion — static fallback ---------- */
@media (prefers-reduced-motion: reduce) {
	.fios-root .fios-panel { transition: none; }
}

/* Hide SVG/labels while scene still booting to prevent FOUC */
.fios-root:not(.is-ready) .fios-labels,
.fios-root:not(.is-ready) .fios-leaders {
	opacity: 0;
	transition: opacity .3s;
}
.fios-root.is-ready .fios-labels,
.fios-root.is-ready .fios-leaders {
	opacity: 1;
	transition: opacity .6s;
}
