/* Page Sections — Bento stats (fake-UI dashboard collage). */

.ps-bento__head {
	max-width: 720px;
	margin: 0 auto clamp(28px, 4vw, 48px);
	text-align: center;
}

.ps-bento__eyebrow {
	margin: 0 0 0.5em;
	color: var(--red);
	font-family: var(--font);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.ps-bento__heading {
	margin: 0 0 0.4em;
	font-family: var(--font-heading);
	font-size: clamp(1.7rem, 3.2vw, 2.4rem);
	line-height: 1.15;
	color: var(--teal);
}

.ps-bento__intro {
	margin: 0;
	color: var(--grey-700);
	font-size: 1rem;
	line-height: 1.6;
}

/* ---------------------------------------------------------------------------
 * Grid
 * --------------------------------------------------------------------------- */

.ps-bento__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-rows: minmax(140px, auto);
	gap: clamp(12px, 1.5vw, 20px);
}

/* ---------------------------------------------------------------------------
 * Card base
 * --------------------------------------------------------------------------- */

.ps-bento__card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: clamp(18px, 2vw, 28px);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-card);
	min-width: 0;
	overflow: hidden;
	opacity: 1;
	transform: translateY(0);
	transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* Reveal animation hook (JS adds .is-revealed when it enters viewport). */
.ps-bento__grid[data-bento-anim] .ps-bento__card:not(.is-revealed) {
	opacity: 0;
	transform: translateY(18px);
}

/* Stagger via nth-child when revealed (small offsets only). */
.ps-bento__grid[data-bento-anim] .ps-bento__card:nth-child(1)  { transition-delay: 0ms; }
.ps-bento__grid[data-bento-anim] .ps-bento__card:nth-child(2)  { transition-delay: 60ms; }
.ps-bento__grid[data-bento-anim] .ps-bento__card:nth-child(3)  { transition-delay: 120ms; }
.ps-bento__grid[data-bento-anim] .ps-bento__card:nth-child(4)  { transition-delay: 180ms; }
.ps-bento__grid[data-bento-anim] .ps-bento__card:nth-child(5)  { transition-delay: 240ms; }
.ps-bento__grid[data-bento-anim] .ps-bento__card:nth-child(6)  { transition-delay: 300ms; }
.ps-bento__grid[data-bento-anim] .ps-bento__card:nth-child(7)  { transition-delay: 360ms; }
.ps-bento__grid[data-bento-anim] .ps-bento__card:nth-child(8)  { transition-delay: 420ms; }

/* Accent colour fills */
.ps-bento__card--accent-cream { background: var(--cream); }
.ps-bento__card--accent-sand  { background: var(--sand); }
.ps-bento__card--accent-teal  { background: var(--teal); }
.ps-bento__card--accent-plum  { background: var(--plum); }
.ps-bento__card--accent-red   { background: var(--red); }
.ps-bento__card--accent-green { background: var(--green); }

