/* ==========================================================================
   MAGNIFISA 2.0 — refinements layered on main.css
   Smoother motion, professional components, mobile quick-action bar.
   ========================================================================== */

/* ---------- smoothness ---------- */

@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .28s; animation-timing-function: cubic-bezier(.22, .61, .36, 1); }

html { scrollbar-gutter: stable; }
[id] { scroll-margin-top: 92px; }

body.mg { text-rendering: optimizeLegibility; }

/* Scroll reveal: a transition (interruptible, no restart flicker) instead of
   a keyframe animation, and only hidden when JavaScript is running. */
.reveal {
	animation: none !important;
	opacity: 1;
	transform: none;
}
html.js .reveal {
	opacity: 0;
	transform: translate3d(0, 16px, 0);
	transition: opacity .6s cubic-bezier(.16, 1, .3, 1), transform .6s cubic-bezier(.16, 1, .3, 1);
	transition-delay: var(--d, 0s);
}
html.js .reveal.is-in { opacity: 1; transform: none; }

/* Above-the-fold hero pieces animate once on load. */
.mg-reveal { animation-duration: .7s !important; }
.mg-line > span { animation-duration: .8s; }

/* Heavy below-the-fold sections render only when near the viewport. */
.mg-cv, .mg-grid { content-visibility: auto; contain-intrinsic-size: auto 900px; }

/* Pause looping animations off-screen (toggled by JS). */
.is-paused, .is-paused * { animation-play-state: paused !important; }

/* ---------- top bar ---------- */

.mg-topbar { background: #060E21; color: rgba(216, 226, 240, .72); font-size: .78rem; border-bottom: 1px solid var(--line-dark); }
.mg-topbar__inner {
	width: min(100% - (var(--gut) * 2), 1400px); margin-inline: auto;
	display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px;
}
.mg-topbar__note { margin: 0; letter-spacing: .06em; }
.mg-topbar__links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.mg-topbar__links a { color: inherit; transition: color .2s; }
.mg-topbar__links a:hover { color: var(--gold); }

/* ---------- header ---------- */

.mg-header { transition: background .3s ease, border-color .3s ease; }
.mg-header__inner, .mg-logo { transition: height .3s ease; }
.mg-btn--dl svg { width: 16px; height: 16px; }
.mg-btn svg { flex: 0 0 auto; }
.mg-btn__meta { font-family: var(--ff-body); font-weight: 500; font-size: .72em; opacity: .7; margin-inline-start: 2px; }
.mg-header .mg-btn__meta { display: none; }
.mg-btn-row--center { justify-content: center; margin-top: clamp(28px, 4vw, 44px); }
.mg-drawer__cta { margin: 0 0 28px; }

/* ---------- hero ---------- */

.mg-hero { min-height: clamp(560px, 86vh, 860px); }
.mg-hero__media { will-change: transform; }
.mg-hero__lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); }

/* ---------- trust strip ---------- */

.mg-trust { background: var(--noir); color: var(--champagne); border-top: 1px solid var(--line-dark); }
.mg-trust__list {
	list-style: none; margin-block: 0; padding: 0;
	display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
}
.mg-trust__list li { padding: 22px 18px; border-inline-start: 1px solid var(--line-dark); }
.mg-trust__list li:first-child { border-inline-start: 0; padding-inline-start: 0; }
.mg-trust__list strong { display: block; font-family: var(--ff-display); font-weight: 700; font-size: clamp(1.2rem, 2.2vw, 1.6rem); letter-spacing: -.02em; color: var(--gold); }
.mg-trust__list span { display: block; font-size: .84rem; color: rgba(216, 226, 240, .66); margin-top: 2px; }

/* ---------- section heads ---------- */

.mg-shead--wide { max-width: 86ch; }
.mg-shead--split { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(18px, 4vw, 60px); align-items: end; }
.mg-shead--split .mg-h2, .mg-shead--split .mg-lede { margin-bottom: 0; }

/* ---------- sintered stone process ---------- */

.mg-sintered { background: radial-gradient(90% 70% at 85% 0%, rgba(74, 111, 181, .12), transparent 60%), var(--noir); }
.mg-process {
	list-style: none; margin: 0; padding: 0; counter-reset: none;
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px);
	position: relative;
}
.mg-process::before {
	content: ""; position: absolute; top: 58px; left: 8%; right: 8%; height: 1px;
	background: linear-gradient(90deg, transparent, rgba(74, 111, 181, .55), transparent);
}
.mg-process__step {
	position: relative; padding: clamp(22px, 3vw, 32px);
	border: 1px solid var(--line-dark); border-radius: var(--r-lg);
	background: rgba(10, 22, 49, .72); backdrop-filter: blur(4px);
}
.mg-process__num { display: block; font-size: .72rem; font-weight: 600; letter-spacing: .2em; color: var(--gold); margin-bottom: 14px; }
.mg-process__big {
	display: block; font-family: var(--ff-display); font-weight: 700;
	font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1; letter-spacing: -.03em; color: var(--champagne);
	margin-bottom: 16px; min-height: 1em;
}
.mg-process__big--icon { color: var(--gold); }
.mg-process__big--icon svg { width: 48px; height: 48px; }
.mg-process__step h3 { font-family: var(--ff-display); font-size: 1.2rem; font-weight: 600; margin: 0 0 .45em; color: var(--champagne); }
.mg-process__step p { margin: 0; font-size: .95rem; color: rgba(216, 226, 240, .72); }

.mg-process__result {
	display: flex; gap: 12px; align-items: flex-start;
	margin: clamp(22px, 3vw, 34px) 0 0; padding: 18px 22px;
	border-radius: var(--r); background: rgba(74, 111, 181, .1); border: 1px solid rgba(74, 111, 181, .32);
	color: var(--champagne); font-size: 1rem;
}
.mg-process__result svg { width: 22px; height: 22px; color: var(--gold); flex: 0 0 auto; margin-top: 2px; }

.mg-adv { margin-top: clamp(34px, 5vw, 56px); padding-top: clamp(26px, 4vw, 40px); border-top: 1px solid var(--line-dark); }
.mg-adv__title { font-family: var(--ff-display); font-size: 1.15rem; font-weight: 600; margin: 0 0 18px; color: var(--champagne); }
.mg-adv__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 26px; }
.mg-adv__list li { position: relative; padding-inline-start: 26px; color: rgba(216, 226, 240, .8); font-size: .96rem; }
.mg-adv__list li::before {
	content: ""; position: absolute; inset-inline-start: 0; top: .5em; width: 12px; height: 7px;
	border-left: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(-45deg);
}

/* ---------- the two products ---------- */

.mg-two__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.6vw, 30px); }

