/**
 * CherryBerry ERP — homepage and marketing section styles.
 *
 * Loaded only on the front page, the ERP module templates and the
 * solutions/about templates, so blog readers never download it.
 *
 * 1. Hero and dashboard stage
 * 2. Automation flow
 * 3. Stats and why-us
 * 4. Process timeline
 * 5. Industries
 * 6. Analytics insight cards
 * 7. About visual, mission and vision
 * 8. Core values
 * 9. Module detail page
 */

/* ============================================================
   1. HERO AND DASHBOARD STAGE
   ============================================================ */
.hero {
	position: relative;
	overflow: hidden;
	padding-top: clamp(48px, 7vw, 84px);
	padding-bottom: clamp(56px, 8vw, 96px);
}

.hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -2;
	background:
		radial-gradient(760px 460px at 88% -8%, rgba(232, 93, 122, .16), transparent 60%),
		radial-gradient(680px 520px at 6% 6%, rgba(206, 19, 56, .08), transparent 55%),
		var(--bg);
}

.hero-grid {
	display: grid;
	grid-template-columns: 1.02fr 1.1fr;
	gap: clamp(30px, 5vw, 60px);
	align-items: center;
}

.hero-grid > * { min-width: 0; }

.hero h1 {
	font-size: clamp(34px, 5vw, 60px);
	color: var(--ink);
	margin-bottom: 20px;
}

.hero h1 .grad {
	background: var(--grad-cherry);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: var(--cherry);
}

.hero-sub {
	font-size: clamp(16px, 1.7vw, 19px);
	max-width: 52ch;
	margin-bottom: 28px;
	color: var(--slate);
}

.hero .cb-ctas { margin-bottom: 34px; }
.hero .cb-ctas .btn { padding: 15px 26px; font-size: 16px; min-height: 50px; }

.hero-trust {
	display: flex;
	gap: clamp(20px, 4vw, 44px);
	flex-wrap: wrap;
}

.hero-trust .stat b {
	font-family: var(--display);
	font-size: clamp(24px, 3vw, 32px);
	color: var(--ink);
	display: block;
	font-weight: 800;
}

.hero-trust .stat span { font-size: 13.5px; color: var(--slate-2); }

.dash-stage {
	position: relative;
	min-width: 0;
}

.shots {
	position: relative;
	max-width: 100%;
}

/* On desktop only the first screenshot shows; the rest are a mobile gallery. */
@media (min-width: 769px) {
	.shots .shot:not(:first-child) { display: none; }
}

.shot-dots { display: none; }

.float-card {
	position: absolute;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 14px;
	box-shadow: var(--shadow-l);
	padding: 12px 14px;
	display: flex;
	align-items: center;
	gap: 11px;
	z-index: 3;
}

.float-card .fic {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	flex-shrink: 0;
}

.float-card .fic .cb-icon { width: 18px; height: 18px; }
.float-card .fl1 { font-size: 12px; color: var(--slate-2); font-weight: 500; }

.float-card .fl2 {
	font-family: var(--display);
	font-weight: 800;
	font-size: 15px;
	color: var(--ink);
}

.fc-sales { top: -24px; right: -14px; animation: cb-floaty 6s ease-in-out infinite; }
.fc-inv { bottom: 168px; left: -38px; animation: cb-floaty 7s ease-in-out infinite .8s; }
.fc-emp { bottom: 58px; right: -26px; animation: cb-floaty 6.5s ease-in-out infinite .4s; }

@keyframes cb-floaty {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-9px); }
}

@media (prefers-reduced-motion: reduce) {
	.fc-sales,
	.fc-inv,
	.fc-emp { animation: none; }
}

/* ============================================================
   2. AUTOMATION FLOW
   ============================================================ */
.flow {
	display: flex;
	align-items: stretch;
	justify-content: center;
	margin-top: 52px;
	flex-wrap: wrap;
}

.flow-node {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px 18px;
	width: 190px;
	text-align: center;
	box-shadow: var(--shadow-s);
	position: relative;
}

.flow-node .fn-ic {
	width: 46px;
	height: 46px;
	border-radius: 13px;
	display: grid;
	place-items: center;
	margin: 0 auto 12px;
	background: var(--cherry-soft);
	color: var(--cherry);
}