/* Tone (text colours) */
.ps-bento__card--light { color: var(--teal); }
.ps-bento__card--dark  { color: #ffffff; }

/* Cream tone: keep titles teal but soften secondary text. */
.ps-bento__card--accent-cream .ps-bento__card-sub,
.ps-bento__card--accent-sand  .ps-bento__card-sub { color: var(--grey-700); }

.ps-bento__card--dark .ps-bento__card-title  { color: rgba(255,255,255,0.7); }
.ps-bento__card--dark .ps-bento__card-sub    { color: rgba(255,255,255,0.78); }
.ps-bento__card--light .ps-bento__card-title { color: rgba(24,60,66,0.62); }

/* Red/green fills are much lighter than teal/plum — dimmed white text loses
   too much contrast there, so keep it (near-)solid on those accents. */
.ps-bento__card--accent-red .ps-bento__card-title,
.ps-bento__card--accent-green .ps-bento__card-title { color: rgba(255,255,255,0.92); }
.ps-bento__card--accent-red .ps-bento__card-sub,
.ps-bento__card--accent-green .ps-bento__card-sub { color: #fff; }

/* ---------------------------------------------------------------------------
 * Sizes — col × row spans on a 4-col grid
 * --------------------------------------------------------------------------- */

.ps-bento__card--size-small  { grid-column: span 1; grid-row: span 1; }
.ps-bento__card--size-medium { grid-column: span 2; grid-row: span 1; }
.ps-bento__card--size-large  { grid-column: span 2; grid-row: span 2; }
.ps-bento__card--size-wide   { grid-column: span 4; grid-row: span 1; }
.ps-bento__card--size-tall   { grid-column: span 1; grid-row: span 2; }

/* ---------------------------------------------------------------------------
 * Card content elements
 * --------------------------------------------------------------------------- */

.ps-bento__card-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	background: rgba(255,255,255,0.15);
}
.ps-bento__card--light .ps-bento__card-icon { background: rgba(24,60,66,0.08); }

.ps-bento__icon-svg { width: 18px; height: 18px; stroke-width: 1.8; }

.ps-bento__card-title {
	margin: 0;
	font-family: var(--font);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.ps-bento__card-value {
	margin: 0;
	font-family: var(--font-heading);
	font-size: clamp(1.6rem, 3vw, 2.6rem);
	line-height: 1;
	letter-spacing: 0.005em;
}

.ps-bento__card-value--sm { font-size: clamp(1.2rem, 2vw, 1.7rem); }

.ps-bento__card-sub {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.4;
}

.ps-bento__card-caption {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.55;
}

/* ---------------------------------------------------------------------------
 * Progress
 * --------------------------------------------------------------------------- */

.ps-bento__progress {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: auto;
}

.ps-bento__progress-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	font-size: 0.85rem;
}

.ps-bento__progress-label {
	font-weight: 500;
}

.ps-bento__progress-pct {
	font-family: var(--font-heading);
	font-size: 1.05rem;
	font-weight: 400;
}

.ps-bento__progress-track {
	position: relative;
	height: 8px;
	border-radius: 999px;
	background: rgba(255,255,255,0.18);
	overflow: hidden;
}
.ps-bento__card--light .ps-bento__progress-track { background: var(--grey-200); }

.ps-bento__progress-fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--red);
}
.ps-bento__card--accent-red .ps-bento__progress-fill   { background: var(--cream); }
.ps-bento__card--accent-green .ps-bento__progress-fill { background: var(--cream); }
.ps-bento__card--accent-teal .ps-bento__progress-fill  { background: var(--green); }
.ps-bento__card--accent-plum .ps-bento__progress-fill  { background: var(--red); }
.ps-bento__card--accent-cream .ps-bento__progress-fill { background: var(--teal); }
.ps-bento__card--accent-sand .ps-bento__progress-fill  { background: var(--teal); }

/* ---------------------------------------------------------------------------
 * List
 * --------------------------------------------------------------------------- */

.ps-bento__list {
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: 0.92rem;
}

