/* Home redesign layer — sits on top of the theme stylesheet, changes nothing in it.
   Patterns borrowed (structure only, not artwork) from how the strongest sites in this
   field are built: short hero + two CTAs, capability grid with icons, alternating
   spotlight sections with a visual, numbered process, one closing CTA. */

/* ---------------------------------------------------------------- icons -- */
.on-sprite symbol { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.on-ico {
	width: 22px;
	height: 22px;
	display: block;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.on-ico-box {
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border-radius: 11px;
	background: rgba(37, 211, 193, .10);
	border: 1px solid rgba(37, 211, 193, .28);
	color: #5be1d3;
	margin-bottom: .9rem;
	transition: background-color .2s ease-out, color .2s ease-out, border-color .2s ease-out;
}

.on-card:hover .on-ico-box { background: rgba(37, 211, 193, .18); color: #25d3c1; }

.on-trust > * { display: flex; flex-direction: column; gap: .15rem; }
.on-trust .on-ico-box { margin-bottom: .55rem; }
.on-trust strong { line-height: 1.35; }

/* ------------------------------------------------------------- hero bits -- */
/* The display scale (up to 5.5rem) swallowed the whole first screen once the new
   typeface landed; the hero headline gets its own, calmer scale. */
.on-hero h1 {
	font-size: clamp(2.1rem, 4.2vw, 3.5rem) !important;
	line-height: 1.08;
	max-width: 15ch;
}

.on-rtl .on-hero h1 { line-height: 1.32; max-width: 20ch; }

.on-hero .has-large-font-size {
	font-size: clamp(1rem, 1.45vw, 1.12rem) !important;
	line-height: 1.65;
	max-width: 46ch;
}

.on-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	padding: .35rem .8rem;
	border: 1px solid rgba(37, 211, 193, .3);
	border-radius: 999px;
	background: rgba(37, 211, 193, .07);
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #5be1d3;
}

.on-rtl .on-eyebrow { letter-spacing: normal; text-transform: none; }

.on-eyebrow::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #25d3c1;
	box-shadow: 0 0 0 4px rgba(37, 211, 193, .18);
}

.on-hero-facts {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem 1.4rem;
	margin-top: 1.3rem;
	padding: 0;
	list-style: none;
	color: #a9bdcb;
	font-size: .92rem;
}

.on-hero-facts li { display: flex; align-items: center; gap: .5rem; }
.on-hero-facts .on-ico { width: 18px; height: 18px; color: #25d3c1; }

/* --------------------------------------------------------- system figure -- */
.on-figure {
	position: relative;
	display: grid;
	place-items: center;
	min-height: 22rem;
}

.on-figure svg { width: 100%; height: auto; max-width: 30rem; }
.on-figure .on-node rect,
.on-figure .on-node circle { fill: #0b1d2b; stroke: #203447; }
.on-figure .on-node text { fill: #a9bdcb; font-size: 10px; font-weight: 600; }
.on-figure .on-link { stroke: #203447; stroke-width: 1.2; fill: none; }
.on-figure .on-link--live { stroke: #25d3c1; stroke-dasharray: 5 7; animation: on-dash 2.6s linear infinite; }
.on-figure .on-hub circle { fill: #071522; stroke: #25d3c1; stroke-width: 2; }

@keyframes on-dash { to { stroke-dashoffset: -24; } }

/* ------------------------------------------------------------ spotlights -- */
.on-spot { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.on-spot--flip > :first-child { order: 2; }

.on-spot-list { list-style: none; padding: 0; margin: 1rem 0 1.4rem; display: grid; gap: .55rem; }
.on-spot-list li { display: flex; gap: .6rem; align-items: flex-start; color: #a9bdcb; }
.on-spot-list .on-ico { width: 19px; height: 19px; margin-top: .18rem; color: #25d3c1; flex: 0 0 auto; }

.on-panel {
	border: 1px solid #203447;
	border-radius: 14px;
	background: linear-gradient(180deg, #0b1d2b, #081827);
	padding: 1.1rem;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}

.on-panel__bar { display: flex; gap: .35rem; margin-bottom: .9rem; }
.on-panel__bar i { width: 9px; height: 9px; border-radius: 50%; background: #203447; display: block; }
.on-panel__bar i:first-child { background: #25d3c1; }

.on-panel__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: .62rem .75rem;
	border-radius: 8px;
	background: rgba(16, 44, 60, .55);
	color: #d7e3ec;
	font-size: .9rem;
}

.on-panel__row + .on-panel__row { margin-top: .45rem; }
.on-panel__row b { color: #f5f9fc; font-weight: 700; }
.on-panel__row span { color: #a9bdcb; font-variant-numeric: tabular-nums; }
.on-panel__row--total { background: rgba(37, 211, 193, .12); border: 1px solid rgba(37, 211, 193, .3); }
.on-panel__row--total span { color: #5be1d3; font-weight: 700; }
.on-panel__note { margin: .8rem .2rem 0; color: #7f95a5; font-size: .78rem; }

/* -------------------------------------------------------------- process --- */
.on-process { position: relative; }
.on-process > .wp-block-column { padding-top: 1.6rem; }
.on-process > .wp-block-column::after {
	content: "";
	position: absolute;
	top: .55rem;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, #203447 15%, #203447 85%, transparent);
}
.on-process > .wp-block-column::before {
	position: relative;
	z-index: 1;
	display: inline-grid !important;
	place-items: center;
	width: 2.2rem;
	height: 2.2rem;
	border-radius: 50%;
	background: #0b1d2b;
	border: 1px solid rgba(37, 211, 193, .4);
	font-size: .9rem !important;
	margin-bottom: .8rem !important;
}

/* ------------------------------------------------------------- close CTA -- */
.on-cta-card {
	border: 1px solid rgba(37, 211, 193, .35);
	border-radius: 16px;
	background:
		radial-gradient(120% 140% at 50% 0%, rgba(37, 211, 193, .14), transparent 60%),
		#0b1d2b;
	padding: clamp(1.75rem, 4vw, 3rem);
	text-align: center;
}

/* -------------------------------------------------------------- responsive */
@media (max-width: 900px) {
	.on-spot { grid-template-columns: 1fr; }
	.on-spot--flip > :first-child { order: 0; }
	.on-figure { min-height: 16rem; }
	.on-process > .wp-block-column::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.on-figure .on-link--live { animation: none; stroke-dasharray: 0; }
	.on-ico-box { transition: none; }
}

/* The theme's "large" size was tuned for the old system font; with Plus Jakarta Sans
   it reads a size too big in body copy. One cap, hero keeps its own rule.  large-font-size cap */
:where(.wp-site-blocks) .has-large-font-size {
	font-size: clamp(1.02rem, 1.5vw, 1.2rem) !important;
	line-height: 1.62;
}

.on-cta-card .has-large-font-size { max-width: 52ch; margin-inline: auto; }

/* A pill sitting directly in a constrained section (inner-page heroes) must start at the
   content column, like the heading under it — auto margins don't apply to inline boxes. eyebrow-in-constrained */
.is-layout-constrained > .on-eyebrow {
	margin-inline-start: max(0px, calc((100% - var(--wp--style--global--content-size)) / 2)) !important;
	margin-inline-end: 0 !important;
}

/* ======================================================= home polish, round 1 */

/* 1 — one container width. The trust band and the card grids are plain HTML inside a
   constrained group, so they inherited the 760px text column while the hero and the
   spotlights use the 1200px wide column. */
.on-wide {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
}

/* 2 — 12 capability cards fill 4 columns exactly (4+4+4); 3 columns in between. */
@media (min-width: 1100px) {
	.on-dynamic-grid.on-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.on-dynamic-grid.on-cols-4 h3 { font-size: 1.1rem; line-height: 1.3; }
.on-rtl .on-dynamic-grid.on-cols-4 h3 { line-height: 1.5; }

.on-card--all {
	border-color: rgba(37, 211, 193, .4) !important;
	background: linear-gradient(160deg, rgba(37, 211, 193, .12), #0b1d2b 70%) !important;
}
.on-card--all h3 a { color: #5be1d3; }
.on-card--all .on-ico-box { background: #25d3c1; color: #071522; border-color: #25d3c1; }
.on-card--all .on-ico { transition: transform .2s ease-out; }
.on-card--all:hover .on-ico { transform: translateX(3px); }
.on-rtl .on-card--all .on-ico { transform: scaleX(-1); }
.on-rtl .on-card--all:hover .on-ico { transform: scaleX(-1) translateX(3px); }

/* 3 — hero headline: three lines, and the facts row stays on one line. */
.on-hero h1 { max-width: 22ch; font-size: clamp(2rem, 3.7vw, 3.1rem) !important; }
.on-hero-facts { gap: .5rem 1.1rem; font-size: .9rem; }

/* 4 — WhatsApp: a 56px badge that opens into the labelled pill on hover/focus. */
body .on-whatsapp {
	box-sizing: border-box;
	min-height: 0;
	height: 56px;
	max-width: 56px;
	padding: 0 1rem 0 14px;
	overflow: hidden;
	white-space: nowrap;
	gap: .6rem;
	justify-content: flex-start;
	color: transparent !important;   /* label hidden while collapsed; the icon has its own colour */
	transition: max-width .28s ease-out, color .2s ease-out, box-shadow .2s ease-out;
}
body .on-whatsapp::before {
	content: "";
	flex: 0 0 28px;
	width: 28px;
	height: 28px;
	background: #071522;
	-webkit-mask: var(--on-wa) center / contain no-repeat;
	mask: var(--on-wa) center / contain no-repeat;
	--on-wa: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E");
}
body .on-whatsapp:hover,
body .on-whatsapp:focus-visible { max-width: 15rem; color: #071522 !important; }
@media (hover: none) and (any-hover: none) { body .on-whatsapp:hover { max-width: 56px; color: transparent !important; } }
@media (prefers-reduced-motion: reduce) { body .on-whatsapp { transition: none; } }

/* Home rhythm. The section groups carry their spacing only in block comments, which the
   rendered HTML never receives, so most sections had 0 (or 20px) of padding and touched the
   screen edge on phones; the 1.5rem block gap was what separated them. Set it once, here.
   Scoped to the two home pages (body.on-home); inner pages are reviewed separately.
   The Arabic page nests its sections one level deeper (main > .entry-content). */
.on-home .wp-site-blocks > main { margin-block-start: 0; }
.on-home :is(main, .entry-content) > .alignfull {
	margin-block-start: 0;
	padding-block: clamp(3rem, 5vw, 4.5rem);
	padding-inline: 1rem;
}
.on-home :is(main, .entry-content) > .alignfull:has(> .on-trust) { padding-block: 1.5rem 2rem; }
.on-home :is(main, .entry-content) > .on-hero { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(2.25rem, 4vw, 3.25rem); }

/* ================================================== home polish, round 2 */

/* 6 — orange is for the one action we want (book a demo); teal stays for identity and links. */
.wp-block-button:not(.is-style-outline) > a.wp-block-button__link[href$="/request-a-demo/"] {
	background: #ff8c42;
	color: #071522;
	transition: background-color .18s ease-out, transform .18s ease-out, box-shadow .18s ease-out;
}
.wp-block-button:not(.is-style-outline) > a.wp-block-button__link[href$="/request-a-demo/"]:hover {
	background: #ffa163;
	color: #071522;
	box-shadow: 0 8px 22px rgba(255, 140, 66, .28);
}
.wp-block-button > a.wp-block-button__link[href$="/request-a-demo/"]:focus-visible {
	outline: 3px solid #ffd2b3;
	outline-offset: 3px;
}

/* the header button carries the preset teal class (with !important), so it needs the same weight */
a.wp-block-button__link.has-teal-background-color[href$="/request-a-demo/"] {
	background-color: #ff8c42 !important;
	color: #071522 !important;
}
a.wp-block-button__link.has-teal-background-color[href$="/request-a-demo/"]:hover { background-color: #ffa163 !important; }

/* 7 — the logo's four arms, reaching out from behind the hub and fading as they go. */
.on-hero { position: relative; overflow: hidden; }
.on-figure > svg:not(.on-arms) { position: relative; z-index: 1; }
.on-arms {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 200%;
	max-width: none;
	height: auto;
	transform: translateX(-50%);
	transform-origin: 50% 0;
	pointer-events: none;
	z-index: 0;
	animation: on-sway 9s ease-in-out infinite alternate;
}
@keyframes on-sway {
	from { transform: translateX(-50%) rotate(-1.1deg); }
	to   { transform: translateX(-50%) rotate(1.1deg); }
}
@media (prefers-reduced-motion: reduce) { .on-arms { animation: none; } }

/* ============================================ inner pages, round 3 */

/* The theme's own spacing scale never loaded (WordPress' default scale won), which left the
   side gutter at 0.67rem — 11px on a phone. 1rem is what the theme.json asked for. */
html body { --wp--preset--spacing--30: 1rem; }

/* Header: the two languages differ (padding, inner width) — same height, same 1200 column
   as the page content underneath. */
.on-header { padding-block: .8rem; padding-inline: 1rem; }
.on-header > .alignwide {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
}

/* No lighter strip between the header and the first band. */
.wp-site-blocks > main { margin-block-start: 0; }

/* Full-bleed bands on every page: real side padding (they touched the screen edge on
   phones) and a rhythm of their own instead of the 20px WordPress gives .has-background.
   Home rules above win on the home pages by specificity. */
:is(main, .entry-content) > .alignfull {
	margin-block-start: 0;
	padding-inline: 1rem;
	padding-block: clamp(2.5rem, 5vw, 4rem);
}
/* the title band on plain pages (Services, Contact) is only a heading */
main > .alignfull:has(> .wp-block-post-title) { padding-block: clamp(1.75rem, 3vw, 2.5rem); }
/* ...and its heading sits on the same column as the text below it */
main > .alignfull > .wp-block-post-title {
	max-width: var(--wp--style--global--content-size, 760px);
	margin-inline: auto;
}
/* breathing room between a band and the text that follows it */
.entry-content > .alignfull + :not(.alignfull) { margin-block-start: clamp(2rem, 4vw, 2.75rem); }

/* Card grids use the wide column too, and fill it evenly (4 → one row, 12 → 4×3). */
:is(.entry-content, .alignfull) > .on-dynamic-grid {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
}
@media (min-width: 1100px) {
	:is(.entry-content, .alignfull) > .on-dynamic-grid:has(> :nth-child(4):last-child),
	:is(.entry-content, .alignfull) > .on-dynamic-grid:has(> :nth-child(8):last-child),
	:is(.entry-content, .alignfull) > .on-dynamic-grid:has(> :nth-child(12):last-child) {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Portfolio: the groups in these templates are static HTML, so their padding attributes never
   reached the page (title touched the header, text touched the screen edge on phones). */
.single-on_portfolio main > .wp-block-group:not(.alignfull),
.single-on_portfolio main > .wp-block-post-content { padding-inline: 1rem; }
.single-on_portfolio main > .wp-block-group:first-child { padding-top: clamp(2.5rem, 5vw, 4rem); padding-bottom: 1.5rem; }
.single-on_portfolio main > .wp-block-group:not(.alignfull):not(:first-child) { padding-bottom: 2rem; }

/* Blocks marked "wide" directly under <main> (portfolio archive, search) sit on the 1200 column. */
main > .alignwide {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
	width: 100%;
}
.archive main, .search main { padding-inline: 1rem; }

/* Real screens (Octopus Fit demo site) in a browser frame + a phone. */
.on-shots {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 210px;
	gap: 1.5rem;
	align-items: end;
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
}
.on-shot {
	margin: 0;
	border: 1px solid #203447;
	border-radius: 14px;
	overflow: hidden;
	background: #0b1d2b;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
.on-shot img { display: block; width: 100%; height: auto; }
.on-shot__bar { display: flex; gap: .35rem; padding: .6rem .8rem; border-bottom: 1px solid #203447; }
.on-shot__bar i { width: 9px; height: 9px; border-radius: 50%; background: #203447; display: block; }
.on-shot__bar i:first-child { background: #25d3c1; }
.on-shot--phone { border-radius: 26px; border: 4px solid #203447; }
@media (max-width: 700px) {
	.on-shots { grid-template-columns: 1fr; }
	.on-shot--phone { width: min(60%, 230px); margin-inline: auto; }
}

/* Client logos: each mark sits on a tile in its own brand colour (Barvalo's is dark brown on
   transparent, Uptown's cream on transparent — neither reads on our navy). */
.on-logos {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1.25rem;
	margin-block: 1.25rem 2rem;
}
.on-logo {
	margin: 0;
	width: 168px;
	height: 168px;
	display: grid;
	place-items: center;
	border-radius: 18px;
	border: 1px solid #203447;
	box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
}
.on-logo img { display: block; width: 62%; height: auto; }
.on-logo--barvalo { background: #f6efe6; }
.on-logo--uptown { background: #0d2b27; }
h2:has(+ .on-logos) { text-align: center; }