.flow-node .fn-ic .cb-icon { width: 23px; height: 23px; }
.flow-node h3 { font-size: 15.5px; margin-bottom: 5px; }
.flow-node p { font-size: 12.5px; color: var(--slate-2); }

.flow-arrow {
	display: grid;
	place-items: center;
	width: 56px;
	color: var(--berry);
}

.flow-arrow .cb-icon { width: 30px; height: 30px; }

.flow-arrow .dashline {
	stroke-dasharray: 4 4;
	animation: cb-dash 1.2s linear infinite;
}

@keyframes cb-dash {
	to { stroke-dashoffset: -16; }
}

@media (prefers-reduced-motion: reduce) {
	.flow-arrow .dashline { animation: none; }
}

/* ============================================================
   3. STATS AND WHY US
   ============================================================ */
.stats-band {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
	margin-bottom: 48px;
}

.stat-box {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius-l);
	padding: 26px;
	text-align: center;
}

.stat-box b {
	font-family: var(--display);
	font-weight: 800;
	font-size: clamp(30px, 4vw, 42px);
	background: var(--grad-cherry);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: var(--cherry);
	display: block;
}

.stat-box span { font-size: 14px; color: var(--slate); font-weight: 500; }

.why-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.why-item {
	display: flex;
	gap: 13px;
	align-items: flex-start;
	padding: 18px;
	border-radius: var(--radius);
	transition: background-color .2s ease, box-shadow .2s ease;
}

.why-item:hover { background: #fff; box-shadow: var(--shadow-s); }

.why-item .wic {
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: var(--cherry-soft);
	color: var(--cherry);
	display: grid;
	place-items: center;
	flex-shrink: 0;
}

.why-item .wic .cb-icon { width: 21px; height: 21px; }
.why-item h3 { font-size: 15.5px; margin-bottom: 4px; }
.why-item p { font-size: 13px; color: var(--slate); line-height: 1.5; }

/* ============================================================
   4. PROCESS TIMELINE
   ============================================================ */
.timeline {
	/* The connector geometry is derived from these, so the circle size and the
	   column count only need changing in one place per breakpoint. */
	--tl-cols: 5;
	--tl-gap: 14px;
	--tl-dot: 80px;
	--tl-col: calc((100% - (var(--tl-gap) * (var(--tl-cols) - 1))) / var(--tl-cols));
	--tl-start: calc(var(--tl-dot) / 2);
	--tl-track: calc((var(--tl-col) + var(--tl-gap)) * (var(--tl-cols) - 1));

	margin-top: 52px;
	position: relative;
}

/* The track runs between the first and last circle centres, not edge to edge. */
.tl-line {
	position: absolute;
	left: var(--tl-start);
	width: var(--tl-track);
	top: calc(var(--tl-dot) / 2 - 1px);
	height: 2px;
	background: var(--line);
	z-index: 0;
}

.tl-fill {
	position: absolute;
	left: var(--tl-start);
	top: calc(var(--tl-dot) / 2 - 1px);
	height: 2px;
	width: 0;
	max-width: var(--tl-track);
	background: var(--grad-cherry);
	z-index: 1;
	transition: width 1.4s ease;
}

.tl-steps {
	display: grid;
	grid-template-columns: repeat(var(--tl-cols), minmax(0, 1fr));
	gap: var(--tl-gap);
	position: relative;
	z-index: 2;
	list-style: none;
}

.tl-step .num {
	width: var(--tl-dot);
	height: var(--tl-dot);
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--line);
	display: grid;
	place-items: center;
	font-family: var(--display);
	font-weight: 800;
	font-size: 24px;
	color: var(--cherry);
	margin-bottom: 20px;
	transition: border-color .3s ease, box-shadow .3s ease;
}

.tl-step.in .num {
	border-color: var(--cherry);
	box-shadow: 0 12px 24px -10px rgba(206, 19, 56, .5);
}

.tl-step h3 { font-size: 16px; margin-bottom: 9px; }
.tl-step p { font-size: 13.5px; color: var(--slate); line-height: 1.55; }

/* Five columns get tight before the layout stacks, so the circle shrinks. */
@media (min-width: 1025px) and (max-width: 1200px) {
	.timeline { --tl-dot: 68px; }
	.tl-step .num { font-size: 21px; margin-bottom: 16px; }
}

/* ============================================================
   5. INDUSTRIES
   ============================================================ */
.ind-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-top: 44px;
}

.ind {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 22px;
	text-align: center;
	transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}

