/* =====================================================================
   MATERIALS page (W5) — steel, building materials, ready-mix concrete.
   Idea: every picture is cut out of the billet — two night/sand pieces
   split along the S-kerf and slide apart to show the material behind.
   ===================================================================== */

.mat { overflow-x: clip; }
.mat-h2 { max-width: 22ch; }
.mat-under { margin-top: var(--sp-7); }
.mat-body { font-size: var(--fs-base); line-height: var(--lh-text); max-width: 56ch; }

/* ---------- kerf-open picture (covers are built by materials.js) ---------- */
.mat-cut { position: relative; overflow: hidden; margin: 0; background: var(--surface); isolation: isolate; }
.mat-cut > img, .mat-cut > picture > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mat-cut > picture { display: block; height: 100%; }
.mat-cut__cover { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); z-index: 2; pointer-events: none; overflow: visible; will-change: transform; }
.mat-cut__cover path { fill: var(--c-night); }
.reduce-motion .mat-cut__cover, .sen-failsafe .mat-cut__cover { display: none; }

/* ---------- HERO ---------- */
.mat-hero { position: relative; display: flex; flex-direction: column; min-height: max(36rem, 100svh); isolation: isolate; }
.mat-hero__media { position: absolute; inset: 0; z-index: 0; background: var(--c-night); }
.mat-hero__media img { object-position: 60% 50%; }
.mat-hero__media::after { /* neutral scrim under the text — the one sanctioned gradient */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11, 36, 39, 0.78) 0, rgba(11, 36, 39, 0) 26%),
    linear-gradient(90deg, rgba(11, 36, 39, 0.62) 0%, rgba(11, 36, 39, 0.3) 42%, rgba(11, 36, 39, 0) 68%),
    linear-gradient(0deg, rgba(11, 36, 39, 0.94) 0%, rgba(11, 36, 39, 0.7) 30%, rgba(11, 36, 39, 0.06) 62%, rgba(11, 36, 39, 0.4) 100%);
}
@media (max-width: 767px) {
  /* phone: the picture is a field of its own at the top, the words sit on solid Night Teal below it */
  .mat-hero__media { position: relative; inset: auto; height: 40svh; min-height: 17rem; }
  .mat-hero__media::after { background: linear-gradient(180deg, rgba(11, 36, 39, 0.85) 0, rgba(11, 36, 39, 0.5) 24%, rgba(11, 36, 39, 0) 46%), linear-gradient(0deg, rgba(11, 36, 39, 1) 0%, rgba(11, 36, 39, 0) 38%); }
  .mat-hero { min-height: 0; }
  .mat-hero__media img { object-position: 70% 50%; }
}
.mat-hero__inner { position: relative; z-index: 3; flex: 1; display: flex; align-items: flex-end; padding-top: calc(var(--header-h) + var(--sp-8)); padding-bottom: var(--sp-8); }
.mat-hero__copy { max-width: 76rem; }
.mat-hero__copy .kicker { color: var(--c-copper-lt); }
.mat-hero__title { font-size: clamp(2.125rem, 0.6rem + 4.4vw, 5.5rem); line-height: 0.98; max-width: 17ch; text-wrap: balance; }
.mat-hero__sub { margin-top: var(--sp-6); max-width: 58ch; font-size: var(--fs-base); line-height: 1.55; color: var(--c-cream); }
.mat-hero .btn-row { margin-top: var(--sp-7); }