.mg-two__card {
	display: flex; flex-direction: column;
	background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
	transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s;
}
.mg-two__card:hover { transform: translateY(-6px); box-shadow: 0 26px 60px rgba(10, 22, 49, .14); border-color: rgba(74, 111, 181, .5); }
.mg-two__media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--champagne-soft); }
.mg-two__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.mg-two__card:hover .mg-two__media img { transform: scale(1.05); }
.mg-two__tag {
	position: absolute; top: 14px; inset-inline-start: 14px; margin: 0;
	display: flex; align-items: center; gap: 8px;
	background: rgba(10, 22, 49, .85); color: var(--champagne); backdrop-filter: blur(6px);
	padding: 7px 14px; border-radius: 100px; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
}
.mg-two__tag b { color: var(--gold); font-weight: 700; }

.mg-two__body { padding: clamp(20px, 3vw, 32px); display: flex; flex-direction: column; flex: 1; }
.mg-two__name { font-family: var(--ff-display); font-weight: 700; font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.035em; line-height: 1; margin: 0 0 .2em; }
.mg-two__sub { color: var(--gold); font-weight: 600; font-size: .9rem; margin: 0 0 1em; }
.mg-two__desc { color: var(--ink-60); margin: 0 0 1.3em; }
.mg-two__specs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 1.5em; padding: 0; }
.mg-two__specs li { font-size: .8rem; padding: 6px 12px; border: 1px solid var(--line); border-radius: 100px; background: var(--champagne-soft); }
.mg-two__card .mg-btn-row { margin-top: auto; }

.mg-compare { margin-top: clamp(30px, 4vw, 50px); }
.mg-compare__title { font-family: var(--ff-display); font-size: 1.1rem; font-weight: 600; margin: 0 0 16px; text-align: center; }
.mg-table--compare th:first-child { width: 22%; }
.mg-table--compare td { font-weight: 500; }
.mg-table--compare thead th:nth-child(2), .mg-table--compare thead th:nth-child(3) { color: var(--gold); }

@media (max-width: 820px) { .mg-two__grid { grid-template-columns: 1fr; } }

/* ---------- two-range switcher (product pages) ---------- */