.ind:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow);
	border-color: transparent;
}

.ind .iic {
	width: 52px;
	height: 52px;
	border-radius: 14px;
	margin: 0 auto 14px;
	display: grid;
	place-items: center;
	background: var(--bg-soft);
	color: var(--cherry);
	border: 1px solid var(--line-2);
	transition: background-color .24s ease;
}

.ind:hover .iic { background: var(--cherry-soft); }
.ind .iic .cb-icon { width: 26px; height: 26px; }
.ind h3 { font-size: 15.5px; }

/* ============================================================
   6. ANALYTICS INSIGHT CARDS
   ============================================================ */
.insights {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 16px;
	margin-top: 44px;
}

.ins-card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius-l);
	padding: 20px;
	box-shadow: var(--shadow-s);
	min-width: 0;
}

.ins-a { grid-column: span 7; }
.ins-b { grid-column: span 5; }
.ins-c,
.ins-d,
.ins-e { grid-column: span 4; }

.ins-card h3 { font-size: 15px; margin-bottom: 2px; }

.ins-card .sub {
	font-size: 12.5px;
	color: var(--slate-2);
	margin-bottom: 14px;
}

.ins-kpi {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.ins-kpi .big {
	font-family: var(--display);
	font-weight: 800;
	font-size: 30px;
	color: var(--ink);
}

.chgpill {
	font-size: 12px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 7px;
}

.chgpill.up { background: var(--green-soft); color: #14532D; }

.legend {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 10px;
}

.legend span {
	font-size: 12px;
	color: var(--slate);
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.legend i {
	width: 9px;
	height: 9px;
	border-radius: 3px;
	display: inline-block;
}

.donut-row {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 8px;
}

.donut-legend {
	display: grid;
	gap: 8px;
	flex: 1;
	min-width: 0;
}

.donut-legend div {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--slate);
}

.donut-legend i {
	width: 9px;
	height: 9px;
	border-radius: 3px;
	flex-shrink: 0;
}

.donut-legend b {
	margin-left: auto;
	color: var(--ink);
	font-family: var(--display);
}

.bar-emp { display: grid; gap: 9px; }

.bar-emp .row {
	display: grid;
	grid-template-columns: 68px 1fr 38px;
	gap: 9px;
	align-items: center;
	font-size: 12px;
	color: var(--slate);
}

.bar-emp .track {
	height: 8px;
	background: var(--bg-soft-2);
	border-radius: 6px;
	overflow: hidden;
}

.bar-emp .fill {
	height: 100%;
	border-radius: 6px;
	background: var(--grad-cherry);
}

.bar-emp b {
	color: var(--ink);
	text-align: right;
	font-family: var(--display);
	font-size: 12px;
}

/* ============================================================
   7. ABOUT VISUAL, MISSION AND VISION
   ============================================================ */
.about-visual {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius-l);
	box-shadow: var(--shadow-l);
	padding: 22px;
}

.bd-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 0 16px;
	border-bottom: 1px solid var(--line-2);
}

.bd-head .bd-logo {
	width: 30px;
	height: 30px;
	border-radius: 9px;
	background: var(--grad-cherry);
	display: grid;
	place-items: center;
	color: #fff;
	font-family: var(--display);
	font-weight: 800;
	font-size: 15px;
}

.bd-head h3 { font-size: 15px; }

.kpi-row {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
	margin: 16px 0 0;
}

.kpi {
	background: var(--bg-soft);
	border: 1px solid var(--line-2);
	border-radius: 12px;
	padding: 11px;
}

.kpi .lab { font-size: 12px; color: var(--slate-2); font-weight: 500; }

.kpi .val {
	font-family: var(--display);
	font-weight: 800;
	font-size: 17px;
	color: var(--ink);
	margin-top: 6px;
}

.kpi .val.is-text { font-size: 14px; }

.panel {
	background: var(--bg-soft);
	border: 1px solid var(--line-2);
	border-radius: 14px;
	padding: 13px;
	margin-top: 14px;
}

.panel h4 {
	font-family: var(--sans);
	font-weight: 600;
	font-size: 12.5px;
	color: var(--ink);
	margin-bottom: 10px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.panel h4 small { color: var(--slate-2); font-weight: 500; font-size: 12px; }

.mvv {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 26px;
}

.mvv-card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 22px;
}