.mat-route { position: relative; z-index: 3; padding-bottom: var(--sp-5); }
.mat-route__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
@media (min-width: 900px) { .mat-route__list { grid-template-columns: 1fr 1fr 1fr 1.35fr; } }
.mat-route__list a {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; padding: 0.75rem 1.1rem;
  background: rgba(17, 49, 58, 0.92); color: var(--c-cream); text-decoration: none; font-size: var(--fs-sm); font-weight: 600;
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.mat-route__list .icon { width: 1.1rem; height: 1.1rem; flex: none; color: var(--c-copper-lt); transition: transform var(--dur-2) var(--ease-out); }
.mat-route__core a { background: var(--c-copper); color: var(--c-sand); }
.mat-route__core .icon { color: var(--c-sand); }
@media (hover: hover) and (pointer: fine) {
  .mat-route__list a:hover { background: var(--c-night-3); }
  .mat-route__list a:hover .icon { transform: translateY(3px); }
  .mat-route__core a:hover { background: var(--c-cream); color: var(--c-night); }
  .mat-route__core a:hover .icon { color: var(--c-copper); transform: translateX(4px); }
}
@media (max-width: 899px) { .mat-route__core { grid-column: 1 / -1; } }

/* ---------- SCOPE + licence register ---------- */
.mat-points { display: grid; gap: var(--sp-5); margin-inline: 0; margin-bottom: 0; }
@media (min-width: 600px) and (max-width: 1099px) { .mat-points { grid-template-columns: 1fr 1fr; } }
.mat-points dt { font-family: var(--font-display); font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 740; font-size: var(--fs-h4); line-height: 1.15; letter-spacing: -0.01em; }
.mat-points dd { margin: var(--sp-2) 0 0; max-width: 46ch; }
.mat-register { background: var(--surface); padding: clamp(1.25rem, 0.8rem + 1.8vw, 2.75rem); }
.mat-register__no { display: block; margin-top: 0.35rem; font-family: var(--font-text); font-stretch: 100%; font-variation-settings: normal; font-size: var(--fs-sm); font-weight: 600; color: var(--accent); }
.mat-register__table tbody th { width: auto; color: var(--ink); font-weight: 600; }
.mat-register__table td { white-space: nowrap; }
.mat-register__table td:last-child { white-space: normal; }
.mat-register__table .is-core th, .mat-register__table .is-core td { padding-block: 1.2rem; }
.mat-register td a { display: inline-block; padding-block: 0.55em; }
.mat-tag { display: inline-block; padding: 0.3rem 0.6rem; font-size: var(--fs-xs); font-weight: 650; background: var(--bg); color: var(--ink); }
.mat-tag--core { background: var(--c-copper); color: var(--c-sand); }
@media (max-width: 599px) {
  .mat-register__table thead { display: none; }
  .mat-register__table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; padding: 0.95rem 0; border-bottom: 1px solid var(--line); }
  .mat-register__table th, .mat-register__table td { display: block; padding: 0; border: 0; }
  .mat-register__table tbody th { flex: 1 1 100%; }
}