.mg-switch { background: var(--ink); border-bottom: 1px solid rgba(216, 226, 240, .1); }
.mg-switch__inner { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); padding: 14px 0; flex-wrap: wrap; }
.mg-switch__label {
	margin: 0; color: var(--champagne); opacity: .5;
	font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; white-space: nowrap;
}
.mg-switch__list { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; flex: 1; flex-wrap: wrap; }
.mg-switch__item {
	display: flex; flex-direction: column; gap: 2px;
	padding: 9px 18px; border-radius: 100px; border: 1px solid rgba(216, 226, 240, .18);
	color: var(--champagne); text-decoration: none; transition: border-color .25s, background .25s, color .25s;
}
.mg-switch__item b { font-family: var(--ff-display); font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.mg-switch__item span { font-size: .76rem; opacity: .6; }
.mg-switch__short { display: none; }
.mg-switch__item:hover { border-color: var(--gold); background: rgba(74, 111, 181, .1); }
.mg-switch__item.is-active { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.mg-switch__item.is-active span { opacity: .75; }

@media (max-width: 600px) {
	.mg-switch__label { display: none; }
	.mg-switch__item { padding: 8px 14px; flex: 1; }
	.mg-switch__item span { font-size: .68rem; }
}

/* ---------- labelled division paragraphs (About) ---------- */

.mg-prose__label {
	display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
	font-family: var(--ff-display); font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em;
	margin: 1.8em 0 .5em; padding-top: 1.1em; border-top: 1px solid var(--line);
}
.mg-prose__label span {
	font-size: .7rem; font-weight: 700; letter-spacing: .1em; color: var(--gold);
	border: 1px solid rgba(74, 111, 181, .4); border-radius: 100px; padding: 3px 9px;
}
.mg-prose__label em { font-style: normal; font-weight: 400; font-size: .92rem; color: var(--ink-60); }

/* ---------- slab tiles ---------- */

.mg-slabgrid--home { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.mg-tall__view {
	position: absolute; left: 50%; bottom: 14px; translate: -50% 8px;
	background: rgba(255, 255, 255, .92); color: var(--noir);
	font-size: .74rem; font-weight: 600; letter-spacing: .04em;
	padding: 6px 14px; border-radius: 100px; opacity: 0;
	transition: opacity .25s ease, translate .25s ease;
}
.mg-tall:hover .mg-tall__view, .mg-tall:focus-visible .mg-tall__view { opacity: 1; translate: -50% 0; }

/* ---------- family jump nav ---------- */

.mg-jump { position: sticky; top: var(--header-h); z-index: 50; background: rgba(243, 246, 251, .94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.mg-header.is-stuck ~ .mg-jump { top: 64px; }
.mg-jump__inner { display: flex; gap: 6px; overflow-x: auto; padding-block: 10px; scrollbar-width: none; }
.mg-jump__inner::-webkit-scrollbar { display: none; }
.mg-jump a {
	flex: 0 0 auto; padding: 7px 14px; border-radius: 100px; font-size: .84rem; font-weight: 500;
	border: 1px solid var(--line); background: #fff; white-space: nowrap; transition: border-color .2s, background .2s, color .2s;
}
.mg-jump a span { opacity: .5; font-size: .8em; margin-inline-start: 3px; }
.mg-jump a:hover { border-color: var(--gold); }

.mg-apps { list-style: none; margin: 1.4em 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mg-apps li { padding: 7px 14px; border: 1px solid var(--line); border-radius: 100px; font-size: .88rem; background: rgba(255, 255, 255, .7); }

/* ---------- downloads ---------- */

.mg-downloads { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.mg-download .mg-btn { margin-top: auto; }
.mg-downloads__note { margin: 18px 0 0; font-size: .86rem; color: rgba(216, 226, 240, .58); }

/* ---------- footer CTA ---------- */

.mg-footer__cta { text-align: start; }
.mg-footer__cta-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: clamp(20px, 4vw, 56px); align-items: end; }
.mg-footer__cta .mg-lede { margin-inline: 0; }
.mg-footer__cta .mg-btn-row { justify-content: flex-start; margin-top: 0; }
.mg-footer__col small { opacity: .55; }

/* ---------- contact ---------- */

.mg-phero--short { padding-block: clamp(100px, 12vh, 150px) clamp(40px, 6vh, 64px); }
.mg-contact { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.mg-contact__intro { margin: -6px 0 22px; color: var(--ink-60); }
.mg-contact__info { display: grid; gap: 16px; }
.mg-contact__card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 3vw, 28px); }
.mg-contact__card .mg-contact__list { margin: 0; }
.mg-contact__list small { display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--smoke); margin-bottom: 2px; }
.mg-contact__card--dark { background: var(--noir); color: var(--champagne); border-color: var(--noir); }
.mg-contact__card--dark p { color: rgba(216, 226, 240, .7); margin: 0 0 16px; }
.mg-contact__card--dark .mg-h3 { color: var(--champagne); }

/* ---------- form states ---------- */

.mg-form__status {
	padding: 14px 16px; border-radius: 10px; font-size: .95rem;
	background: rgba(74, 111, 181, .12); border: 1px solid rgba(74, 111, 181, .45); color: var(--ink);
}
.mg-form__status[data-state="error"] { background: rgba(158, 57, 46, .08); border-color: rgba(158, 57, 46, .4); }
.mg-form__status[data-state="sent"] { display: flex; gap: 10px; align-items: center; }
.mg-form__status[data-state="sent"]::before {
	content: ""; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
	background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.mg-form__product { padding: 10px 14px; border-radius: 10px; background: var(--champagne-soft); border: 1px solid var(--line); font-size: .92rem; }
.mg-form__product span { color: var(--smoke); }
.mg-field__err { display: none; font-style: normal; font-size: .8rem; color: #9e392e; }
.mg-field.is-invalid input, .mg-field.is-invalid textarea { border-color: #9e392e; background: #fff; }
.mg-field.is-invalid .mg-field__err { display: block; }
.mg-form__submit[aria-busy="true"] { pointer-events: none; opacity: .75; }
.mg-form__submit[aria-busy="true"] svg { animation: mg-spin .8s linear infinite; }
@keyframes mg-spin { to { transform: rotate(360deg); } }
.mg-form.is-sent .mg-field, .mg-form.is-sent .mg-form__row, .mg-form.is-sent .mg-form__submit, .mg-form.is-sent .mg-form__product { display: none; }

/* ---------- modal ---------- */

.mg-modal__panel { animation-duration: .32s; }
.mg-detail__actions { display: grid; gap: 10px; }

/* ---------- mobile quick-action bar ---------- */

.mg-mobilebar { display: none; }

@media (max-width: 900px) {
	.mg-hide-md { display: none; }
	.mg-topbar__note { display: none; }
	.mg-topbar__inner { justify-content: center; }
	.mg-trust__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.mg-trust__list li:nth-child(4) { border-inline-start: 0; padding-inline-start: 0; }
	.mg-trust__list li { padding-block: 16px; }
	.mg-process { grid-template-columns: 1fr; }
	.mg-process::before { display: none; }
	.mg-adv__list { grid-template-columns: 1fr 1fr; }
	.mg-shead--split, .mg-footer__cta-inner, .mg-contact { grid-template-columns: 1fr; }
	.mg-jump { top: var(--header-h); }

	.mg-whatsapp { display: none; }
	body.mg { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
	.mg-mobilebar {
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 85;
		display: grid; grid-template-columns: repeat(4, 1fr);
		background: rgba(10, 22, 49, .97); backdrop-filter: blur(12px);
		border-top: 1px solid var(--line-dark);
		padding-bottom: env(safe-area-inset-bottom);
	}
	.mg-mobilebar a {
		display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
		height: 62px; color: rgba(216, 226, 240, .8); font-size: .7rem; font-weight: 500;
	}
	.mg-mobilebar svg { width: 21px; height: 21px; }
	.mg-mobilebar a.is-primary { color: var(--noir); background: var(--gold); }
}

@media (max-width: 620px) {
	.mg-topbar__links { gap: 16px; }
	.mg-trust__list { grid-template-columns: 1fr 1fr; }
	.mg-trust__list li, .mg-trust__list li:nth-child(4) { border-inline-start: 0; padding-inline-start: 0; }
	.mg-adv__list { grid-template-columns: 1fr; }
	.mg-header .mg-btn--dl span { display: none; }
	.mg-header .mg-btn--dl { padding: 10px 12px; }
	.mg-slabgrid--home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
	html.js .reveal { opacity: 1; transform: none; transition: none; }
	@view-transition { navigation: none; }
}

/* Visually hidden, still read by screen readers. */
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ============================================================
   Phone refinements — shorter pages, bigger targets, no side-scroll
   ============================================================ */

html { scroll-padding-top: 90px; }

@media (max-width: 767px) {
	.mg-topbar { display: none; }

	.mg-section { padding: 56px 0; }
	.mg-section--tight { padding-top: 34px; }
	.mg-shead { margin-bottom: 26px; }

	.mg-trust__list {
		display: flex; gap: 0; overflow-x: auto; scroll-snap-type: x proximity;
		-webkit-overflow-scrolling: touch; scrollbar-width: none;
	}
	.mg-trust__list::-webkit-scrollbar { display: none; }
	.mg-trust__list li {
		flex: 0 0 auto; min-width: 40vw; scroll-snap-align: start;
		padding: 16px 22px 16px 0; border-inline-start: 0;
	}
	.mg-trust__list li + li { border-inline-start: 1px solid var(--line-dark); padding-inline-start: 22px; }
	.mg-trust__list span { font-size: .78rem; }

	.mg-btn { min-height: 48px; }
	.mg-chipbtn, .mg-jump a { min-height: 42px; display: inline-flex; align-items: center; }

	.mg-hero__inner .mg-btn { width: 100%; justify-content: center; }
	.mg-hero__lede { font-size: 1rem; }

	.mg-two__media { aspect-ratio: 16 / 9; }
	.mg-two__body { padding: 20px 18px 22px; }
	.mg-two__name { font-size: 2.1rem; }
	.mg-two__specs { gap: 6px; margin-bottom: 1.2em; }
	.mg-two__specs li { font-size: .74rem; padding: 5px 10px; }
	.mg-two__card .mg-btn { flex: 1 1 100%; justify-content: center; }

	.mg-switch__inner { padding: 10px 0; gap: 10px; }
	.mg-switch__list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
	.mg-switch__item { padding: 10px 12px; border-radius: 14px; align-items: center; text-align: center; }
	.mg-switch__long { display: none; }
	.mg-switch__short { display: block; }

	.mg-slabgrid--home {
		display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px;
		scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
		scrollbar-width: none; scroll-padding-inline: var(--gut);
	}
	.mg-slabgrid--home::-webkit-scrollbar { display: none; }
	.mg-slabgrid--home > * { flex: 0 0 46%; scroll-snap-align: start; }
	.mg-slabgrid--home .mg-tall__media { aspect-ratio: 80 / 210; }
}

@media (max-width: 600px) {
	.mg-slabgrid:not(.mg-slabgrid--home) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
	.mg-slabgrid:not(.mg-slabgrid--home) .mg-tall__media { aspect-ratio: 80 / 230; }
	.mg-slabgrid:not(.mg-slabgrid--home) figcaption strong { font-size: .8rem; line-height: 1.25; }
	.mg-slabgrid:not(.mg-slabgrid--home) figcaption span { font-size: .68rem; }
	.mg-tall__faces { font-size: .62rem; padding: 3px 7px; }
}

@media (max-width: 640px) {
	.mg-table-wrap { overflow: visible; }
	.mg-table--compare { min-width: 0; display: block; }
	.mg-table--compare thead { display: none; }
	.mg-table--compare tbody, .mg-table--compare tr, .mg-table--compare th, .mg-table--compare td { display: block; }
	.mg-table--compare tr { padding: 15px 16px; border-bottom: 1px solid var(--line); }
	.mg-table--compare tr:last-child { border-bottom: 0; }
	.mg-table--compare tbody th {
		padding: 0 0 10px; border: 0; opacity: 1; font-weight: 600;
		font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-60);
	}
	.mg-table--compare td { position: relative; border: 0; padding: 0 0 0 62px; margin-bottom: 8px; font-size: .92rem; }
	.mg-table--compare td:last-child { margin-bottom: 0; }
	.mg-table--compare td::before {
		content: attr(data-label); position: absolute; inset-inline-start: 0; top: 2px;
		font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
	}
	.mg-table--compare tbody tr:hover { background: none; }

	.mg-table:not(.mg-table--compare) { min-width: 520px; font-size: .86rem; }
	.mg-table:not(.mg-table--compare) th, .mg-table:not(.mg-table--compare) td { padding: 12px 14px; }
}

/* Compare rows: label on top, the two answers side by side */
@media (max-width: 640px) {
	.mg-table--compare tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; padding: 14px 16px; }
	.mg-table--compare tbody th { grid-column: 1 / -1; padding: 0 0 6px; }
	.mg-table--compare td { padding: 0; margin: 0; font-size: .88rem; line-height: 1.4; }
	.mg-table--compare td::before { position: static; display: block; margin-bottom: 4px; }
}

@media (max-width: 767px) {
	.mg-hero__inner .mg-btn__meta { display: none; }
}

/* ---------- 3D kitchen visualiser ---------- */

.mg-viz__stage {
	position: relative; overflow: hidden; aspect-ratio: 16 / 9;
	border-radius: var(--r-lg); border: 1px solid var(--line-dark); background: #0B1735;
}
.mg-viz__canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.mg-viz__canvas:active { cursor: grabbing; }
.mg-viz__veil {
	position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
	background: #0B1735; color: rgba(216, 226, 240, .65); font-size: .86rem; text-align: center; padding: 20px;
	transition: opacity .7s var(--ease), visibility .7s;
}
.mg-viz__veil p { margin: 0; }
.mg-viz__veil.is-gone { opacity: 0; visibility: hidden; }
.mg-viz__spin {
	width: 34px; height: 34px; border-radius: 50%;
	border: 2px solid rgba(216, 226, 240, .22); border-top-color: var(--gold);
	animation: mg-spin 1s linear infinite;
}
@keyframes mg-spin { to { transform: rotate(360deg); } }
.mg-viz__hint {
	position: absolute; top: 14px; inset-inline-start: 16px; margin: 0; pointer-events: none;
	font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
	color: rgba(216, 226, 240, .75); background: rgba(10, 22, 49, .5); backdrop-filter: blur(6px);
	padding: 7px 13px; border-radius: 100px; transition: opacity .5s var(--ease);
}
.mg-viz__hint.is-gone { opacity: 0; }
.mg-viz__tools {
	position: absolute; inset-inline: 14px; bottom: 14px;
	display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.mg-viz__surfaces, .mg-viz__reset {
	background: rgba(10, 22, 49, .55); backdrop-filter: blur(10px);
	border: 1px solid rgba(216, 226, 240, .14); border-radius: 100px;
}
.mg-viz__surfaces { display: flex; gap: 4px; padding: 4px; }
.mg-viz__surf, .mg-viz__reset {
	font: inherit; font-size: .8rem; color: rgba(216, 226, 240, .72); cursor: pointer;
	padding: 9px 16px; min-height: 40px; border-radius: 100px; transition: background .25s, color .25s;
}
.mg-viz__surf { border: 0; background: none; }
.mg-viz__surf:hover { color: var(--champagne); }
.mg-viz__surf.is-on { background: var(--gold); color: var(--ink); font-weight: 600; }
.mg-viz__reset:hover { color: var(--champagne); border-color: rgba(74, 111, 181, .5); }

.mg-dl-light {
	display: inline-flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
	margin-top: 10px; font-size: .8rem; line-height: 1.4;
	color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(74, 111, 181, .35);
	padding-bottom: 2px; transition: color .25s, border-color .25s;
}
.mg-dl-light:hover { color: var(--champagne); border-color: currentColor; }
.mg-dl-light small { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; opacity: .7; unicode-bidi: plaintext; }

.mg-viz__scenes {
	display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
	margin: 0 auto 16px; padding: 5px; width: fit-content; max-width: 100%;
	border: 1px solid rgba(216, 226, 240, .14); border-radius: 100px;
	background: rgba(10, 22, 49, .45);
}
.mg-viz__scene {
	font: inherit; font-size: .82rem; color: rgba(216, 226, 240, .7);
	border: 0; background: none; cursor: pointer; white-space: nowrap;
	padding: 9px 18px; min-height: 40px; border-radius: 100px;
	transition: background .25s, color .25s;
}
.mg-viz__scene:hover { color: var(--champagne); }
.mg-viz__scene.is-on { background: var(--gold); color: var(--ink); font-weight: 600; }
@media (max-width: 560px) {
	.mg-viz__scenes { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
	.mg-viz__scenes::-webkit-scrollbar { display: none; }
	.mg-viz__scene { padding: 9px 14px; font-size: .78rem; }
}

.mg-viz__picker {
	display: flex; gap: 10px; margin-top: 18px; overflow-x: auto; padding-bottom: 10px;
	scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
}
.mg-viz__picker::-webkit-scrollbar { display: none; }
.mg-viz__swatch {
	flex: 0 0 auto; width: 84px; border: 0; background: none; padding: 0; cursor: pointer;
	color: rgba(216, 226, 240, .6); scroll-snap-align: start; font: inherit;
}
.mg-viz__swatch > span {
	display: block; height: 84px; border-radius: 12px; background-size: cover; background-position: center;
	border: 2px solid transparent; transition: border-color .25s, transform .3s var(--ease);
}
.mg-viz__swatch em { display: block; font-style: normal; font-size: .68rem; margin-top: 7px; line-height: 1.25; }
.mg-viz__swatch:hover > span { transform: translateY(-3px); }
.mg-viz__swatch.is-active > span { border-color: var(--gold); transform: translateY(-3px); }
.mg-viz__swatch.is-active { color: var(--champagne); }
.mg-viz__note { margin: 14px 0 0; font-size: .82rem; color: rgba(216, 226, 240, .5); }
.mg-viz__note a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 767px) {
	.mg-viz__stage { aspect-ratio: 3 / 4; }
	.mg-viz__tools { inset-inline: 10px; bottom: 10px; gap: 8px; }
	.mg-viz__surf, .mg-viz__reset { font-size: .74rem; padding: 8px 12px; min-height: 38px; }
	.mg-viz__swatch { width: 70px; }
	.mg-viz__swatch > span { height: 70px; }
}

/* Keep the page itself as the scroller: overflow-x on <body> turns the body
   into a nested scroll box, which breaks momentum scrolling on iOS and
   anchor jumps everywhere. */
html { overflow-x: hidden; }
body.mg { overflow-x: clip; }
@supports not (overflow: clip) { body.mg { overflow-x: visible; } }

/* photographic finish over the 3D canvas */
.mg-viz__stage::after {
	content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
	transition: opacity 1s var(--ease);
	background: radial-gradient(118% 78% at 50% 44%, rgba(0, 0, 0, 0) 46%, rgba(0, 0, 0, .42) 100%);
}
.mg-viz__stage.is-live::after { opacity: 1; }

/* ---------- home page rhythm ---------- */

/* one label style for every section heading */
.mg-shead .mg-eyebrow::before,
.mg-split__text .mg-eyebrow::before {
	content: ''; display: inline-block; width: 22px; height: 1px; margin-inline-end: 10px;
	background: currentColor; opacity: .55; vertical-align: middle;
}

/* the two ranges, right under the hero buttons */
.mg-hero__ranges { display: flex; gap: 10px; list-style: none; margin: 26px 0 0; padding: 0; flex-wrap: wrap; }
.mg-hero__ranges a {
	display: flex; flex-direction: column; gap: 1px; padding: 10px 18px; border-radius: 100px;
	border: 1px solid rgba(216, 226, 240, .22); background: rgba(10, 22, 49, .35); backdrop-filter: blur(8px);
	color: var(--champagne); text-decoration: none;
	transition: border-color .25s, background .25s, transform .3s var(--ease);
}
.mg-hero__ranges a:hover { border-color: var(--gold); background: rgba(74, 111, 181, .14); transform: translateY(-2px); }
.mg-hero__ranges b { font-family: var(--ff-display); font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.mg-hero__ranges span { font-size: .72rem; opacity: .62; }

/* family chips above the slab preview */
.mg-fams { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 clamp(20px, 3vw, 30px); }
.mg-fams a {
	display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 100px;
	border: 1px solid var(--line); background: #fff; font-size: .85rem; color: var(--ink); text-decoration: none;
	transition: border-color .25s, transform .3s var(--ease), box-shadow .3s;
}
.mg-fams a:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(10, 22, 49, .08); }
.mg-fams span { font-size: .72rem; color: var(--gold); font-weight: 700; }

/* spec chips reused inside a split section */
.mg-split__text .mg-two__specs { margin: 0 0 1.6em; }

@media (max-width: 767px) {
	.mg-hero__ranges { gap: 8px; margin-top: 18px; }
	.mg-hero__ranges li { flex: 1 1 46%; }
	.mg-hero__ranges a { align-items: center; text-align: center; padding: 10px 12px; }
	.mg-fams { gap: 7px; }
	.mg-fams a { padding: 8px 13px; font-size: .8rem; }
}

@media (max-width: 767px) {
	/* families: one swipeable row instead of three stacked lines */
	.mg-fams {
		flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity;
		-webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px;
	}
	.mg-fams::-webkit-scrollbar { display: none; }
	.mg-fams a { flex: 0 0 auto; scroll-snap-align: start; }
	.mg-hero__ranges a { padding: 9px 10px; }
	.mg-hero__ranges span { font-size: .68rem; }
}

/* the featured slab row: one clean band on desktop, two even rows on tablets */
@media (min-width: 1100px) {
	.mg-slabgrid--home { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
}
@media (min-width: 768px) and (max-width: 1099px) {
	.mg-slabgrid--home { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- slab calculator ---------- */

.mg-calc__box {
	background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
	padding: clamp(18px, 3vw, 30px); box-shadow: 0 20px 50px rgba(10, 22, 49, .06);
}
.mg-calc__rows { display: grid; gap: 12px; }
.mg-calc__row {
	display: grid; grid-template-columns: minmax(150px, 1.2fr) 1fr 1fr auto; gap: 12px; align-items: end;
	padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.mg-calc__row select, .mg-calc__row input, .mg-calc__waste select {
	width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
	background: var(--paper); font: inherit; font-size: 16px; color: var(--ink);
}
.mg-calc__row input:focus, .mg-calc__row select:focus { outline: 2px solid rgba(74, 111, 181, .5); outline-offset: 1px; }
.mg-calc__row label { display: grid; gap: 6px; position: relative; }
.mg-calc__row label span { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-60); font-weight: 600; }
.mg-calc__row label em { position: absolute; right: 12px; bottom: 14px; font-style: normal; font-size: .8rem; color: var(--ink-60); pointer-events: none; }
.mg-calc__del {
	width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: none;
	font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ink-60); transition: border-color .2s, color .2s;
}
.mg-calc__del:hover { border-color: var(--gold); color: var(--ink); }
.mg-calc__bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 16px 0 20px; }
.mg-calc__waste { display: flex; align-items: center; gap: 10px; font-size: .86rem; color: var(--ink-60); }
.mg-calc__waste select { width: auto; min-height: 40px; }
.mg-calc__result {
	display: flex; align-items: center; gap: clamp(16px, 4vw, 48px); flex-wrap: wrap;
	padding: 18px 22px; border-radius: 14px; background: var(--ink); color: var(--champagne);
}
.mg-calc__result span { display: block; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; opacity: .6; }
.mg-calc__result strong { font-family: var(--ff-display); font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.02em; color: var(--gold); }
.mg-calc__result .mg-btn { margin-inline-start: auto; }
.mg-calc__note { margin: 12px 0 0; font-size: .8rem; color: var(--ink-60); }

@media (max-width: 640px) {
	.mg-calc__row { grid-template-columns: 1fr 1fr; }
	.mg-calc__row select { grid-column: 1 / -1; }
	.mg-calc__del { grid-column: 1 / -1; width: 100%; height: 40px; font-size: .85rem; }
	.mg-calc__del::after { content: ' Remove'; }
	.mg-calc__result .mg-btn { width: 100%; margin: 0; justify-content: center; }
}

/* ---------- worktop FAQ ---------- */

.mg-faq { display: grid; gap: 10px; align-content: start; }
.mg-faq__item {
	background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 0 18px;
	transition: border-color .25s, box-shadow .25s;
}
.mg-faq__item[open] { border-color: rgba(74, 111, 181, .5); box-shadow: 0 12px 30px rgba(10, 22, 49, .06); }
.mg-faq__item summary {
	list-style: none; cursor: pointer; padding: 16px 30px 16px 0; position: relative;
	font-family: var(--ff-display); font-weight: 600; letter-spacing: -.01em;
}
.mg-faq__item summary::-webkit-details-marker { display: none; }
.mg-faq__item summary::after {
	content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
	font-size: 1.4rem; font-weight: 400; color: var(--gold); transition: transform .3s var(--ease);
}
.mg-faq__item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.mg-faq__item p { margin: 0 0 16px; color: var(--ink-60); font-size: .95rem; }
.mg-guide .mg-split { align-items: start; }

/* ---------- review follow-ups ---------- */

.mg-spec-note { margin: 14px 0 0; font-size: .84rem; color: rgba(216, 226, 240, .6); }
.mg-spec-note a { color: var(--gold); }
.mg-table small { opacity: .7; }
.mg-form__row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mg-modal__sample { margin-top: 8px; }
.mg-anchor { display: block; height: 0; }

@media (max-width: 767px) {
	.mg-form__row--3 { grid-template-columns: 1fr; }
}

/* Flex installations: a 3 × 2 grid on desktop */
@media (min-width: 900px) {
	.mg-gallery--flex { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ==========================================================================
   Arabic (RTL) — /ar/
   ========================================================================== */

html[lang="ar"], html[lang="ar"] body.mg { direction: rtl; }
html[lang="ar"] {
	--ff-display: "IBM Plex Sans Arabic", "Outfit", ui-sans-serif, system-ui, sans-serif;
	--ff-body: "IBM Plex Sans Arabic", "Inter", ui-sans-serif, system-ui, sans-serif;
}
/* Arabic letters join: letter-spacing and capitals would break them apart. */
html[lang="ar"] body.mg * { letter-spacing: 0 !important; text-transform: none !important; }
html[lang="ar"] body.mg { line-height: 1.8; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3,
html[lang="ar"] .mg-h2, html[lang="ar"] .mg-display, html[lang="ar"] .mg-hero__title { line-height: 1.32; }
html[lang="ar"] .mg-eyebrow { font-size: .84rem; }
html[lang="ar"] .mg-lede, html[lang="ar"] .mg-hero__lede { line-height: 1.85; }

/* Arrows point the other way. */
html[dir="rtl"] .mg-btn > svg:last-child:not(:first-child),
html[dir="rtl"] .mg-link > svg:last-child { transform: scaleX(-1); }
html[dir="rtl"] .mg-btn:hover > svg:last-child:not(:first-child),
html[dir="rtl"] .mg-link:hover > svg:last-child { transform: translateX(-4px) scaleX(-1); }
html[dir="rtl"] .mg-btn:hover > svg:first-child:not(:last-child) { transform: none; }

/* Things positioned with left/right. */
html[dir="rtl"] .mg-nav__list a::after { left: auto; right: 0; }
html[dir="rtl"] .mg-split__media--offset { right: auto; left: -6%; }
html[dir="rtl"] .mg-table th, html[dir="rtl"] .mg-table td { text-align: right; }
html[dir="rtl"] .mg-calc__row label em { right: auto; left: 12px; }
html[dir="rtl"] .mg-faq__item summary { padding: 16px 0 16px 30px; }
html[dir="rtl"] .mg-faq__item summary::after { right: auto; left: 0; }
html[dir="rtl"] .mg-ticker, html[dir="rtl"] .mg-marquee { direction: ltr; }

/* Language switch */
.mg-lang {
	display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 5px 14px;
	border-radius: 100px; border: 1px solid rgba(216, 226, 240, .28); color: var(--champagne);
	font-size: .86rem; font-weight: 600; text-decoration: none; white-space: nowrap;
	transition: border-color .25s, background .25s, color .25s;
}
.mg-lang:hover { border-color: var(--gold); background: rgba(74, 111, 181, .14); color: #fff; }
.mg-lang[lang="ar"] { font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; font-size: .92rem; }
.mg-lang--drawer { margin-top: 18px; }
@media (max-width: 480px) {
	.mg-header__actions .mg-lang { padding: 4px 10px; min-height: 34px; font-size: .8rem; }
}

@media (max-width: 640px) {
	html[lang="ar"] .mg-calc__del::after { content: ' حذف'; }
}

/* The dark scrim sits behind the text, which starts on the right in Arabic. */
html[dir="rtl"] .mg-hero__scrim {
	background:
		radial-gradient(120% 90% at 85% 100%, rgba(10, 22, 49, .95) 0%, rgba(10, 22, 49, .55) 45%, rgba(10, 22, 49, .2) 75%),
		linear-gradient(to top, rgba(10, 22, 49, .96) 0%, rgba(10, 22, 49, .35) 55%, rgba(10, 22, 49, .75) 100%);
}
html[dir="rtl"] .mg-sintered { background: radial-gradient(90% 70% at 15% 0%, rgba(74, 111, 181, .12), transparent 60%), var(--noir); }

/* Off-screen helpers must hide to the right in RTL — overflow on the left is scrollable. */
html[dir="rtl"] .mg-skip { left: auto; right: -9999px; }
html[dir="rtl"] .mg-skip:focus { right: 0; }
html[dir="rtl"] .mg-hp { left: auto; right: -9999px; }

/* Figures with Latin units ("1,200 °C") keep their own direction inside Arabic lines. */
html[dir="rtl"] .mg-trust__list strong,
html[dir="rtl"] .mg-process__big,
html[dir="rtl"] .mg-phero__specs dd { unicode-bidi: plaintext; text-align: right; }

/* ---------- Stone colour filters ---------- */

.mg-tall.is-hidden, .mg-fam.is-hidden { display: none; }
.mg-count { margin: -8px 0 26px; font-size: .86rem; color: var(--ink-60); }
.mg-filterbar__finishes { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 12px; }
.mg-chipbtn--sm { padding: 7px 13px; font-size: .8rem; }

@media (max-width: 767px) {
	.mg-filterbar__finishes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.mg-filterbar__finishes::-webkit-scrollbar { display: none; }
	.mg-chipbtn--sm { flex: 0 0 auto; }
}

/* ---------- one colour, its own page ---------- */

.mg-crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-60); margin-bottom: clamp(20px, 3vw, 32px); }
.mg-crumbs a { color: var(--ink-60); text-decoration: none; transition: color .2s; }
.mg-crumbs a:hover { color: var(--gold); }
.mg-crumbs em { font-style: normal; color: var(--ink); font-weight: 600; }

.mg-slabpage__grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.mg-slabpage__media {
	margin: 0; position: relative; border-radius: var(--r-lg); overflow: hidden;
	border: 1px solid var(--line); background: var(--champagne-soft); aspect-ratio: 80 / 260; max-height: 78vh;
}
.mg-slabpage__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-slabpage__solid { position: absolute; inset: 0; display: block; }
.mg-slabpage__info { position: sticky; top: 110px; }
.mg-slabpage__info .mg-display { margin: 0 0 .35em; }
.mg-slabpage__info .mg-lede { margin-bottom: clamp(22px, 3vw, 30px); }
.mg-slabpage__info .mg-btn-row { margin-top: 18px; }
.mg-slabpage__note { margin: 22px 0 0; font-size: .86rem; color: var(--ink-60); }

.mg-specs {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 0;
	background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.mg-specs > div { background: #fff; padding: 14px 16px; }
.mg-specs dt { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-60); margin: 0 0 5px; }
.mg-specs dd { margin: 0; font-family: var(--ff-display); font-weight: 600; font-size: 1.05rem; letter-spacing: -.02em; }

.mg-tall__link { color: inherit; text-decoration: none; }
.mg-tall__link:hover { color: var(--gold); }

@media (max-width: 860px) {
	.mg-slabpage__grid { grid-template-columns: 1fr; }
	.mg-slabpage__media { aspect-ratio: 4 / 5; max-height: none; }
	.mg-slabpage__info { position: static; }
}

/* ---------- favourites ---------- */

.mg-fav {
	position: absolute; top: 10px; inset-inline-end: 10px; z-index: 3;
	width: 34px; height: 34px; display: grid; place-items: center;
	border: 0; border-radius: 50%; cursor: pointer;
	background: rgba(10, 22, 49, .5); color: rgba(255, 255, 255, .9); backdrop-filter: blur(6px);
	opacity: 0; transition: opacity .25s, background .25s, color .25s, transform .25s;
}
.mg-fav svg { width: 17px; height: 17px; }
.mg-tall:hover .mg-fav, .mg-tile:hover .mg-fav, .mg-fav:focus-visible, .mg-fav.is-on { opacity: 1; }
.mg-fav:hover { transform: scale(1.08); }
.mg-fav.is-on { background: var(--gold); color: var(--ink); }
.mg-fav.is-on svg { fill: currentColor; }
@media (hover: none) { .mg-fav { opacity: 1; } }

.mg-favbar { position: fixed; inset-inline-start: 20px; bottom: 20px; z-index: 84; }
.mg-favbar__btn {
	display: flex; align-items: center; gap: 9px; padding: 11px 18px; border: 0; border-radius: 100px; cursor: pointer;
	background: var(--ink); color: var(--champagne); font: inherit; font-size: .88rem; font-weight: 600;
	box-shadow: 0 12px 30px rgba(10, 22, 49, .35); transition: transform .3s var(--ease);
}
.mg-favbar__btn:hover { transform: translateY(-2px); }
.mg-favbar__btn svg { width: 17px; height: 17px; color: var(--gold); }
.mg-favbar__btn em { font-style: normal; background: var(--gold); color: var(--ink); border-radius: 100px; padding: 1px 8px; font-size: .78rem; }

.mg-favpanel {
	position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 95; width: min(380px, 92vw);
	background: var(--paper); border-inline-start: 1px solid var(--line);
	box-shadow: -20px 0 60px rgba(10, 22, 49, .18);
	display: flex; flex-direction: column; padding: 22px;
	transform: translateX(110%); transition: transform .45s var(--ease); visibility: hidden;
}
html[dir="rtl"] .mg-favpanel { transform: translateX(-110%); }
.mg-favpanel.is-open { transform: none; visibility: visible; }
.mg-favpanel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.mg-favpanel__head h2 { font-family: var(--ff-display); font-size: 1.3rem; margin: 0; }
.mg-favpanel__close { border: 0; background: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--ink-60); }
.mg-favpanel__list { list-style: none; margin: 0 0 18px; padding: 0; overflow-y: auto; flex: 1; display: grid; gap: 10px; align-content: start; }
.mg-favpanel__list li { display: flex; align-items: center; gap: 12px; }
.mg-favpanel__list a { display: flex; align-items: center; gap: 12px; flex: 1; text-decoration: none; color: var(--ink); font-weight: 500; font-size: .92rem; }
.mg-favpanel__list img, .mg-favpanel__blank { width: 42px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--champagne-soft); flex: 0 0 auto; }
.mg-favpanel__x { border: 0; background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ink-60); padding: 4px 6px; }
.mg-favpanel__x:hover { color: var(--ink); }
.mg-favpanel__empty { color: var(--ink-60); font-size: .9rem; }
.mg-favpanel__actions { display: grid; gap: 10px; justify-items: center; }
.mg-favpanel__actions .mg-link { background: none; border: 0; cursor: pointer; font: inherit; }

@media (max-width: 767px) {
	.mg-favbar { bottom: 78px; inset-inline-start: 14px; }
	.mg-favbar__btn { padding: 9px 14px; font-size: .82rem; }
	.mg-favpanel { width: 100%; padding-bottom: 80px; }
}

/* ---------- full slab viewer ---------- */

.mg-viewer { position: fixed; inset: 0; z-index: 120; background: rgba(6, 14, 33, .97); display: flex; flex-direction: column; }
.mg-viewer[hidden] { display: none; }
.mg-viewer__bar {
	display: flex; align-items: center; gap: clamp(8px, 2vw, 20px); flex-wrap: wrap;
	padding: 12px clamp(12px, 3vw, 26px); border-bottom: 1px solid rgba(216, 226, 240, .12); color: var(--champagne);
}
.mg-viewer__name { font-family: var(--ff-display); font-size: 1.05rem; margin-inline-end: auto; }
.mg-viewer__modes, .mg-viewer__faces, .mg-viewer__zoom { display: flex; gap: 6px; align-items: center; }
.mg-viewer__mode, .mg-viewer__face, .mg-viewer__zoom button {
	border: 1px solid rgba(216, 226, 240, .22); background: none; color: rgba(216, 226, 240, .75);
	font: inherit; font-size: .8rem; padding: 7px 13px; border-radius: 100px; cursor: pointer;
	transition: background .2s, color .2s, border-color .2s;
}
.mg-viewer__mode.is-on, .mg-viewer__face.is-on { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.mg-viewer__mode:hover, .mg-viewer__face:hover, .mg-viewer__zoom button:hover { color: #fff; border-color: var(--gold); }
.mg-viewer__zoom { gap: 4px; }
.mg-viewer__zoom button { width: 34px; padding: 6px 0; text-align: center; }
.mg-viewer__zoom span { font-size: .78rem; min-width: 46px; text-align: center; color: rgba(216, 226, 240, .7); }
.mg-viewer__close { border: 0; background: none; color: var(--champagne); font-size: 1.9rem; line-height: 1; cursor: pointer; padding: 0 4px; }

.mg-viewer__stage { flex: 1; overflow: hidden; display: grid; place-items: center; touch-action: none; cursor: grab; padding: 18px; }
.mg-viewer__stage:active { cursor: grabbing; }
.mg-viewer__canvas { display: flex; gap: 3px; transition: transform .12s linear; transform-origin: center center; }
.mg-viewer__canvas img { height: min(74vh, 900px); width: auto; display: block; border-radius: 2px; }
.mg-viewer__canvas img.is-flipped { transform: scaleX(-1); }
.mg-viewer__canvas[data-count="4"] img { height: min(62vh, 760px); }
.mg-viewer__hint { text-align: center; color: rgba(216, 226, 240, .45); font-size: .76rem; margin: 0; padding: 0 0 14px; }

.mg-slabpage__media[data-faces-json] { cursor: zoom-in; }
.mg-slabpage__zoom {
	position: absolute; inset-inline-end: 12px; bottom: 12px; z-index: 2;
	display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 100px; border: 0; cursor: pointer;
	background: rgba(10, 22, 49, .78); color: var(--champagne); font: inherit; font-size: .8rem; backdrop-filter: blur(6px);
}
.mg-slabpage__zoom:hover { background: var(--gold); color: var(--ink); }

@media (max-width: 767px) {
	.mg-viewer__bar { gap: 8px; padding: 10px 12px; }
	.mg-viewer__name { width: 100%; margin: 0 0 4px; font-size: .95rem; }
	.mg-viewer__mode, .mg-viewer__face { padding: 6px 10px; font-size: .74rem; }
	.mg-viewer__canvas img { height: min(58vh, 560px); }
}

/* ---------- home page — professional polish ---------- */

/* hero: one clean scrim, so every line reads over any photo */
.mg-hero__media img { opacity: .6; }
.mg-hero__scrim {
	background:
		linear-gradient(100deg, rgba(10, 22, 49, .93) 0%, rgba(10, 22, 49, .74) 32%, rgba(10, 22, 49, .3) 62%, rgba(10, 22, 49, .1) 100%),
		linear-gradient(to top, rgba(10, 22, 49, .9) 0%, rgba(10, 22, 49, .12) 46%, rgba(10, 22, 49, .6) 100%);
}
.mg-hero__lede { max-width: 54ch; line-height: 1.62; color: rgba(216, 226, 240, .86); }
.mg-hero__ranges { margin-top: clamp(20px, 2.6vw, 30px); }
.mg-hero__ranges a { padding: 12px 20px; border-color: rgba(216, 226, 240, .3); background: rgba(10, 22, 49, .5); }
.mg-hero__ranges b { font-size: 1.05rem; }
.mg-hero__ranges span { opacity: .74; }

/* Arabic reads from the right, so the veil is mirrored with it */
html[dir="rtl"] .mg-hero__scrim {
	background:
		linear-gradient(260deg, rgba(10, 22, 49, .93) 0%, rgba(10, 22, 49, .74) 32%, rgba(10, 22, 49, .3) 62%, rgba(10, 22, 49, .1) 100%),
		linear-gradient(to top, rgba(10, 22, 49, .9) 0%, rgba(10, 22, 49, .12) 46%, rgba(10, 22, 49, .6) 100%);
}

/* headings break evenly instead of leaving one word alone on a line */
.mg-h2, .mg-hero__title, .mg-two__name, .mg-download h3 { text-wrap: balance; }
.mg-lede, .mg-hero__lede, .mg-two__desc, .mg-checks li { text-wrap: pretty; }

/* one measure for every section lede */
.mg-shead .mg-lede, .mg-split__text .mg-lede { max-width: 64ch; }
.mg-shead--split .mg-lede { max-width: 54ch; }

/* collection: names and finishes sit on one baseline, however long the name */
.mg-slabgrid--home .mg-tall figcaption { min-height: 4.2em; }
.mg-slabgrid--home .mg-tall figcaption strong { line-height: 1.25; }

/* the three process cards read as one set */
.mg-process__big { min-height: 1.15em; }

/* the offset photo: a print-style white mount, not a heavy dark frame */
.mg-split__media--offset { border: 7px solid #fff; box-shadow: 0 26px 60px rgba(10, 22, 49, .26); }
.mg-section--dark .mg-split__media--offset { border-color: #fff; }

/* applications: photos at full strength, the caption on its own scrim */
.mg-gallery { gap: 4px; }
.mg-gallery__item { aspect-ratio: 3 / 2; }
.mg-gallery__item img { opacity: 1; }
.mg-gallery__item figcaption {
	padding: 40px 20px 18px;
	background: linear-gradient(to top, rgba(10, 22, 49, .88) 0%, rgba(10, 22, 49, .4) 55%, transparent 100%);
}

/* Flex block: the photo carries the same height as the text beside it */
#flex .mg-split__media img { aspect-ratio: 5 / 4; object-fit: cover; }

/* comparison table: quieter head, clearer answer row */
.mg-table--compare thead th { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }
.mg-table--compare tbody tr:nth-child(even):not(.is-hero) { background: rgba(10, 22, 49, .022); }
.mg-table--compare tbody tr.is-hero th, .mg-table--compare tbody tr.is-hero td { font-weight: 600; }

@media (max-width: 767px) {
	/* on a phone the photo sits behind the whole block, so the veil is vertical */
	.mg-hero__media img { opacity: .5; }
	.mg-hero__scrim {
		background: linear-gradient(to top, rgba(10, 22, 49, .95) 0%, rgba(10, 22, 49, .78) 42%, rgba(10, 22, 49, .58) 72%, rgba(10, 22, 49, .7) 100%);
	}
	.mg-hero__lede { max-width: 44ch; }
	.mg-gallery__item { aspect-ratio: 4 / 3; }
	.mg-slabgrid--home .mg-tall figcaption { min-height: 0; }
	#flex .mg-split__media img { aspect-ratio: 3 / 2; }
}