.mvv-card .mic {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--cherry-soft);
	color: var(--cherry);
	display: grid;
	place-items: center;
	margin-bottom: 14px;
}

.mvv-card .mic .cb-icon { width: 22px; height: 22px; }
.mvv-card h3 { font-size: 17px; margin-bottom: 8px; }
.mvv-card p { font-size: 14px; line-height: 1.6; }

/* ============================================================
   8. CORE VALUES
   ============================================================ */
.val-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin-top: 44px;
}

.val {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 22px;
	display: flex;
	gap: 14px;
	align-items: flex-start;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.val:hover { border-color: var(--cherry); box-shadow: var(--shadow-s); }

.val .valic {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--cherry-soft), #fff);
	color: var(--cherry);
	display: grid;
	place-items: center;
	flex-shrink: 0;
	border: 1px solid var(--line-2);
}

.val .valic .cb-icon { width: 22px; height: 22px; }
.val h3 { font-size: 15.5px; margin-bottom: 5px; }
.val p { font-size: 13px; color: var(--slate); line-height: 1.5; }

/* ============================================================
   9. MODULE DETAIL PAGE
   ============================================================ */
.module-hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr);
	gap: clamp(28px, 4vw, 56px);
	align-items: center;
}

/* Without a screenshot the hero falls back to a single measured column. */
.module-hero-grid.is-single { grid-template-columns: minmax(0, 1fr); }

.module-hero-copy { min-width: 0; }
.module-hero-media { min-width: 0; }

/* The H1 already names the module, so the frame caption would only repeat it. */
.module-hero-media .shot-cap:empty { display: none; }
.module-hero-media .featured-media { margin: 0; }

/* Narrower measures only where the screenshot shares the row. */
.module-hero-grid:not(.is-single) h1 { max-width: 16ch; }
.module-hero-grid:not(.is-single) .lead-sub { max-width: 52ch; }

.module-hero-ic {
	width: 64px;
	height: 64px;
	border-radius: 18px;
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, var(--cherry-soft), #fff);
	color: var(--cherry);
	border: 1px solid var(--line-2);
	margin-bottom: 20px;
}

.module-hero-ic .cb-icon { width: 32px; height: 32px; }

.module-body {
	font-size: 16.5px;
	line-height: 1.75;
	color: var(--slate);
}

.module-body > * + * { margin-top: 20px; }

.module-body h2 {
	font-size: clamp(22px, 2.6vw, 30px);
	margin-top: 40px;
	margin-bottom: 4px;
}

.module-body h3 {
	font-size: clamp(18px, 2vw, 22px);
	margin-top: 32px;
	margin-bottom: 2px;
}

.module-body ul,
.module-body ol {
	padding-left: 22px;
	display: grid;
	gap: 10px;
}

.module-body ul { list-style: disc; }
.module-body ol { list-style: decimal; }
.module-body li::marker { color: var(--cherry); }

.module-aside {
	position: sticky;
	top: 100px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius-l);
	padding: 24px;
	box-shadow: var(--shadow-s);
}

.module-aside h2 { font-size: 17px; margin-bottom: 14px; }

.module-aside ul {
	display: grid;
	gap: 4px;
	margin-bottom: 20px;
}

.module-aside ul a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 10px;
	font-size: 14.5px;
	color: var(--ink-2);
	font-weight: 500;
}

.module-aside ul a:hover { background: var(--bg-soft); color: var(--cherry); }
.module-aside ul a .cb-icon { width: 17px; height: 17px; color: var(--cherry); }
.module-aside ul li.is-current a { background: var(--cherry-soft); color: var(--cherry); font-weight: 600; }

.module-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: clamp(30px, 4vw, 56px);
	align-items: start;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
	.fc-inv { left: -14px; }
	.fc-sales { right: 0; }
}