/* ---------- LINES ---------- */
.mat-lines__list { list-style: none; margin: var(--sp-8) 0 0; padding: 0; display: grid; gap: var(--sp-7) var(--gap); }
@media (min-width: 700px) { .mat-lines__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .mat-line:nth-child(2) { margin-top: var(--sp-9); }
  .mat-line:nth-child(3) { margin-top: calc(var(--sp-9) * 0.5); }
}
.mat-line__link { display: block; color: inherit; text-decoration: none; }
.mat-line__media { aspect-ratio: 4 / 5; }
.mat-line__media > img { transition: scale 900ms var(--ease-out); }
.mat-line__title { margin-top: var(--sp-5); font-size: var(--fs-h3); line-height: 1.08; display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.mat-line__title .icon { flex: none; width: 1.5rem; height: 1.5rem; margin-top: 0.2em; color: var(--accent); transition: transform var(--dur-2) var(--ease-out); }
.mat-line p { margin-top: var(--sp-3); max-width: 42ch; }
@media (hover: hover) and (pointer: fine) {
  .mat-line__link:hover .mat-line__media > img { scale: 1.04; }
  .mat-line__link:hover .icon { transform: translateY(4px); }
  .mat-line__link:hover .mat-line__title { color: var(--accent); }
}
.mat-line__link:focus-visible { outline: 3px solid var(--focus); outline-offset: 6px; }

/* ---------- STEEL ---------- */
.mat-steel__top { align-items: center; }
.mat-steel__pics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: start; }
.mat-steel__pic--a { grid-column: 1 / 6; grid-row: 1; aspect-ratio: 3 / 2; }
.mat-steel__pic--b { grid-column: 4 / 7; grid-row: 1; aspect-ratio: 4 / 5; margin-top: 52%; z-index: 1; outline: var(--kerf) solid var(--c-white); }
.mat-schedule { margin-top: var(--sp-9); }
.mat-schedule__table { font-size: var(--fs-base); }
.mat-schedule__table caption { font-size: var(--fs-h3); padding-bottom: var(--sp-5); }
.mat-schedule__table tbody th { width: 22%; font-family: var(--font-display); font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 740; font-size: var(--fs-h4); color: var(--ink); line-height: 1.2; }
.mat-schedule__table td:last-child { color: var(--ink-2); font-weight: 550; }
.mat-schedule__table th, .mat-schedule__table td { padding-block: 1.25rem; }
@media (max-width: 699px) {
  .mat-schedule__table thead { display: none; }
  .mat-schedule__table tr { display: grid; gap: 0.35rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
  .mat-schedule__table th, .mat-schedule__table td { display: block; width: auto !important; padding: 0; border: 0; }
  .mat-schedule__table td:last-child::before { content: "Specify: "; color: var(--accent); font-weight: 650; }
}

/* ---------- BUILDING MATERIALS ---------- */
.mat-build__media { aspect-ratio: 21 / 9; }
.mat-build__media > img { object-position: 50% 62%; }
@media (max-width: 767px) { .mat-build__media { aspect-ratio: 4 / 3; } }
.mat-h2--wide { max-width: 22ch; }
.mat-build .mat-h2--wide, .mat-mix .mat-h2--wide { margin-top: var(--sp-8); }
.mat-build__body { margin-top: var(--sp-6); }
.mat-quote__grid { margin-top: var(--sp-7); }
.mat-boq caption { font-size: var(--fs-h4); }
.mat-boq tbody th { width: 50%; }
.mat-boq td { font-weight: 600; }

/* ---------- READY-MIX ---------- */
.mat-mix__media { aspect-ratio: 21 / 9; }
.mat-mix__media > img { object-position: 50% 58%; }
@media (max-width: 767px) { .mat-mix__media { aspect-ratio: 4 / 3; } .mat-mix__media > img { object-position: 70% 50%; } }
.mat-mix__body { margin-top: var(--sp-6); }
.mat-ticket { background: var(--surface); padding: clamp(1.25rem, 0.8rem + 1.8vw, 2.5rem); }
.mat-ticket__table caption { font-size: var(--fs-h3); }
.mat-ticket__table tbody th { width: 52%; color: var(--ink); font-weight: 550; }
.mat-ticket__we th, .mat-ticket__we td { background: var(--surface-2); padding-inline: 0.9rem; }
.mat-ticket__we + tr:not(.mat-ticket__we) th, .mat-ticket__we + tr:not(.mat-ticket__we) td { padding-top: 1.1rem; }
.mat-ticket__blank { color: var(--ink-2); font-weight: 500; }
.mat-ticket__blank::before { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; margin-right: 0.55rem; background: var(--accent); clip-path: polygon(0 0, 60% 0, 100% 40%, 100% 100%, 0 100%); }

/* ---------- QUOTE (live request builder) ---------- */
@media (min-width: 1100px) { .mat-quote__sticky { position: sticky; top: calc(var(--header-h) + var(--sp-6)); } }
.mat-meter__label { font-size: var(--fs-sm); font-weight: 600; }
.mat-meter__count { font-family: var(--font-display); font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 780; font-size: var(--fs-h3); color: var(--accent); margin-right: 0.35em; font-variant-numeric: tabular-nums; }
.mat-meter__bar { position: relative; height: var(--m); margin-top: var(--sp-3); background: var(--surface-2); clip-path: polygon(0 0, calc(100% - var(--m)) 0, 100% 100%, 0 100%); }
.mat-meter__bar > span { position: absolute; inset: 0; background: var(--c-copper); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform 600ms var(--ease-lock); }
.mat-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mat-check li { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 0.95rem 1rem; background: var(--surface); transition: background-color var(--dur-2) var(--ease-out); }
.mat-check strong { display: block; font-weight: 650; }
.mat-check span:not(.mat-check__box) { display: block; font-size: var(--fs-sm); color: var(--ink-2); margin-top: 0.15rem; }
.mat-check__box { width: 1.375rem; height: 1.375rem; margin-top: 0.1rem; box-shadow: inset 0 0 0 1.5px var(--ink-2); display: grid; place-content: center; transition: background-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2); }
.mat-check__box::after { content: ""; width: 0.7rem; height: 0.7rem; background: var(--c-sand); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); transform: scale(0); transition: transform var(--dur-2) var(--ease-lock); }
.mat-check li.is-done { background: var(--surface-2); }
.mat-check li.is-done .mat-check__box { background: var(--c-copper); box-shadow: none; }
.mat-check li.is-done .mat-check__box::after { transform: scale(1); }
.mat-check li.is-na { background: var(--surface); }
.mat-check li.is-na strong, .mat-check li.is-na span:not(.mat-check__box) { color: var(--ink-2); font-weight: 550; }
.mat-check li.is-na .mat-check__box { box-shadow: inset 0 0 0 1.5px var(--line); }