.ps-bento__list-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.ps-bento__list-left {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.ps-bento__list-dot {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	border-radius: 999px;
	background: rgba(255,255,255,0.25);
	box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}
.ps-bento__card--light .ps-bento__list-dot {
	background: rgba(24,60,66,0.1);
	box-shadow: inset 0 0 0 1px rgba(24,60,66,0.08);
}

.ps-bento__list-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ps-bento__list-value {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
 * Mini chart
 * --------------------------------------------------------------------------- */

.ps-bento__chart {
	flex: 1 1 auto;
	display: flex;
	align-items: flex-end;
	min-height: 60px;
	color: currentColor;
	opacity: 0.85;
}

.ps-bento__chart-svg {
	width: 100%;
	height: 100%;
	max-height: 110px;
	display: block;
}

/* ---------------------------------------------------------------------------
 * Badge
 * --------------------------------------------------------------------------- */

.ps-bento__badge {
	margin: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 6px;
	padding: 8px 0;
}

.ps-bento__badge-value {
	font-family: var(--font-heading);
	font-size: clamp(2rem, 4vw, 3rem);
	line-height: 1;
	letter-spacing: 0.01em;
}

.ps-bento__badge-label {
	font-family: var(--font);
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.ps-bento__badge-sub {
	font-size: 0.82rem;
	opacity: 0.78;
}

/* ---------------------------------------------------------------------------
 * Type-specific tweaks
 * --------------------------------------------------------------------------- */

.ps-bento__card--type-stat       { justify-content: space-between; }
.ps-bento__card--type-progress   { justify-content: space-between; }
.ps-bento__card--type-mini_chart { justify-content: space-between; }
.ps-bento__card--type-badge      { padding: 16px; }

/* Larger sizes get a bit more breathing room for the value. */
.ps-bento__card--size-large .ps-bento__card-value,
.ps-bento__card--size-tall .ps-bento__card-value {
	font-size: clamp(2rem, 3.6vw, 3.2rem);
}

/* ---------------------------------------------------------------------------
 * Responsive
 * --------------------------------------------------------------------------- */

/* Tablet (~768–1023) — 2 col with a bit more vertical breathing room. */
@media (min-width: 768px) and (max-width: 1023px) {
	.ps-bento__grid {
		gap: clamp(14px, 1.8vw, 22px);
		grid-auto-rows: minmax(150px, auto);
	}
	.ps-bento__card { padding: clamp(20px, 2.4vw, 26px); }
}

/* Desktop — generous gap, taller base row, beefier card values. */
@media (min-width: 1024px) {
	.ps-bento__grid {
		gap: clamp(14px, 1.5vw, 20px);
		grid-auto-rows: minmax(150px, auto);
	}
	.ps-bento__card { padding: clamp(20px, 1.8vw, 26px); gap: 10px; }
	.ps-bento__card-value { font-size: clamp(1.8rem, 2.4vw, 2.4rem); }
	.ps-bento__card--size-large .ps-bento__card-value,
	.ps-bento__card--size-tall  .ps-bento__card-value { font-size: clamp(2.2rem, 3vw, 3rem); }
	.ps-bento__card-caption { font-size: 0.98rem; }
	.ps-bento__badge-value  { font-size: clamp(2.2rem, 2.8vw, 2.8rem); }
	.ps-bento__chart { min-height: 80px; }
	.ps-bento__chart-svg { max-height: 120px; }
}

/* Wide desktop — push the largest cards a step further. */
@media (min-width: 1280px) {
	.ps-bento__grid { gap: 22px; grid-auto-rows: minmax(160px, auto); }
	.ps-bento__card--size-large .ps-bento__card-value,
	.ps-bento__card--size-tall  .ps-bento__card-value { font-size: clamp(2.4rem, 2.8vw, 3.2rem); }
}

@media (max-width: 1023px) {
	.ps-bento__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* Most sizes normalise to a single column, but large/tall keep their row span. */
	.ps-bento__card--size-small,
	.ps-bento__card--size-medium,
	.ps-bento__card--size-tall {
		grid-column: span 1;
	}

	.ps-bento__card--size-large,
	.ps-bento__card--size-wide {
		grid-column: span 2;
	}

	.ps-bento__card--size-large { grid-row: span 2; }
	.ps-bento__card--size-tall  { grid-row: span 2; }
}

@media (max-width: 600px) {
	.ps-bento__grid {
		grid-template-columns: 1fr;
		grid-auto-rows: minmax(120px, auto);
	}

	.ps-bento__card--size-small,
	.ps-bento__card--size-medium,
	.ps-bento__card--size-large,
	.ps-bento__card--size-wide,
	.ps-bento__card--size-tall {
		grid-column: span 1;
		grid-row: span 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ps-bento__card {
		transition: none !important;
	}
	.ps-bento__grid[data-bento-anim] .ps-bento__card:not(.is-revealed) {
		opacity: 1;
		transform: none;
	}
}