@media (max-width: 1024px) {
	.hero-grid { grid-template-columns: 1fr; gap: 44px; }

	.dash-stage {
		max-width: 640px;
		width: 100%;
		margin-inline: auto;
	}

	.stats-band,
	.why-grid,
	.ind-grid,
	.val-grid { grid-template-columns: repeat(2, 1fr); }

	.tl-line,
	.tl-fill { display: none; }

	.tl-steps { grid-template-columns: 1fr; gap: 0; }

	.tl-step {
		display: grid;
		grid-template-columns: var(--tl-dot) 1fr;
		grid-template-rows: auto auto;
		column-gap: 18px;
		align-content: start;
		position: relative;
		padding-bottom: 30px;
	}

	.tl-step:last-child { padding-bottom: 0; }

	/* The circle spans both text rows, otherwise the paragraph auto-places
	   underneath it in the narrow first column. */
	.tl-step .num {
		grid-area: 1 / 1 / 3 / 2;
		align-self: start;
		margin-bottom: 0;
	}

	.tl-step h3 { grid-area: 1 / 2 / 2 / 3; align-self: center; }
	.tl-step p { grid-area: 2 / 2 / 3 / 3; }

	/* Stacked, the connector runs down between the circles instead of across. */
	.tl-step:not(:last-child)::before {
		content: "";
		position: absolute;
		left: calc(var(--tl-dot) / 2 - 1px);
		top: var(--tl-dot);
		bottom: 0;
		width: 2px;
		background: var(--line);
	}

	.insights { grid-template-columns: 1fr; }
	.ins-a, .ins-b, .ins-c, .ins-d, .ins-e { grid-column: auto; }

	.mvv { grid-template-columns: 1fr; }

	.flow-node { width: 170px; }

	.fc-sales { top: -18px; right: -4px; }
	.fc-inv { bottom: 150px; left: -6px; }
	.fc-emp { bottom: 56px; right: -6px; }

	.module-layout { grid-template-columns: 1fr; }
	.module-aside { position: static; }

	.module-hero-grid { grid-template-columns: 1fr; gap: 36px; }

	/* Stacked, the screenshot lines up with the copy rather than centring. */
	.module-hero-media {
		max-width: 640px;
		width: 100%;
	}
}

/* Screenshots become a swipeable gallery on small screens. */
@media (max-width: 768px) {
	.shots {
		display: flex;
		gap: 16px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		overscroll-behavior-x: contain;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.shots::-webkit-scrollbar { display: none; }

	.shots .shot {
		flex: 0 0 100%;
		min-width: 0;
		scroll-snap-align: center;
	}

	.shots .frame-scroll { overflow: hidden; }

	.shot-dots {
		display: flex;
		gap: 4px;
		justify-content: center;
		margin-top: 6px;
	}

	.shot-dots button {
		width: 34px;
		height: 34px;
		border: none;
		background: none;
		padding: 0;
		cursor: pointer;
		display: grid;
		place-items: center;
	}

	.shot-dots button::before {
		content: "";
		width: 8px;
		height: 8px;
		border-radius: 99px;
		background: var(--line);
		transition: background-color .22s ease, width .22s ease;
	}

	.shot-dots button.on::before {
		background: var(--cherry);
		width: 22px;
	}

	.float-card { display: none; }

	/* A wide screenshot keeps a readable minimum width and scrolls sideways. */
	.is-wide-shot .frame-scroll { overflow-x: auto; }
	.is-wide-shot .frame-scroll img { min-width: 620px; }
	.is-wide-shot .swipe-hint { display: inline; }

	.hero { padding-top: 34px; }
	.hero h1 { font-size: clamp(30px, 8.6vw, 42px); }
	.hero-sub { font-size: 16.5px; }
	.hero .cb-ctas { gap: 12px; margin-bottom: 30px; flex-direction: column; }
	.hero .cb-ctas .btn { width: 100%; }
	.hero-trust { gap: 18px; }
	.hero-trust .stat { flex: 1 1 96px; }

	.stats-band,
	.why-grid,
	.ind-grid,
	.val-grid { grid-template-columns: 1fr; }

	.flow { gap: 6px; }

	.flow-node {
		width: 100%;
		max-width: 320px;
	}

	.flow-arrow {
		width: 100%;
		transform: rotate(90deg);
		height: 40px;
	}

	.ins-card { padding: 22px; }
	.kpi-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
	.hero-trust .stat b { font-size: 24px; }
	.timeline { --tl-dot: 60px; }
	.timeline .tl-step { gap: 14px; }
	.tl-step .num { font-size: 20px; }
	.donut-row { flex-direction: column; align-items: flex-start; gap: 12px; }
	.bar-emp .row { grid-template-columns: 62px 1fr 34px; }
	.stat-box b { font-size: 30px; }
}

@media (max-width: 380px) {
	.hero h1 { font-size: 29px; }
	.hero-trust { gap: 14px; }
	.hero-trust .stat b { font-size: 22px; }
}