.mat-form { --surface: var(--c-night); --surface-2: var(--c-night-2); gap: var(--sp-5); }
.mat-form .card__title { margin-bottom: var(--sp-2); }
.mat-form__mix { padding: var(--sp-5) !important; background: var(--c-night-2); gap: var(--sp-4) !important; }
.mat-form__mix > legend { float: left; width: 100%; font-family: var(--font-display); font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 740; font-size: var(--fs-h4); color: var(--accent); margin-bottom: var(--sp-2); }
.mat-form__mix[hidden] { display: none; }
.mat-quote .form-success { color: var(--ink); }
.mat-form .form-row { display: grid; gap: var(--sp-4); }
@media (min-width: 640px) { .mat-form .form-row--2 { grid-template-columns: 1fr 1fr; } .mat-form .form-row--qty { grid-template-columns: 2fr 1fr; } }

/* what the quote states — set as the head of a quote document */
.mat-states { margin-top: var(--sp-section); }
.mat-states__sheet { margin: var(--sp-7) 0 0; display: grid; gap: 2px; background: transparent; }
@media (min-width: 700px) { .mat-states__sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .mat-states__sheet { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mat-states__sheet > div { background: var(--c-sand); padding: clamp(1.25rem, 0.8rem + 1.5vw, 2.25rem); min-height: 0; display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-6); }
.mat-states__sheet > div:first-child { background: var(--c-night); color: var(--c-cream); --ph-bg: rgba(208, 138, 78, 0.18); --ph-ink: #FAD9B8; }
.mat-states__sheet dt { font-family: var(--font-display); font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 760; font-size: var(--fs-h3); line-height: 1.05; letter-spacing: -0.015em; order: 0; }
.mat-states__sheet dd { margin: 0; max-width: 34ch; }
@media (min-width: 700px) { .mat-states__sheet > div { min-height: 13rem; } }
@media (max-width: 699px) { .mat-states__sheet > div { gap: var(--sp-4); } }

/* ---------- EXPORT ---------- */
.mat-reach { font-size: var(--fs-base); }
.mat-reach caption { font-size: var(--fs-h4); }
.mat-reach tbody th { width: 28%; color: var(--ink); font-weight: 650; }
.mat-yes, .mat-no { display: inline-flex; gap: 0.6rem; align-items: baseline; }
.mat-yes::before, .mat-no::before { content: ""; flex: none; width: 0.65rem; height: 0.65rem; background: var(--c-copper); clip-path: polygon(0 0, 60% 0, 100% 40%, 100% 100%, 0 100%); transform: translateY(0.05em); }
.mat-no { color: var(--ink-2); }
.mat-no::before { background: transparent; box-shadow: inset 0 0 0 2px var(--ink-2); clip-path: none; }
@media (max-width: 699px) {
  .mat-reach thead { display: none; }
  .mat-reach tr { display: grid; gap: 0.4rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
  .mat-reach th, .mat-reach td { display: block; width: auto !important; padding: 0; border: 0; }
  .mat-reach td:nth-of-type(1)::before { content: "UAE: "; font-weight: 650; }
  .mat-reach td:nth-of-type(2)::before { content: "Abroad: "; font-weight: 650; }
}

/* ---------- CORE (link back) ---------- */
.mat-core__head { display: grid; gap: var(--sp-6) var(--gap); align-items: start; }
@media (min-width: 900px) { .mat-core__head { grid-template-columns: auto minmax(0, 1fr); } }
.mat-core__mark { width: clamp(4.5rem, 3rem + 5vw, 8.5rem); }
.mat-core__head .mat-h2 { max-width: 20ch; }
.mat-core__cards { display: grid; gap: var(--gap); margin-top: var(--sp-8); }
@media (min-width: 768px) { .mat-core__cards { grid-template-columns: 1fr 1fr; } }
.mat-core__card { display: block; color: var(--ink); text-decoration: none; background: var(--surface); }
.mat-core__card .frame > img { transition: scale 900ms var(--ease-out); }
.mat-core__label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: clamp(1rem, 0.7rem + 1vw, 1.6rem) clamp(1.1rem, 0.8rem + 1.2vw, 1.8rem); font-family: var(--font-display); font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 760; font-size: var(--fs-h3); line-height: 1.1; transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out); }
.mat-core__label .icon { width: 1.6rem; height: 1.6rem; flex: none; color: var(--accent); transition: transform var(--dur-2) var(--ease-out), color var(--dur-2); }
.mat-core__card--eq .mat-core__label { background: var(--c-copper); color: var(--c-sand); }
.mat-core__card--eq .mat-core__label .icon { color: var(--c-sand); }
@media (hover: hover) and (pointer: fine) {
  .mat-core__card:hover .frame > img { scale: 1.04; }
  .mat-core__card:hover .mat-core__label { background: var(--c-cream); color: var(--c-night); }
  .mat-core__card:hover .mat-core__label .icon { color: var(--c-copper); transform: translateX(5px); }
}
.mat-core__card:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

/* ---------- FAQ ---------- */
.mat-faq__list { display: grid; gap: 2px; }
.mat-faq details { background: var(--surface); }
.mat-faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  min-height: 3.5rem; padding: 1.15rem 1.4rem; font-family: var(--font-display); font-stretch: 112%; font-variation-settings: "wdth" 112;
  font-weight: 680; font-size: var(--fs-h4); line-height: 1.25; transition: background-color var(--dur-2) var(--ease-out);
}
.mat-faq summary::-webkit-details-marker { display: none; }
.mat-faq summary::after { content: ""; flex: none; width: 1.1rem; height: 1.1rem; background: var(--accent); clip-path: polygon(40% 0, 60% 0, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0 60%, 0 40%, 40% 40%); transition: transform var(--dur-2) var(--ease-out); }
.mat-faq details[open] summary::after { transform: rotate(45deg); }
@media (hover: hover) and (pointer: fine) { .mat-faq summary:hover { background: var(--surface-2); } }
.mat-faq summary:focus-visible { outline-offset: -3px; }
.mat-faq__a { padding: 0 1.4rem 1.4rem; max-width: 64ch; }

/* reduced motion: nothing travels */
@media (prefers-reduced-motion: reduce) {
  .mat-line__media > img, .mat-core__card .frame > img, .mat-meter__bar > span, .mat-check__box::after { transition: none; }
}

/* workaround (see REQUESTS.md): .lg-N + .lg-start-M collapses to one column in site.css (grid-column: span N sets start, not end) */
@media (min-width: 1100px) {
  .mat .lg-6.lg-start-7 { grid-column: 7 / span 6; }
  .mat .lg-5.lg-start-8 { grid-column: 8 / span 5; }
  .mat .lg-7.lg-start-6 { grid-column: 6 / span 7; }
}

/* phone overrides placed last so they win over the base hero/register rules */
@media (max-width: 767px) {
  .mat .mat-hero__inner { padding-top: 0; margin-top: calc(-1 * var(--sp-6)); padding-bottom: var(--sp-7); }
}
@media (max-width: 599px) {
  .mat .mat-register__table .is-core th, .mat .mat-register__table .is-core td { padding: 0; }
}

/* placeholder ink at AA on tinted surfaces (review G5; mirrors the requested site.css values, page-scoped) */
.mat .band--sand, .mat .band--cream, .mat .band--white { --ph-ink: #7A3E16; }
.mat .band--night, .mat .band--teal { --ph-ink: #FAD9B8; }
